diff --git a/kwinbindings.cpp b/kwinbindings.cpp index 3d3d76e271..cb971e80ea 100644 --- a/kwinbindings.cpp +++ b/kwinbindings.cpp @@ -1,19 +1,19 @@ #ifndef NOSLOTS # define DEF2( name, descr, key, fnSlot ) \ a = new KAction( i18n(descr), actionCollection, name ); \ - a->setShortcut(KShortcut(key)); \ + a->setGlobalShortcut(KShortcut(key)); \ connect(a, SIGNAL(triggered(bool)), SLOT(fnSlot)) # define DEF( name, key, fnSlot ) \ a = new KAction( i18n(name), actionCollection, name ); \ - a->setShortcut(KShortcut(key)); \ + a->setGlobalShortcut(KShortcut(key)); \ connect(a, SIGNAL(triggered(bool)), SLOT(fnSlot)) #else # define DEF2( name, descr, key, fnSlot ) \ a = new KAction( i18n(descr), actionCollection, name ); \ - a->setShortcut(KShortcut(key)); + a->setGlobalShortcut(KShortcut(key)); # define DEF( name, key, fnSlot ) \ a = new KAction( i18n(name), actionCollection, name ); \ - a->setShortcut(KShortcut(key)); + a->setGlobalShortcut(KShortcut(key)); #endif // some shortcuts have Tarzan-speech like names, they need extra normal human descriptions with DEF2() @@ -24,25 +24,25 @@ new KAction( i18n("Navigation"), actionCollection, "Group:Navigation" ); DEF( I18N_NOOP("Walk Through Windows"), Qt::ALT+Qt::Key_Tab, slotWalkThroughWindows() ); DEF( I18N_NOOP("Walk Through Windows (Reverse)"), Qt::ALT+Qt::SHIFT+Qt::Key_Tab, slotWalkBackThroughWindows() ); - DEF( I18N_NOOP("Walk Through Desktops"), Qt::META+Qt::Key_Tab, slotWalkThroughDesktops() ); - DEF( I18N_NOOP("Walk Through Desktops (Reverse)"), Qt::META+Qt::SHIFT+Qt::Key_Tab, slotWalkBackThroughDesktops() ); + DEF( I18N_NOOP("Walk Through Desktops"), 0, slotWalkThroughDesktops() ); + DEF( I18N_NOOP("Walk Through Desktops (Reverse)"), 0, slotWalkBackThroughDesktops() ); DEF( I18N_NOOP("Walk Through Desktop List"), 0, slotWalkThroughDesktopList() ); DEF( I18N_NOOP("Walk Through Desktop List (Reverse)"), 0, slotWalkBackThroughDesktopList() ); new KAction( i18n("Windows"), actionCollection, "Group:Windows" ); - DEF( I18N_NOOP("Window Operations Menu"), Qt::ALT+Qt::Key_Menu, slotWindowOperations() ); + DEF( I18N_NOOP("Window Operations Menu"), Qt::ALT+Qt::Key_F3, slotWindowOperations() ); DEF2( "Window Close", I18N_NOOP("Close Window"), - "Alt+Escape;Alt+F4", slotWindowClose() ); + Qt::ALT+Qt::Key_F4, slotWindowClose() ); DEF2( "Window Maximize", I18N_NOOP("Maximize Window"), - Qt::META+Qt::Key_Plus, slotWindowMaximize() ); + 0, slotWindowMaximize() ); DEF2( "Window Maximize Vertical", I18N_NOOP("Maximize Window Vertically"), - Qt::META+Qt::Key_Bar, slotWindowMaximizeVertical() ); + 0, slotWindowMaximizeVertical() ); DEF2( "Window Maximize Horizontal", I18N_NOOP("Maximize Window Horizontally"), - Qt::META+Qt::Key_Equal, slotWindowMaximizeHorizontal() ); + 0, slotWindowMaximizeHorizontal() ); DEF2( "Window Minimize", I18N_NOOP("Minimize Window"), - Qt::META+Qt::Key_Minus, slotWindowMinimize() ); + 0, slotWindowMinimize() ); DEF2( "Window Shade", I18N_NOOP("Shade Window"), - Qt::META+Qt::Key_Underscore, slotWindowShade() ); + 0, slotWindowShade() ); DEF2( "Window Move", I18N_NOOP("Move Window"), 0, slotWindowMove() ); DEF2( "Window Resize", I18N_NOOP("Resize Window"), @@ -84,16 +84,16 @@ new KAction( i18n("Window & Desktop"), actionCollection, "Group:Window Desktop" ); DEF2( "Window On All Desktops", I18N_NOOP("Keep Window on All Desktops"), 0, slotWindowOnAllDesktops() ); - DEF( I18N_NOOP("Window to Desktop 1"), Qt::META+Qt::ALT+Qt::Key_F1, slotWindowToDesktop1() ); - DEF( I18N_NOOP("Window to Desktop 2"), Qt::META+Qt::ALT+Qt::Key_F2, slotWindowToDesktop2() ); - DEF( I18N_NOOP("Window to Desktop 3"), Qt::META+Qt::ALT+Qt::Key_F3, slotWindowToDesktop3() ); - DEF( I18N_NOOP("Window to Desktop 4"), Qt::META+Qt::ALT+Qt::Key_F4, slotWindowToDesktop4() ); - DEF( I18N_NOOP("Window to Desktop 5"), Qt::META+Qt::ALT+Qt::Key_F5, slotWindowToDesktop5() ); - DEF( I18N_NOOP("Window to Desktop 6"), Qt::META+Qt::ALT+Qt::Key_F6, slotWindowToDesktop6() ); - DEF( I18N_NOOP("Window to Desktop 7"), Qt::META+Qt::ALT+Qt::Key_F7, slotWindowToDesktop7() ); - DEF( I18N_NOOP("Window to Desktop 8"), Qt::META+Qt::ALT+Qt::Key_F8, slotWindowToDesktop8() ); - DEF( I18N_NOOP("Window to Desktop 9"), Qt::META+Qt::ALT+Qt::Key_F9, slotWindowToDesktop9() ); - DEF( I18N_NOOP("Window to Desktop 10"), Qt::META+Qt::ALT+Qt::Key_F10, slotWindowToDesktop10() ); + DEF( I18N_NOOP("Window to Desktop 1"), 0, slotWindowToDesktop1() ); + DEF( I18N_NOOP("Window to Desktop 2"), 0, slotWindowToDesktop2() ); + DEF( I18N_NOOP("Window to Desktop 3"), 0, slotWindowToDesktop3() ); + DEF( I18N_NOOP("Window to Desktop 4"), 0, slotWindowToDesktop4() ); + DEF( I18N_NOOP("Window to Desktop 5"), 0, slotWindowToDesktop5() ); + DEF( I18N_NOOP("Window to Desktop 6"), 0, slotWindowToDesktop6() ); + DEF( I18N_NOOP("Window to Desktop 7"), 0, slotWindowToDesktop7() ); + DEF( I18N_NOOP("Window to Desktop 8"), 0, slotWindowToDesktop8() ); + DEF( I18N_NOOP("Window to Desktop 9"), 0, slotWindowToDesktop9() ); + DEF( I18N_NOOP("Window to Desktop 10"), 0, slotWindowToDesktop10() ); DEF( I18N_NOOP("Window to Desktop 11"), 0, slotWindowToDesktop11() ); DEF( I18N_NOOP("Window to Desktop 12"), 0, slotWindowToDesktop12() ); DEF( I18N_NOOP("Window to Desktop 13"), 0, slotWindowToDesktop13() ); @@ -112,16 +112,16 @@ DEF( I18N_NOOP("Window One Desktop Down"), 0, slotWindowToDesktopDown() ); new KAction( i18n("Desktop Switching"), actionCollection, "Group:Desktop Switching" ); - DEF( I18N_NOOP("Switch to Desktop 1"), Qt::META+Qt::Key_F1, slotSwitchToDesktop1() ); - DEF( I18N_NOOP("Switch to Desktop 2"), Qt::META+Qt::Key_F2, slotSwitchToDesktop2() ); - DEF( I18N_NOOP("Switch to Desktop 3"), Qt::META+Qt::Key_F3, slotSwitchToDesktop3() ); - DEF( I18N_NOOP("Switch to Desktop 4"), Qt::META+Qt::Key_F4, slotSwitchToDesktop4() ); - DEF( I18N_NOOP("Switch to Desktop 5"), Qt::META+Qt::Key_F5, slotSwitchToDesktop5() ); - DEF( I18N_NOOP("Switch to Desktop 6"), Qt::META+Qt::Key_F6, slotSwitchToDesktop6() ); - DEF( I18N_NOOP("Switch to Desktop 7"), Qt::META+Qt::Key_F7, slotSwitchToDesktop7() ); - DEF( I18N_NOOP("Switch to Desktop 8"), Qt::META+Qt::Key_F8, slotSwitchToDesktop8() ); - DEF( I18N_NOOP("Switch to Desktop 9"), Qt::META+Qt::Key_F9, slotSwitchToDesktop9() ); - DEF( I18N_NOOP("Switch to Desktop 10"), Qt::META+Qt::Key_F10, slotSwitchToDesktop10() ); + DEF( I18N_NOOP("Switch to Desktop 1"), Qt::CTRL+Qt::Key_F1, slotSwitchToDesktop1() ); + DEF( I18N_NOOP("Switch to Desktop 2"), Qt::CTRL+Qt::Key_F2, slotSwitchToDesktop2() ); + DEF( I18N_NOOP("Switch to Desktop 3"), Qt::CTRL+Qt::Key_F3, slotSwitchToDesktop3() ); + DEF( I18N_NOOP("Switch to Desktop 4"), Qt::CTRL+Qt::Key_F4, slotSwitchToDesktop4() ); + DEF( I18N_NOOP("Switch to Desktop 5"), Qt::CTRL+Qt::Key_F5, slotSwitchToDesktop5() ); + DEF( I18N_NOOP("Switch to Desktop 6"), Qt::CTRL+Qt::Key_F6, slotSwitchToDesktop6() ); + DEF( I18N_NOOP("Switch to Desktop 7"), Qt::CTRL+Qt::Key_F7, slotSwitchToDesktop7() ); + DEF( I18N_NOOP("Switch to Desktop 8"), Qt::CTRL+Qt::Key_F8, slotSwitchToDesktop8() ); + DEF( I18N_NOOP("Switch to Desktop 9"), Qt::CTRL+Qt::Key_F9, slotSwitchToDesktop9() ); + DEF( I18N_NOOP("Switch to Desktop 10"), Qt::CTRL+Qt::Key_F10, slotSwitchToDesktop10() ); DEF( I18N_NOOP("Switch to Desktop 11"), Qt::CTRL+Qt::Key_F11, slotSwitchToDesktop11() ); DEF( I18N_NOOP("Switch to Desktop 12"), Qt::CTRL+Qt::Key_F12, slotSwitchToDesktop12() ); DEF( I18N_NOOP("Switch to Desktop 13"), Qt::CTRL+Qt::SHIFT+Qt::Key_F1, slotSwitchToDesktop13() ); @@ -141,9 +141,9 @@ new KAction( i18n("Miscellaneous"), actionCollection, "Group:Miscellaneous" ); DEF( I18N_NOOP("Mouse Emulation"), Qt::ALT+Qt::Key_F12, slotMouseEmulation() ); - DEF( I18N_NOOP("Kill Window"), Qt::META+Qt::CTRL+Qt::Key_Delete, slotKillWindow() ); + DEF( I18N_NOOP("Kill Window"), Qt::CTRL+Qt::Key_Delete, slotKillWindow() ); DEF( I18N_NOOP("Window Screenshot"), Qt::ALT+Qt::Key_Print, slotGrabWindow() ); - DEF( I18N_NOOP("Desktop Screenshot"), Qt::META+Qt::Key_Print, slotGrabDesktop() ); + DEF( I18N_NOOP("Desktop Screenshot"), Qt::CTRL+Qt::Key_Print, slotGrabDesktop() ); DEF( I18N_NOOP("Block Global Shortcuts"), 0, slotDisableGlobalShortcuts()); /*This belongs in taskbar rather than here, so it'll have to wait until after 2.2 is done. diff --git a/useractions.cpp b/useractions.cpp index 1d5490a20e..6090594f68 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -58,6 +58,7 @@ QMenu* Workspace::clientPopup() advanced_popup = new QMenu( popup ); advanced_popup->setFont(KGlobalSettings::menuFont()); + connect( advanced_popup, SIGNAL( triggered(QAction*) ), this, SLOT( clientPopupActivated(QAction*) ) ); mKeepAboveOpAction = advanced_popup->addAction( i18n("Keep &Above Others") ); mKeepAboveOpAction->setIcon( SmallIconSet( "up" ) ); @@ -163,10 +164,18 @@ QMenu* Workspace::clientPopup() return popup; } -//sets the transparency of the client to given value(given by slider) void Workspace::setPopupClientOpacity(int value) { - // TODO + if( active_popup_client == NULL ) + return; + active_popup_client->setOpacity( value / 100.0 ); + } + +void Workspace::resetClientOpacity() + { + if( active_popup_client == NULL ) + return; + active_popup_client->setOpacity( 1.0 ); } void Workspace::setTransButtonText(int value) @@ -182,11 +191,6 @@ void Workspace::setTransButtonText(int value) transButton->setText('0'+QString::number(value)+" %"); } -void Workspace::resetClientOpacity() - { - // TODO - } - /*! The client popup menu will become visible soon. @@ -640,10 +644,10 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo workspace()->windowToNextDesktop( this ); break; case Options::MouseOpacityMore: - // TODO + setOpacity( qMin( opacity() + 0.1, 1.0 )); break; case Options::MouseOpacityLess: - // TODO + setOpacity( qMax( opacity() - 0.1, 0.0 )); break; case Options::MouseNothing: replay = true; diff --git a/workspace.cpp b/workspace.cpp index 5ed2bb1a67..a5a8911c49 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -2395,7 +2395,7 @@ void Workspace::helperDialog( const QString& message, const Client* c ) { KAction* action = keys->action( "Window Operations Menu" ); QString shortcut = QString( "%1 (%2)" ).arg( action->text() ) - .arg( action->shortcut().seq( 0 ).toString()); + .arg( action->globalShortcut().seq( 0 ).toString()); args << "--msgbox" << i18n( "You have selected to show a window without its border.\n" "Without the border, you will not be able to enable the border " @@ -2408,7 +2408,7 @@ void Workspace::helperDialog( const QString& message, const Client* c ) { KAction* action = keys->action( "Window Operations Menu" ); QString shortcut = QString( "%1 (%2)" ).arg( action->text() ) - .arg( action->shortcut().seq( 0 ).toString()); + .arg( action->globalShortcut().seq( 0 ).toString()); args << "--msgbox" << i18n( "You have selected to show a window in fullscreen mode.\n" "If the application itself does not have an option to turn the fullscreen "