Core: make useMacShortcut constexpr

Change-Id: I293b96428784b6efecac6dae4f2f9690af0027da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2018-02-02 13:39:18 +01:00
parent 1611d016a1
commit 0eb7bab20c
33 changed files with 112 additions and 112 deletions

View File

@@ -223,7 +223,7 @@ void BazaarPlugin::createFileActions(const Context &context)
m_diffFile = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this); m_diffFile = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_diffFile, DIFF, context); command = ActionManager::registerAction(m_diffFile, DIFF, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Z,Meta+D") : tr("ALT+Z,Alt+D"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Z,Meta+D") : tr("ALT+Z,Alt+D")));
connect(m_diffFile, &QAction::triggered, this, &BazaarPlugin::diffCurrentFile); connect(m_diffFile, &QAction::triggered, this, &BazaarPlugin::diffCurrentFile);
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -231,7 +231,7 @@ void BazaarPlugin::createFileActions(const Context &context)
m_logFile = new ParameterAction(tr("Log Current File"), tr("Log \"%1\""), ParameterAction::EnabledWithParameter, this); m_logFile = new ParameterAction(tr("Log Current File"), tr("Log \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_logFile, LOG, context); command = ActionManager::registerAction(m_logFile, LOG, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Z,Meta+L") : tr("ALT+Z,Alt+L"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Z,Meta+L") : tr("ALT+Z,Alt+L")));
connect(m_logFile, &QAction::triggered, this, &BazaarPlugin::logCurrentFile); connect(m_logFile, &QAction::triggered, this, &BazaarPlugin::logCurrentFile);
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -239,7 +239,7 @@ void BazaarPlugin::createFileActions(const Context &context)
m_statusFile = new ParameterAction(tr("Status Current File"), tr("Status \"%1\""), ParameterAction::EnabledWithParameter, this); m_statusFile = new ParameterAction(tr("Status Current File"), tr("Status \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_statusFile, STATUS, context); command = ActionManager::registerAction(m_statusFile, STATUS, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Z,Meta+S") : tr("ALT+Z,Alt+S"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Z,Meta+S") : tr("ALT+Z,Alt+S")));
connect(m_statusFile, &QAction::triggered, this, &BazaarPlugin::statusCurrentFile); connect(m_statusFile, &QAction::triggered, this, &BazaarPlugin::statusCurrentFile);
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -413,7 +413,7 @@ void BazaarPlugin::createRepositoryActions(const Context &context)
action = new QAction(tr("Commit..."), this); action = new QAction(tr("Commit..."), this);
m_repositoryActionList.append(action); m_repositoryActionList.append(action);
command = ActionManager::registerAction(action, COMMIT, context); command = ActionManager::registerAction(action, COMMIT, context);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Z,Meta+C") : tr("ALT+Z,Alt+C"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Z,Meta+C") : tr("ALT+Z,Alt+C")));
connect(action, &QAction::triggered, this, &BazaarPlugin::commit); connect(action, &QAction::triggered, this, &BazaarPlugin::commit);
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);

View File

@@ -799,7 +799,7 @@ BookmarkViewFactory::BookmarkViewFactory(BookmarkManager *bm)
setDisplayName(BookmarkView::tr("Bookmarks")); setDisplayName(BookmarkView::tr("Bookmarks"));
setPriority(300); setPriority(300);
setId("Bookmarks"); setId("Bookmarks");
setActivationSequence(QKeySequence(UseMacShortcuts ? tr("Alt+Meta+M") : tr("Alt+M"))); setActivationSequence(QKeySequence(useMacShortcuts ? tr("Alt+Meta+M") : tr("Alt+M")));
} }
NavigationView BookmarkViewFactory::createWidget() NavigationView BookmarkViewFactory::createWidget()

View File

@@ -106,7 +106,7 @@ BookmarksPluginRunData::BookmarksPluginRunData()
// Toggle // Toggle
Command *cmd = ActionManager::registerAction(&m_toggleAction, BOOKMARKS_TOGGLE_ACTION, Command *cmd = ActionManager::registerAction(&m_toggleAction, BOOKMARKS_TOGGLE_ACTION,
editorManagerContext); editorManagerContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? BookmarksPlugin::tr("Meta+M") cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? BookmarksPlugin::tr("Meta+M")
: BookmarksPlugin::tr("Ctrl+M"))); : BookmarksPlugin::tr("Ctrl+M")));
mbm->addAction(cmd); mbm->addAction(cmd);
@@ -114,13 +114,13 @@ BookmarksPluginRunData::BookmarksPluginRunData()
// Previous // Previous
cmd = ActionManager::registerAction(&m_prevAction, BOOKMARKS_PREV_ACTION, editorManagerContext); cmd = ActionManager::registerAction(&m_prevAction, BOOKMARKS_PREV_ACTION, editorManagerContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? BookmarksPlugin::tr("Meta+,") cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? BookmarksPlugin::tr("Meta+,")
: BookmarksPlugin::tr("Ctrl+,"))); : BookmarksPlugin::tr("Ctrl+,")));
mbm->addAction(cmd); mbm->addAction(cmd);
// Next // Next
cmd = ActionManager::registerAction(&m_nextAction, BOOKMARKS_NEXT_ACTION, editorManagerContext); cmd = ActionManager::registerAction(&m_nextAction, BOOKMARKS_NEXT_ACTION, editorManagerContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? BookmarksPlugin::tr("Meta+.") cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? BookmarksPlugin::tr("Meta+.")
: BookmarksPlugin::tr("Ctrl+."))); : BookmarksPlugin::tr("Ctrl+.")));
mbm->addAction(cmd); mbm->addAction(cmd);

View File

@@ -456,7 +456,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
command = ActionManager::registerAction(m_checkOutAction, CMD_ID_CHECKOUT, command = ActionManager::registerAction(m_checkOutAction, CMD_ID_CHECKOUT,
context); context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+O") : tr("Alt+L,Alt+O"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+O") : tr("Alt+L,Alt+O")));
connect(m_checkOutAction, &QAction::triggered, this, &ClearCasePlugin::checkOutCurrentFile); connect(m_checkOutAction, &QAction::triggered, this, &ClearCasePlugin::checkOutCurrentFile);
clearcaseMenu->addAction(command); clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -464,7 +464,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
m_checkInCurrentAction = new ParameterAction(tr("Check &In..."), tr("Check &In \"%1\"..."), ParameterAction::AlwaysEnabled, this); m_checkInCurrentAction = new ParameterAction(tr("Check &In..."), tr("Check &In \"%1\"..."), ParameterAction::AlwaysEnabled, this);
command = ActionManager::registerAction(m_checkInCurrentAction, CMD_ID_CHECKIN, context); command = ActionManager::registerAction(m_checkInCurrentAction, CMD_ID_CHECKIN, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+I") : tr("Alt+L,Alt+I"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+I") : tr("Alt+L,Alt+I")));
connect(m_checkInCurrentAction, &QAction::triggered, this, &ClearCasePlugin::startCheckInCurrentFile); connect(m_checkInCurrentAction, &QAction::triggered, this, &ClearCasePlugin::startCheckInCurrentFile);
clearcaseMenu->addAction(command); clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -472,7 +472,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
m_undoCheckOutAction = new ParameterAction(tr("Undo Check Out"), tr("&Undo Check Out \"%1\""), ParameterAction::AlwaysEnabled, this); m_undoCheckOutAction = new ParameterAction(tr("Undo Check Out"), tr("&Undo Check Out \"%1\""), ParameterAction::AlwaysEnabled, this);
command = ActionManager::registerAction(m_undoCheckOutAction, CMD_ID_UNDOCHECKOUT, context); command = ActionManager::registerAction(m_undoCheckOutAction, CMD_ID_UNDOCHECKOUT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+U") : tr("Alt+L,Alt+U"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+U") : tr("Alt+L,Alt+U")));
connect(m_undoCheckOutAction, &QAction::triggered, this, &ClearCasePlugin::undoCheckOutCurrent); connect(m_undoCheckOutAction, &QAction::triggered, this, &ClearCasePlugin::undoCheckOutCurrent);
clearcaseMenu->addAction(command); clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -480,7 +480,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
m_undoHijackAction = new ParameterAction(tr("Undo Hijack"), tr("Undo Hi&jack \"%1\""), ParameterAction::AlwaysEnabled, this); m_undoHijackAction = new ParameterAction(tr("Undo Hijack"), tr("Undo Hi&jack \"%1\""), ParameterAction::AlwaysEnabled, this);
command = ActionManager::registerAction(m_undoHijackAction, CMD_ID_UNDOHIJACK, context); command = ActionManager::registerAction(m_undoHijackAction, CMD_ID_UNDOHIJACK, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+R") : tr("Alt+L,Alt+R"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+R") : tr("Alt+L,Alt+R")));
connect(m_undoHijackAction, &QAction::triggered, this, &ClearCasePlugin::undoHijackCurrent); connect(m_undoHijackAction, &QAction::triggered, this, &ClearCasePlugin::undoHijackCurrent);
clearcaseMenu->addAction(command); clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -491,7 +491,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
command = ActionManager::registerAction(m_diffCurrentAction, command = ActionManager::registerAction(m_diffCurrentAction,
CMD_ID_DIFF_CURRENT, context); CMD_ID_DIFF_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+D") : tr("Alt+L,Alt+D"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+D") : tr("Alt+L,Alt+D")));
connect(m_diffCurrentAction, &QAction::triggered, this, &ClearCasePlugin::diffCurrentFile); connect(m_diffCurrentAction, &QAction::triggered, this, &ClearCasePlugin::diffCurrentFile);
clearcaseMenu->addAction(command); clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -500,7 +500,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
command = ActionManager::registerAction(m_historyCurrentAction, command = ActionManager::registerAction(m_historyCurrentAction,
CMD_ID_HISTORY_CURRENT, context); CMD_ID_HISTORY_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+H") : tr("Alt+L,Alt+H"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+H") : tr("Alt+L,Alt+H")));
connect(m_historyCurrentAction, &QAction::triggered, this, connect(m_historyCurrentAction, &QAction::triggered, this,
&ClearCasePlugin::historyCurrentFile); &ClearCasePlugin::historyCurrentFile);
clearcaseMenu->addAction(command); clearcaseMenu->addAction(command);
@@ -510,7 +510,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
command = ActionManager::registerAction(m_annotateCurrentAction, command = ActionManager::registerAction(m_annotateCurrentAction,
CMD_ID_ANNOTATE, context); CMD_ID_ANNOTATE, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+A") : tr("Alt+L,Alt+A"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+A") : tr("Alt+L,Alt+A")));
connect(m_annotateCurrentAction, &QAction::triggered, this, connect(m_annotateCurrentAction, &QAction::triggered, this,
&ClearCasePlugin::annotateCurrentFile); &ClearCasePlugin::annotateCurrentFile);
clearcaseMenu->addAction(command); clearcaseMenu->addAction(command);
@@ -556,14 +556,14 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
m_checkInAllAction = new QAction(tr("Check In All &Files..."), this); m_checkInAllAction = new QAction(tr("Check In All &Files..."), this);
command = ActionManager::registerAction(m_checkInAllAction, CMD_ID_CHECKIN_ALL, context); command = ActionManager::registerAction(m_checkInAllAction, CMD_ID_CHECKIN_ALL, context);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+F") : tr("Alt+L,Alt+F"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+F") : tr("Alt+L,Alt+F")));
connect(m_checkInAllAction, &QAction::triggered, this, &ClearCasePlugin::startCheckInAll); connect(m_checkInAllAction, &QAction::triggered, this, &ClearCasePlugin::startCheckInAll);
clearcaseMenu->addAction(command); clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_statusAction = new QAction(tr("View &Status"), this); m_statusAction = new QAction(tr("View &Status"), this);
command = ActionManager::registerAction(m_statusAction, CMD_ID_STATUS, context); command = ActionManager::registerAction(m_statusAction, CMD_ID_STATUS, context);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+S") : tr("Alt+L,Alt+S"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+S") : tr("Alt+L,Alt+S")));
connect(m_statusAction, &QAction::triggered, this, &ClearCasePlugin::viewStatus); connect(m_statusAction, &QAction::triggered, this, &ClearCasePlugin::viewStatus);
clearcaseMenu->addAction(command); clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);

