forked from qt-creator/qt-creator
Macros: add different shortcuts for mac.
Also change the default "Execute last macro" to a one sequence shortcut. Merge-request: 234 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com> Task-number: QTCREATORBUG-3500
This commit is contained in:
committed by
Tobias Hunger
parent
8a9debda94
commit
a471f54240
@@ -91,20 +91,28 @@ bool MacrosPlugin::initialize(const QStringList &arguments, QString *error_messa
|
|||||||
|
|
||||||
QAction *startMacro = new QAction(tr("Start Macro"), this);
|
QAction *startMacro = new QAction(tr("Start Macro"), this);
|
||||||
Core::Command *command = am->registerAction(startMacro, Constants::START_MACRO, textContext);
|
Core::Command *command = am->registerAction(startMacro, Constants::START_MACRO, textContext);
|
||||||
|
#ifdef Q_WS_MAC
|
||||||
|
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+(")));
|
||||||
|
#else
|
||||||
command->setDefaultKeySequence(QKeySequence(tr("Alt+(")));
|
command->setDefaultKeySequence(QKeySequence(tr("Alt+(")));
|
||||||
|
#endif
|
||||||
mmacrotools->addAction(command);
|
mmacrotools->addAction(command);
|
||||||
connect(startMacro, SIGNAL(triggered()), m_macroManager, SLOT(startMacro()));
|
connect(startMacro, SIGNAL(triggered()), m_macroManager, SLOT(startMacro()));
|
||||||
|
|
||||||
QAction *endMacro = new QAction(tr("End Macro"), this);
|
QAction *endMacro = new QAction(tr("End Macro"), this);
|
||||||
endMacro->setEnabled(false);
|
endMacro->setEnabled(false);
|
||||||
command = am->registerAction(endMacro, Constants::END_MACRO, globalcontext);
|
command = am->registerAction(endMacro, Constants::END_MACRO, globalcontext);
|
||||||
|
#ifdef Q_WS_MAC
|
||||||
|
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+)")));
|
||||||
|
#else
|
||||||
command->setDefaultKeySequence(QKeySequence(tr("Alt+)")));
|
command->setDefaultKeySequence(QKeySequence(tr("Alt+)")));
|
||||||
|
#endif
|
||||||
mmacrotools->addAction(command);
|
mmacrotools->addAction(command);
|
||||||
connect(endMacro, SIGNAL(triggered()), m_macroManager, SLOT(endMacro()));
|
connect(endMacro, SIGNAL(triggered()), m_macroManager, SLOT(endMacro()));
|
||||||
|
|
||||||
QAction *executeLastMacro = new QAction(tr("Execute Last Macro"), this);
|
QAction *executeLastMacro = new QAction(tr("Execute Last Macro"), this);
|
||||||
command = am->registerAction(executeLastMacro, Constants::EXECUTE_LAST_MACRO, textContext);
|
command = am->registerAction(executeLastMacro, Constants::EXECUTE_LAST_MACRO, textContext);
|
||||||
command->setDefaultKeySequence(QKeySequence(tr("Alt+R,Alt+M")));
|
command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+R")));
|
||||||
mmacrotools->addAction(command);
|
mmacrotools->addAction(command);
|
||||||
connect(executeLastMacro, SIGNAL(triggered()), m_macroManager, SLOT(executeLastMacro()));
|
connect(executeLastMacro, SIGNAL(triggered()), m_macroManager, SLOT(executeLastMacro()));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user