22 #include <tdeparts/dockmainwindow.h>
23 #include <tdeparts/event.h>
24 #include <tdeparts/part.h>
26 #include <tdeparts/plugin.h>
27 #include <kstatusbar.h>
28 #include <kinstance.h>
29 #include <khelpmenu.h>
30 #include <kstandarddirs.h>
31 #include <tqapplication.h>
34 #include <kxmlguifactory.h>
38 using namespace KParts;
42 class DockMainWindowPrivate
45 DockMainWindowPrivate()
48 m_bShellGUIActivated =
false;
51 ~DockMainWindowPrivate()
55 TQGuardedPtr<Part> m_activePart;
56 bool m_bShellGUIActivated;
64 d =
new DockMainWindowPrivate();
75 kdDebug(1000) << TQString(TQString(
"DockMainWindow::createGUI for %1").arg(part?part->name():
"0L")) <<
endl;
79 setUpdatesEnabled(
false );
81 TQPtrList<Plugin> plugins;
83 if ( d->m_activePart )
85 kdDebug(1000) << TQString(TQString(
"deactivating GUI for %1").arg(d->m_activePart->name())) <<
endl;
88 TQApplication::sendEvent( d->m_activePart, &ev );
92 disconnect( d->m_activePart, TQT_SIGNAL( setWindowCaption(
const TQString & ) ),
93 this, TQT_SLOT(
setCaption(
const TQString & ) ) );
94 disconnect( d->m_activePart, TQT_SIGNAL( setStatusBarText(
const TQString & ) ),
98 if ( !d->m_bShellGUIActivated )
102 d->m_bShellGUIActivated =
true;
108 connect( part, TQT_SIGNAL( setWindowCaption(
const TQString & ) ),
109 this, TQT_SLOT(
setCaption(
const TQString & ) ) );
110 connect( part, TQT_SIGNAL( setStatusBarText(
const TQString & ) ),
116 TQApplication::sendEvent( part, &ev );
120 setUpdatesEnabled(
true );
122 d->m_activePart = part;
130 void DockMainWindow::createShellGUI(
bool create )
133 assert( d->m_bShellGUIActivated != create );
134 d->m_bShellGUIActivated = create;
146 TQString auto_file(
instance()->instanceName() +
"ui.rc" );
151 TQApplication::sendEvent(
this, &ev );
159 TQApplication::sendEvent(
this, &ev );
166 #include "dockmainwindow.moc"