[rkward-cvs] SF.net SVN: rkward:[2496] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu May 21 20:18:03 UTC 2009


Revision: 2496
          http://rkward.svn.sourceforge.net/rkward/?rev=2496&view=rev
Author:   tfry
Date:     2009-05-21 20:18:03 +0000 (Thu, 21 May 2009)

Log Message:
-----------
Add the (non-contextual) plugin actions to the shortcuts-configuration dialog

Modified Paths:
--------------
    trunk/rkward/rkward/plugin/rkcomponentmap.cpp
    trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp
    trunk/rkward/rkward/windows/rktoplevelwindowgui.h

Modified: trunk/rkward/rkward/plugin/rkcomponentmap.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkcomponentmap.cpp	2009-05-20 17:03:16 UTC (rev 2495)
+++ trunk/rkward/rkward/plugin/rkcomponentmap.cpp	2009-05-21 20:18:03 UTC (rev 2496)
@@ -142,6 +142,9 @@
 
 RKComponentMap::RKComponentMap () : RKComponentGUIXML (), KXMLGUIClient () {
 	RK_TRACE (PLUGIN);
+
+	setComponentData (KGlobal::mainComponent ());
+	actionCollection ()->setConfigGroup ("Plugin Shortcuts");
 }
 
 RKComponentMap::~RKComponentMap () {
@@ -366,6 +369,7 @@
 	}
 
 	setXMLGUIBuildDocument (gui_xml);
+	actionCollection ()->readSettings ();
 	return counter;
 }
 
@@ -374,7 +378,9 @@
 
 	if (handle->isPlugin ()) {
 		handle->setAccessible (true);
-		actionCollection ()->addAction (id, handle, SLOT (activated()))->setText (handle->getLabel ());
+		KAction *action = actionCollection ()->addAction (id, handle, SLOT (activated()));
+		action->setText (handle->getLabel ());
+		action->setShortcutConfigurable (true);
 	}
 }
 

Modified: trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp
===================================================================
--- trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp	2009-05-20 17:03:16 UTC (rev 2495)
+++ trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp	2009-05-21 20:18:03 UTC (rev 2496)
@@ -2,7 +2,7 @@
                           rktoplevelwindowgui  -  description
                              -------------------
     begin                : Tue Apr 24 2007
-    copyright            : (C) 2007 by Thomas Friedrichsmeier
+    copyright            : (C) 2007, 2009 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -38,6 +38,7 @@
 #include "../windows/rkhelpsearchwindow.h"
 #include "../windows/rkmdiwindow.h"
 #include "../misc/rkstandardicons.h"
+#include "../plugin/rkcomponentmap.h"
 #include "../rbackend/rinterface.h"
 #include "../rkglobals.h"
 #include "../rkward.h"
@@ -114,7 +115,12 @@
 
 	KMessageBox::information (for_window, i18n ("For technical reasons, the following dialog allows you to configure the keyboard shortcuts only for those parts of RKWard that are currently active.\n\nTherefore, if you want to configure keyboard shortcuts e.g. for use inside the script editor, you need to open a script editor window, and activate it."), i18n ("Note"), "configure_shortcuts_kparts");
 
-	factory ()->configureShortcuts ();
+	KShortcutsDialog dlg (KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsAllowed, qobject_cast<QWidget*> (parent()));
+	foreach (KXMLGUIClient *client, factory ()->clients ()) {
+		if (client && !client->xmlFile ().isEmpty ()) dlg.addCollection (client->actionCollection());
+	}
+	dlg.addCollection (RKComponentMap::getMap ()->actionCollection (), i18n ("RKWard Plugins"));
+	dlg.configure (true);
 
 	// we need to update all MDI windows, even if they are not currently in the factory.
 	// (they may share some or all shortcuts of the currently active window)

Modified: trunk/rkward/rkward/windows/rktoplevelwindowgui.h
===================================================================
--- trunk/rkward/rkward/windows/rktoplevelwindowgui.h	2009-05-20 17:03:16 UTC (rev 2495)
+++ trunk/rkward/rkward/windows/rktoplevelwindowgui.h	2009-05-21 20:18:03 UTC (rev 2496)
@@ -2,7 +2,7 @@
                           rktoplevelwindowgui  -  description
                              -------------------
     begin                : Tue Apr 24 2007
-    copyright            : (C) 2007 by Thomas Friedrichsmeier
+    copyright            : (C) 2007, 2009 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list