[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/kickoff
From:       Darío Andrés Rodríguez <andresbajotierra () gmail ! co
Date:       2009-04-25 15:12:16
Message-ID: 1240672336.364849.11865.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 959066 by darioandres:

Preserve global shortcut when switching menu-style Kickoff<->SimpleMenu
This is just a workaround (because all the settings are lost on the switch)

The real fix would be not destroying the current applet and creating a new one
on switch but changing its style internally

BUG: 178926


 M  +6 -1      applet/applet.cpp  
 M  +6 -1      simpleapplet/simpleapplet.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/kickoff/applet/applet.cpp #959065:959066
@@ -133,7 +133,12 @@
 void LauncherApplet::switchMenuStyle()
 {
     if (containment()) {
-        containment()->addApplet("simplelauncher", QVariantList(), geometry());
+        Plasma::Applet * simpleLauncher = 
+                            containment()->addApplet("simplelauncher", QVariantList(), geometry());
+        //Switch shortcuts with the new launcher to avoid losing it
+        KShortcut currentShortcut = globalShortcut();
+        setGlobalShortcut(KShortcut());
+        simpleLauncher->setGlobalShortcut(currentShortcut);
         destroy();
     }
 }
--- trunk/KDE/kdebase/workspace/plasma/applets/kickoff/simpleapplet/simpleapplet.cpp #959065:959066
@@ -346,7 +346,12 @@
 void MenuLauncherApplet::switchMenuStyle()
 {
     if (containment()) {
-        containment()->addApplet("launcher", QVariantList(), geometry());
+        Plasma::Applet * launcher = 
+                                containment()->addApplet("launcher", QVariantList(), geometry());
+        //Switch shortcuts with the new launcher to avoid losing it
+        KShortcut currentShortcut = globalShortcut();
+        setGlobalShortcut(KShortcut());
+        launcher->setGlobalShortcut(currentShortcut);
         destroy();
     }
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic