From kde-commits Fri Feb 26 09:23:48 2010 From: Ben Cooksley Date: Fri, 26 Feb 2010 09:23:48 +0000 To: kde-commits Subject: KDE/kdebase/workspace/systemsettings Message-Id: <1267176228.656762.3002.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=126717623700305 SVN commit 1096209 by bcooksley: Allow Quit to be hidden by views. M +8 -2 app/SettingsBase.cpp M +1 -0 app/SettingsBase.h M +1 -1 app/systemsettingsui.rc M +2 -1 core/BaseMode.h M +1 -1 icons/IconMode.cpp --- trunk/KDE/kdebase/workspace/systemsettings/app/SettingsBase.cpp #1096208:1096209 @@ -112,7 +112,7 @@ { // Fill the toolbar with default actions // Exit is the very last action - actionCollection()->addAction( KStandardAction::Quit, "quit", this, SLOT( close() ) ); + quitAction = actionCollection()->addAction( KStandardAction::Quit, "quit_action", this, SLOT( close() ) ); // Configure goes at the end configureAction = actionCollection()->addAction( KStandardAction::Preferences, this, SLOT( configShow() ) ); configureAction->setShortcut(KShortcut(QKeySequence(Qt::CTRL + Qt::Key_M))); @@ -137,7 +137,7 @@ helpActionMenu->setMenu( dynamic_cast( factory()->container("help", this) ) ); setMinimumSize(620,430); toolBar()->setMovable(false); // We don't allow any changes - changeToolBar( BaseMode::Search | BaseMode::Configure ); + changeToolBar( BaseMode::Search | BaseMode::Configure | BaseMode::Quit ); } void SettingsBase::initHelpMenu() @@ -337,6 +337,7 @@ } guiFactory()->unplugActionList( this, "configure" ); guiFactory()->unplugActionList( this, "search" ); + guiFactory()->unplugActionList( this, "quit" ); if ( BaseMode::Search & toolbar ) { QList searchBarActions; searchBarActions << spacerAction << searchAction; @@ -347,6 +348,11 @@ configureBarActions << configureAction; guiFactory()->plugActionList( this, "configure", configureBarActions ); } + if ( BaseMode::Quit & toolbar ) { + QList quitBarActions; + quitBarActions << quitAction; + guiFactory()->plugActionList( this, "quit", quitBarActions ); + } } void SettingsBase::changeAboutMenu( const KAboutData * menuAbout, KAction * menuItem, QString fallback ) --- trunk/KDE/kdebase/workspace/systemsettings/app/SettingsBase.h #1096208:1096209 @@ -74,6 +74,7 @@ KAction * searchAction; KAction * spacerAction; KAction * configureAction; + KAction * quitAction; // The help menu KAction * aboutViewAction; KAction * aboutModuleAction; --- trunk/KDE/kdebase/workspace/systemsettings/app/systemsettingsui.rc #1096208:1096209 @@ -18,7 +18,7 @@ - + --- trunk/KDE/kdebase/workspace/systemsettings/core/BaseMode.h #1096208:1096209 @@ -73,7 +73,8 @@ enum ToolBarItemsFlags { NoItems = 0x1, /**< The Toolbar will not have any items added by System Settings */ Search = 0x2, /**< The Toolbar will have the search bar added by System Settings */ - Configure = 0x4 /**< The Toolbar will have configure added by System Settings */ + Configure = 0x4, /**< The Toolbar will have configure added by System Settings */ + Quit = 0x8, /**< The toolbar will have exit added by System Settings */ }; Q_DECLARE_FLAGS(ToolBarItems, ToolBarItemsFlags) --- trunk/KDE/kdebase/workspace/systemsettings/icons/IconMode.cpp #1096208:1096209 @@ -153,7 +153,7 @@ d->moduleView->closeModules(); d->mainWidget->setCurrentWidget( d->iconWidget ); d->backAction->setEnabled( false ); - emit changeToolBarItems( BaseMode::Search | BaseMode::Configure ); + emit changeToolBarItems( BaseMode::Search | BaseMode::Configure | BaseMode::Quit ); emit viewChanged( false ); } }