From e2997d6bc4b2500640c74f0a336a6d923b93092c Mon Sep 17 00:00:00 2001 From: Ellis Whitehead Date: Fri, 16 Nov 2001 23:21:43 +0000 Subject: [PATCH] Lots and lots and lots of changes all over the place for shortcut changes. Including new KAccel and KGlobalAccel classes. svn path=/trunk/kdebase/kcontrol/; revision=122759 --- kwinbindings.cpp | 217 +++++++++++++++++++++++------------------------ options.cpp | 4 +- workspace.cpp | 117 ++++++++++--------------- 3 files changed, 150 insertions(+), 188 deletions(-) diff --git a/kwinbindings.cpp b/kwinbindings.cpp index 1a7ed2ab2f..097ce84f31 100644 --- a/kwinbindings.cpp +++ b/kwinbindings.cpp @@ -1,118 +1,111 @@ -#ifdef WITH_LABELS - keys->insertItem(i18n("System"), "Program:kwin", 0); +#ifndef NOSLOTS +# define DEF( name, key3, key4, fnSlot ) \ + keys->insertAction( name, i18n(name), KShortcuts(key3), KShortcuts(key4), this, SLOT(fnSlot) ) +#else +# define DEF( name, key3, key4, fnSlot ) \ + keys->insertAction( name, i18n(name), KShortcuts(key3), KShortcuts(key4) ) #endif -#ifdef WITH_LABELS - keys->insertItem(i18n("Navigation"), "Group:Navigation", 0); -#endif - keys->insertItem(i18n("Walk through Windows"), "Walk through windows", KKey("ALT+Tab"), KKey("Alt+Tab")); - keys->insertItem(i18n("Walk through Windows (Reverse)"), "Walk back through windows", KKey("SHIFT+ALT+Tab"), KKey("Alt+Shift+Tab")); - keys->insertItem(i18n("Walk through Desktops"), "Walk through desktops", KKey(), KKey("Meta+Tab")); - keys->insertItem(i18n("Walk through Desktops (Reverse)"), "Walk back through desktops", KKey(), KKey("Meta+Shift+Tab")); - keys->insertItem(i18n("Walk through Desktop List"), "Walk through desktop list", KKey("CTRL+Tab"), KKey()); - keys->insertItem(i18n("Walk through Desktop List (Reverse)"), "Walk back through desktop list", KKey("SHIFT+CTRL+Tab"), KKey()); + keys->insertLabel( "Program:kwin", i18n("System") ); -#ifdef WITH_LABELS - keys->insertItem(i18n("Windows"), "Group:Windows", 0); -#endif - keys->insertItem(i18n("Window Operations Menu"), "Pop-up window operations menu", KKey("ALT+F3"), KKey("Alt+Space")); - keys->insertItem(i18n("Window Close"), "Window close", KKey("ALT+F4"), KKey("Alt+Escape")); - keys->insertItem(i18n("Window Close (All)"), "Window close all", KKey("ALT+Shift+F4"), KKey("Alt+Shift+Escape")); - keys->insertItem(i18n("Window Maximize"), "Window maximize", KKey(), KKey("Meta+Plus")); - keys->insertItem(i18n("Window Maximize Vertical"), "Window maximize vertical", KKey(), KKey("Meta+Bar")); - keys->insertItem(i18n("Window Maximize Horizontal"), "Window maximize horizontal", KKey(), KKey("Meta+Equal")); - keys->insertItem(i18n("Window Iconify"), "Window iconify", KKey(), KKey("Meta+Minus")); - //keys->insertItem(i18n("Window Iconify (All)"), "Window iconify all", KKey(), KKey("Meta+Ctrl+Minus")); - keys->insertItem(i18n("Window Shade"), "Window shade", KKey(), KKey("Meta+Underscore")); - keys->insertItem(i18n("Window Move"), "Window move", 0); - keys->insertItem(i18n("Window Resize"), "Window resize", 0); - keys->insertItem(i18n("Window Raise"), "Window raise", 0); - keys->insertItem(i18n("Window Lower"), "Window lower", 0); - keys->insertItem(i18n("Window Raise or Lower"), "Toggle raise and lower", 0); -/* -This belongs in taskbar rather than here, so it'll have to wait until after 2.2 is done. + keys->insertLabel( "Group:Navigation", i18n("Navigation") ); + DEF( "Walk Through Windows", "Alt+Tab", "Alt+Tab", slotWalkThroughWindows() ); + DEF( "Walk Through Windows (Reverse)", "Alt+Shift+Tab", "Alt+Shift+Tab", slotBackWalkThroughWindows() ); + DEF( "Walk Through Desktops", "", "Meta+Tab", slotWalkThroughDesktops() ); + DEF( "Walk Through Desktops (Reverse)", "", "Meta+Tab", slotWalkBackThroughDesktops() ); + DEF( "Walk Through Desktop List", "Ctrl+Tab", "", slotWalkThroughDesktopList() ); + DEF( "Walk Through Desktop List (Reverse)", "Ctrl+Shift+Tab", "", slotWalkBackThroughDesktopList() ); + + keys->insertLabel( "Group:Windows", i18n("Windows") ); + DEF( "Window Operations Menu", "Alt+F3", "Alt+Menu", slotWindowOperations() ); + DEF( "Window Close", "Alt+F4", "Alt+Escape", slotWindowClose() ); + DEF( "Window Close (All)", "ALT+Shift+F4", "Alt+Shift+Escape", slotWindowCloseAll() ); + DEF( "Window Maximize", "", "Meta+Plus", slotWindowMaximize() ); + DEF( "Window Maximize Vertical", "", "Meta+Bar", slotWindowMaximizeVertical() ); + DEF( "Window Maximize Horizontal", "", "Meta+Equal", slotWindowMaximizeHorizontal() ); + DEF( "Window Iconify", "", "Meta+Minus", slotWindowIconify() ); + //keys->insertAction(i18n("Window Iconify (All)"Window iconify all", Meta+Ctrl+Minus")); + DEF( "Window Shade", "", "Meta+Underscore", slotWindowShade() ); + DEF( "Window Move", "", "", slotWindowMove() ); + DEF( "Window Resize", "", "", slotWindowResize() ); + DEF( "Window Raise", "", "", slotWindowRaise() ); + DEF( "Window Lower", "", "", slotWindowLower() ); + DEF( "Window Toggle Raise/Lower", "", "", slotWindowRaiseOrLower() ); + + keys->insertLabel( "Group:Window Desktop", i18n("Window & Desktop") ); + DEF( "Window to Desktop 1", "", "Meta+Alt+F1", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 2", "", "Meta+Alt+F2", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 3", "", "Meta+Alt+F3", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 4", "", "Meta+Alt+F4", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 5", "", "Meta+Alt+F5", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 6", "", "Meta+Alt+F6", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 7", "", "Meta+Alt+F7", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 8", "", "Meta+Alt+F8", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 9", "", "Meta+Alt+F9", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 10", "", "Meta+Alt+F10", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 11", "", "", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 12", "", "", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 13", "", "", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 14", "", "", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 15", "", "", slotWindowToDesktop(int) ); + DEF( "Window to Desktop 16", "", "", slotWindowToDesktop(int) ); + DEF( "Window to Next Desktop", "", "", slotWindowToNextDesktop() ); + DEF( "Window to Previous Desktop", "", "", slotWindowToPreviousDesktop() ); + + keys->insertLabel( "Group:Desktop Switching", i18n("Desktop Switching") ); + DEF( "Switch to Desktop 1", "CTRL+F1", "Meta+F1", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 2", "CTRL+F2", "Meta+F2", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 3", "CTRL+F3", "Meta+F3", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 4", "CTRL+F4", "Meta+F4", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 5", "CTRL+F5", "Meta+F5", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 6", "CTRL+F6", "Meta+F6", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 7", "CTRL+F7", "Meta+F7", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 8", "CTRL+F8", "Meta+F8", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 9", "CTRL+F9", "Meta+F9", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 10", "CTRL+F10", "Meta+F10", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 11", "CTRL+F11", "", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 12", "CTRL+F12", "", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 13", "CTRL+SHIFT+F1", "", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 14", "CTRL+SHIFT+F2", "", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 15", "CTRL+SHIFT+F3", "", slotSwitchToDesktop(int) ); + DEF( "Switch to Desktop 16", "CTRL+SHIFT+F4", "", slotSwitchToDesktop(int) ); + DEF( "Switch to Next Desktop", "", "", slotSwitchDesktopNext() ); + DEF( "Switch to Previous Desktop", "", "", slotSwitchDesktopPrev() ); + DEF( "Switch One Desktop to the Right", "", "", slotSwitchDesktopRight() ); + DEF( "Switch One Desktop to the Left", "", "", slotSwitchDesktopLeft() ); + DEF( "Switch One Desktop Up", "", "", slotSwitchDesktopUp() ); + DEF( "Switch One Desktop Down", "", "", slotSwitchDesktopDown() ); + + keys->insertLabel( "Group:Miscellaneous", i18n("Miscellaneous") ); + DEF( "Mouse Emulation", "ALT+F12", "", slotMouseEmulation() ); + DEF( "Kill Window", "CTRL+ALT+Escape", "Meta+Ctrl+Delete", slotKillWindow() ); + DEF( "Window Screenshot", "Alt+Print", "Alt+Print", slotGrabWindow() ); + DEF( "Desktop Screenshot", "CTRL+Print", "Meta+Print", slotGrabDesktop() ); + +/*This belongs in taskbar rather than here, so it'll have to wait until after 2.2 is done. -- ellis - keys->insertItem(i18n("Switch to Window 1"), "Switch to Window 1", KKey(), KKey("Meta+1")); - keys->insertItem(i18n("Switch to Window 2"), "Switch to Window 2", KKey(), KKey("Meta+2")); - keys->insertItem(i18n("Switch to Window 3"), "Switch to Window 3", KKey(), KKey("Meta+3")); - keys->insertItem(i18n("Switch to Window 4"), "Switch to Window 4", KKey(), KKey("Meta+4")); - keys->insertItem(i18n("Switch to Window 5"), "Switch to Window 5", KKey(), KKey("Meta+5")); - keys->insertItem(i18n("Switch to Window 6"), "Switch to Window 6", KKey(), KKey("Meta+6")); - keys->insertItem(i18n("Switch to Window 7"), "Switch to Window 7", KKey(), KKey("Meta+7")); - keys->insertItem(i18n("Switch to Window 8"), "Switch to Window 8", KKey(), KKey("Meta+8")); - keys->insertItem(i18n("Switch to Window 9"), "Switch to Window 9", KKey(), KKey("Meta+9")); +DEF( "Switch to Window 1", "Meta+1")); +DEF( "Switch to Window 2", "Meta+2")); +DEF( "Switch to Window 3", "Meta+3")); +DEF( "Switch to Window 4", "Meta+4")); +DEF( "Switch to Window 5", "Meta+5")); +DEF( "Switch to Window 6", "Meta+6")); +DEF( "Switch to Window 7", "Meta+7")); +DEF( "Switch to Window 8", "Meta+8")); +DEF( "Switch to Window 9", "Meta+9")); + +#ifdef WITH_LABELS +DEF( "Window & Taskbar"Group:Window Desktop", 0); +#endif +DEF( "Window to Taskbar Position 1", "Meta+Alt+1")); +DEF( "Window to Taskbar Position 2", "Meta+Alt+2")); +DEF( "Window to Taskbar Position 3", "Meta+Alt+3")); +DEF( "Window to Taskbar Position 4", "Meta+Alt+4")); +DEF( "Window to Taskbar Position 5", "Meta+Alt+5")); +DEF( "Window to Taskbar Position 6", "Meta+Alt+6")); +DEF( "Window to Taskbar Position 7", "Meta+Alt+7")); +DEF( "Window to Taskbar Position 8", "Meta+Alt+8")); +DEF( "Window to Taskbar Position 9", "Meta+Alt+9")); */ -#ifdef WITH_LABELS - keys->insertItem(i18n("Window & Desktop"), "Group:Window Desktop", 0); -#endif - keys->insertItem(i18n("Window to Desktop 1"), "Window to Desktop 1", KKey(), KKey("Meta+Alt+F1")); - keys->insertItem(i18n("Window to Desktop 2"), "Window to Desktop 2", KKey(), KKey("Meta+Alt+F2")); - keys->insertItem(i18n("Window to Desktop 3"), "Window to Desktop 3", KKey(), KKey("Meta+Alt+F3")); - keys->insertItem(i18n("Window to Desktop 4"), "Window to Desktop 4", KKey(), KKey("Meta+Alt+F4")); - keys->insertItem(i18n("Window to Desktop 5"), "Window to Desktop 5", KKey(), KKey("Meta+Alt+F5")); - keys->insertItem(i18n("Window to Desktop 6"), "Window to Desktop 6", KKey(), KKey("Meta+Alt+F6")); - keys->insertItem(i18n("Window to Desktop 7"), "Window to Desktop 7", KKey(), KKey("Meta+Alt+F7")); - keys->insertItem(i18n("Window to Desktop 8"), "Window to Desktop 8", KKey(), KKey("Meta+Alt+F8")); - keys->insertItem(i18n("Window to Desktop 9"), "Window to Desktop 9", KKey(), KKey("Meta+Alt+F9")); - keys->insertItem(i18n("Window to Desktop 10"), "Window to Desktop 10", KKey(), KKey("Meta+Alt+F10")); - keys->insertItem(i18n("Window to Desktop 11"), "Window to Desktop 11", KKey(), KKey()); - keys->insertItem(i18n("Window to Desktop 12"), "Window to Desktop 12", KKey(), KKey()); - keys->insertItem(i18n("Window to Desktop 13"), "Window to Desktop 13", KKey(), KKey()); - keys->insertItem(i18n("Window to Desktop 14"), "Window to Desktop 14", KKey(), KKey()); - keys->insertItem(i18n("Window to Desktop 15"), "Window to Desktop 15", KKey(), KKey()); - keys->insertItem(i18n("Window to Desktop 16"), "Window to Desktop 16", KKey(), KKey()); - keys->insertItem(i18n("Window to Next Desktop"), "Window to next desktop", 0); - keys->insertItem(i18n("Window to Previous Desktop"), "Window to previous desktop", 0); - -/* -This belongs in taskbar rather than here, so it'll have to wait until after 2.2 is done. - -- ellis -#ifdef WITH_LABELS - keys->insertItem(i18n("Window & Taskbar"), "Group:Window Desktop", 0); -#endif - keys->insertItem(i18n("Window to Taskbar Position 1"), "Window to Taskbar Position 1", KKey(), KKey("Meta+Alt+1")); - keys->insertItem(i18n("Window to Taskbar Position 2"), "Window to Taskbar Position 2", KKey(), KKey("Meta+Alt+2")); - keys->insertItem(i18n("Window to Taskbar Position 3"), "Window to Taskbar Position 3", KKey(), KKey("Meta+Alt+3")); - keys->insertItem(i18n("Window to Taskbar Position 4"), "Window to Taskbar Position 4", KKey(), KKey("Meta+Alt+4")); - keys->insertItem(i18n("Window to Taskbar Position 5"), "Window to Taskbar Position 5", KKey(), KKey("Meta+Alt+5")); - keys->insertItem(i18n("Window to Taskbar Position 6"), "Window to Taskbar Position 6", KKey(), KKey("Meta+Alt+6")); - keys->insertItem(i18n("Window to Taskbar Position 7"), "Window to Taskbar Position 7", KKey(), KKey("Meta+Alt+7")); - keys->insertItem(i18n("Window to Taskbar Position 8"), "Window to Taskbar Position 8", KKey(), KKey("Meta+Alt+8")); - keys->insertItem(i18n("Window to Taskbar Position 9"), "Window to Taskbar Position 9", KKey(), KKey("Meta+Alt+9")); -*/ - -#ifdef WITH_LABELS - keys->insertItem(i18n("Desktop Switching"), "Group:Desktop Switching", 0); -#endif - keys->insertItem(i18n("Switch to Desktop 1"), "Switch to desktop 1", KKey("CTRL+F1"), KKey("Meta+F1")); - keys->insertItem(i18n("Switch to Desktop 2"), "Switch to desktop 2", KKey("CTRL+F2"), KKey("Meta+F2")); - keys->insertItem(i18n("Switch to Desktop 3"), "Switch to desktop 3", KKey("CTRL+F3"), KKey("Meta+F3")); - keys->insertItem(i18n("Switch to Desktop 4"), "Switch to desktop 4", KKey("CTRL+F4"), KKey("Meta+F4")); - keys->insertItem(i18n("Switch to Desktop 5"), "Switch to desktop 5", KKey("CTRL+F5"), KKey("Meta+F5")); - keys->insertItem(i18n("Switch to Desktop 6"), "Switch to desktop 6", KKey("CTRL+F6"), KKey("Meta+F6")); - keys->insertItem(i18n("Switch to Desktop 7"), "Switch to desktop 7", KKey("CTRL+F7"), KKey("Meta+F7")); - keys->insertItem(i18n("Switch to Desktop 8"), "Switch to desktop 8", KKey("CTRL+F8"), KKey("Meta+F8")); - keys->insertItem(i18n("Switch to Desktop 9"), "Switch to desktop 9", KKey("CTRL+F9"), KKey("Meta+F9")); - keys->insertItem(i18n("Switch to Desktop 10"), "Switch to desktop 10", KKey("CTRL+F10"), KKey("Meta+F10")); - keys->insertItem(i18n("Switch to Desktop 11"), "Switch to desktop 11", KKey("CTRL+F11"), KKey()); - keys->insertItem(i18n("Switch to Desktop 12"), "Switch to desktop 12", KKey("CTRL+F12"), KKey()); - keys->insertItem(i18n("Switch to Desktop 13"), "Switch to desktop 13", KKey("CTRL+SHIFT+F1"), KKey()); - keys->insertItem(i18n("Switch to Desktop 14"), "Switch to desktop 14", KKey("CTRL+SHIFT+F2"), KKey()); - keys->insertItem(i18n("Switch to Desktop 15"), "Switch to desktop 15", KKey("CTRL+SHIFT+F3"), KKey()); - keys->insertItem(i18n("Switch to Desktop 16"), "Switch to desktop 16", KKey("CTRL+SHIFT+F4"), KKey()); - keys->insertItem(i18n("Switch to Next Desktop"), "Switch desktop next", KKey().key()); - keys->insertItem(i18n("Switch to Previous Desktop"), "Switch desktop previous", KKey().key()); - keys->insertItem(i18n("Switch One Desktop to the Right"), "Switch desktop right", KKey().key()); - keys->insertItem(i18n("Switch One Desktop to the Left"), "Switch desktop left", KKey().key()); - keys->insertItem(i18n("Switch One Desktop Up"), "Switch desktop up", KKey().key()); - keys->insertItem(i18n("Switch One Desktop Down"), "Switch desktop down", KKey().key()); - -#ifdef WITH_LABELS - keys->insertItem(i18n("Miscellaneous"), "Group:Miscellaneous", 0); -#endif - keys->insertItem(i18n("Mouse Emulation"), "Mouse emulation", KKey("ALT+F12"), KKey()); - keys->insertItem(i18n("Kill Window"), "Kill Window", KKey("CTRL+ALT+Escape"), KKey("Meta+Ctrl+Delete")); - keys->insertItem(i18n("Window Screenshot"), "Screenshot of active window", KKey("Alt+Print"), KKey("Alt+Print")); - keys->insertItem(i18n("Desktop Screenshot"), "Screenshot of desktop", KKey("CTRL+Print"), KKey("Meta+Print")); - +#undef DEF diff --git a/options.cpp b/options.cpp index a9263a66cf..a28c834270 100644 --- a/options.cpp +++ b/options.cpp @@ -10,7 +10,7 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include #include #include -#include // for KKeyX11::keyboardHasMetaKey() +#include // for KKeySequence::keyboardHasMetaKey() using namespace KWinInternal; @@ -247,7 +247,7 @@ void Options::reload() CmdWindow1 = mouseCommand(config->readEntry("CommandWindow1","Activate, raise and pass click")); CmdWindow2 = mouseCommand(config->readEntry("CommandWindow2","Activate and pass click")); CmdWindow3 = mouseCommand(config->readEntry("CommandWindow3","Activate and pass click")); - CmdAllModKey = (config->readEntry("CommandAllKey", KKey::keyboardHasMetaKey() ? "Meta" : "Alt") == "Meta") ? Qt::Key_Meta : Qt::Key_Alt; + CmdAllModKey = (config->readEntry("CommandAllKey", KKeySequence::keyboardHasMetaKey() ? "Meta" : "Alt") == "Meta") ? Qt::Key_Meta : Qt::Key_Alt; CmdAll1 = mouseCommand(config->readEntry("CommandAll1","Move")); CmdAll2 = mouseCommand(config->readEntry("CommandAll2","Toggle raise and lower")); CmdAll3 = mouseCommand(config->readEntry("CommandAll3","Resize")); diff --git a/workspace.cpp b/workspace.cpp index 98336e8125..40d1576e0f 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -7,6 +7,7 @@ Copyright (C) 1999, 2000 Matthias Ettrich //#define QT_CLEAN_NAMESPACE #define select kwin_hide_select +#include #include #include #include @@ -476,7 +477,6 @@ Workspace::~Workspace() delete desktop_widget; delete tab_box; delete popup; - delete keys; if ( root == qt_xrootwin() ) XDeleteProperty(qt_xdisplay(), qt_xrootwin(), atoms->kwin_running); @@ -844,7 +844,7 @@ void Workspace::slotWalkThroughWindows() if( tab_grab || control_grab ) return; if ( options->altTabStyle == Options::CDE || !options->focusPolicyIsReasonable() ) { - XUngrabKeyboard(qt_xdisplay(), kwin_time); // need that because of accelerator raw mode + //XUngrabKeyboard(qt_xdisplay(), kwin_time); // need that because of accelerator raw mode // CDE style raise / lower CDEWalkThroughWindows( true ); } else { @@ -1563,7 +1563,10 @@ QPopupMenu* Workspace::clientPopup( Client* c ) popup->insertSeparator(); - QString k = KKey::keyToString( keys->currentKey( "Window close" ), true ); + QString k; + KAccelAction* pAction = keys->basePtr()->actionPtr( "Window Close" ); + if( pAction ) + k = pAction->m_rgShortcuts.toString(); popup->insertItem( SmallIconSet( "remove" ), i18n("&Close")+'\t'+k, Options::CloseOp ); } return popup; @@ -1975,22 +1978,37 @@ void Workspace::reconfigure() } +// FIXME: get rid of this once Workspace looks at KKeySequences instead of +// uint's for keycodes. +inline int currentKey( KGlobalAccel* keys, const char* psAction ) +{ + KAccelAction* pAction = keys->basePtr()->actionPtr( psAction ); + if( pAction ) + return pAction->getShortcut(0).getSequence(0).getKey(0).keyQt(); + else + return 0; +} + /*! Reread settings */ void Workspace::slotReconfigure() { + kdDebug(1212) << "Workspace::slotReconfigure()" << endl; + reconfigureTimer.stop(); KGlobal::config()->reparseConfiguration(); options->reload(); keys->readSettings(); + keys->updateConnections(); tab_box->reconfigure(); - walkThroughDesktopsKeycode = keys->currentKey( "Walk through desktops" ); - walkBackThroughDesktopsKeycode = keys->currentKey( "Walk back through desktops" ); - walkThroughDesktopListKeycode = keys->currentKey( "Walk through desktop list" ); - walkBackThroughDesktopListKeycode = keys->currentKey( "Walk back through desktop list" ); - walkThroughWindowsKeycode = keys->currentKey( "Walk through windows" ); - walkBackThroughWindowsKeycode = keys->currentKey( "Walk back through windows" ); + walkThroughDesktopsKeycode = currentKey( keys, "Walk Through Desktops" ); + walkBackThroughDesktopsKeycode = currentKey( keys, "Walk Through Desktops (Reverse)" ); + walkThroughDesktopListKeycode = currentKey( keys, "Walk Through Desktop List" ); + walkBackThroughDesktopListKeycode = currentKey( keys, "Walk Through Desktop List (Reverse)" ); + walkThroughWindowsKeycode = currentKey( keys, "Walk Through Windows" ); + walkBackThroughWindowsKeycode = currentKey( keys, "Walk Through Windows (Reverse)" ); + mgr->updatePlugin(); // NO need whatsoever to call slotResetAllClientsDelayed here, // updatePlugin resets all clients if necessary anyway. @@ -2639,10 +2657,10 @@ void Workspace::propagateSystemTrayWins() Create the global accel object \c keys. */ void Workspace::createKeybindings(){ - keys = new KGlobalAccel(); + keys = new KGlobalAccel( this ); #include "kwinbindings.cpp" - +/* keys->connectItem( "Switch to desktop 1", this, SLOT( slotSwitchToDesktop( int ) )); keys->connectItem( "Switch to desktop 2", this, SLOT( slotSwitchToDesktop( int ) )); keys->connectItem( "Switch to desktop 3", this, SLOT( slotSwitchToDesktop( int ) )); @@ -2666,50 +2684,6 @@ void Workspace::createKeybindings(){ keys->connectItem( "Switch desktop up", this, SLOT( slotSwitchDesktopUp() )); keys->connectItem( "Switch desktop down", this, SLOT( slotSwitchDesktopDown() )); - /*keys->connectItem( "Switch to Window 1", this, SLOT( slotSwitchToWindow( int ) )); - keys->connectItem( "Switch to Window 2", this, SLOT( slotSwitchToWindow( int ) )); - keys->connectItem( "Switch to Window 3", this, SLOT( slotSwitchToWindow( int ) )); - keys->connectItem( "Switch to Window 4", this, SLOT( slotSwitchToWindow( int ) )); - keys->connectItem( "Switch to Window 5", this, SLOT( slotSwitchToWindow( int ) )); - keys->connectItem( "Switch to Window 6", this, SLOT( slotSwitchToWindow( int ) )); - keys->connectItem( "Switch to Window 7", this, SLOT( slotSwitchToWindow( int ) )); - keys->connectItem( "Switch to Window 8", this, SLOT( slotSwitchToWindow( int ) )); - keys->connectItem( "Switch to Window 9", this, SLOT( slotSwitchToWindow( int ) ));*/ - - keys->connectItem( "Window to Desktop 1", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 2", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 3", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 4", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 5", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 6", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 7", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 8", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 9", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 10", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 11", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 12", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 13", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 14", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 15", this, SLOT( slotWindowToDesktop( int ) )); - keys->connectItem( "Window to Desktop 16", this, SLOT( slotWindowToDesktop( int ) )); - - keys->connectItem( "Pop-up window operations menu", this, SLOT( slotWindowOperations() ) ); - keys->connectItem( "Window close", this, SLOT( slotWindowClose() ) ); - keys->connectItem( "Window close all", this, SLOT( slotWindowCloseAll() ) ); - keys->connectItem( "Window maximize", this, SLOT( slotWindowMaximize() ) ); - keys->connectItem( "Window maximize horizontal", this, SLOT( slotWindowMaximizeHorizontal() ) ); - keys->connectItem( "Window maximize vertical", this, SLOT( slotWindowMaximizeVertical() ) ); - keys->connectItem( "Window iconify", this, SLOT( slotWindowIconify() ) ); - //keys->connectItem( "Window iconify all", this, SLOT( slotWindowIconifyAll() ) ); - keys->connectItem( "Window shade", this, SLOT( slotWindowShade() ) ); - keys->connectItem( "Window move", this, SLOT( slotWindowMove() ) ); - keys->connectItem( "Window resize", this, SLOT( slotWindowResize() ) ); - keys->connectItem( "Window raise", this, SLOT( slotWindowRaise() ) ); - keys->connectItem( "Window lower", this, SLOT( slotWindowLower() ) ); - keys->connectItem( "Toggle raise and lower", this, SLOT( slotWindowRaiseOrLower() ) ); - keys->connectItem( "Window to next desktop", this, SLOT( slotWindowNextDesktop() ) ); - keys->connectItem( "Window to previous desktop", this, SLOT( slotWindowPreviousDesktop() ) ); - keys->connectItem( "Walk through desktops", this, SLOT( slotWalkThroughDesktops())); keys->connectItem( "Walk back through desktops", this, SLOT( slotWalkBackThroughDesktops())); keys->connectItem( "Walk through desktop list", this, SLOT( slotWalkThroughDesktopList())); @@ -2717,26 +2691,21 @@ void Workspace::createKeybindings(){ keys->connectItem( "Walk through windows",this, SLOT( slotWalkThroughWindows())); keys->connectItem( "Walk back through windows",this, SLOT( slotWalkBackThroughWindows())); - keys->connectItem( "Mouse emulation", this, SLOT( slotMouseEmulation() ) ); - - keys->connectItem( "Kill Window", this, SLOT( slotKillWindow() ) ); - - keys->connectItem( "Screenshot of active window", this, SLOT( slotGrabWindow() ) ); - keys->connectItem( "Screenshot of desktop", this, SLOT( slotGrabDesktop() ) ); - +*/ keys->readSettings(); - walkThroughDesktopsKeycode = keys->currentKey( "Walk through desktops" ); - walkBackThroughDesktopsKeycode = keys->currentKey( "Walk back through desktops" ); - walkThroughDesktopListKeycode = keys->currentKey( "Walk through desktop list" ); - walkBackThroughDesktopListKeycode = keys->currentKey( "Walk back through desktop list" ); - walkThroughWindowsKeycode = keys->currentKey( "Walk through windows" ); - walkBackThroughWindowsKeycode = keys->currentKey( "Walk back through windows" ); - keys->setItemRawModeEnabled( "Walk through desktops", TRUE ); - keys->setItemRawModeEnabled( "Walk back through desktops", TRUE ); - keys->setItemRawModeEnabled( "Walk through desktop list", TRUE ); - keys->setItemRawModeEnabled( "Walk back through desktop list", TRUE ); - keys->setItemRawModeEnabled( "Walk through windows", TRUE ); - keys->setItemRawModeEnabled( "Walk back through windows", TRUE ); + keys->updateConnections(); + walkThroughDesktopsKeycode = currentKey( keys, "Walk Through Desktops" ); + walkBackThroughDesktopsKeycode = currentKey( keys, "Walk Through Desktops (Reverse)" ); + walkThroughDesktopListKeycode = currentKey( keys, "Walk Through Desktop List" ); + walkBackThroughDesktopListKeycode = currentKey( keys, "Walk Through Desktop List (Reverse)" ); + walkThroughWindowsKeycode = currentKey( keys, "Walk Through Windows" ); + walkBackThroughWindowsKeycode = currentKey( keys, "Walk Through Windows (Reverse)" ); + //keys->setItemRawModeEnabled( "Walk through desktops", TRUE ); + //keys->setItemRawModeEnabled( "Walk back through desktops", TRUE ); + //keys->setItemRawModeEnabled( "Walk through desktop list", TRUE ); + //keys->setItemRawModeEnabled( "Walk back through desktop list", TRUE ); + //keys->setItemRawModeEnabled( "Walk through windows", TRUE ); + //keys->setItemRawModeEnabled( "Walk back through windows", TRUE ); } void Workspace::slotSwitchDesktop1(){