[rkward-cvs] SF.net SVN: rkward: [2234] branches/KDE4_port

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sun Nov 18 17:06:57 UTC 2007


Revision: 2234
          http://rkward.svn.sourceforge.net/rkward/?rev=2234&view=rev
Author:   tfry
Date:     2007-11-18 09:06:57 -0800 (Sun, 18 Nov 2007)

Log Message:
-----------
Create RKStandardActions namespace, and change run action shortcuts

Modified Paths:
--------------
    branches/KDE4_port/NOTES
    branches/KDE4_port/TODO_KDE4
    branches/KDE4_port/rkward/CMakeLists.txt
    branches/KDE4_port/rkward/misc/CMakeLists.txt
    branches/KDE4_port/rkward/rkconsole.cpp
    branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp
    branches/KDE4_port/rkward/windows/rkcommandlog.cpp
    branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp

Added Paths:
-----------
    branches/KDE4_port/rkward/misc/rkstandardactions.cpp
    branches/KDE4_port/rkward/misc/rkstandardactions.h

Modified: branches/KDE4_port/NOTES
===================================================================
--- branches/KDE4_port/NOTES	2007-11-18 16:28:05 UTC (rev 2233)
+++ branches/KDE4_port/NOTES	2007-11-18 17:06:57 UTC (rev 2234)
@@ -1,5 +1,8 @@
 Notes about changes in RKWard that existing users need to adapt to:
 
+*** From 0.4.x to 0.5.0 ***
+- Due to clashes with other default shortcuts, the shortcuts for Run->Run Line, Run Selection, and Run All were changed to Shift+F7, Shift+F8, Shift+F9, respectively.
+
 *** From 0.4.7a to 0.4.8 ***
 - With the addition of the new filesystem browser, the shortcuts to show/hide the main tool windows have changed. The filesystem browser window can be toggled using Alt+2, the shortcuts for command log, pending jobs, console, and help search are now Alt+3 through 6, respectively, instead of Alt+2 through 5.
 - All commands run through the console are now added to the command history of the console, by default. This setting can be changed back to the old behavior (only commands *entered* in the console are added to the history) under Settings->Configure RKWard->Console.

Modified: branches/KDE4_port/TODO_KDE4
===================================================================
--- branches/KDE4_port/TODO_KDE4	2007-11-18 16:28:05 UTC (rev 2233)
+++ branches/KDE4_port/TODO_KDE4	2007-11-18 17:06:57 UTC (rev 2234)
@@ -35,8 +35,6 @@
 		-* Code completion setup wizard could (looks better that way?) be in either tab or page format
 			- Can't do any thing about this. It part of the katepart.
 	- placement of menu options?
-	- F9 key seems to be occupied, now (by show/hide folding markers)
-		- perhaps switch to Shift+F7,8,9 for Run line, selection, all (do so globally!)
 
 rkward
 	- does closing windows work

Modified: branches/KDE4_port/rkward/CMakeLists.txt
===================================================================
--- branches/KDE4_port/rkward/CMakeLists.txt	2007-11-18 16:28:05 UTC (rev 2233)
+++ branches/KDE4_port/rkward/CMakeLists.txt	2007-11-18 17:06:57 UTC (rev 2234)
@@ -27,9 +27,7 @@
 
 # auto-gen sources
 QT4_AUTOMOC(${RKWard_Sources})
-#KDE4_ADD_DCOP_SKELS(RKWard_Sources rkward.h)
 
-
 # somehow the needed libdirs for R do not get passed down automatically
 GET_DIRECTORY_PROPERTY(R_SHAREDLIBDIR DIRECTORY rbackend LINK_DIRECTORIES)
 LINK_DIRECTORIES(${R_SHAREDLIBDIR})
@@ -38,6 +36,8 @@
 
 TARGET_LINK_LIBRARIES(rkward.bin ${KDE4_KDECORE_LIBS} windows agents dialogs plugin settings dataeditor core scriptbackends rbackend misc ${KDE4_KHTML_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KDEUI_LIBS})
 
