KIOSK: Hide configure option if control modules have not been authorized

svn path=/trunk/kdebase/kwin/; revision=296848
icc-effect-5.14.5
Waldo Bastian 2004-03-18 13:18:41 +00:00
parent 0992665bb4
commit 30faf2c53e
3 changed files with 16 additions and 4 deletions

View File

@ -69,7 +69,8 @@ QPopupMenu* Workspace::clientPopup()
popup->insertSeparator();
if (!KGlobal::config()->isImmutable())
if (!KGlobal::config()->isImmutable() &&
!kapp->authorizeControlModules(Workspace::configModules(true)).isEmpty())
{
popup->insertItem(SmallIconSet( "configure" ), i18n("Configur&e Window Behavior..."), this, SLOT( configureWM() ));
popup->insertSeparator();

View File

@ -844,11 +844,20 @@ void Workspace::saveDesktopSettings()
}
}
void Workspace::configureWM()
QStringList Workspace::configModules(bool controlCenter)
{
QStringList args;
args << "kwindecoration" << "kwinactions" << "kwinfocus" << "kwinmoving" << "kwinadvanced";
KApplication::kdeinitExec( "kcmshell", args );
args << "kde-kwindecoration.desktop";
if (controlCenter)
args << "kde-kwinoptions.desktop";
else if (kapp->authorizeControlModule("kde-kwinoptions.desktop"))
args << "kwinactions" << "kwinfocus" << "kwinmoving" << "kwinadvanced";
return args;
}
void Workspace::configureWM()
{
KApplication::kdeinitExec( "kcmshell", configModules(false) );
}
/*!

View File

@ -238,6 +238,8 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine
int packPositionUp( const Client* cl, int oldy, bool top_edge ) const;
int packPositionDown( const Client* cl, int oldy, bool bottom_edge ) const;
static QStringList configModules(bool controlCenter);
public slots:
void refresh();
// keybindings