View File

@@ -43,7 +43,7 @@ namespace Core {
class Context; class Context;
enum { UseMacShortcuts = Utils::HostOsInfo::isMacHost() ? 1 : 0 }; constexpr bool useMacShortcuts = Utils::HostOsInfo::isMacHost();
class CORE_EXPORT Command : public QObject class CORE_EXPORT Command : public QObject
{ {

View File

@@ -347,76 +347,76 @@ void EditorManagerPrivate::init()
// Goto Previous In History Action // Goto Previous In History Action
cmd = ActionManager::registerAction(m_gotoPreviousDocHistoryAction, Constants::GOTOPREVINHISTORY, editDesignContext); cmd = ActionManager::registerAction(m_gotoPreviousDocHistoryAction, Constants::GOTOPREVINHISTORY, editDesignContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Alt+Tab") : tr("Ctrl+Tab"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Alt+Tab") : tr("Ctrl+Tab")));
mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE); mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE);
connect(m_gotoPreviousDocHistoryAction, &QAction::triggered, connect(m_gotoPreviousDocHistoryAction, &QAction::triggered,
this, &EditorManagerPrivate::gotoPreviousDocHistory); this, &EditorManagerPrivate::gotoPreviousDocHistory);
// Goto Next In History Action // Goto Next In History Action
cmd = ActionManager::registerAction(m_gotoNextDocHistoryAction, Constants::GOTONEXTINHISTORY, editDesignContext); cmd = ActionManager::registerAction(m_gotoNextDocHistoryAction, Constants::GOTONEXTINHISTORY, editDesignContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Alt+Shift+Tab") : tr("Ctrl+Shift+Tab"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Alt+Shift+Tab") : tr("Ctrl+Shift+Tab")));
mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE); mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE);
connect(m_gotoNextDocHistoryAction, &QAction::triggered, connect(m_gotoNextDocHistoryAction, &QAction::triggered,
this, &EditorManagerPrivate::gotoNextDocHistory); this, &EditorManagerPrivate::gotoNextDocHistory);
// Go back in navigation history // Go back in navigation history
cmd = ActionManager::registerAction(m_goBackAction, Constants::GO_BACK, editDesignContext); cmd = ActionManager::registerAction(m_goBackAction, Constants::GO_BACK, editDesignContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Alt+Left") : tr("Alt+Left"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Alt+Left") : tr("Alt+Left")));
mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE); mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE);
connect(m_goBackAction, &QAction::triggered, connect(m_goBackAction, &QAction::triggered,
m_instance, &EditorManager::goBackInNavigationHistory); m_instance, &EditorManager::goBackInNavigationHistory);
// Go forward in navigation history // Go forward in navigation history
cmd = ActionManager::registerAction(m_goForwardAction, Constants::GO_FORWARD, editDesignContext); cmd = ActionManager::registerAction(m_goForwardAction, Constants::GO_FORWARD, editDesignContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Alt+Right") : tr("Alt+Right"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Alt+Right") : tr("Alt+Right")));
mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE); mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE);
connect(m_goForwardAction, &QAction::triggered, connect(m_goForwardAction, &QAction::triggered,
m_instance, &EditorManager::goForwardInNavigationHistory); m_instance, &EditorManager::goForwardInNavigationHistory);
m_splitAction = new QAction(Utils::Icons::SPLIT_HORIZONTAL.icon(), tr("Split"), this); m_splitAction = new QAction(Utils::Icons::SPLIT_HORIZONTAL.icon(), tr("Split"), this);
cmd = ActionManager::registerAction(m_splitAction, Constants::SPLIT, editManagerContext); cmd = ActionManager::registerAction(m_splitAction, Constants::SPLIT, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+E,2") : tr("Ctrl+E,2"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+E,2") : tr("Ctrl+E,2")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_splitAction, &QAction::triggered, this, []() { split(Qt::Vertical); }); connect(m_splitAction, &QAction::triggered, this, []() { split(Qt::Vertical); });
m_splitSideBySideAction = new QAction(Utils::Icons::SPLIT_VERTICAL.icon(), m_splitSideBySideAction = new QAction(Utils::Icons::SPLIT_VERTICAL.icon(),
tr("Split Side by Side"), this); tr("Split Side by Side"), this);
cmd = ActionManager::registerAction(m_splitSideBySideAction, Constants::SPLIT_SIDE_BY_SIDE, editManagerContext); cmd = ActionManager::registerAction(m_splitSideBySideAction, Constants::SPLIT_SIDE_BY_SIDE, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+E,3") : tr("Ctrl+E,3"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+E,3") : tr("Ctrl+E,3")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_splitSideBySideAction, &QAction::triggered, m_instance, &EditorManager::splitSideBySide); connect(m_splitSideBySideAction, &QAction::triggered, m_instance, &EditorManager::splitSideBySide);
m_splitNewWindowAction = new QAction(tr("Open in New Window"), this); m_splitNewWindowAction = new QAction(tr("Open in New Window"), this);
cmd = ActionManager::registerAction(m_splitNewWindowAction, Constants::SPLIT_NEW_WINDOW, editManagerContext); cmd = ActionManager::registerAction(m_splitNewWindowAction, Constants::SPLIT_NEW_WINDOW, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+E,4") : tr("Ctrl+E,4"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+E,4") : tr("Ctrl+E,4")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_splitNewWindowAction, &QAction::triggered, connect(m_splitNewWindowAction, &QAction::triggered,
this, []() { splitNewWindow(currentEditorView()); }); this, []() { splitNewWindow(currentEditorView()); });
m_removeCurrentSplitAction = new QAction(tr("Remove Current Split"), this); m_removeCurrentSplitAction = new QAction(tr("Remove Current Split"), this);
cmd = ActionManager::registerAction(m_removeCurrentSplitAction, Constants::REMOVE_CURRENT_SPLIT, editManagerContext); cmd = ActionManager::registerAction(m_removeCurrentSplitAction, Constants::REMOVE_CURRENT_SPLIT, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+E,0") : tr("Ctrl+E,0"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+E,0") : tr("Ctrl+E,0")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_removeCurrentSplitAction, &QAction::triggered, connect(m_removeCurrentSplitAction, &QAction::triggered,
this, &EditorManagerPrivate::removeCurrentSplit); this, &EditorManagerPrivate::removeCurrentSplit);
m_removeAllSplitsAction = new QAction(tr("Remove All Splits"), this); m_removeAllSplitsAction = new QAction(tr("Remove All Splits"), this);
cmd = ActionManager::registerAction(m_removeAllSplitsAction, Constants::REMOVE_ALL_SPLITS, editManagerContext); cmd = ActionManager::registerAction(m_removeAllSplitsAction, Constants::REMOVE_ALL_SPLITS, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+E,1") : tr("Ctrl+E,1"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+E,1") : tr("Ctrl+E,1")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_removeAllSplitsAction, &QAction::triggered, connect(m_removeAllSplitsAction, &QAction::triggered,
this, &EditorManagerPrivate::removeAllSplits); this, &EditorManagerPrivate::removeAllSplits);
m_gotoPreviousSplitAction = new QAction(tr("Go to Previous Split or Window"), this); m_gotoPreviousSplitAction = new QAction(tr("Go to Previous Split or Window"), this);
cmd = ActionManager::registerAction(m_gotoPreviousSplitAction, Constants::GOTO_PREV_SPLIT, editManagerContext); cmd = ActionManager::registerAction(m_gotoPreviousSplitAction, Constants::GOTO_PREV_SPLIT, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+E,i") : tr("Ctrl+E,i"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+E,i") : tr("Ctrl+E,i")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_gotoPreviousSplitAction, &QAction::triggered, connect(m_gotoPreviousSplitAction, &QAction::triggered,
this, &EditorManagerPrivate::gotoPreviousSplit); this, &EditorManagerPrivate::gotoPreviousSplit);
m_gotoNextSplitAction = new QAction(tr("Go to Next Split or Window"), this); m_gotoNextSplitAction = new QAction(tr("Go to Next Split or Window"), this);
cmd = ActionManager::registerAction(m_gotoNextSplitAction, Constants::GOTO_NEXT_SPLIT, editManagerContext); cmd = ActionManager::registerAction(m_gotoNextSplitAction, Constants::GOTO_NEXT_SPLIT, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+E,o") : tr("Ctrl+E,o"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+E,o") : tr("Ctrl+E,o")));
mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
connect(m_gotoNextSplitAction, &QAction::triggered, this, &EditorManagerPrivate::gotoNextSplit); connect(m_gotoNextSplitAction, &QAction::triggered, this, &EditorManagerPrivate::gotoNextSplit);

View File

