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=659342icc-effect-5.14.5
parent
629166134a
commit
f312d14146
24
tabbox.cpp
24
tabbox.cpp
|
@ -25,6 +25,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <qdesktopwidget.h>
|
#include <qdesktopwidget.h>
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
|
#include <QAction>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
#include <kglobalsettings.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()
|
bool Workspace::startKDEWalkThroughWindows()
|
||||||
{
|
{
|
||||||
if( !establishTabBoxGrab())
|
if( !establishTabBoxGrab())
|
||||||
return false;
|
return false;
|
||||||
tab_grab = true;
|
tab_grab = true;
|
||||||
keys->setEnabled( false );
|
modalActionsSwitch( false );
|
||||||
disable_shortcuts_keys->setEnabled( false );
|
|
||||||
client_keys->setEnabled( false );
|
|
||||||
tab_box->setMode( TabBoxWindowsMode );
|
tab_box->setMode( TabBoxWindowsMode );
|
||||||
tab_box->reset();
|
tab_box->reset();
|
||||||
return true;
|
return true;
|
||||||
|
@ -999,9 +1009,7 @@ bool Workspace::startWalkThroughDesktops( TabBoxMode mode )
|
||||||
if( !establishTabBoxGrab())
|
if( !establishTabBoxGrab())
|
||||||
return false;
|
return false;
|
||||||
control_grab = true;
|
control_grab = true;
|
||||||
keys->setEnabled( false );
|
modalActionsSwitch( false );
|
||||||
disable_shortcuts_keys->setEnabled( false );
|
|
||||||
client_keys->setEnabled( false );
|
|
||||||
tab_box->setMode( mode );
|
tab_box->setMode( mode );
|
||||||
tab_box->reset();
|
tab_box->reset();
|
||||||
return true;
|
return true;
|
||||||
|
@ -1181,9 +1189,7 @@ void Workspace::closeTabBox()
|
||||||
{
|
{
|
||||||
removeTabBoxGrab();
|
removeTabBoxGrab();
|
||||||
tab_box->hide();
|
tab_box->hide();
|
||||||
keys->setEnabled( true );
|
modalActionsSwitch( true );
|
||||||
disable_shortcuts_keys->setEnabled( true );
|
|
||||||
client_keys->setEnabled( true );
|
|
||||||
tab_grab = false;
|
tab_grab = false;
|
||||||
control_grab = false;
|
control_grab = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -622,6 +622,8 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
QMenu *desk_popup;
|
QMenu *desk_popup;
|
||||||
int desk_popup_index;
|
int desk_popup_index;
|
||||||
|
|
||||||
|
void modalActionsSwitch( bool enabled );
|
||||||
|
|
||||||
KActionCollection *keys;
|
KActionCollection *keys;
|
||||||
KActionCollection *client_keys;
|
KActionCollection *client_keys;
|
||||||
QAction *mResizeOpAction;
|
QAction *mResizeOpAction;
|
||||||
|
|
Loading…
Reference in New Issue