adaptations to the new KGlobalAccel and KActionCollection. Workspace::modalActionsSwitch() has a stupid name, feel free to do whatever with it.

svn path=/trunk/KDE/kdebase/workspace/; revision=659342
icc-effect-5.14.5
Andreas Hartmetz 2007-04-30 00:52:51 +00:00
parent 629166134a
commit f312d14146
2 changed files with 17 additions and 9 deletions

View File

@ -25,6 +25,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include <QApplication>
#include <qdesktopwidget.h>
#include <QCursor>
#include <QAction>
#include <stdarg.h>
#include <kdebug.h>
#include <kglobalsettings.h>
@ -981,14 +982,23 @@ void Workspace::slotWalkBackThroughDesktopList()
}
}
void Workspace::modalActionsSwitch( bool enabled )
{
QList<KActionCollection*> collections;
collections.append( keys );
collections.append( disable_shortcuts_keys );
collections.append( client_keys );
foreach (KActionCollection* collection, collections)
foreach (QAction *action, collection->actions())
action->setEnabled(enabled);
}
bool Workspace::startKDEWalkThroughWindows()
{
if( !establishTabBoxGrab())
return false;
tab_grab = true;
keys->setEnabled( false );
disable_shortcuts_keys->setEnabled( false );
client_keys->setEnabled( false );
modalActionsSwitch( false );
tab_box->setMode( TabBoxWindowsMode );
tab_box->reset();
return true;
@ -999,9 +1009,7 @@ bool Workspace::startWalkThroughDesktops( TabBoxMode mode )
if( !establishTabBoxGrab())
return false;
control_grab = true;
keys->setEnabled( false );
disable_shortcuts_keys->setEnabled( false );
client_keys->setEnabled( false );
modalActionsSwitch( false );
tab_box->setMode( mode );
tab_box->reset();
return true;
@ -1181,9 +1189,7 @@ void Workspace::closeTabBox()
{
removeTabBoxGrab();
tab_box->hide();
keys->setEnabled( true );
disable_shortcuts_keys->setEnabled( true );
client_keys->setEnabled( true );
modalActionsSwitch( true );
tab_grab = false;
control_grab = false;
}

View File

@ -622,6 +622,8 @@ class Workspace : public QObject, public KDecorationDefines
QMenu *desk_popup;
int desk_popup_index;
void modalActionsSwitch( bool enabled );
KActionCollection *keys;
KActionCollection *client_keys;
QAction *mResizeOpAction;