@@ -132,7 +132,7 @@ OpenEditorsViewFactory::OpenEditorsViewFactory()
{ {
setId("Open Documents"); setId("Open Documents");
setDisplayName(OpenEditorsWidget::tr("Open Documents")); setDisplayName(OpenEditorsWidget::tr("Open Documents"));
setActivationSequence(QKeySequence(UseMacShortcuts ? tr("Meta+O") : tr("Alt+O"))); setActivationSequence(QKeySequence(useMacShortcuts ? tr("Meta+O") : tr("Alt+O")));
setPriority(200); setPriority(200);
} }

View File

@@ -531,7 +531,7 @@ void MainWindow::registerDefaultActions()
tmpaction = new QAction(icon, EditorManager::tr("Save &As..."), this); tmpaction = new QAction(icon, EditorManager::tr("Save &As..."), this);
tmpaction->setEnabled(false); tmpaction->setEnabled(false);
cmd = ActionManager::registerAction(tmpaction, Constants::SAVEAS); cmd = ActionManager::registerAction(tmpaction, Constants::SAVEAS);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Shift+S") : QString())); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+S") : QString()));
cmd->setAttribute(Command::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(tr("Save As...")); cmd->setDescription(tr("Save As..."));
mfile->addAction(cmd, Constants::G_FILE_SAVE); mfile->addAction(cmd, Constants::G_FILE_SAVE);
@@ -539,7 +539,7 @@ void MainWindow::registerDefaultActions()
// SaveAll Action // SaveAll Action
m_saveAllAction = new QAction(tr("Save A&ll"), this); m_saveAllAction = new QAction(tr("Save A&ll"), this);
cmd = ActionManager::registerAction(m_saveAllAction, Constants::SAVEALL); cmd = ActionManager::registerAction(m_saveAllAction, Constants::SAVEALL);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? QString() : tr("Ctrl+Shift+S"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? QString() : tr("Ctrl+Shift+S")));
mfile->addAction(cmd, Constants::G_FILE_SAVE); mfile->addAction(cmd, Constants::G_FILE_SAVE);
connect(m_saveAllAction, &QAction::triggered, this, &MainWindow::saveAll); connect(m_saveAllAction, &QAction::triggered, this, &MainWindow::saveAll);
@@ -633,7 +633,7 @@ void MainWindow::registerDefaultActions()
mwindow->addSeparator(Constants::G_WINDOW_LIST); mwindow->addSeparator(Constants::G_WINDOW_LIST);
if (UseMacShortcuts) { if (useMacShortcuts) {
// Minimize Action // Minimize Action
QAction *minimizeAction = new QAction(tr("Minimize"), this); QAction *minimizeAction = new QAction(tr("Minimize"), this);
minimizeAction->setEnabled(false); // actual implementation in WindowSupport minimizeAction->setEnabled(false); // actual implementation in WindowSupport
@@ -653,12 +653,12 @@ void MainWindow::registerDefaultActions()
toggleFullScreenAction->setCheckable(!HostOsInfo::isMacHost()); toggleFullScreenAction->setCheckable(!HostOsInfo::isMacHost());
toggleFullScreenAction->setEnabled(false); // actual implementation in WindowSupport toggleFullScreenAction->setEnabled(false); // actual implementation in WindowSupport
cmd = ActionManager::registerAction(toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN); cmd = ActionManager::registerAction(toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Meta+F") : tr("Ctrl+Shift+F11"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Meta+F") : tr("Ctrl+Shift+F11")));
if (HostOsInfo::isMacHost()) if (HostOsInfo::isMacHost())
cmd->setAttribute(Command::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
mwindow->addAction(cmd, Constants::G_WINDOW_SIZE); mwindow->addAction(cmd, Constants::G_WINDOW_SIZE);
if (UseMacShortcuts) { if (useMacShortcuts) {
mwindow->addSeparator(Constants::G_WINDOW_SIZE); mwindow->addSeparator(Constants::G_WINDOW_SIZE);
QAction *closeAction = new QAction(tr("Close Window"), this); QAction *closeAction = new QAction(tr("Close Window"), this);
@@ -677,7 +677,7 @@ void MainWindow::registerDefaultActions()
m_toggleLeftSideBarAction->setCheckable(true); m_toggleLeftSideBarAction->setCheckable(true);
cmd = ActionManager::registerAction(m_toggleLeftSideBarAction, Constants::TOGGLE_LEFT_SIDEBAR); cmd = ActionManager::registerAction(m_toggleLeftSideBarAction, Constants::TOGGLE_LEFT_SIDEBAR);
cmd->setAttribute(Command::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+0") : tr("Alt+0"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+0") : tr("Alt+0")));
connect(m_toggleLeftSideBarAction, &QAction::triggered, connect(m_toggleLeftSideBarAction, &QAction::triggered,
this, [this](bool visible) { setSidebarVisible(visible, Side::Left); }); this, [this](bool visible) { setSidebarVisible(visible, Side::Left); });
ProxyAction *toggleLeftSideBarProxyAction = ProxyAction *toggleLeftSideBarProxyAction =
@@ -693,7 +693,7 @@ void MainWindow::registerDefaultActions()
m_toggleRightSideBarAction->setCheckable(true); m_toggleRightSideBarAction->setCheckable(true);
cmd = ActionManager::registerAction(m_toggleRightSideBarAction, Constants::TOGGLE_RIGHT_SIDEBAR); cmd = ActionManager::registerAction(m_toggleRightSideBarAction, Constants::TOGGLE_RIGHT_SIDEBAR);
cmd->setAttribute(Command::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Shift+0") : tr("Alt+Shift+0"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+0") : tr("Alt+Shift+0")));
connect(m_toggleRightSideBarAction, &QAction::triggered, connect(m_toggleRightSideBarAction, &QAction::triggered,
this, [this](bool visible) { setSidebarVisible(visible, Side::Right); }); this, [this](bool visible) { setSidebarVisible(visible, Side::Right); });
ProxyAction *toggleRightSideBarProxyAction = ProxyAction *toggleRightSideBarProxyAction =

View File

@@ -198,7 +198,7 @@ void ModeManagerPrivate::appendMode(IMode *mode)
const Id actionId = mode->id().withPrefix("QtCreator.Mode."); const Id actionId = mode->id().withPrefix("QtCreator.Mode.");
QAction *action = new QAction(ModeManager::tr("Switch to <b>%1</b> mode").arg(mode->displayName()), m_instance); QAction *action = new QAction(ModeManager::tr("Switch to <b>%1</b> mode").arg(mode->displayName()), m_instance);
Command *cmd = ActionManager::registerAction(action, actionId); Command *cmd = ActionManager::registerAction(action, actionId);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? QString("Meta+%1").arg(index + 1) cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? QString("Meta+%1").arg(index + 1)
: QString("Ctrl+%1").arg(index + 1))); : QString("Ctrl+%1").arg(index + 1)));
m_modeCommands.append(cmd); m_modeCommands.append(cmd);

View File

@@ -256,7 +256,7 @@ void OutputPaneManager::init()
mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup");
cmd = ActionManager::registerAction(m_minMaxAction, "Coreplugin.OutputPane.minmax"); cmd = ActionManager::registerAction(m_minMaxAction, "Coreplugin.OutputPane.minmax");
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Shift+9") : tr("Alt+Shift+9"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+9") : tr("Alt+Shift+9")));
cmd->setAttribute(Command::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
cmd->setAttribute(Command::CA_UpdateIcon); cmd->setAttribute(Command::CA_UpdateIcon);
mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup");

View File

@@ -60,7 +60,7 @@ WindowSupport::WindowSupport(QWidget *window, const Context &context)
m_contextObject->setContext(context); m_contextObject->setContext(context);
ICore::addContextObject(m_contextObject); ICore::addContextObject(m_contextObject);
if (UseMacShortcuts) { if (useMacShortcuts) {
m_minimizeAction = new QAction(this); m_minimizeAction = new QAction(this);
ActionManager::registerAction(m_minimizeAction, Constants::MINIMIZE_WINDOW, context); ActionManager::registerAction(m_minimizeAction, Constants::MINIMIZE_WINDOW, context);
connect(m_minimizeAction, &QAction::triggered, m_window, &QWidget::showMinimized); connect(m_minimizeAction, &QAction::triggered, m_window, &QWidget::showMinimized);
@@ -87,7 +87,7 @@ WindowSupport::WindowSupport(QWidget *window, const Context &context)
WindowSupport::~WindowSupport() WindowSupport::~WindowSupport()
{ {
if (!m_shutdown) { // don't update all that stuff if we are shutting down anyhow if (!m_shutdown) { // don't update all that stuff if we are shutting down anyhow
if (UseMacShortcuts) { if (useMacShortcuts) {
ActionManager::unregisterAction(m_minimizeAction, Constants::MINIMIZE_WINDOW); ActionManager::unregisterAction(m_minimizeAction, Constants::MINIMIZE_WINDOW);
ActionManager::unregisterAction(m_zoomAction, Constants::ZOOM_WINDOW); ActionManager::unregisterAction(m_zoomAction, Constants::ZOOM_WINDOW);
ActionManager::unregisterAction(m_closeAction, Constants::CLOSE_WINDOW); ActionManager::unregisterAction(m_closeAction, Constants::CLOSE_WINDOW);
@@ -100,7 +100,7 @@ WindowSupport::~WindowSupport()
void WindowSupport::setCloseActionEnabled(bool enabled) void WindowSupport::setCloseActionEnabled(bool enabled)
{ {
if (UseMacShortcuts) if (useMacShortcuts)
m_closeAction->setEnabled(enabled); m_closeAction->setEnabled(enabled);
} }

View File

@@ -152,13 +152,13 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
m_postEditorAction = new QAction(tr("Paste Snippet..."), this); m_postEditorAction = new QAction(tr("Paste Snippet..."), this);
command = ActionManager::registerAction(m_postEditorAction, "CodePaster.Post"); command = ActionManager::registerAction(m_postEditorAction, "CodePaster.Post");
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+P") : tr("Alt+C,Alt+P"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+C,Meta+P") : tr("Alt+C,Alt+P")));
connect(m_postEditorAction, &QAction::triggered, this, &CodepasterPlugin::pasteSnippet); connect(m_postEditorAction, &QAction::triggered, this, &CodepasterPlugin::pasteSnippet);
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"); command = ActionManager::registerAction(m_fetchAction, "CodePaster.Fetch");
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+F") : tr("Alt+C,Alt+F"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+C,Meta+F") : tr("Alt+C,Alt+F")));
connect(m_fetchAction, &QAction::triggered, this, &CodepasterPlugin::fetch); connect(m_fetchAction, &QAction::triggered, this, &CodepasterPlugin::fetch);
cpContainer->addAction(command); cpContainer->addAction(command);

View File

@@ -209,14 +209,14 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
m_openTypeHierarchyAction = new QAction(tr("Open Type Hierarchy"), this); m_openTypeHierarchyAction = new QAction(tr("Open Type Hierarchy"), this);
cmd = ActionManager::registerAction(m_openTypeHierarchyAction, Constants::OPEN_TYPE_HIERARCHY, context); cmd = ActionManager::registerAction(m_openTypeHierarchyAction, Constants::OPEN_TYPE_HIERARCHY, context);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Shift+T") : tr("Ctrl+Shift+T"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+T") : tr("Ctrl+Shift+T")));
connect(m_openTypeHierarchyAction, &QAction::triggered, this, &CppEditorPlugin::openTypeHierarchy); connect(m_openTypeHierarchyAction, &QAction::triggered, this, &CppEditorPlugin::openTypeHierarchy);
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd); cppToolsMenu->addAction(cmd);
m_openIncludeHierarchyAction = new QAction(tr("Open Include Hierarchy"), this); m_openIncludeHierarchyAction = new QAction(tr("Open Include Hierarchy"), this);
cmd = ActionManager::registerAction(m_openIncludeHierarchyAction, Constants::OPEN_INCLUDE_HIERARCHY, context); cmd = ActionManager::registerAction(m_openIncludeHierarchyAction, Constants::OPEN_INCLUDE_HIERARCHY, context);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Shift+I") : tr("Ctrl+Shift+I"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+I") : tr("Ctrl+Shift+I")));
connect(m_openIncludeHierarchyAction, &QAction::triggered, this, &CppEditorPlugin::openIncludeHierarchy); connect(m_openIncludeHierarchyAction, &QAction::triggered, this, &CppEditorPlugin::openIncludeHierarchy);
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd); cppToolsMenu->addAction(cmd);
@@ -247,7 +247,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
cppToolsMenu->addSeparator(); cppToolsMenu->addSeparator();
QAction *inspectCppCodeModel = new QAction(tr("Inspect C++ Code Model..."), this); QAction *inspectCppCodeModel = new QAction(tr("Inspect C++ Code Model..."), this);
cmd = ActionManager::registerAction(inspectCppCodeModel, Constants::INSPECT_CPP_CODEMODEL); cmd = ActionManager::registerAction(inspectCppCodeModel, Constants::INSPECT_CPP_CODEMODEL);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Shift+F12") : tr("Ctrl+Shift+F12"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+F12") : tr("Ctrl+Shift+F12")));
connect(inspectCppCodeModel, &QAction::triggered, this, &CppEditorPlugin::inspectCppCodeModel); connect(inspectCppCodeModel, &QAction::triggered, this, &CppEditorPlugin::inspectCppCodeModel);
cppToolsMenu->addAction(cmd); cppToolsMenu->addAction(cmd);