+# NOTE: KDE4_KFILE_LIBS still links against Qt3Support
+
 # wrapper script
 GET_DIRECTORY_PROPERTY(R_HOME DIRECTORY rbackend DEFINITION R_HOME)
 # TODO: somehow this is built unconditionally, but nevermind

Modified: branches/KDE4_port/rkward/misc/CMakeLists.txt
===================================================================
--- branches/KDE4_port/rkward/misc/CMakeLists.txt	2007-11-18 16:28:05 UTC (rev 2233)
+++ branches/KDE4_port/rkward/misc/CMakeLists.txt	2007-11-18 17:06:57 UTC (rev 2234)
@@ -14,6 +14,7 @@
    rksaveobjectchooser.cpp
    rkdummypart.cpp
    rkstandardicons.cpp
+   rkstandardactions.cpp
    )
 
 QT4_AUTOMOC(${misc_STAT_SRCS})

Added: branches/KDE4_port/rkward/misc/rkstandardactions.cpp
===================================================================
--- branches/KDE4_port/rkward/misc/rkstandardactions.cpp	                        (rev 0)
+++ branches/KDE4_port/rkward/misc/rkstandardactions.cpp	2007-11-18 17:06:57 UTC (rev 2234)
@@ -0,0 +1,65 @@
+/***************************************************************************
+                          rkstandardactions  -  description
+                             -------------------
+    begin                : Sun Nov 18 2007
+    copyright            : (C) 2007 by Thomas Friedrichsmeier
+    email                : tfry at users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "rkstandardactions.h"
+
+#include <klocale.h>
+#include <kactioncollection.h>
+#include <kaction.h>
+
+#include "rkstandardicons.h"
+
+#include "../debug.h"
+
+KAction* RKStandardActions::runLine (KActionCollection* action_collection, const QString &name, const QObject *receiver, const char *member) {
+	RK_TRACE (MISC);
+
+	KAction* ret = action_collection->addAction (name, receiver, member);
+	ret->setText (i18n ("Run current line"));
+	ret->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionRunLine));
+	ret->setShortcut (Qt::ShiftModifier + Qt::Key_F7);
+	return ret;
+}
+
+KAction* RKStandardActions::runSelection (KActionCollection* action_collection, const QString &name, const QObject *receiver, const char *member) {
+	RK_TRACE (MISC);
+
+	KAction* ret = action_collection->addAction (name, receiver, member);
+	ret->setText (i18n ("Run selection"));
+	ret->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionRunSelection));
+	ret->setShortcut (Qt::ShiftModifier + Qt::Key_F8);
+	return ret;
+}
+
+KAction* RKStandardActions::runAll (KActionCollection* action_collection, const QString &name, const QObject *receiver, const char *member) {
+	RK_TRACE (MISC);
+
+	KAction* ret = action_collection->addAction (name, receiver, member);
+	ret->setText (i18n ("Run all"));
+	ret->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionRunAll));
+	ret->setShortcut (Qt::ShiftModifier + Qt::Key_F9);
+	return ret;
+}
+
+KAction* RKStandardActions::functionHelp (KActionCollection* action_collection, const QString &name, const QObject *receiver, const char *member) {
+	RK_TRACE (MISC);
+
+	KAction* ret = action_collection->addAction (name, receiver, member);
+	ret->setText (i18n ("&Function reference"));
+	ret->setShortcut (Qt::Key_F2);
+	return ret;
+}

Added: branches/KDE4_port/rkward/misc/rkstandardactions.h
===================================================================
--- branches/KDE4_port/rkward/misc/rkstandardactions.h	                        (rev 0)
+++ branches/KDE4_port/rkward/misc/rkstandardactions.h	2007-11-18 17:06:57 UTC (rev 2234)
@@ -0,0 +1,37 @@
+/***************************************************************************
+                          rkstandardactions  -  description
+                             -------------------
+    begin                : Sun Nov 18 2007
+    copyright            : (C) 2007 by Thomas Friedrichsmeier
+    email                : tfry at users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef RKSTANDARDACTIONS_H
+#define RKSTANDARDACTIONS_H
+
+class KAction;
+class QString;
+class QObject;
+class KActionCollection;
+
+/** This namespace provides functions to generate some standard actions, i.e. actions which are needed at more than one place.
+
+ at author Thomas Friedrichsmeier */
+namespace RKStandardActions {
+	KAction* runLine (KActionCollection* action_collection, const QString &name, const QObject *receiver=0, const char *member=0);
+	KAction* runSelection (KActionCollection* action_collection, const QString &name, const QObject *receiver=0, const char *member=0);
+	KAction* runAll (KActionCollection* action_collection, const QString &name, const QObject *receiver=0, const char *member=0);
+
+	KAction* functionHelp (KActionCollection* action_collection, const QString &name, const QObject *receiver=0, const char *member=0);
+};
+
+#endif

