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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Dec 5 15:11:44 UTC 2006


Revision: 993
          http://svn.sourceforge.net/rkward/?rev=993&view=rev
Author:   tfry
Date:     2006-12-05 07:11:44 -0800 (Tue, 05 Dec 2006)

Log Message:
-----------
Add run selection action to command log

Modified Paths:
--------------
    trunk/rkward/rkward/windows/rkcommandlog.cpp
    trunk/rkward/rkward/windows/rkcommandlog.h
    trunk/rkward/rkward/windows/rkcommandlogpart.rc

Modified: trunk/rkward/rkward/windows/rkcommandlog.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkcommandlog.cpp	2006-12-05 14:40:27 UTC (rev 992)
+++ trunk/rkward/rkward/windows/rkcommandlog.cpp	2006-12-05 15:11:44 UTC (rev 993)
@@ -19,6 +19,7 @@
 
 #include "../rbackend/rinterface.h"
 #include "../rkglobals.h"
+#include "../rkconsole.h"
 #include "../settings/rksettingsmodulewatch.h"
 #include "../settings/rksettings.h"
 #include "rkcommandeditorwindow.h"
@@ -218,6 +219,12 @@
 	log_view->setWordWrap (QTextEdit::NoWrap);
 }
 
+void RKCommandLog::runSelection () {
+	RK_TRACE (APP);
+
+	RKConsole::pipeUserCommand (new RCommand (getView ()->selectedText (), RCommand::User, QString::null));
+}
+
 ////////////////////////// END RKCommandLog ///////////////////////////
 /////////////////////// BEGIN RKCommandLogView ////////////////////////
 
@@ -276,6 +283,8 @@
 	KStdAction::clear (log, SLOT (clearLog ()), actionCollection (), "log_clear");
 	KStdAction::selectAll (log->getView (), SLOT (selectAll ()), actionCollection (), "log_select_all");
 	new KAction (i18n ("Configure"), 0, log, SLOT (configureLog ()), actionCollection (), "log_configure");
+	run_selection = new KAction (i18n ("Run selection"), KShortcut ("F8"), log, SLOT (runSelection ()), actionCollection (), "log_run_selection");
+	run_selection->setIcon("player_play");
 
 	connect (log->getView (), SIGNAL (popupMenuRequest (const QPoint &)), this, SLOT (doPopupMenu (const QPoint &)));
 }
@@ -289,6 +298,7 @@
 
 	QPopupMenu *menu = static_cast<QPopupMenu *> (factory ()->container ("rkcommandlog_context_menu", this));
 	copy->setEnabled (log->getView ()->hasSelectedText ());
+	run_selection->setEnabled (log->getView ()->hasSelectedText ());
 
 	if (!menu) {
 		RK_ASSERT (false);
@@ -297,6 +307,7 @@
 	menu->exec (pos);
 
 	copy->setEnabled (true);
+	run_selection->setEnabled (true);
 }
 
 #include "rkcommandlog.moc"

Modified: trunk/rkward/rkward/windows/rkcommandlog.h
===================================================================
--- trunk/rkward/rkward/windows/rkcommandlog.h	2006-12-05 14:40:27 UTC (rev 992)
+++ trunk/rkward/rkward/windows/rkcommandlog.h	2006-12-05 15:11:44 UTC (rev 993)
@@ -65,6 +65,7 @@
 	void configureLog ();
 /** clears the log_view-window */
 	void clearLog ();
+	void runSelection ();
 private:
 	void addInputNoCheck (RCommand *command);
 	void addOutputNoCheck (RCommand *command, const QString &output);
@@ -111,6 +112,7 @@
 private:
 	RKCommandLog *log;
 
+	KAction *run_selection;
 	KAction *copy;
 };
 

Modified: trunk/rkward/rkward/windows/rkcommandlogpart.rc
===================================================================
--- trunk/rkward/rkward/windows/rkcommandlogpart.rc	2006-12-05 14:40:27 UTC (rev 992)
+++ trunk/rkward/rkward/windows/rkcommandlogpart.rc	2006-12-05 15:11:44 UTC (rev 993)
@@ -2,6 +2,7 @@
 <kpartgui name="rkward" version="0.4.2">
 	<Menu name="rkcommandlog_context_menu">
 		<Action name="log_copy"/>
+		<Action name="log_run_selection"/>
 		<Separator/>
 		<Action name="log_select_all"/>
 		<Separator/>


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