View File

@@ -237,7 +237,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
command = ActionManager::registerAction(m_diffCurrentAction, command = ActionManager::registerAction(m_diffCurrentAction,
CMD_ID_DIFF_CURRENT, context); CMD_ID_DIFF_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+D") : tr("Alt+C,Alt+D"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+C,Meta+D") : tr("Alt+C,Alt+D")));
connect(m_diffCurrentAction, &QAction::triggered, this, &CvsPlugin::diffCurrentFile); connect(m_diffCurrentAction, &QAction::triggered, this, &CvsPlugin::diffCurrentFile);
cvsMenu->addAction(command); cvsMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -264,7 +264,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
command = ActionManager::registerAction(m_addAction, CMD_ID_ADD, command = ActionManager::registerAction(m_addAction, CMD_ID_ADD,
context); context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+A") : tr("Alt+C,Alt+A"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+C,Meta+A") : tr("Alt+C,Alt+A")));
connect(m_addAction, &QAction::triggered, this, &CvsPlugin::addCurrentFile); connect(m_addAction, &QAction::triggered, this, &CvsPlugin::addCurrentFile);
cvsMenu->addAction(command); cvsMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -273,7 +273,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
command = ActionManager::registerAction(m_commitCurrentAction, command = ActionManager::registerAction(m_commitCurrentAction,
CMD_ID_COMMIT_CURRENT, context); CMD_ID_COMMIT_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+C") : tr("Alt+C,Alt+C"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+C,Meta+C") : tr("Alt+C,Alt+C")));
connect(m_commitCurrentAction, &QAction::triggered, this, &CvsPlugin::startCommitCurrentFile); connect(m_commitCurrentAction, &QAction::triggered, this, &CvsPlugin::startCommitCurrentFile);
cvsMenu->addAction(command); cvsMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);

View File

@@ -1279,7 +1279,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
TaskHub::addCategory(TASK_CATEGORY_DEBUGGER_RUNTIME, TaskHub::addCategory(TASK_CATEGORY_DEBUGGER_RUNTIME,
tr("Debugger Runtime")); tr("Debugger Runtime"));
const QKeySequence debugKey = QKeySequence(UseMacShortcuts ? tr("Ctrl+Y") : tr("F5")); const QKeySequence debugKey = QKeySequence(useMacShortcuts ? tr("Ctrl+Y") : tr("F5"));
QSettings *settings = ICore::settings(); QSettings *settings = ICore::settings();
@@ -1583,7 +1583,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
m_hiddenStopAction->setAttribute(ProxyAction::UpdateIcon); m_hiddenStopAction->setAttribute(ProxyAction::UpdateIcon);
cmd = ActionManager::registerAction(m_hiddenStopAction, Constants::HIDDEN_STOP); cmd = ActionManager::registerAction(m_hiddenStopAction, Constants::HIDDEN_STOP);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Shift+Ctrl+Y") : tr("Shift+F5"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Shift+Ctrl+Y") : tr("Shift+F5")));
cmd = ActionManager::registerAction(m_abortAction, Constants::ABORT); cmd = ActionManager::registerAction(m_abortAction, Constants::ABORT);
cmd->setDescription(tr("Reset Debugger")); cmd->setDescription(tr("Reset Debugger"));
@@ -1596,25 +1596,25 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
debugMenu->addSeparator(); debugMenu->addSeparator();
cmd = ActionManager::registerAction(m_nextAction, Constants::NEXT); cmd = ActionManager::registerAction(m_nextAction, Constants::NEXT);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Shift+O") : tr("F10"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+O") : tr("F10")));
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
cmd->setAttribute(Command::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
debugMenu->addAction(cmd); debugMenu->addAction(cmd);
cmd = ActionManager::registerAction(m_stepAction, Constants::STEP); cmd = ActionManager::registerAction(m_stepAction, Constants::STEP);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Shift+I") : tr("F11"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+I") : tr("F11")));
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
cmd->setAttribute(Command::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
debugMenu->addAction(cmd); debugMenu->addAction(cmd);
cmd = ActionManager::registerAction(m_stepOutAction, Constants::STEPOUT); cmd = ActionManager::registerAction(m_stepOutAction, Constants::STEPOUT);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Shift+T") : tr("Shift+F11"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+T") : tr("Shift+F11")));
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
debugMenu->addAction(cmd); debugMenu->addAction(cmd);
cmd = ActionManager::registerAction(m_runToLineAction, cmd = ActionManager::registerAction(m_runToLineAction,
"Debugger.RunToLine", cppDebuggercontext); "Debugger.RunToLine", cppDebuggercontext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Shift+F8") : tr("Ctrl+F10"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Shift+F8") : tr("Ctrl+F10")));
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
debugMenu->addAction(cmd); debugMenu->addAction(cmd);
@@ -1639,7 +1639,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
if (isReverseDebuggingEnabled()) { if (isReverseDebuggingEnabled()) {
cmd = ActionManager::registerAction(m_reverseDirectionAction, cmd = ActionManager::registerAction(m_reverseDirectionAction,
Constants::REVERSE, cppDebuggercontext); Constants::REVERSE, cppDebuggercontext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? QString() : tr("F12"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? QString() : tr("F12")));
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
debugMenu->addAction(cmd); debugMenu->addAction(cmd);
} }
@@ -1663,7 +1663,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
debugMenu->addAction(cmd); debugMenu->addAction(cmd);
cmd = ActionManager::registerAction(m_breakAction, "Debugger.ToggleBreak"); cmd = ActionManager::registerAction(m_breakAction, "Debugger.ToggleBreak");
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("F8") : tr("F9"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("F8") : tr("F9")));
debugMenu->addAction(cmd); debugMenu->addAction(cmd);
connect(m_breakAction, &QAction::triggered, connect(m_breakAction, &QAction::triggered,
this, &DebuggerPluginPrivate::toggleBreakpointHelper); this, &DebuggerPluginPrivate::toggleBreakpointHelper);

View File

@@ -558,12 +558,12 @@ void FormEditorData::setupActions()
//tool actions //tool actions
m_toolActionIds.push_back("FormEditor.LayoutHorizontally"); m_toolActionIds.push_back("FormEditor.LayoutHorizontally");
const QString horizLayoutShortcut = UseMacShortcuts ? tr("Meta+Shift+H") : tr("Ctrl+H"); const QString horizLayoutShortcut = useMacShortcuts ? tr("Meta+Shift+H") : tr("Ctrl+H");
addToolAction(m_fwm->actionHorizontalLayout(), m_contexts, addToolAction(m_fwm->actionHorizontalLayout(), m_contexts,
m_toolActionIds.back(), mformtools, horizLayoutShortcut); m_toolActionIds.back(), mformtools, horizLayoutShortcut);
m_toolActionIds.push_back("FormEditor.LayoutVertically"); m_toolActionIds.push_back("FormEditor.LayoutVertically");
const QString vertLayoutShortcut = UseMacShortcuts ? tr("Meta+L") : tr("Ctrl+L"); const QString vertLayoutShortcut = useMacShortcuts ? tr("Meta+L") : tr("Ctrl+L");
addToolAction(m_fwm->actionVerticalLayout(), m_contexts, addToolAction(m_fwm->actionVerticalLayout(), m_contexts,
m_toolActionIds.back(), mformtools, vertLayoutShortcut); m_toolActionIds.back(), mformtools, vertLayoutShortcut);
@@ -580,7 +580,7 @@ void FormEditorData::setupActions()
m_toolActionIds.back(), mformtools); m_toolActionIds.back(), mformtools);
m_toolActionIds.push_back("FormEditor.LayoutGrid"); m_toolActionIds.push_back("FormEditor.LayoutGrid");
const QString gridShortcut = UseMacShortcuts ? tr("Meta+Shift+G") : tr("Ctrl+G"); const QString gridShortcut = useMacShortcuts ? tr("Meta+Shift+G") : tr("Ctrl+G");
addToolAction(m_fwm->actionGridLayout(), m_contexts, addToolAction(m_fwm->actionGridLayout(), m_contexts,
m_toolActionIds.back(), mformtools, gridShortcut); m_toolActionIds.back(), mformtools, gridShortcut);
@@ -589,7 +589,7 @@ void FormEditorData::setupActions()
m_toolActionIds.back(), mformtools); m_toolActionIds.back(), mformtools);
m_toolActionIds.push_back("FormEditor.LayoutAdjustSize"); m_toolActionIds.push_back("FormEditor.LayoutAdjustSize");
const QString adjustShortcut = UseMacShortcuts ? tr("Meta+J") : tr("Ctrl+J"); const QString adjustShortcut = useMacShortcuts ? tr("Meta+J") : tr("Ctrl+J");
addToolAction(m_fwm->actionAdjustSize(), m_contexts, addToolAction(m_fwm->actionAdjustSize(), m_contexts,
m_toolActionIds.back(), mformtools, adjustShortcut); m_toolActionIds.back(), mformtools, adjustShortcut);