Modified: branches/KDE4_port/rkward/rkconsole.cpp
===================================================================
--- branches/KDE4_port/rkward/rkconsole.cpp	2007-11-18 16:28:05 UTC (rev 2233)
+++ branches/KDE4_port/rkward/rkconsole.cpp	2007-11-18 17:06:57 UTC (rev 2234)
@@ -50,6 +50,7 @@
 #include "settings/rksettingsmoduleconsole.h"
 #include "misc/rkcommonfunctions.h"
 #include "misc/rkstandardicons.h"
+#include "misc/rkstandardactions.h"
 #include "core/robjectlist.h"
 #include "core/rfunctionobject.h"
 
@@ -794,14 +795,9 @@
 void RKConsole::initializeActions (KActionCollection *ac) {
 	RK_TRACE (APP);
 
-	context_help_action = ac->addAction ("function_reference", this, SLOT(showContextHelp()));
-	context_help_action->setText (i18n ("&Function reference"));
-	context_help_action->setShortcut (Qt::Key_F2);
+	context_help_action = RKStandardActions::functionHelp (ac, "function_reference", this, SLOT(showContextHelp()));
 
-	run_selection_action = ac->addAction ("run_selection", this, SLOT (runSelection()));
-	run_selection_action->setText (i18n ("Run selection"));
-	run_selection_action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionRunSelection));
-	run_selection_action->setShortcut (Qt::Key_F8);
+	run_selection_action = RKStandardActions::runSelection (ac, "run_selection", this, SLOT (runSelection()));
 
 	interrupt_command_action = ac->addAction ("interrupt", this, SLOT (slotInterruptCommand()));
 	interrupt_command_action->setText (i18n ("Interrupt running command"));

Modified: branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp	2007-11-18 16:28:05 UTC (rev 2233)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp	2007-11-18 17:06:57 UTC (rev 2234)
@@ -23,7 +23,7 @@
 #include <kxmlguifactory.h>
 
 #include "rkcommandeditorwindow.h"
-#include "../misc/rkstandardicons.h"
+#include "../misc/rkstandardactions.h"
 #include "../debug.h"
 
 RKCommandEditorWindowPart::RKCommandEditorWindowPart (QWidget *parent, RKCommandEditorWindow *editor_widget) : KParts::Part (parent) {
@@ -46,25 +46,12 @@
 void RKCommandEditorWindowPart::initializeActions () {
 	RK_TRACE (COMMANDEDITOR);
 
-	runAll = actionCollection ()->addAction ("run_all", command_editor, SLOT (runAll()));
-	runAll->setText (i18n ("Run all"));
-	runAll->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionRunAll));
-	runAll->setShortcut (Qt::Key_F9);
+	runAll = RKStandardActions::runAll (actionCollection (), "run_all", command_editor, SLOT (runAll()));
+	runSelection = RKStandardActions::runSelection (actionCollection (), "run_selection", command_editor, SLOT (runSelection()));
+	runLine = RKStandardActions::runLine (actionCollection (), "run_line", command_editor, SLOT (runLine()));
 
-	runSelection = actionCollection ()->addAction ("run_selection", command_editor, SLOT (runSelection()));
-	runSelection->setText (i18n ("Run selection"));
-	runSelection->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionRunSelection));
-	runSelection->setShortcut (Qt::Key_F8);
+	helpFunction = RKStandardActions::functionHelp (actionCollection (), "function_reference", command_editor, SLOT (showHelp()));
 
-	runLine = actionCollection ()->addAction ("run_line", command_editor, SLOT (runLine()));
-	runLine->setText (i18n ("Run current line"));
-	runLine->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionRunLine));
-	runLine->setShortcut (Qt::ControlModifier + Qt::Key_L);
-
-	helpFunction = actionCollection ()->addAction ("function_reference", command_editor, SLOT (showHelp()));
-	helpFunction->setText (i18n ("&Function reference"));
-	helpFunction->setShortcut (Qt::Key_F2);
-
 	QAction* configure = actionCollection ()->addAction ("configure_commandeditor", command_editor, SLOT (configure()));
 	configure->setText (i18n ("Configure Script Editor"));
 }

Modified: branches/KDE4_port/rkward/windows/rkcommandlog.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandlog.cpp	2007-11-18 16:28:05 UTC (rev 2233)
+++ branches/KDE4_port/rkward/windows/rkcommandlog.cpp	2007-11-18 17:06:57 UTC (rev 2234)
@@ -21,7 +21,7 @@
 #include "../rkglobals.h"
 #include "../rkconsole.h"
 #include "../settings/rksettingsmodulewatch.h"
-#include "../misc/rkstandardicons.h"
+#include "../misc/rkstandardactions.h"
 #include "rkcommandeditorwindow.h"
 
 #include <qpushbutton.h>
@@ -276,10 +276,7 @@
 	QAction *configure = actionCollection ()->addAction ("log_configure", log, SLOT(configureLog()));
 	configure->setText (i18n ("Configure"));
 
-	run_selection = actionCollection ()->addAction ("log_run_selection", log, SLOT(runSelection()));
-	run_selection->setText (i18n ("Run selection"));
-	run_selection->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionRunSelection));
-	run_selection->setShortcut (Qt::Key_F8);
+	run_selection = RKStandardActions::runSelection (actionCollection (), "log_run_selection", log, SLOT(runSelection()));
 
 	connect (log->getView (), SIGNAL (popupMenuRequest (const QPoint &)), this, SLOT (doPopupMenu (const QPoint &)));
 }

Modified: branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp	2007-11-18 16:28:05 UTC (rev 2233)
+++ branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp	2007-11-18 17:06:57 UTC (rev 2234)
@@ -39,6 +39,7 @@
 #include "../rkconsole.h"
 #include "../settings/rksettingsmodulegeneral.h"
 #include "../misc/rkcommonfunctions.h"
+#include "../misc/rkstandardactions.h"
 #include "../misc/rkstandardicons.h"
 #include "../misc/xmlhelper.h"
 #include "../plugin/rkcomponentmap.h"
@@ -95,10 +96,7 @@
 	action_collection->addAction (KStandardAction::Copy, "copy", khtmlpart->browserExtension (), SLOT (copy ()));
 
 	// run selection
-	run_selection = action_collection->addAction ("run_selection", this, SLOT (runSelection()));
-	run_selection->setText (i18n ("Run selection"));
-	run_selection->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionRunSelection));
-	run_selection->setShortcut (Qt::Key_F8);
+	run_selection = RKStandardActions::runSelection (action_collection, "run_selection", this, SLOT (runSelection()));
 
 	// needed to enable / disable the run selection action
 	connect (khtmlpart, SIGNAL (selectionChanged()), this, SLOT (selectionChanged()));


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