Enable multi key shortcuts on the Mac.

Since that was fixed in Qt.
This commit is contained in:
con
2009-10-09 13:32:28 +02:00
parent 1610c14d22
commit fe9d0bf3c5
7 changed files with 20 additions and 70 deletions
@@ -325,43 +325,39 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE); mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE);
connect(m_d->m_goForwardAction, SIGNAL(triggered()), this, SLOT(goForwardInNavigationHistory())); connect(m_d->m_goForwardAction, SIGNAL(triggered()), this, SLOT(goForwardInNavigationHistory()));
#ifdef Q_WS_MAC
QString prefix = tr("Meta+E");
#else
QString prefix = tr("Ctrl+E");
#endif
m_d->m_splitAction = new QAction(tr("Split"), this); m_d->m_splitAction = new QAction(tr("Split"), this);
cmd = am->registerAction(m_d->m_splitAction, Constants::SPLIT, editManagerContext); cmd = am->registerAction(m_d->m_splitAction, Constants::SPLIT, editManagerContext);
#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("%1,2").arg(prefix)));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,2")));
#endif
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_d->m_splitAction, SIGNAL(triggered()), this, SLOT(split())); connect(m_d->m_splitAction, SIGNAL(triggered()), this, SLOT(split()));
m_d->m_splitSideBySideAction = new QAction(tr("Split Side by Side"), this); m_d->m_splitSideBySideAction = new QAction(tr("Split Side by Side"), this);
cmd = am->registerAction(m_d->m_splitSideBySideAction, Constants::SPLIT_SIDE_BY_SIDE, editManagerContext); cmd = am->registerAction(m_d->m_splitSideBySideAction, Constants::SPLIT_SIDE_BY_SIDE, editManagerContext);
#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("%1,3").arg(prefix)));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,3")));
#endif
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_d->m_splitSideBySideAction, SIGNAL(triggered()), this, SLOT(splitSideBySide())); connect(m_d->m_splitSideBySideAction, SIGNAL(triggered()), this, SLOT(splitSideBySide()));
m_d->m_removeCurrentSplitAction = new QAction(tr("Remove Current Split"), this); m_d->m_removeCurrentSplitAction = new QAction(tr("Remove Current Split"), this);
cmd = am->registerAction(m_d->m_removeCurrentSplitAction, Constants::REMOVE_CURRENT_SPLIT, editManagerContext); cmd = am->registerAction(m_d->m_removeCurrentSplitAction, Constants::REMOVE_CURRENT_SPLIT, editManagerContext);
#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("%1,0").arg(prefix)));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,0")));
#endif
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_d->m_removeCurrentSplitAction, SIGNAL(triggered()), this, SLOT(removeCurrentSplit())); connect(m_d->m_removeCurrentSplitAction, SIGNAL(triggered()), this, SLOT(removeCurrentSplit()));
m_d->m_removeAllSplitsAction = new QAction(tr("Remove All Splits"), this); m_d->m_removeAllSplitsAction = new QAction(tr("Remove All Splits"), this);
cmd = am->registerAction(m_d->m_removeAllSplitsAction, Constants::REMOVE_ALL_SPLITS, editManagerContext); cmd = am->registerAction(m_d->m_removeAllSplitsAction, Constants::REMOVE_ALL_SPLITS, editManagerContext);
#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("%1,1").arg(prefix)));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,1")));
#endif
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_d->m_removeAllSplitsAction, SIGNAL(triggered()), this, SLOT(removeAllSplits())); connect(m_d->m_removeAllSplitsAction, SIGNAL(triggered()), this, SLOT(removeAllSplits()));
m_d->m_gotoOtherSplitAction = new QAction(tr("Goto Other Split"), this); m_d->m_gotoOtherSplitAction = new QAction(tr("Goto Other Split"), this);
cmd = am->registerAction(m_d->m_gotoOtherSplitAction, Constants::GOTO_OTHER_SPLIT, editManagerContext); cmd = am->registerAction(m_d->m_gotoOtherSplitAction, Constants::GOTO_OTHER_SPLIT, editManagerContext);
#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("%1,o").arg(prefix)));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,o")));
#endif
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_d->m_gotoOtherSplitAction, SIGNAL(triggered()), this, SLOT(gotoOtherSplit())); connect(m_d->m_gotoOtherSplitAction, SIGNAL(triggered()), this, SLOT(gotoOtherSplit()));
-4
View File
@@ -113,17 +113,13 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
m_postAction = new QAction(tr("Paste Snippet..."), this); m_postAction = new QAction(tr("Paste Snippet..."), this);
command = actionManager->registerAction(m_postAction, "CodePaster.Post", globalcontext); command = actionManager->registerAction(m_postAction, "CodePaster.Post", globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+P"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+P")));
#endif
connect(m_postAction, SIGNAL(triggered()), this, SLOT(post())); connect(m_postAction, SIGNAL(triggered()), this, SLOT(post()));
cpContainer->addAction(command); cpContainer->addAction(command);
m_fetchAction = new QAction(tr("Fetch Snippet..."), this); m_fetchAction = new QAction(tr("Fetch Snippet..."), this);
command = actionManager->registerAction(m_fetchAction, "CodePaster.Fetch", globalcontext); command = actionManager->registerAction(m_fetchAction, "CodePaster.Fetch", globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+F"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+F")));
#endif
connect(m_fetchAction, SIGNAL(triggered()), this, SLOT(fetch())); connect(m_fetchAction, SIGNAL(triggered()), this, SLOT(fetch()));
cpContainer->addAction(command); cpContainer->addAction(command);
-6
View File
@@ -264,9 +264,7 @@ bool CVSPlugin::initialize(const QStringList &arguments, QString *errorMessage)
command = ami->registerAction(m_addAction, CMD_ID_ADD, command = ami->registerAction(m_addAction, CMD_ID_ADD,
globalcontext); globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+A"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+A")));
#endif
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
cvsMenu->addAction(command); cvsMenu->addAction(command);
@@ -296,9 +294,7 @@ bool CVSPlugin::initialize(const QStringList &arguments, QString *errorMessage)
command = ami->registerAction(m_diffCurrentAction, command = ami->registerAction(m_diffCurrentAction,
CMD_ID_DIFF_CURRENT, globalcontext); CMD_ID_DIFF_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+D"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+D")));
#endif
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
cvsMenu->addAction(command); cvsMenu->addAction(command);
@@ -314,9 +310,7 @@ bool CVSPlugin::initialize(const QStringList &arguments, QString *errorMessage)
command = ami->registerAction(m_commitCurrentAction, command = ami->registerAction(m_commitCurrentAction,
CMD_ID_COMMIT_CURRENT, globalcontext); CMD_ID_COMMIT_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+C"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+C")));
#endif
connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile())); connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile()));
cvsMenu->addAction(command); cvsMenu->addAction(command);
-18
View File
@@ -241,53 +241,41 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_diffAction = new Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); m_diffAction = new Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext); command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+D"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+D")));
#endif
connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_statusAction = new Utils::ParameterAction(tr("File Status"), tr("Status Related to \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); m_statusAction = new Utils::ParameterAction(tr("File Status"), tr("Status Related to \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext); command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S")));
#endif
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_statusAction, SIGNAL(triggered()), this, SLOT(statusFile())); connect(m_statusAction, SIGNAL(triggered()), this, SLOT(statusFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_logAction = new Utils::ParameterAction(tr("Log File"), tr("Log of \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); m_logAction = new Utils::ParameterAction(tr("Log File"), tr("Log of \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext); command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L")));
#endif
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_logAction, SIGNAL(triggered()), this, SLOT(logFile())); connect(m_logAction, SIGNAL(triggered()), this, SLOT(logFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_blameAction = new Utils::ParameterAction(tr("Blame"), tr("Blame for \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); m_blameAction = new Utils::ParameterAction(tr("Blame"), tr("Blame for \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext); command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B")));
#endif
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_blameAction, SIGNAL(triggered()), this, SLOT(blameFile())); connect(m_blameAction, SIGNAL(triggered()), this, SLOT(blameFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_undoFileAction = new Utils::ParameterAction(tr("Undo Changes"), tr("Undo Changes for \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); m_undoFileAction = new Utils::ParameterAction(tr("Undo Changes"), tr("Undo Changes for \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext); command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U")));
#endif
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_undoFileAction, SIGNAL(triggered()), this, SLOT(undoFileChanges())); connect(m_undoFileAction, SIGNAL(triggered()), this, SLOT(undoFileChanges()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_stageAction = new Utils::ParameterAction(tr("Stage File for Commit"), tr("Stage \"%1\" for Commit"), Utils::ParameterAction::AlwaysEnabled, this); m_stageAction = new Utils::ParameterAction(tr("Stage File for Commit"), tr("Stage \"%1\" for Commit"), Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext); command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A")));
#endif
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stageAction, SIGNAL(triggered()), this, SLOT(stageFile())); connect(m_stageAction, SIGNAL(triggered()), this, SLOT(stageFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -302,9 +290,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_diffProjectAction = new Utils::ParameterAction(tr("Diff Current Project"), tr("Diff Project \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); m_diffProjectAction = new Utils::ParameterAction(tr("Diff Current Project"), tr("Diff Project \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext); command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D")); command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D"));
#endif
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject())); connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -317,9 +303,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_logProjectAction = new Utils::ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); m_logProjectAction = new Utils::ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext); command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K")));
#endif
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject())); connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -354,9 +338,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_commitAction = new QAction(tr("Commit..."), this); m_commitAction = new QAction(tr("Commit..."), this);
command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext); command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C")));
#endif
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_commitAction, SIGNAL(triggered()), this, SLOT(startCommit())); connect(m_commitAction, SIGNAL(triggered()), this, SLOT(startCommit()));
gitContainer->addAction(command); gitContainer->addAction(command);
-12
View File
@@ -260,9 +260,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
m_editAction = new Utils::ParameterAction(tr("Edit"), tr("Edit \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); m_editAction = new Utils::ParameterAction(tr("Edit"), tr("Edit \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_editAction, CMD_ID_EDIT, globalcontext); command = am->registerAction(m_editAction, CMD_ID_EDIT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+E"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+E")));
#endif
command->setDefaultText(tr("Edit File")); command->setDefaultText(tr("Edit File"));
connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile())); connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile()));
mperforce->addAction(command); mperforce->addAction(command);
@@ -270,9 +268,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
m_addAction = new Utils::ParameterAction(tr("Add"), tr("Add \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); m_addAction = new Utils::ParameterAction(tr("Add"), tr("Add \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_addAction, CMD_ID_ADD, globalcontext); command = am->registerAction(m_addAction, CMD_ID_ADD, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+A"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+A")));
#endif
command->setDefaultText(tr("Add File")); command->setDefaultText(tr("Add File"));
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
mperforce->addAction(command); mperforce->addAction(command);
@@ -287,9 +283,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
m_revertAction = new Utils::ParameterAction(tr("Revert"), tr("Revert \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); m_revertAction = new Utils::ParameterAction(tr("Revert"), tr("Revert \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_revertAction, CMD_ID_REVERT, globalcontext); command = am->registerAction(m_revertAction, CMD_ID_REVERT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+R"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+R")));
#endif
command->setDefaultText(tr("Revert File")); command->setDefaultText(tr("Revert File"));
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile())); connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
mperforce->addAction(command); mperforce->addAction(command);
@@ -310,9 +304,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
m_diffProjectAction = new Utils::ParameterAction(diffProjectDefaultText, tr("Diff Project \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); m_diffProjectAction = new Utils::ParameterAction(diffProjectDefaultText, tr("Diff Project \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
command = am->registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, globalcontext); command = am->registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+D"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+D")));
#endif
command->setDefaultText(diffProjectDefaultText); command->setDefaultText(diffProjectDefaultText);
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject())); connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
mperforce->addAction(command); mperforce->addAction(command);
@@ -329,9 +321,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
m_openedAction = new QAction(tr("Opened"), this); m_openedAction = new QAction(tr("Opened"), this);
command = am->registerAction(m_openedAction, CMD_ID_OPENED, globalcontext); command = am->registerAction(m_openedAction, CMD_ID_OPENED, globalcontext);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+O"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+O")));
#endif
connect(m_openedAction, SIGNAL(triggered()), this, SLOT(printOpenedFileList())); connect(m_openedAction, SIGNAL(triggered()), this, SLOT(printOpenedFileList()));
mperforce->addAction(command); mperforce->addAction(command);
@@ -379,9 +369,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
m_filelogCurrentAction = new Utils::ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); m_filelogCurrentAction = new Utils::ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_filelogCurrentAction, CMD_ID_FILELOG_CURRENT, globalcontext); command = am->registerAction(m_filelogCurrentAction, CMD_ID_FILELOG_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+F"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+F")));
#endif
command->setDefaultText(tr("Filelog Current File")); command->setDefaultText(tr("Filelog Current File"));
connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile())); connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile()));
mperforce->addAction(command); mperforce->addAction(command);
@@ -293,9 +293,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
command = ami->registerAction(m_addAction, CMD_ID_ADD, command = ami->registerAction(m_addAction, CMD_ID_ADD,
globalcontext); globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+A"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+A")));
#endif
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
@@ -325,9 +323,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
command = ami->registerAction(m_diffCurrentAction, command = ami->registerAction(m_diffCurrentAction,
CMD_ID_DIFF_CURRENT, globalcontext); CMD_ID_DIFF_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+D"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+D")));
#endif
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
@@ -343,9 +339,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
command = ami->registerAction(m_commitCurrentAction, command = ami->registerAction(m_commitCurrentAction,
CMD_ID_COMMIT_CURRENT, globalcontext); CMD_ID_COMMIT_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_WS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+C"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+C")));
#endif
connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile())); connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
@@ -141,11 +141,15 @@ void TextEditorActionHandler::createActions()
advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT);
connect(m_formatAction, SIGNAL(triggered(bool)), this, SLOT(formatAction())); connect(m_formatAction, SIGNAL(triggered(bool)), this, SLOT(formatAction()));
#ifdef Q_WS_MAC
QString modifier = tr("Meta");
#else
QString modifier = tr("Ctrl");
#endif
m_rewrapParagraphAction = new QAction(tr("&Rewrap Paragraph"), this); m_rewrapParagraphAction = new QAction(tr("&Rewrap Paragraph"), this);
command = am->registerAction(m_rewrapParagraphAction, TextEditor::Constants::REWRAP_PARAGRAPH, m_contextId); command = am->registerAction(m_rewrapParagraphAction, TextEditor::Constants::REWRAP_PARAGRAPH, m_contextId);
#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("%1+E, R").arg(modifier)));
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+E, R")));
#endif
advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT);
connect(m_rewrapParagraphAction, SIGNAL(triggered(bool)), this, SLOT(rewrapParagraphAction())); connect(m_rewrapParagraphAction, SIGNAL(triggered(bool)), this, SLOT(rewrapParagraphAction()));
@@ -154,9 +158,7 @@ void TextEditorActionHandler::createActions()
m_visualizeWhitespaceAction->setCheckable(true); m_visualizeWhitespaceAction->setCheckable(true);
command = am->registerAction(m_visualizeWhitespaceAction, command = am->registerAction(m_visualizeWhitespaceAction,
TextEditor::Constants::VISUALIZE_WHITESPACE, m_contextId); TextEditor::Constants::VISUALIZE_WHITESPACE, m_contextId);
#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("%1+E, %2+V").arg(modifier, modifier)));
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+E, Ctrl+V")));
#endif
advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT);
connect(m_visualizeWhitespaceAction, SIGNAL(triggered(bool)), this, SLOT(setVisualizeWhitespace(bool))); connect(m_visualizeWhitespaceAction, SIGNAL(triggered(bool)), this, SLOT(setVisualizeWhitespace(bool)));
@@ -170,9 +172,7 @@ void TextEditorActionHandler::createActions()
m_textWrappingAction = new QAction(tr("Enable Text &Wrapping"), this); m_textWrappingAction = new QAction(tr("Enable Text &Wrapping"), this);
m_textWrappingAction->setCheckable(true); m_textWrappingAction->setCheckable(true);
command = am->registerAction(m_textWrappingAction, TextEditor::Constants::TEXT_WRAPPING, m_contextId); command = am->registerAction(m_textWrappingAction, TextEditor::Constants::TEXT_WRAPPING, m_contextId);
#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("%1+E, %2+W").arg(modifier, modifier)));
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+E, Ctrl+W")));
#endif
advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT);
connect(m_textWrappingAction, SIGNAL(triggered(bool)), this, SLOT(setTextWrapping(bool))); connect(m_textWrappingAction, SIGNAL(triggered(bool)), this, SLOT(setTextWrapping(bool)));