View File

@@ -475,13 +475,13 @@ bool DiffEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
m_diffCurrentFileAction = new QAction(tr("Diff Current File"), this); m_diffCurrentFileAction = new QAction(tr("Diff Current File"), this);
Command *diffCurrentFileCommand = ActionManager::registerAction(m_diffCurrentFileAction, "DiffEditor.DiffCurrentFile"); Command *diffCurrentFileCommand = ActionManager::registerAction(m_diffCurrentFileAction, "DiffEditor.DiffCurrentFile");
diffCurrentFileCommand->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+H") : tr("Ctrl+H"))); diffCurrentFileCommand->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+H") : tr("Ctrl+H")));
connect(m_diffCurrentFileAction, &QAction::triggered, this, &DiffEditorPlugin::diffCurrentFile); connect(m_diffCurrentFileAction, &QAction::triggered, this, &DiffEditorPlugin::diffCurrentFile);
diffContainer->addAction(diffCurrentFileCommand); diffContainer->addAction(diffCurrentFileCommand);
m_diffOpenFilesAction = new QAction(tr("Diff Open Files"), this); m_diffOpenFilesAction = new QAction(tr("Diff Open Files"), this);
Command *diffOpenFilesCommand = ActionManager::registerAction(m_diffOpenFilesAction, "DiffEditor.DiffOpenFiles"); Command *diffOpenFilesCommand = ActionManager::registerAction(m_diffOpenFilesAction, "DiffEditor.DiffOpenFiles");
diffOpenFilesCommand->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Shift+H") : tr("Ctrl+Shift+H"))); diffOpenFilesCommand->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+H") : tr("Ctrl+Shift+H")));
connect(m_diffOpenFilesAction, &QAction::triggered, this, &DiffEditorPlugin::diffOpenFiles); connect(m_diffOpenFilesAction, &QAction::triggered, this, &DiffEditorPlugin::diffOpenFiles);
diffContainer->addAction(diffOpenFilesCommand); diffContainer->addAction(diffOpenFilesCommand);

View File

@@ -1201,7 +1201,7 @@ bool FakeVimPluginPrivate::initialize()
Command *cmd = nullptr; Command *cmd = nullptr;
cmd = ActionManager::registerAction(theFakeVimSetting(ConfigUseFakeVim), cmd = ActionManager::registerAction(theFakeVimSetting(ConfigUseFakeVim),
INSTALL_HANDLER, Context(Core::Constants::C_GLOBAL), true); INSTALL_HANDLER, Context(Core::Constants::C_GLOBAL), true);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? Tr::tr("Meta+Shift+V,Meta+Shift+V") : Tr::tr("Alt+V,Alt+V"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+V,Meta+Shift+V") : Tr::tr("Alt+V,Alt+V")));
ActionContainer *advancedMenu = ActionContainer *advancedMenu =
ActionManager::actionContainer(Core::Constants::M_EDIT_ADVANCED); ActionManager::actionContainer(Core::Constants::M_EDIT_ADVANCED);
@@ -1212,7 +1212,7 @@ bool FakeVimPluginPrivate::initialize()
auto act = new QAction(this); auto act = new QAction(this);
act->setText(Tr::tr("Execute User Action #%1").arg(i)); act->setText(Tr::tr("Execute User Action #%1").arg(i));
cmd = ActionManager::registerAction(act, base.withSuffix(i)); cmd = ActionManager::registerAction(act, base.withSuffix(i));
cmd->setDefaultKeySequence(QKeySequence((UseMacShortcuts ? Tr::tr("Meta+Shift+V,%1") : Tr::tr("Alt+V,%1")).arg(i))); cmd->setDefaultKeySequence(QKeySequence((useMacShortcuts ? Tr::tr("Meta+Shift+V,%1") : Tr::tr("Alt+V,%1")).arg(i)));
connect(act, &QAction::triggered, this, [this, i] { userActionTriggered(i); }); connect(act, &QAction::triggered, this, [this, i] { userActionTriggered(i); });
} }

View File

@@ -337,21 +337,21 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
createFileAction(currentFileMenu, tr("Diff Current File"), tr("Diff of \"%1\""), createFileAction(currentFileMenu, tr("Diff Current File"), tr("Diff of \"%1\""),
"Git.Diff", context, true, std::bind(&GitPlugin::diffCurrentFile, this), "Git.Diff", context, true, std::bind(&GitPlugin::diffCurrentFile, this),
QKeySequence(UseMacShortcuts ? tr("Meta+G,Meta+D") : tr("Alt+G,Alt+D"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+D") : tr("Alt+G,Alt+D")));
createFileAction(currentFileMenu, tr("Log Current File"), tr("Log of \"%1\""), createFileAction(currentFileMenu, tr("Log Current File"), tr("Log of \"%1\""),
"Git.Log", context, true, std::bind(&GitPlugin::logFile, this), "Git.Log", context, true, std::bind(&GitPlugin::logFile, this),
QKeySequence(UseMacShortcuts ? tr("Meta+G,Meta+L") : tr("Alt+G,Alt+L"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+L") : tr("Alt+G,Alt+L")));
createFileAction(currentFileMenu, tr("Blame Current File"), tr("Blame for \"%1\""), createFileAction(currentFileMenu, tr("Blame Current File"), tr("Blame for \"%1\""),
"Git.Blame", context, true, std::bind(&GitPlugin::blameFile, this), "Git.Blame", context, true, std::bind(&GitPlugin::blameFile, this),
QKeySequence(UseMacShortcuts ? tr("Meta+G,Meta+B") : tr("Alt+G,Alt+B"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+B") : tr("Alt+G,Alt+B")));
currentFileMenu->addSeparator(context); currentFileMenu->addSeparator(context);
createFileAction(currentFileMenu, tr("Stage File for Commit"), tr("Stage \"%1\" for Commit"), createFileAction(currentFileMenu, tr("Stage File for Commit"), tr("Stage \"%1\" for Commit"),
"Git.Stage", context, true, std::bind(&GitPlugin::stageFile, this), "Git.Stage", context, true, std::bind(&GitPlugin::stageFile, this),
QKeySequence(UseMacShortcuts ? tr("Meta+G,Meta+A") : tr("Alt+G,Alt+A"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+A") : tr("Alt+G,Alt+A")));
createFileAction(currentFileMenu, tr("Unstage File from Commit"), tr("Unstage \"%1\" from Commit"), createFileAction(currentFileMenu, tr("Unstage File from Commit"), tr("Unstage \"%1\" from Commit"),
"Git.Unstage", context, true, std::bind(&GitPlugin::unstageFile, this)); "Git.Unstage", context, true, std::bind(&GitPlugin::unstageFile, this));
@@ -363,7 +363,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
createFileAction(currentFileMenu, tr("Undo Uncommitted Changes"), tr("Undo Uncommitted Changes for \"%1\""), createFileAction(currentFileMenu, tr("Undo Uncommitted Changes"), tr("Undo Uncommitted Changes for \"%1\""),
"Git.Undo", context, "Git.Undo", context,
true, std::bind(&GitPlugin::undoFileChanges, this, true), true, std::bind(&GitPlugin::undoFileChanges, this, true),
QKeySequence(UseMacShortcuts ? tr("Meta+G,Meta+U") : tr("Alt+G,Alt+U"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+U") : tr("Alt+G,Alt+U")));
/* "Current Project" menu */ /* "Current Project" menu */
@@ -373,11 +373,11 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
createProjectAction(currentProjectMenu, tr("Diff Current Project"), tr("Diff Project \"%1\""), createProjectAction(currentProjectMenu, tr("Diff Current Project"), tr("Diff Project \"%1\""),
"Git.DiffProject", context, true, &GitPlugin::diffCurrentProject, "Git.DiffProject", context, true, &GitPlugin::diffCurrentProject,
QKeySequence(UseMacShortcuts ? tr("Meta+G,Meta+Shift+D") : tr("Alt+G,Alt+Shift+D"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+Shift+D") : tr("Alt+G,Alt+Shift+D")));
createProjectAction(currentProjectMenu, tr("Log Project"), tr("Log Project \"%1\""), createProjectAction(currentProjectMenu, tr("Log Project"), tr("Log Project \"%1\""),
"Git.LogProject", context, true, &GitPlugin::logProject, "Git.LogProject", context, true, &GitPlugin::logProject,
QKeySequence(UseMacShortcuts ? tr("Meta+G,Meta+K") : tr("Alt+G,Alt+K"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+K") : tr("Alt+G,Alt+K")));
createProjectAction(currentProjectMenu, tr("Clean Project..."), tr("Clean Project \"%1\"..."), createProjectAction(currentProjectMenu, tr("Clean Project..."), tr("Clean Project \"%1\"..."),
"Git.CleanProject", context, true, &GitPlugin::cleanProject); "Git.CleanProject", context, true, &GitPlugin::cleanProject);
@@ -408,7 +408,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
createRepositoryAction(localRepositoryMenu, tr("Commit..."), "Git.Commit", createRepositoryAction(localRepositoryMenu, tr("Commit..."), "Git.Commit",
context, true, std::bind(&GitPlugin::startCommit, this, SimpleCommit), context, true, std::bind(&GitPlugin::startCommit, this, SimpleCommit),
QKeySequence(UseMacShortcuts ? tr("Meta+G,Meta+C") : tr("Alt+G,Alt+C"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+C") : tr("Alt+G,Alt+C")));
createRepositoryAction(localRepositoryMenu, tr("Amend Last Commit..."), "Git.AmendCommit", createRepositoryAction(localRepositoryMenu, tr("Amend Last Commit..."), "Git.AmendCommit",
context, true, std::bind(&GitPlugin::startCommit, this, AmendCommit)); context, true, std::bind(&GitPlugin::startCommit, this, AmendCommit));

View File

@@ -204,7 +204,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
m_addBookmarkAction = new QAction(Utils::Icons::BOOKMARK_TOOLBAR.icon(), tr("Add Bookmark"), this); m_addBookmarkAction = new QAction(Utils::Icons::BOOKMARK_TOOLBAR.icon(), tr("Add Bookmark"), this);
cmd = Core::ActionManager::registerAction(m_addBookmarkAction, Constants::HELP_ADDBOOKMARK, context); cmd = Core::ActionManager::registerAction(m_addBookmarkAction, Constants::HELP_ADDBOOKMARK, context);
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+M") : tr("Ctrl+M"))); cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+M") : tr("Ctrl+M")));
connect(m_addBookmarkAction, &QAction::triggered, this, &HelpWidget::addBookmark); connect(m_addBookmarkAction, &QAction::triggered, this, &HelpWidget::addBookmark);
layout->addWidget(new Utils::StyledSeparator(toolBar)); layout->addWidget(new Utils::StyledSeparator(toolBar));
layout->addWidget(Core::Command::toolButtonWithAppendedShortcut(m_addBookmarkAction, cmd)); layout->addWidget(Core::Command::toolButtonWithAppendedShortcut(m_addBookmarkAction, cmd));
@@ -345,7 +345,7 @@ void HelpWidget::addSideBar()
this, &HelpWidget::open); this, &HelpWidget::open);
m_contentsAction = new QAction(HelpPlugin::tr(Constants::SB_CONTENTS), this); m_contentsAction = new QAction(HelpPlugin::tr(Constants::SB_CONTENTS), this);
cmd = Core::ActionManager::registerAction(m_contentsAction, Constants::HELP_CONTENTS, m_context->context()); cmd = Core::ActionManager::registerAction(m_contentsAction, Constants::HELP_CONTENTS, m_context->context());
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+C") cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+Shift+C")
: tr("Ctrl+Shift+C"))); : tr("Ctrl+Shift+C")));
shortcutMap.insert(Constants::HELP_CONTENTS, cmd); shortcutMap.insert(Constants::HELP_CONTENTS, cmd);
@@ -357,7 +357,7 @@ void HelpWidget::addSideBar()
this, &HelpWidget::showLinks); this, &HelpWidget::showLinks);
m_indexAction = new QAction(HelpPlugin::tr(Constants::SB_INDEX), this); m_indexAction = new QAction(HelpPlugin::tr(Constants::SB_INDEX), this);
cmd = Core::ActionManager::registerAction(m_indexAction, Constants::HELP_INDEX, m_context->context()); cmd = Core::ActionManager::registerAction(m_indexAction, Constants::HELP_INDEX, m_context->context());
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+I") cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+I")
: tr("Ctrl+Shift+I"))); : tr("Ctrl+Shift+I")));
shortcutMap.insert(Constants::HELP_INDEX, cmd); shortcutMap.insert(Constants::HELP_INDEX, cmd);
@@ -369,7 +369,7 @@ void HelpWidget::addSideBar()
m_bookmarkAction = new QAction(tr("Activate Help Bookmarks View"), this); m_bookmarkAction = new QAction(tr("Activate Help Bookmarks View"), this);
cmd = Core::ActionManager::registerAction(m_bookmarkAction, Constants::HELP_BOOKMARKS, cmd = Core::ActionManager::registerAction(m_bookmarkAction, Constants::HELP_BOOKMARKS,
m_context->context()); m_context->context());
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Alt+Meta+M") cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Alt+Meta+M")
: tr("Ctrl+Shift+B"))); : tr("Ctrl+Shift+B")));
shortcutMap.insert(Constants::HELP_BOOKMARKS, cmd); shortcutMap.insert(Constants::HELP_BOOKMARKS, cmd);
@@ -378,7 +378,7 @@ void HelpWidget::addSideBar()
m_searchAction = new QAction(tr("Activate Help Search View"), this); m_searchAction = new QAction(tr("Activate Help Search View"), this);
cmd = Core::ActionManager::registerAction(m_searchAction, Constants::HELP_SEARCH, cmd = Core::ActionManager::registerAction(m_searchAction, Constants::HELP_SEARCH,
m_context->context()); m_context->context());
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+/") cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+/")
: tr("Ctrl+Shift+/"))); : tr("Ctrl+Shift+/")));
shortcutMap.insert(Constants::HELP_SEARCH, cmd); shortcutMap.insert(Constants::HELP_SEARCH, cmd);
@@ -390,7 +390,7 @@ void HelpWidget::addSideBar()
m_openPagesAction = new QAction(tr("Activate Open Help Pages View"), this); m_openPagesAction = new QAction(tr("Activate Open Help Pages View"), this);
cmd = Core::ActionManager::registerAction(m_openPagesAction, Constants::HELP_OPENPAGES, cmd = Core::ActionManager::registerAction(m_openPagesAction, Constants::HELP_OPENPAGES,
m_context->context()); m_context->context());
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+O") cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+O")
: tr("Ctrl+Shift+O"))); : tr("Ctrl+Shift+O")));
shortcutMap.insert(Constants::HELP_OPENPAGES, cmd); shortcutMap.insert(Constants::HELP_OPENPAGES, cmd);
} }

