KIOSK: Hide configure option if control modules have not been authorized
svn path=/trunk/kdebase/kwin/; revision=296848
This commit is contained in:
parent
0992665bb4
commit
30faf2c53e
3 changed files with 16 additions and 4 deletions
|
@ -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();
|
||||
|
|
|
@ -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) );
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue