[rkward-cvs] SF.net SVN: rkward-code:[4593] trunk/rkward/rkward/rkconsole.cpp

tfry at users.sf.net tfry at users.sf.net
Thu Mar 14 11:32:42 UTC 2013


Revision: 4593
          http://sourceforge.net/p/rkward/code/4593
Author:   tfry
Date:     2013-03-14 11:32:41 +0000 (Thu, 14 Mar 2013)
Log Message:
-----------
Change interrupt shortcut from cmd+c to ctrl+c on Mac. Assign default shortcut for copy literal (cmd+c on Mac, meta+c elsewhere).

Modified Paths:
--------------
    trunk/rkward/rkward/rkconsole.cpp

Modified: trunk/rkward/rkward/rkconsole.cpp
===================================================================
--- trunk/rkward/rkward/rkconsole.cpp	2013-03-14 09:02:20 UTC (rev 4592)
+++ trunk/rkward/rkward/rkconsole.cpp	2013-03-14 11:32:41 UTC (rev 4593)
@@ -880,18 +880,25 @@
 
 void RKConsole::initializeActions (KActionCollection *ac) {
 	RK_TRACE (APP);
-
+#ifdef Q_WS_MAC
+#	define REAL_CTRL_KEY Qt::MetaModifier
+#	define REAL_CMD_KEY Qt::ConrolModifier
+#else
+#	define REAL_CTRL_KEY Qt::ControlModifier
+#	define REAL_CMD_KEY Qt::MetaModifier
+#endif
 	RKStandardActions::copyLinesToOutput (this, this, SLOT (copyLinesToOutput()));
 	context_help_action = RKStandardActions::functionHelp (this, this, SLOT(showContextHelp()));
 	run_selection_action = RKStandardActions::runSelection (this, this, SLOT (runSelection()));
 
 	interrupt_command_action = ac->addAction ("interrupt", this, SLOT (resetConsole()));
 	interrupt_command_action->setText (i18n ("Interrupt running command"));
-	interrupt_command_action->setShortcut (Qt::ControlModifier + Qt::Key_C);
+	interrupt_command_action->setShortcut (REAL_CTRL_KEY + Qt::Key_C);
 	interrupt_command_action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionInterrupt));
 	interrupt_command_action->setEnabled (false);
 
 	copy_literal_action = ac->addAction ("rkconsole_copy_literal", this, SLOT (literalCopy()));
+	copy_literal_action->setShortcut (REAL_CMD_KEY + Qt::Key_C);
 	copy_literal_action->setText (i18n ("Copy selection literally"));
 
 	copy_commands_action = ac->addAction ("rkconsole_copy_commands", this, SLOT (copyCommands()));





More information about the rkward-tracker mailing list