View File

@@ -77,7 +77,7 @@ void ImageViewerPlugin::extensionsInitialized()
}); });
a = registerNewAction(Constants::ACTION_ORIGINAL_SIZE, tr("Original Size"), a = registerNewAction(Constants::ACTION_ORIGINAL_SIZE, tr("Original Size"),
QKeySequence(Core::UseMacShortcuts ? tr("Meta+0") : tr("Ctrl+0"))); QKeySequence(Core::useMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")));
connect(a, &QAction::triggered, this, []() { connect(a, &QAction::triggered, this, []() {
if (ImageViewer *iv = currentImageViewer()) if (ImageViewer *iv = currentImageViewer())
iv->resetToOriginalSize(); iv->resetToOriginalSize();

View File

@@ -74,20 +74,20 @@ bool MacrosPlugin::initialize(const QStringList &arguments, QString *errorMessag
QAction *startMacro = new QAction(tr("Record Macro"), this); QAction *startMacro = new QAction(tr("Record Macro"), this);
Core::Command *command = Core::ActionManager::registerAction(startMacro, Constants::START_MACRO, textContext); Core::Command *command = Core::ActionManager::registerAction(startMacro, Constants::START_MACRO, textContext);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Ctrl+(") : tr("Alt+("))); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Ctrl+(") : tr("Alt+(")));
mmacrotools->addAction(command); mmacrotools->addAction(command);
connect(startMacro, &QAction::triggered, m_macroManager, &MacroManager::startMacro); connect(startMacro, &QAction::triggered, m_macroManager, &MacroManager::startMacro);
QAction *endMacro = new QAction(tr("Stop Recording Macro"), this); QAction *endMacro = new QAction(tr("Stop Recording Macro"), this);
endMacro->setEnabled(false); endMacro->setEnabled(false);
command = Core::ActionManager::registerAction(endMacro, Constants::END_MACRO); command = Core::ActionManager::registerAction(endMacro, Constants::END_MACRO);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Ctrl+)") : tr("Alt+)"))); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Ctrl+)") : tr("Alt+)")));
mmacrotools->addAction(command); mmacrotools->addAction(command);
connect(endMacro, &QAction::triggered, m_macroManager, &MacroManager::endMacro); connect(endMacro, &QAction::triggered, m_macroManager, &MacroManager::endMacro);
QAction *executeLastMacro = new QAction(tr("Play Last Macro"), this); QAction *executeLastMacro = new QAction(tr("Play Last Macro"), this);
command = Core::ActionManager::registerAction(executeLastMacro, Constants::EXECUTE_LAST_MACRO, textContext); command = Core::ActionManager::registerAction(executeLastMacro, Constants::EXECUTE_LAST_MACRO, textContext);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+R") : tr("Alt+R"))); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+R") : tr("Alt+R")));
mmacrotools->addAction(command); mmacrotools->addAction(command);
connect(executeLastMacro, &QAction::triggered, m_macroManager, &MacroManager::executeLastMacro); connect(executeLastMacro, &QAction::triggered, m_macroManager, &MacroManager::executeLastMacro);

View File

@@ -185,7 +185,7 @@ void MercurialPlugin::createFileActions(const Core::Context &context)
diffFile = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this); diffFile = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
command = Core::ActionManager::registerAction(diffFile, Core::Id(Constants::DIFF), context); command = Core::ActionManager::registerAction(diffFile, Core::Id(Constants::DIFF), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+H,Meta+D") : tr("Alt+G,Alt+D"))); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+H,Meta+D") : tr("Alt+G,Alt+D")));
connect(diffFile, &QAction::triggered, this, &MercurialPlugin::diffCurrentFile); connect(diffFile, &QAction::triggered, this, &MercurialPlugin::diffCurrentFile);
m_mercurialContainer->addAction(command); m_mercurialContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -193,7 +193,7 @@ void MercurialPlugin::createFileActions(const Core::Context &context)
logFile = new ParameterAction(tr("Log Current File"), tr("Log \"%1\""), ParameterAction::EnabledWithParameter, this); logFile = new ParameterAction(tr("Log Current File"), tr("Log \"%1\""), ParameterAction::EnabledWithParameter, this);
command = Core::ActionManager::registerAction(logFile, Core::Id(Constants::LOG), context); command = Core::ActionManager::registerAction(logFile, Core::Id(Constants::LOG), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+H,Meta+L") : tr("Alt+G,Alt+L"))); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+H,Meta+L") : tr("Alt+G,Alt+L")));
connect(logFile, &QAction::triggered, this, &MercurialPlugin::logCurrentFile); connect(logFile, &QAction::triggered, this, &MercurialPlugin::logCurrentFile);
m_mercurialContainer->addAction(command); m_mercurialContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -201,7 +201,7 @@ void MercurialPlugin::createFileActions(const Core::Context &context)
statusFile = new ParameterAction(tr("Status Current File"), tr("Status \"%1\""), ParameterAction::EnabledWithParameter, this); statusFile = new ParameterAction(tr("Status Current File"), tr("Status \"%1\""), ParameterAction::EnabledWithParameter, this);
command = Core::ActionManager::registerAction(statusFile, Core::Id(Constants::STATUS), context); command = Core::ActionManager::registerAction(statusFile, Core::Id(Constants::STATUS), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+H,Meta+S") : tr("Alt+G,Alt+S"))); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+H,Meta+S") : tr("Alt+G,Alt+S")));
connect(statusFile, &QAction::triggered, this, &MercurialPlugin::statusCurrentFile); connect(statusFile, &QAction::triggered, this, &MercurialPlugin::statusCurrentFile);
m_mercurialContainer->addAction(command); m_mercurialContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -391,7 +391,7 @@ void MercurialPlugin::createRepositoryActions(const Core::Context &context)
action = new QAction(tr("Commit..."), this); action = new QAction(tr("Commit..."), this);
m_repositoryActionList.append(action); m_repositoryActionList.append(action);
command = Core::ActionManager::registerAction(action, Core::Id(Constants::COMMIT), context); command = Core::ActionManager::registerAction(action, Core::Id(Constants::COMMIT), context);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+H,Meta+C") : tr("Alt+G,Alt+C"))); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+H,Meta+C") : tr("Alt+G,Alt+C")));
connect(action, &QAction::triggered, this, &MercurialPlugin::commit); connect(action, &QAction::triggered, this, &MercurialPlugin::commit);
m_mercurialContainer->addAction(command); m_mercurialContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);

