KDevelop API Documentation

src/mainwindowshare.cpp

Go to the documentation of this file.
00001 /*************************************************************************** 00002 mainwindowshare.cpp - shared stuff of the main widgets 00003 ------------------- 00004 begin : 19 Dec 2002 00005 copyright : (C) 2002 by Falk Brettschneider 00006 email : falk@kdevelop.org 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include <qcheckbox.h> 00019 #include <qvbox.h> 00020 #include <qbuttongroup.h> 00021 #include <qradiobutton.h> 00022 #include <qdir.h> 00023 #include <qregexp.h> 00024 00025 #include <kaction.h> 00026 #include <kaboutdata.h> 00027 #include <kstdaction.h> 00028 #include <kapplication.h> 00029 #include <klocale.h> 00030 #include <kstatusbar.h> 00031 #include <kparts/mainwindow.h> 00032 #include <kdialogbase.h> 00033 #include <kconfig.h> 00034 #include <kkeydialog.h> 00035 #include <kmenubar.h> 00036 #include <kedittoolbar.h> 00037 #include <kbugreport.h> 00038 #include <kurlrequester.h> 00039 #include <kpopupmenu.h> 00040 00041 #include <ktexteditor/document.h> 00042 #include <ktexteditor/view.h> 00043 #include <ktexteditor/configinterface.h> 00044 #include <kparts/partmanager.h> 00045 #include <kdevpartcontroller.h> 00046 #include <kdeversion.h> 00047 #include <kdebug.h> 00048 #include "partcontroller.h" 00049 00050 #if (KDE_VERSION > 305) 00051 #include <knotifydialog.h> 00052 #endif 00053 00054 #include <config.h> 00055 00056 #include "projectmanager.h" 00057 #include "core.h" 00058 #include "settingswidget.h" 00059 #include "api.h" 00060 #include "kdevmakefrontend.h" 00061 00062 #include "mainwindowshare.h" 00063 00064 #ifdef KDE_MAKE_VERSION 00065 # if KDE_VERSION < KDE_MAKE_VERSION(3,1,90) 00066 # define NEED_CONFIGHACK 00067 # endif 00068 #else 00069 # define NEED_CONFIGHACK 00070 #endif 00071 00072 using namespace MainWindowUtils; 00073 00074 MainWindowShare::MainWindowShare(QObject* pParent, const char* name) 00075 :QObject(pParent, name) 00076 ,m_toggleMainToolbar(0L) 00077 ,m_toggleBuildToolbar(0L) 00078 ,m_toggleViewToolbar(0L) 00079 ,m_toggleBrowserToolbar(0L) 00080 ,m_toggleStatusbar(0L) 00081 ,m_stopProcesses(0L) 00082 { 00083 m_pMainWnd = (KParts::MainWindow*)pParent; 00084 } 00085 00086 void MainWindowShare::init() 00087 { 00088 connect(Core::getInstance(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), 00089 this, SLOT(contextMenu(QPopupMenu *, const Context *))); 00090 00091 connect( m_pMainWnd->actionCollection(), SIGNAL( actionStatusText( const QString & ) ), 00092 this, SLOT( slotActionStatusText( const QString & ) ) ); 00093 } 00094 00095 void MainWindowShare::slotActionStatusText( const QString &text ) 00096 { 00097 kdDebug(9000) << "MainWindowShare::slotActionStatusText() - " << text << endl; 00098 00099 if ( ! m_pMainWnd ) return; 00100 00101 KStatusBar * statusBar = m_pMainWnd->statusBar(); 00102 00103 if ( ! statusBar ) return; 00104 00105 statusBar->message( text ); 00106 } 00107 00108 void MainWindowShare::createActions() 00109 { 00110 ProjectManager::getInstance()->createActions( m_pMainWnd->actionCollection() ); 00111 00112 KStdAction::quit(this->parent(), SLOT(close()), m_pMainWnd->actionCollection()); 00113 00114 KAction* action; 00115 00116 m_stopProcesses = new KToolBarPopupAction( i18n( "&Stop" ), "stop", 00117 Key_Escape, this, SLOT(slotStopButtonPressed()), 00118 m_pMainWnd->actionCollection(), "stop_processes" ); 00119 m_stopProcesses->setToolTip(i18n("Stop")); 00120 m_stopProcesses->setWhatsThis(i18n("<b>Stop</b><p>Stops all running processes (like building process, grep command, etc.). When placed onto a toolbar provides a popup menu to choose a process to stop.")); 00121 m_stopProcesses->setEnabled( false ); 00122 connect(m_stopProcesses->popupMenu(), SIGNAL(aboutToShow()), 00123 this, SLOT(slotStopMenuAboutToShow())); 00124 connect(m_stopProcesses->popupMenu(), SIGNAL(activated(int)), 00125 this, SLOT(slotStopPopupActivated(int))); 00126 00127 connect( Core::getInstance(), SIGNAL(activeProcessChanged(KDevPlugin*, bool)), 00128 this, SLOT(slotActiveProcessChanged(KDevPlugin*, bool)) ); 00129 00130 action = KStdAction::showMenubar( 00131 this, SLOT(slotShowMenuBar()), 00132 m_pMainWnd->actionCollection(), "settings_show_menubar" ); 00133 action->setToolTip(beautifyToolTip(action->text())); 00134 action->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(action->text())).arg(i18n("Lets you switch the menubar on/off."))); 00135 00136 action = KStdAction::keyBindings( 00137 this, SLOT(slotKeyBindings()), 00138 m_pMainWnd->actionCollection(), "settings_configure_shortcuts" ); 00139 action->setToolTip(beautifyToolTip(action->text())); 00140 action->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(action->text())).arg(i18n("Lets you configure shortcut keys."))); 00141 00142 action = KStdAction::configureToolbars( 00143 this, SLOT(slotConfigureToolbars()), 00144 m_pMainWnd->actionCollection(), "settings_configure_toolbars" ); 00145 action->setToolTip(beautifyToolTip(action->text())); 00146 action->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(action->text())).arg(i18n("Lets you configure toolbars."))); 00147 00148 #if (KDE_VERSION > 305) 00149 00150 action = KStdAction::configureNotifications( 00151 this, SLOT(slotConfigureNotifications()), 00152 m_pMainWnd->actionCollection(), "settings_configure_notifications" ); 00153 action->setToolTip(beautifyToolTip(action->text())); 00154 action->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(action->text())).arg(i18n("Lets you configure system notifications."))); 00155 #endif 00156 00157 action = KStdAction::preferences(this, SLOT(slotSettings()), 00158 m_pMainWnd->actionCollection(), "settings_configure" ); 00159 action->setToolTip(beautifyToolTip(action->text())); 00160 action->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(action->text())).arg(i18n("Lets you customize KDevelop."))); 00161 00162 00163 #if (KDE_VERSION <= 305) 00164 m_toggleMainToolbar = KStdAction::showToolbar(this, SLOT(slotToggleMainToolbar()), m_pMainWnd->actionCollection(), "settings_main_toolbar"); 00165 m_toggleMainToolbar->setText(i18n("Show &Main Toolbar")); 00166 m_toggleMainToolbar->setToolTip( i18n("Show Main Toolbar") ); 00167 m_toggleMainToolbar->setWhatsThis(i18n("<b>Show Main Toolbar</b><p>Hides or shows the main toolbar.")); 00168 00169 m_toggleBuildToolbar = KStdAction::showToolbar(this, SLOT(slotToggleBuildToolbar()),m_pMainWnd->actionCollection(), "settings_build_toolbar"); 00170 m_toggleBuildToolbar->setText(i18n("Show &Build Toolbar")); 00171 m_toggleBuildToolbar->setToolTip( i18n("Show Build Toolbar") ); 00172 m_toggleBuildToolbar->setWhatsThis(i18n("<b>Show Build Toolbar</b><p>Hides or shows the build toolbar.")); 00173 00174 m_toggleViewToolbar = KStdAction::showToolbar(this, SLOT(slotToggleViewToolbar()),m_pMainWnd->actionCollection(), "settings_view_toolbar"); 00175 m_toggleViewToolbar->setText(i18n("Show &View Toolbar")); 00176 m_toggleViewToolbar->setToolTip( i18n("Show View Toolbar") ); 00177 m_toggleViewToolbar->setWhatsThis(i18n("<b>Show View Toolbar</b><p>Hides or shows the view toolbar.")); 00178 00179 m_toggleBrowserToolbar = KStdAction::showToolbar(this, SLOT(slotToggleBrowserToolbar()),m_pMainWnd->actionCollection(), "settings_browser_toolbar"); 00180 m_toggleBrowserToolbar->setText(i18n("Show &Browser Toolbar")); 00181 m_toggleBrowserToolbar->setToolTip( i18n("Show Browser Toolbar") ); 00182 m_toggleBrowserToolbar->setWhatsThis(i18n("<b>Show Browser Toolbar</b><p>Hides or shows the browser toolbar.")); 00183 #endif 00184 00185 m_toggleStatusbar = KStdAction::showToolbar(this, SLOT(slotToggleStatusbar()),m_pMainWnd->actionCollection(), "settings_statusbar"); 00186 m_toggleStatusbar->setText(i18n("Show &Statusbar")); 00187 m_toggleStatusbar->setToolTip( i18n("Show statusbar") ); 00188 m_toggleStatusbar->setWhatsThis(i18n("<b>Show statusbar</b><p>Hides or shows the statusbar.")); 00189 00190 action = new KAction( i18n("&Next Window"), ALT+Key_Right, this, SIGNAL(gotoNextWindow()),m_pMainWnd->actionCollection(), "view_next_window"); 00191 action->setToolTip( i18n("Next window") ); 00192 action->setWhatsThis(i18n("<b>Next window</b><p>Switches to the next window.")); 00193 00194 action = new KAction( i18n("&Previous Window"), ALT+Key_Left, this, SIGNAL(gotoPreviousWindow()),m_pMainWnd->actionCollection(), "view_previous_window"); 00195 action->setToolTip( i18n("Previous window") ); 00196 action->setWhatsThis(i18n("<b>Previous window</b><p>Switches to the previous window.")); 00197 00198 action = new KAction( i18n("&Last Accessed Window"), ALT+Key_Up, this, SIGNAL(gotoLastWindow()), m_pMainWnd->actionCollection(), "view_last_window"); 00199 action->setToolTip( i18n("Last accessed window") ); 00200 action->setWhatsThis(i18n("<b>Last accessed window</b><p>Switches to the last viewed window (Hold the Alt key pressed and walk on by repeating the Up key).")); 00201 00202 action = new KAction( i18n("&First Accessed Window"), ALT+Key_Down, this, SIGNAL(gotoFirstWindow()), m_pMainWnd->actionCollection(), "view_first_window"); 00203 action->setToolTip( i18n("First accessed window") ); 00204 action->setWhatsThis(i18n("<b>First accessed window</b><p>Switches to the first accessed window (Hold the Alt key pressed and walk on by repeating the Down key).")); 00205 00206 m_configureEditorAction = new KAction( i18n("Configure &Editor..."), 0, this, SLOT( slotConfigureEditors() ), m_pMainWnd->actionCollection(), "settings_configure_editors"); 00207 m_configureEditorAction->setToolTip( i18n("Configure editor settings") ); 00208 m_configureEditorAction->setWhatsThis(i18n("<b>Configure editor</b><p>Opens editor configuration dialog.")); 00209 m_configureEditorAction->setEnabled( false ); 00210 00211 KDevPartController * partController = API::getInstance()->partController(); 00212 connect( partController, SIGNAL(activePartChanged(KParts::Part*)), this, SLOT(slotActivePartChanged(KParts::Part* )) ); 00213 } 00214 00215 void MainWindowShare::slotReportBug() 00216 { 00217 KBugReport a(m_pMainWnd, true, KGlobal::instance()->aboutData() ); 00218 a.exec(); 00219 } 00220 00221 void MainWindowShare::slotToggleMainToolbar() 00222 { 00223 if (m_toggleMainToolbar->isChecked()) 00224 m_pMainWnd->toolBar("mainToolBar")->show(); 00225 else 00226 m_pMainWnd->toolBar("mainToolBar")->hide(); 00227 } 00228 00229 void MainWindowShare::slotToggleBuildToolbar() 00230 { 00231 if (m_toggleBuildToolbar->isChecked()) 00232 m_pMainWnd->toolBar("buildToolBar")->show(); 00233 else 00234 m_pMainWnd->toolBar("buildToolBar")->hide(); 00235 } 00236 00237 void MainWindowShare::slotToggleViewToolbar() 00238 { 00239 if (m_toggleViewToolbar->isChecked()) 00240 m_pMainWnd->toolBar("viewToolBar")->show(); 00241 else 00242 m_pMainWnd->toolBar("viewToolBar")->hide(); 00243 } 00244 00245 void MainWindowShare::slotToggleBrowserToolbar() 00246 { 00247 if (m_toggleBrowserToolbar->isChecked()) 00248 m_pMainWnd->toolBar("browserToolBar")->show(); 00249 else 00250 m_pMainWnd->toolBar("browserToolBar")->hide(); 00251 } 00252 00253 void MainWindowShare::slotToggleStatusbar() 00254 { 00255 KStatusBar* sb = (KStatusBar*) m_pMainWnd->statusBar(); 00256 if (m_toggleStatusbar->isChecked()) 00257 sb->show(); 00258 else 00259 sb->hide(); 00260 } 00261 00262 void MainWindowShare::slotStopButtonPressed() 00263 { 00264 Core::getInstance()->doEmitStopButtonPressed(); 00265 } 00266 00267 void MainWindowShare::slotActiveProcessChanged( KDevPlugin* plugin, bool active ) 00268 { 00269 if ( !plugin ) 00270 return; 00271 00272 if ( active ) { 00273 activeProcesses.append( plugin ); 00274 } else { 00275 activeProcesses.removeRef( plugin ); 00276 } 00277 m_stopProcesses->setEnabled( !activeProcesses.isEmpty() ); 00278 } 00279 00280 void MainWindowShare::slotStopPopupActivated( int id ) 00281 { 00282 KDevPlugin* plugin = activeProcesses.at( id ); 00283 if ( plugin && plugin->pluginName() == m_stopProcesses->popupMenu()->text( id ) ) { 00284 Core::getInstance()->doEmitStopButtonPressed( plugin ); 00285 return; 00286 } else { 00287 // oops... list has changed in the meantime 00288 QString str = m_stopProcesses->popupMenu()->text( id ); 00289 for ( plugin = activeProcesses.first(); plugin; plugin = activeProcesses.next() ) { 00290 if ( plugin->pluginName() == str ) { 00291 Core::getInstance()->doEmitStopButtonPressed( plugin ); 00292 return; 00293 } 00294 } 00295 } 00296 } 00297 00298 void MainWindowShare::slotStopMenuAboutToShow() 00299 { 00300 QPopupMenu* popup = m_stopProcesses->popupMenu(); 00301 popup->clear(); 00302 00303 int i = 0; 00304 for ( KDevPlugin* plugin = activeProcesses.first(); plugin; plugin = activeProcesses.next() ) { 00305 popup->insertItem( plugin->pluginName(), i++ ); 00306 } 00307 } 00308 00309 void MainWindowShare::slotShowMenuBar() 00310 { 00311 if (m_pMainWnd->menuBar()->isVisible()) { 00312 m_pMainWnd->menuBar()->hide(); 00313 } else { 00314 m_pMainWnd->menuBar()->show(); 00315 } 00316 m_pMainWnd->saveMainWindowSettings( KGlobal::config(), "Mainwindow" ); 00317 } 00318 00319 void MainWindowShare::slotConfigureNotifications() 00320 { 00321 #if (KDE_VERSION > 305) 00322 KNotifyDialog::configure(m_pMainWnd, "Notification Configuration Dialog"); 00323 #endif 00324 } 00325 00326 void MainWindowShare::slotSettings() 00327 { 00328 KDialogBase dlg(KDialogBase::TreeList, i18n("Configure KDevelop"), 00329 KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, m_pMainWnd, 00330 "customization dialog"); 00331 00332 QVBox *vbox = dlg.addVBoxPage(i18n("General")); 00333 SettingsWidget *gsw = new SettingsWidget(vbox, "general settings widget"); 00334 00335 gsw->projects_url->setMode((int)KFile::Directory); 00336 00337 KConfig* config = kapp->config(); 00338 config->setGroup("General Options"); 00339 gsw->lastProjectCheckbox->setChecked(config->readBoolEntry("Read Last Project On Startup",true)); 00340 config->setGroup("MakeOutputView"); 00341 gsw->setMessageFont(config->readFontEntry("Messages Font")); 00342 gsw->lineWrappingCheckBox->setChecked(config->readBoolEntry("LineWrapping",true)); 00343 gsw->dirNavigMsgCheckBox->setChecked(config->readBoolEntry("ShowDirNavigMsg",false)); 00344 gsw->compilerOutputButtonGroup->setRadioButtonExclusive(true); 00345 gsw->compilerOutputButtonGroup->setButton(config->readNumEntry("CompilerOutputLevel",0)); 00346 config->setGroup("General Options"); 00347 gsw->setApplicationFont(config->readFontEntry("Application Font")); 00348 gsw->changeMessageFontButton->setText(gsw->messageFont().family()); 00349 gsw->changeMessageFontButton->setFont(gsw->messageFont()); 00350 gsw->changeApplicationFontButton->setText(gsw->applicationFont().family()); 00351 gsw->changeApplicationFontButton->setFont(gsw->applicationFont()); 00352 gsw->projects_url->setURL(config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()+"/")); 00353 00354 config->setGroup("Global Settings Dialog"); 00355 int height = config->readNumEntry( "Height", 600 ); 00356 int width = config->readNumEntry( "Width", 800 ); 00357 00358 dlg.resize( width, height ); 00359 00360 Core::getInstance()->doEmitConfigWidget(&dlg); 00361 dlg.exec(); 00362 00363 config->setGroup("Global Settings Dialog"); 00364 config->writeEntry( "Height", dlg.size().height() ); 00365 config->writeEntry( "Width", dlg.size().width() ); 00366 00367 config->setGroup("General Options"); 00368 config->writeEntry("Read Last Project On Startup",gsw->lastProjectCheckbox->isChecked()); 00369 #if defined(KDE_IS_VERSION) 00370 # if KDE_IS_VERSION(3,1,3) 00371 # ifndef _KDE_3_1_3_ 00372 # define _KDE_3_1_3_ 00373 # endif 00374 # endif 00375 #endif 00376 #if defined(_KDE_3_1_3_) 00377 config->writePathEntry("DefaultProjectsDir", gsw->projects_url->url()); 00378 #else 00379 config->writeEntry("DefaultProjectsDir", gsw->projects_url->url()); 00380 #endif 00381 config->writeEntry("Application Font", gsw->applicationFont()); 00382 config->setGroup("MakeOutputView"); 00383 config->writeEntry("Messages Font",gsw->messageFont()); 00384 config->writeEntry("LineWrapping",gsw->lineWrappingCheckBox->isChecked()); 00385 config->writeEntry("ShowDirNavigMsg",gsw->dirNavigMsgCheckBox->isChecked()); 00386 QButton* pSelButton = gsw->compilerOutputButtonGroup->selected(); 00387 config->writeEntry("CompilerOutputLevel",gsw->compilerOutputButtonGroup->id(pSelButton)); // id must be in sync with the enum! 00388 config->sync(); 00389 if( API::getInstance()->makeFrontend() ) 00390 API::getInstance()->makeFrontend()->updateSettingsFromConfig(); 00391 } 00392 00393 void MainWindowShare::slotConfigureEditors() 00394 { 00395 kdDebug(9000) << " *** MainWindowShare::slotConfigureEditors()" << endl; 00396 00397 KDevPartController * partController = API::getInstance()->partController(); 00398 KParts::Part * part = partController->activePart(); 00399 00400 KTextEditor::ConfigInterface * conf = dynamic_cast<KTextEditor::ConfigInterface*>( part ); 00401 if ( ! conf ) 00402 { 00403 kdDebug(9000) << "*** No KTextEditor::ConfigInterface for part!" << endl; 00404 return; 00405 } 00406 00407 // show the modal config dialog for this part if it has a ConfigInterface 00408 conf->configDialog(); 00409 conf->writeConfig(); 00410 00411 #ifdef NEED_CONFIGHACK 00412 // iterate over other instances of this part type and apply configuration 00413 if( const QPtrList<KParts::Part> * partlist = partController->parts() ) 00414 { 00415 QPtrListIterator<KParts::Part> it( *partlist ); 00416 while ( KParts::Part* p = it.current() ) 00417 { 00418 if ( KTextEditor::ConfigInterface * ci = dynamic_cast<KTextEditor::ConfigInterface *>( p ) ) 00419 { 00420 ci->readConfig(); 00421 } 00422 ++it; 00423 } 00424 } 00425 #endif 00426 } 00427 00428 void MainWindowShare::slotGUICreated( KParts::Part * part ) 00429 { 00430 // kdDebug(9000) << "MainWindowShare::slotGUICreated()" << endl; 00431 00432 if ( ! part ) return; 00433 00434 // disable configuration entry if created part is not an editor 00435 if ( ! dynamic_cast<KTextEditor::ConfigInterface *>( part ) ) 00436 { 00437 m_configureEditorAction->setEnabled( false ); 00438 return; 00439 } 00440 00441 m_configureEditorAction->setEnabled( true ); 00442 00443 // remove the part's merged menu entry 00444 KAction * action = part->action("set_confdlg"); // name from katepartui.rc 00445 if ( action ) 00446 { 00447 kdDebug(9000) << " *** found \"set_confdlg\" action - unplugging" << endl; 00448 action->unplugAll(); 00449 } 00450 } 00451 00452 // called when OK ar Apply is clicked in the EditToolbar Dialog 00453 void MainWindowShare::slotNewToolbarConfig() 00454 { 00455 // replug actionlists here... 00456 00457 m_pMainWnd->applyMainWindowSettings( KGlobal::config(), "Mainwindow" ); 00458 00459 PartController::getInstance()->reinstallPopups(); 00460 } 00461 00462 void MainWindowShare::slotKeyBindings() 00463 { 00464 KKeyDialog dlg( false, m_pMainWnd ); 00465 QPtrList<KXMLGUIClient> clients = m_pMainWnd->guiFactory()->clients(); 00466 for( QPtrListIterator<KXMLGUIClient> it( clients ); 00467 it.current(); ++it ) { 00468 dlg.insert( (*it)->actionCollection() ); 00469 } 00470 if ( dlg.configure() == KKeyDialog::Accepted ) 00471 { 00472 // this is needed for when we have multiple embedded kateparts and change one of them. 00473 // it also needs to be done to their views, as they too have actioncollections to update 00474 if( const QPtrList<KParts::Part> * partlist = PartController::getInstance()->parts() ) 00475 { 00476 QPtrListIterator<KParts::Part> it( *partlist ); 00477 while ( KParts::Part* part = it.current() ) 00478 { 00479 if ( KTextEditor::Document * doc = dynamic_cast<KTextEditor::Document*>( part ) ) 00480 { 00481 doc->reloadXML(); 00482 00483 QPtrList<KTextEditor::View> const & list = doc->views(); 00484 QPtrListIterator<KTextEditor::View> itt( list ); 00485 while( KTextEditor::View * view = itt.current() ) 00486 { 00487 view->reloadXML(); 00488 ++itt; 00489 } 00490 } 00491 ++it; 00492 } 00493 } 00494 } 00495 } 00496 00497 void MainWindowShare::slotConfigureToolbars() 00498 { 00499 m_pMainWnd->saveMainWindowSettings( KGlobal::config(), "Mainwindow" ); 00500 KEditToolbar dlg( m_pMainWnd->factory() ); 00501 connect(&dlg, SIGNAL(newToolbarConfig()), this, SLOT(slotNewToolbarConfig())); 00502 dlg.exec(); 00503 } 00504 00505 void MainWindowShare::contextMenu(QPopupMenu* popup, const Context *) 00506 { 00507 if ( m_pMainWnd->menuBar()->isVisible() ) 00508 return; 00509 00510 int id = popup->insertItem( i18n("Show &Menubar"), m_pMainWnd->menuBar(), SLOT(show()) ); 00511 popup->setWhatsThis(id, i18n("<b>Show menubar</b><p>Lets you switch the menubar on/off.")); 00512 } 00513 00514 void MainWindowShare::slotActivePartChanged( KParts::Part * part ) 00515 { 00516 m_configureEditorAction->setEnabled( part && dynamic_cast<KTextEditor::Document*>(part) ); 00517 } 00518 00519 #include "mainwindowshare.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:13 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003