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

List:       kde-commits
Subject:    KDE/kdebase/workspace/kcontrol/keys
From:       Michael Jansen <kde () michael-jansen ! biz>
Date:       2009-02-28 23:10:11
Message-ID: 1235862611.986121.1953.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 933453 by mjansen:

Implement the possibility to unset all shortcuts for a component at once.

I could have called it "The Amarok" button, because that app made me
implement it.

 M  +8 -0      kglobalshortcutseditor.cpp  
 M  +5 -0      kglobalshortcutseditor.h  


--- trunk/KDE/kdebase/workspace/kcontrol/keys/kglobalshortcutseditor.cpp #933452:933453
@@ -115,6 +115,7 @@
     QMenu *menu = new QMenu(q);
     menu->addAction( i18n("Import Scheme..."), q, SLOT(importScheme()));
     menu->addAction( i18n("Export Scheme..."), q, SLOT(exportScheme()));
+    menu->addAction( i18n("Set All Shortcuts to None"), q, SLOT(clearConfiguration()));
     menu->addAction( i18n("Remove Component"), q, SLOT(removeComponent()));
 
     ui.menu_button->setMenu(menu);
@@ -198,6 +199,13 @@
 }
 
 
+void KGlobalShortcutsEditor::clearConfiguration()
+{
+    QString name = d->ui.components->currentText();
+    d->components.value(name).editor->clearConfiguration();
+}
+
+
 void KGlobalShortcutsEditor::defaults(ComponentScope scope)
 {
     switch (scope)
--- trunk/KDE/kdebase/workspace/kcontrol/keys/kglobalshortcutseditor.h #933452:933453
@@ -113,6 +113,11 @@
     void activateComponent(const QString &component);
 
     /**
+     * Set all shortcuts to none.
+     */
+    void clearConfiguration();
+
+    /**
      * Load/Reload the global shortcuts
      */
     void load();
[prev in list] [next in list] [prev in thread] [next in thread] 

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