View File

@@ -237,7 +237,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
m_filelogCurrentAction = new ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), ParameterAction::EnabledWithParameter, this); m_filelogCurrentAction = new ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_filelogCurrentAction, CMD_ID_FILELOG_CURRENT, context); command = ActionManager::registerAction(m_filelogCurrentAction, CMD_ID_FILELOG_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+F") : tr("Alt+P,Alt+F"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+P,Meta+F") : tr("Alt+P,Alt+F")));
command->setDescription(tr("Filelog Current File")); command->setDescription(tr("Filelog Current File"));
connect(m_filelogCurrentAction, &QAction::triggered, this, &PerforcePlugin::filelogCurrentFile); connect(m_filelogCurrentAction, &QAction::triggered, this, &PerforcePlugin::filelogCurrentFile);
perforceContainer->addAction(command); perforceContainer->addAction(command);
@@ -248,7 +248,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
m_editAction = new ParameterAction(tr("Edit"), tr("Edit \"%1\""), ParameterAction::EnabledWithParameter, this); m_editAction = new ParameterAction(tr("Edit"), tr("Edit \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_editAction, CMD_ID_EDIT, context); command = ActionManager::registerAction(m_editAction, CMD_ID_EDIT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+E") : tr("Alt+P,Alt+E"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+P,Meta+E") : tr("Alt+P,Alt+E")));
command->setDescription(tr("Edit File")); command->setDescription(tr("Edit File"));
connect(m_editAction, &QAction::triggered, this, &PerforcePlugin::openCurrentFile); connect(m_editAction, &QAction::triggered, this, &PerforcePlugin::openCurrentFile);
perforceContainer->addAction(command); perforceContainer->addAction(command);
@@ -257,7 +257,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
m_addAction = new ParameterAction(tr("Add"), tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this); m_addAction = new ParameterAction(tr("Add"), tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_addAction, CMD_ID_ADD, context); command = ActionManager::registerAction(m_addAction, CMD_ID_ADD, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+A") : tr("Alt+P,Alt+A"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+P,Meta+A") : tr("Alt+P,Alt+A")));
command->setDescription(tr("Add File")); command->setDescription(tr("Add File"));
connect(m_addAction, &QAction::triggered, this, &PerforcePlugin::addCurrentFile); connect(m_addAction, &QAction::triggered, this, &PerforcePlugin::addCurrentFile);
perforceContainer->addAction(command); perforceContainer->addAction(command);
@@ -274,7 +274,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
m_revertFileAction = new ParameterAction(tr("Revert"), tr("Revert \"%1\""), ParameterAction::EnabledWithParameter, this); m_revertFileAction = new ParameterAction(tr("Revert"), tr("Revert \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_revertFileAction, CMD_ID_REVERT, context); command = ActionManager::registerAction(m_revertFileAction, CMD_ID_REVERT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+R") : tr("Alt+P,Alt+R"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+P,Meta+R") : tr("Alt+P,Alt+R")));
command->setDescription(tr("Revert File")); command->setDescription(tr("Revert File"));
connect(m_revertFileAction, &QAction::triggered, this, &PerforcePlugin::revertCurrentFile); connect(m_revertFileAction, &QAction::triggered, this, &PerforcePlugin::revertCurrentFile);
perforceContainer->addAction(command); perforceContainer->addAction(command);
@@ -286,7 +286,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
m_diffProjectAction = new ParameterAction(diffProjectDefaultText, tr("Diff Project \"%1\""), ParameterAction::AlwaysEnabled, this); m_diffProjectAction = new ParameterAction(diffProjectDefaultText, tr("Diff Project \"%1\""), ParameterAction::AlwaysEnabled, this);
command = ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, context); command = ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+D") : tr("Alt+P,Alt+D"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+P,Meta+D") : tr("Alt+P,Alt+D")));
command->setDescription(diffProjectDefaultText); command->setDescription(diffProjectDefaultText);
connect(m_diffProjectAction, &QAction::triggered, this, &PerforcePlugin::diffCurrentProject); connect(m_diffProjectAction, &QAction::triggered, this, &PerforcePlugin::diffCurrentProject);
perforceContainer->addAction(command); perforceContainer->addAction(command);
@@ -302,7 +302,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
m_submitProjectAction = new ParameterAction(tr("Submit Project"), tr("Submit Project \"%1\""), ParameterAction::EnabledWithParameter, this); m_submitProjectAction = new ParameterAction(tr("Submit Project"), tr("Submit Project \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_submitProjectAction, CMD_ID_SUBMIT, context); command = ActionManager::registerAction(m_submitProjectAction, CMD_ID_SUBMIT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+S") : tr("Alt+P,Alt+S"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+P,Meta+S") : tr("Alt+P,Alt+S")));
connect(m_submitProjectAction, &QAction::triggered, this, &PerforcePlugin::startSubmitProject); connect(m_submitProjectAction, &QAction::triggered, this, &PerforcePlugin::startSubmitProject);
perforceContainer->addAction(command); perforceContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -340,7 +340,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
m_openedAction = new QAction(tr("Opened"), this); m_openedAction = new QAction(tr("Opened"), this);
command = ActionManager::registerAction(m_openedAction, CMD_ID_OPENED, context); command = ActionManager::registerAction(m_openedAction, CMD_ID_OPENED, context);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+P,Meta+O") : tr("Alt+P,Alt+O"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+P,Meta+O") : tr("Alt+P,Alt+O")));
connect(m_openedAction, &QAction::triggered, this, &PerforcePlugin::printOpenedFileList); connect(m_openedAction, &QAction::triggered, this, &PerforcePlugin::printOpenedFileList);
perforceContainer->addAction(command); perforceContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);

View File

@@ -681,7 +681,7 @@ FolderNavigationWidgetFactory::FolderNavigationWidgetFactory()
setDisplayName(tr("File System")); setDisplayName(tr("File System"));
setPriority(400); setPriority(400);
setId("File System"); setId("File System");
setActivationSequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Y") : tr("Alt+Y"))); setActivationSequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+Y") : tr("Alt+Y")));
insertRootDirectory({QLatin1String("A.Computer"), insertRootDirectory({QLatin1String("A.Computer"),
0 /*sortValue*/, 0 /*sortValue*/,
FolderNavigationWidget::tr("Computer"), FolderNavigationWidget::tr("Computer"),

View File

@@ -953,7 +953,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
dd->m_cancelBuildAction = new QAction(Utils::Icons::STOP_SMALL.icon(), tr("Cancel Build"), dd->m_cancelBuildAction = new QAction(Utils::Icons::STOP_SMALL.icon(), tr("Cancel Build"),
this); this);
cmd = ActionManager::registerAction(dd->m_cancelBuildAction, Constants::CANCELBUILD); cmd = ActionManager::registerAction(dd->m_cancelBuildAction, Constants::CANCELBUILD);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Backspace") : tr("Alt+Backspace"))); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Backspace") : tr("Alt+Backspace")));
mbuild->addAction(cmd, Constants::G_BUILD_CANCEL); mbuild->addAction(cmd, Constants::G_BUILD_CANCEL);
// run action // run action

View File

@@ -540,7 +540,7 @@ ProjectTreeWidgetFactory::ProjectTreeWidgetFactory()
setDisplayName(tr("Projects")); setDisplayName(tr("Projects"));
setPriority(100); setPriority(100);
setId(ProjectExplorer::Constants::PROJECTTREE_ID); setId(ProjectExplorer::Constants::PROJECTTREE_ID);
setActivationSequence(QKeySequence(UseMacShortcuts ? tr("Meta+X") : tr("Alt+X"))); setActivationSequence(QKeySequence(useMacShortcuts ? tr("Meta+X") : tr("Alt+X")));
} }
NavigationView ProjectTreeWidgetFactory::createWidget() NavigationView ProjectTreeWidgetFactory::createWidget()

View File

@@ -126,7 +126,7 @@ ProjectWelcomePage::ProjectWelcomePage()
for (int i = 1; i <= actionsCount; ++i) { for (int i = 1; i <= actionsCount; ++i) {
auto act = new QAction(tr("Open Session #%1").arg(i), this); auto act = new QAction(tr("Open Session #%1").arg(i), this);
Command *cmd = ActionManager::registerAction(act, sessionBase.withSuffix(i), welcomeContext); Command *cmd = ActionManager::registerAction(act, sessionBase.withSuffix(i), welcomeContext);
cmd->setDefaultKeySequence(QKeySequence((UseMacShortcuts ? tr("Ctrl+Meta+%1") : tr("Ctrl+Alt+%1")).arg(i))); cmd->setDefaultKeySequence(QKeySequence((useMacShortcuts ? tr("Ctrl+Meta+%1") : tr("Ctrl+Alt+%1")).arg(i)));
connect(act, &QAction::triggered, this, [this, i] { openSessionAt(i - 1); }); connect(act, &QAction::triggered, this, [this, i] { openSessionAt(i - 1); });
act = new QAction(tr("Open Recent Project #%1").arg(i), this); act = new QAction(tr("Open Recent Project #%1").arg(i), this);

View File

@@ -78,7 +78,7 @@ TextEditorView::TextEditorView(QObject *parent)
QAction *completionAction = new QAction(tr("Trigger Completion"), this); QAction *completionAction = new QAction(tr("Trigger Completion"), this);
Core::Command *command = Core::ActionManager::registerAction(completionAction, TextEditor::Constants::COMPLETE_THIS, context); Core::Command *command = Core::ActionManager::registerAction(completionAction, TextEditor::Constants::COMPLETE_THIS, context);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Space") : tr("Ctrl+Space"))); command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+Space") : tr("Ctrl+Space")));
connect(completionAction, &QAction::triggered, [this]() { connect(completionAction, &QAction::triggered, [this]() {
if (m_widget->textEditor()) if (m_widget->textEditor())

View File

@@ -168,7 +168,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
QAction *showQuickToolbar = new QAction(tr("Show Qt Quick Toolbar"), this); QAction *showQuickToolbar = new QAction(tr("Show Qt Quick Toolbar"), this);
cmd = ActionManager::registerAction(showQuickToolbar, Constants::SHOW_QT_QUICK_HELPER, context); cmd = ActionManager::registerAction(showQuickToolbar, Constants::SHOW_QT_QUICK_HELPER, context);
cmd->setDefaultKeySequence(UseMacShortcuts ? QKeySequence(Qt::META + Qt::ALT + Qt::Key_Space) cmd->setDefaultKeySequence(useMacShortcuts ? QKeySequence(Qt::META + Qt::ALT + Qt::Key_Space)
: QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Space)); : QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Space));
connect(showQuickToolbar, &QAction::triggered, this, &QmlJSEditorPlugin::showContextPane); connect(showQuickToolbar, &QAction::triggered, this, &QmlJSEditorPlugin::showContextPane);
contextMenu->addAction(cmd); contextMenu->addAction(cmd);

View File

@@ -246,7 +246,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
command = ActionManager::registerAction(m_diffCurrentAction, command = ActionManager::registerAction(m_diffCurrentAction,
CMD_ID_DIFF_CURRENT, context); CMD_ID_DIFF_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+D") : tr("Alt+S,Alt+D"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+S,Meta+D") : tr("Alt+S,Alt+D")));
connect(m_diffCurrentAction, &QAction::triggered, this, &SubversionPlugin::diffCurrentFile); connect(m_diffCurrentAction, &QAction::triggered, this, &SubversionPlugin::diffCurrentFile);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -273,7 +273,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
command = ActionManager::registerAction(m_addAction, CMD_ID_ADD, command = ActionManager::registerAction(m_addAction, CMD_ID_ADD,
context); context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+A") : tr("Alt+S,Alt+A"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+S,Meta+A") : tr("Alt+S,Alt+A")));
connect(m_addAction, &QAction::triggered, this, &SubversionPlugin::addCurrentFile); connect(m_addAction, &QAction::triggered, this, &SubversionPlugin::addCurrentFile);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -282,7 +282,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
command = ActionManager::registerAction(m_commitCurrentAction, command = ActionManager::registerAction(m_commitCurrentAction,
CMD_ID_COMMIT_CURRENT, context); CMD_ID_COMMIT_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+C") : tr("Alt+S,Alt+C"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+S,Meta+C") : tr("Alt+S,Alt+C")));
connect(m_commitCurrentAction, &QAction::triggered, this, &SubversionPlugin::startCommitCurrentFile); connect(m_commitCurrentAction, &QAction::triggered, this, &SubversionPlugin::startCommitCurrentFile);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);

View File

@@ -325,7 +325,7 @@ void TextEditorActionHandlerPrivate::createActions()
G_EDIT_FORMAT, advancedEditMenu); G_EDIT_FORMAT, advancedEditMenu);
m_rewrapParagraphAction = registerAction(REWRAP_PARAGRAPH, m_rewrapParagraphAction = registerAction(REWRAP_PARAGRAPH,
[] (TextEditorWidget *w) { w->rewrapParagraph(); }, true, tr("&Rewrap Paragraph"), [] (TextEditorWidget *w) { w->rewrapParagraph(); }, true, tr("&Rewrap Paragraph"),
QKeySequence(Core::UseMacShortcuts ? tr("Meta+E, R") : tr("Ctrl+E, R")), QKeySequence(Core::useMacShortcuts ? tr("Meta+E, R") : tr("Ctrl+E, R")),
G_EDIT_FORMAT, advancedEditMenu); G_EDIT_FORMAT, advancedEditMenu);
m_visualizeWhitespaceAction = registerBoolAction(VISUALIZE_WHITESPACE, m_visualizeWhitespaceAction = registerBoolAction(VISUALIZE_WHITESPACE,
[] (TextEditorWidget *widget, bool checked) { [] (TextEditorWidget *widget, bool checked) {
@@ -336,7 +336,7 @@ void TextEditorActionHandlerPrivate::createActions()
} }
}, },
false, tr("&Visualize Whitespace"), false, tr("&Visualize Whitespace"),
QKeySequence(Core::UseMacShortcuts ? tr("Meta+E, Meta+V") : tr("Ctrl+E, Ctrl+V")), QKeySequence(Core::useMacShortcuts ? tr("Meta+E, Meta+V") : tr("Ctrl+E, Ctrl+V")),
G_EDIT_FORMAT, advancedEditMenu); G_EDIT_FORMAT, advancedEditMenu);
m_visualizeWhitespaceAction->setCheckable(true); m_visualizeWhitespaceAction->setCheckable(true);
m_cleanWhitespaceAction = registerAction(CLEAN_WHITESPACE, m_cleanWhitespaceAction = registerAction(CLEAN_WHITESPACE,
@@ -352,7 +352,7 @@ void TextEditorActionHandlerPrivate::createActions()
} }
}, },
false, tr("Enable Text &Wrapping"), false, tr("Enable Text &Wrapping"),
QKeySequence(Core::UseMacShortcuts ? tr("Meta+E, Meta+W") : tr("Ctrl+E, Ctrl+W")), QKeySequence(Core::useMacShortcuts ? tr("Meta+E, Meta+W") : tr("Ctrl+E, Ctrl+W")),
G_EDIT_FORMAT, advancedEditMenu); G_EDIT_FORMAT, advancedEditMenu);
m_textWrappingAction->setCheckable(true); m_textWrappingAction->setCheckable(true);
m_unCommentSelectionAction = registerAction(UN_COMMENT_SELECTION, m_unCommentSelectionAction = registerAction(UN_COMMENT_SELECTION,
@@ -377,15 +377,15 @@ void TextEditorActionHandlerPrivate::createActions()
G_EDIT_TEXT, advancedEditMenu); G_EDIT_TEXT, advancedEditMenu);
m_upperCaseSelectionAction = registerAction(UPPERCASE_SELECTION, m_upperCaseSelectionAction = registerAction(UPPERCASE_SELECTION,
[] (TextEditorWidget *w) { w->uppercaseSelection(); }, true, tr("Uppercase Selection"), [] (TextEditorWidget *w) { w->uppercaseSelection(); }, true, tr("Uppercase Selection"),
QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+U") : tr("Alt+Shift+U")), QKeySequence(Core::useMacShortcuts ? tr("Meta+Shift+U") : tr("Alt+Shift+U")),
G_EDIT_TEXT, advancedEditMenu); G_EDIT_TEXT, advancedEditMenu);
m_lowerCaseSelectionAction = registerAction(LOWERCASE_SELECTION, m_lowerCaseSelectionAction = registerAction(LOWERCASE_SELECTION,
[] (TextEditorWidget *w) { w->lowercaseSelection(); }, true, tr("Lowercase Selection"), [] (TextEditorWidget *w) { w->lowercaseSelection(); }, true, tr("Lowercase Selection"),
QKeySequence(Core::UseMacShortcuts ? tr("Meta+U") : tr("Alt+U")), QKeySequence(Core::useMacShortcuts ? tr("Meta+U") : tr("Alt+U")),
G_EDIT_TEXT, advancedEditMenu); G_EDIT_TEXT, advancedEditMenu);
m_sortSelectedLinesAction = registerAction(SORT_SELECTED_LINES, m_sortSelectedLinesAction = registerAction(SORT_SELECTED_LINES,
[] (TextEditorWidget *w) { w->sortSelectedLines(); }, false, tr("&Sort Selected Lines"), [] (TextEditorWidget *w) { w->sortSelectedLines(); }, false, tr("&Sort Selected Lines"),
QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+S") : tr("Alt+Shift+S")), QKeySequence(Core::useMacShortcuts ? tr("Meta+Shift+S") : tr("Alt+Shift+S")),
G_EDIT_TEXT, advancedEditMenu); G_EDIT_TEXT, advancedEditMenu);
m_foldAction = registerAction(FOLD, m_foldAction = registerAction(FOLD,
[] (TextEditorWidget *w) { w->fold(); }, true, tr("Fold"), [] (TextEditorWidget *w) { w->fold(); }, true, tr("Fold"),
@@ -409,7 +409,7 @@ void TextEditorActionHandlerPrivate::createActions()
G_EDIT_FONT, advancedEditMenu); G_EDIT_FONT, advancedEditMenu);
m_resetFontSizeAction = registerAction(RESET_FONT_SIZE, m_resetFontSizeAction = registerAction(RESET_FONT_SIZE,
[] (TextEditorWidget *w) { w->zoomReset(); }, false, tr("Reset Font Size"), [] (TextEditorWidget *w) { w->zoomReset(); }, false, tr("Reset Font Size"),
QKeySequence(Core::UseMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")), QKeySequence(Core::useMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")),
G_EDIT_FONT, advancedEditMenu); G_EDIT_FONT, advancedEditMenu);
m_gotoBlockStartAction = registerAction(GOTO_BLOCK_START, m_gotoBlockStartAction = registerAction(GOTO_BLOCK_START,
[] (TextEditorWidget *w) { w->gotoBlockStart(); }, true, tr("Go to Block Start"), [] (TextEditorWidget *w) { w->gotoBlockStart(); }, true, tr("Go to Block Start"),

View File

@@ -104,7 +104,7 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
// Add shortcut for invoking automatic completion // Add shortcut for invoking automatic completion
QAction *completionAction = new QAction(tr("Trigger Completion"), this); QAction *completionAction = new QAction(tr("Trigger Completion"), this);
Command *command = ActionManager::registerAction(completionAction, Constants::COMPLETE_THIS, context); Command *command = ActionManager::registerAction(completionAction, Constants::COMPLETE_THIS, context);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Space") : tr("Ctrl+Space"))); command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Space") : tr("Ctrl+Space")));
connect(completionAction, &QAction::triggered, []() { connect(completionAction, &QAction::triggered, []() {
if (BaseTextEditor *editor = BaseTextEditor::currentTextEditor()) if (BaseTextEditor *editor = BaseTextEditor::currentTextEditor())
editor->editorWidget()->invokeAssist(Completion); editor->editorWidget()->invokeAssist(Completion);