forked from qt-creator/qt-creator
Core: Rename ActionBuilder::setContainer to addToContainer
An action/command can be used in several places. Change-Id: Ifa26f64f7d200d93ada13f272de0fa833f886997 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -189,7 +189,7 @@ void AutotestPluginPrivate::initializeMenuEntries()
|
||||
runAll.setIcon(Utils::Icons::RUN_SMALL.icon());
|
||||
runAll.setToolTip(Tr::tr("Run All Tests"));
|
||||
runAll.setDefaultKeySequence(Tr::tr("Ctrl+Meta+T, Ctrl+Meta+A"), Tr::tr("Alt+Shift+T,Alt+A"));
|
||||
runAll.setContainer(Constants::MENU_ID);
|
||||
runAll.addToContainer(Constants::MENU_ID);
|
||||
runAll.setEnabled(false);
|
||||
runAll.setOnTriggered(this, [this] { onRunAllTriggered(TestRunMode::Run); });
|
||||
|
||||
@@ -198,7 +198,7 @@ void AutotestPluginPrivate::initializeMenuEntries()
|
||||
runAllNoDeploy.setIcon(Utils::Icons::RUN_SMALL.icon());
|
||||
runAllNoDeploy.setToolTip(Tr::tr("Run All Tests Without Deployment"));
|
||||
runAllNoDeploy.setDefaultKeySequence(Tr::tr("Ctrl+Meta+T, Ctrl+Meta+E"), Tr::tr("Alt+Shift+T,Alt+E"));
|
||||
runAllNoDeploy.setContainer(Constants::MENU_ID);
|
||||
runAllNoDeploy.addToContainer(Constants::MENU_ID);
|
||||
runAllNoDeploy.setEnabled(false);
|
||||
runAllNoDeploy.setOnTriggered(this, [this] { onRunAllTriggered(TestRunMode::RunWithoutDeploy); });
|
||||
|
||||
@@ -207,7 +207,7 @@ void AutotestPluginPrivate::initializeMenuEntries()
|
||||
runSelected.setIcon(Utils::Icons::RUN_SELECTED.icon());
|
||||
runSelected.setToolTip(Tr::tr("Run Selected Tests"));
|
||||
runSelected.setDefaultKeySequence(Tr::tr("Ctrl+Meta+T, Ctrl+Meta+R"), Tr::tr("Alt+Shift+T,Alt+R"));
|
||||
runSelected.setContainer(Constants::MENU_ID);
|
||||
runSelected.addToContainer(Constants::MENU_ID);
|
||||
runSelected.setEnabled(false);
|
||||
runSelected.setOnTriggered(this, [this] { onRunSelectedTriggered(TestRunMode::Run); });
|
||||
|
||||
@@ -216,7 +216,7 @@ void AutotestPluginPrivate::initializeMenuEntries()
|
||||
runSelectedNoDeploy.setIcon(Utils::Icons::RUN_SELECTED.icon());
|
||||
runSelectedNoDeploy.setToolTip(Tr::tr("Run Selected Tests Without Deployment"));
|
||||
runSelectedNoDeploy.setDefaultKeySequence(Tr::tr("Ctrl+Meta+T, Ctrl+Meta+W"), Tr::tr("Alt+Shift+T,Alt+W"));
|
||||
runSelectedNoDeploy.setContainer(Constants::MENU_ID);
|
||||
runSelectedNoDeploy.addToContainer(Constants::MENU_ID);
|
||||
runSelectedNoDeploy.setEnabled(false);
|
||||
runSelectedNoDeploy.setOnTriggered(this, [this] { onRunSelectedTriggered(TestRunMode::RunWithoutDeploy); });
|
||||
|
||||
@@ -225,7 +225,7 @@ void AutotestPluginPrivate::initializeMenuEntries()
|
||||
runFailed.setIcon(Icons::RUN_FAILED.icon());
|
||||
runFailed.setToolTip(Tr::tr("Run Failed Tests"));
|
||||
runFailed.setDefaultKeySequence(Tr::tr("Ctrl+Meta+T, Ctrl+Meta+F"), Tr::tr("Alt+Shift+T,Alt+F"));
|
||||
runFailed.setContainer(Constants::MENU_ID);
|
||||
runFailed.addToContainer(Constants::MENU_ID);
|
||||
runFailed.setEnabled(false);
|
||||
runFailed.setOnTriggered(this, [this] { onRunFailedTriggered(); });
|
||||
|
||||
@@ -234,7 +234,7 @@ void AutotestPluginPrivate::initializeMenuEntries()
|
||||
runCurrent.setIcon(Utils::Icons::RUN_FILE.icon());
|
||||
runCurrent.setToolTip(Tr::tr("Run Tests for Current File"));
|
||||
runCurrent.setDefaultKeySequence(Tr::tr("Ctrl+Meta+T, Ctrl+Meta+C"), Tr::tr("Alt+Shift+T,Alt+C"));
|
||||
runCurrent.setContainer(Constants::MENU_ID);
|
||||
runCurrent.addToContainer(Constants::MENU_ID);
|
||||
runCurrent.setEnabled(false);
|
||||
runCurrent.setOnTriggered(this, [this] { onRunFileTriggered(); });
|
||||
|
||||
@@ -243,13 +243,13 @@ void AutotestPluginPrivate::initializeMenuEntries()
|
||||
disableTemp.setToolTip(Tr::tr("Disable scanning and other actions until explicitly rescanning, "
|
||||
"re-enabling, or restarting Qt Creator."));
|
||||
disableTemp.setCheckable(true);
|
||||
disableTemp.setContainer(Constants::MENU_ID);
|
||||
disableTemp.addToContainer(Constants::MENU_ID);
|
||||
disableTemp.setOnTriggered(this, [this](bool on) { onDisableTemporarily(on); });
|
||||
|
||||
ActionBuilder rescan(this, Constants::ACTION_SCAN_ID);
|
||||
rescan.setText(Tr::tr("Re&scan Tests"));
|
||||
rescan.setDefaultKeySequence(Tr::tr("Ctrl+Meta+T, Ctrl+Meta+S"), Tr::tr("Alt+Shift+T,Alt+S"));
|
||||
rescan.setContainer(Constants::MENU_ID);
|
||||
rescan.addToContainer(Constants::MENU_ID);
|
||||
rescan.setOnTriggered(this, [] {
|
||||
if (dd->m_testCodeParser.state() == TestCodeParser::DisabledTemporarily)
|
||||
dd->onDisableTemporarily(false); // Rescan Test should explicitly re-enable
|
||||
@@ -298,14 +298,14 @@ void AutotestPlugin::extensionsInitialized()
|
||||
runTest.setText(Tr::tr("&Run Test"));
|
||||
runTest.setEnabled(false);
|
||||
runTest.setIcon(Utils::Icons::RUN_SMALL.icon());
|
||||
runTest.setContainer(menuId);
|
||||
runTest.addToContainer(menuId);
|
||||
runTest.setOnTriggered([] { dd->onRunUnderCursorTriggered(TestRunMode::Run); });
|
||||
|
||||
ActionBuilder runTestNoDeploy(this, Constants::ACTION_RUN_UCURSOR_NODEPLOY);
|
||||
runTestNoDeploy.setText(Tr::tr("Run Test Without Deployment"));
|
||||
runTestNoDeploy.setIcon(Utils::Icons::RUN_SMALL.icon());
|
||||
runTestNoDeploy.setEnabled(false);
|
||||
runTestNoDeploy.setContainer(menuId);
|
||||
runTestNoDeploy.addToContainer(menuId);
|
||||
runTestNoDeploy.setOnTriggered(
|
||||
[] { dd->onRunUnderCursorTriggered(TestRunMode::RunWithoutDeploy); });
|
||||
|
||||
@@ -313,14 +313,14 @@ void AutotestPlugin::extensionsInitialized()
|
||||
debugTest.setText(Tr::tr("&Debug Test"));
|
||||
debugTest.setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL.icon());
|
||||
debugTest.setEnabled(false);
|
||||
debugTest.setContainer(menuId);
|
||||
debugTest.addToContainer(menuId);
|
||||
debugTest.setOnTriggered([] { dd->onRunUnderCursorTriggered(TestRunMode::Debug); });
|
||||
|
||||
ActionBuilder debugTestNoDeploy(this, Constants::ACTION_RUN_DBG_UCURSOR_NODEPLOY);
|
||||
debugTestNoDeploy.setText(Tr::tr("Debug Test Without Deployment"));
|
||||
debugTestNoDeploy.setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL.icon());
|
||||
debugTestNoDeploy.setEnabled(false);
|
||||
debugTestNoDeploy.setContainer(menuId);
|
||||
debugTestNoDeploy.addToContainer(menuId);
|
||||
debugTestNoDeploy.setOnTriggered(
|
||||
[] { dd->onRunUnderCursorTriggered(TestRunMode::DebugWithoutDeploy); });
|
||||
}
|
||||
|
@@ -361,7 +361,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
annotateFile.setContext(context);
|
||||
annotateFile.bindContextAction(&m_annotateFile);
|
||||
annotateFile.setCommandAttribute(Command::CA_UpdateText);
|
||||
annotateFile.setContainer(bazaarMenuId);
|
||||
annotateFile.addToContainer(bazaarMenuId);
|
||||
annotateFile.setOnTriggered(this, [this] { annotateCurrentFile(); });
|
||||
m_commandLocator->appendCommand(annotateFile.command());
|
||||
|
||||
@@ -371,7 +371,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
diffFile.bindContextAction(&m_diffFile);
|
||||
diffFile.setCommandAttribute(Command::CA_UpdateText);
|
||||
diffFile.setDefaultKeySequence(Tr::tr("Meta+Z,Meta+D"), Tr::tr("Alt+Z,Alt+D"));
|
||||
diffFile.setContainer(bazaarMenuId);
|
||||
diffFile.addToContainer(bazaarMenuId);
|
||||
diffFile.setOnTriggered(this, [this] { diffCurrentFile(); });
|
||||
m_commandLocator->appendCommand(diffFile.command());
|
||||
|
||||
@@ -381,7 +381,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
logFile.bindContextAction(&m_logFile);
|
||||
logFile.setCommandAttribute(Command::CA_UpdateText);
|
||||
logFile.setDefaultKeySequence(Tr::tr("Meta+Z,Meta+L"), Tr::tr("Alt+Z,Alt+L"));
|
||||
logFile.setContainer(bazaarMenuId);
|
||||
logFile.addToContainer(bazaarMenuId);
|
||||
logFile.setOnTriggered(this, [this] { logCurrentFile(); });
|
||||
m_commandLocator->appendCommand(logFile.command());
|
||||
|
||||
@@ -391,7 +391,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
statusFile.bindContextAction(&m_statusFile);
|
||||
statusFile.setCommandAttribute(Command::CA_UpdateText);
|
||||
statusFile.setDefaultKeySequence(Tr::tr("Meta+Z,Meta+S"), Tr::tr("Alt+Z,Alt+S"));
|
||||
statusFile.setContainer(bazaarMenuId);
|
||||
statusFile.addToContainer(bazaarMenuId);
|
||||
statusFile.setOnTriggered(this, [this] { statusCurrentFile(); });
|
||||
m_commandLocator->appendCommand(statusFile.command());
|
||||
|
||||
@@ -402,7 +402,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
addAction.setParameterText(Tr::tr("Add \"%1\""), Tr::tr("Add"));
|
||||
addAction.setContext(context);
|
||||
addAction.setCommandAttribute(Command::CA_UpdateText);
|
||||
addAction.setContainer(bazaarMenuId);
|
||||
addAction.addToContainer(bazaarMenuId);
|
||||
addAction.setOnTriggered(this, [this] { addCurrentFile(); });
|
||||
m_commandLocator->appendCommand(addAction.command());
|
||||
|
||||
@@ -411,7 +411,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
deleteAction.setContext(context);
|
||||
deleteAction.bindContextAction(&m_deleteAction);
|
||||
deleteAction.setCommandAttribute(Command::CA_UpdateText);
|
||||
deleteAction.setContainer(bazaarMenuId);
|
||||
deleteAction.addToContainer(bazaarMenuId);
|
||||
deleteAction.setOnTriggered(this, [this] { promptToDeleteCurrentFile(); });
|
||||
m_commandLocator->appendCommand(deleteAction.command());
|
||||
|
||||
@@ -420,7 +420,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
revertFile.setContext(context);
|
||||
revertFile.bindContextAction(&m_revertFile);
|
||||
revertFile.setCommandAttribute(Command::CA_UpdateText);
|
||||
revertFile.setContainer(bazaarMenuId);
|
||||
revertFile.addToContainer(bazaarMenuId);
|
||||
revertFile.setOnTriggered(this, [this] { revertCurrentFile(); });
|
||||
m_commandLocator->appendCommand(revertFile.command());
|
||||
|
||||
@@ -431,7 +431,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
ActionBuilder diffMulti(this, DIFFMULTI);
|
||||
diffMulti.setText(Tr::tr("Diff"));
|
||||
diffMulti.setContext(context);
|
||||
diffMulti.setContainer(bazaarMenuId);
|
||||
diffMulti.addToContainer(bazaarMenuId);
|
||||
diffMulti.setOnTriggered(this, [this] { diffRepository(); });
|
||||
m_repositoryActionList.append(diffMulti.contextAction());
|
||||
m_commandLocator->appendCommand(diffMulti.command());
|
||||
@@ -439,7 +439,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
ActionBuilder logMulti(this, LOGMULTI);
|
||||
logMulti.setText(Tr::tr("Log"));
|
||||
logMulti.setContext(context);
|
||||
logMulti.setContainer(bazaarMenuId);
|
||||
logMulti.addToContainer(bazaarMenuId);
|
||||
logMulti.setOnTriggered(this, [this] { logRepository(); });
|
||||
m_repositoryActionList.append(logMulti.contextAction());
|
||||
m_commandLocator->appendCommand(logMulti.command());
|
||||
@@ -447,7 +447,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
ActionBuilder revertMulti(this, REVERTMULTI);
|
||||
revertMulti.setText(Tr::tr("Revert..."));
|
||||
revertMulti.setContext(context);
|
||||
revertMulti.setContainer(bazaarMenuId);
|
||||
revertMulti.addToContainer(bazaarMenuId);
|
||||
revertMulti.setOnTriggered(this, [this] { revertAll(); });
|
||||
m_repositoryActionList.append(revertMulti.contextAction());
|
||||
m_commandLocator->appendCommand(revertMulti.command());
|
||||
@@ -455,7 +455,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
ActionBuilder statusMulti(this, STATUSMULTI);
|
||||
statusMulti.setText(Tr::tr("Status"));
|
||||
statusMulti.setContext(context);
|
||||
statusMulti.setContainer(bazaarMenuId);
|
||||
statusMulti.addToContainer(bazaarMenuId);
|
||||
statusMulti.setOnTriggered(this, [this] { this->statusMulti(); });
|
||||
m_repositoryActionList.append(statusMulti.contextAction());
|
||||
m_commandLocator->appendCommand(statusMulti.command());
|
||||
@@ -467,7 +467,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
ActionBuilder pull(this, PULL);
|
||||
pull.setText(Tr::tr("Pull..."));
|
||||
pull.setContext(context);
|
||||
pull.setContainer(bazaarMenuId);
|
||||
pull.addToContainer(bazaarMenuId);
|
||||
pull.setOnTriggered(this, [this] { this->pull(); });
|
||||
m_repositoryActionList.append(pull.contextAction());
|
||||
m_commandLocator->appendCommand(pull.command());
|
||||
@@ -475,7 +475,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
ActionBuilder push(this, PUSH);
|
||||
push.setText(Tr::tr("Push..."));
|
||||
push.setContext(context);
|
||||
push.setContainer(bazaarMenuId);
|
||||
push.addToContainer(bazaarMenuId);
|
||||
push.setOnTriggered(this, [this] { this->push(); });
|
||||
m_repositoryActionList.append(push.contextAction());
|
||||
m_commandLocator->appendCommand(push.command());
|
||||
@@ -483,7 +483,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
ActionBuilder update(this, UPDATE);
|
||||
update.setText(Tr::tr("Update..."));
|
||||
update.setContext(context);
|
||||
update.setContainer(bazaarMenuId);
|
||||
update.addToContainer(bazaarMenuId);
|
||||
update.setOnTriggered(this, [this] { this->update(); });
|
||||
m_repositoryActionList.append(update.contextAction());
|
||||
m_commandLocator->appendCommand(update.command());
|
||||
@@ -491,7 +491,7 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
ActionBuilder commit(this, COMMIT);
|
||||
commit.setText(Tr::tr("Commit..."));
|
||||
commit.setContext(context);
|
||||
commit.setContainer(bazaarMenuId);
|
||||
commit.addToContainer(bazaarMenuId);
|
||||
commit.setDefaultKeySequence(Tr::tr("Meta+Z,Meta+C"), Tr::tr("Alt+Z,Alt+C"));
|
||||
commit.setOnTriggered(this, [this] { this->commit(); });
|
||||
m_repositoryActionList.append(commit.contextAction());
|
||||
@@ -500,14 +500,14 @@ BazaarPluginPrivate::BazaarPluginPrivate()
|
||||
ActionBuilder uncommit(this, UNCOMMIT);
|
||||
uncommit.setText(Tr::tr("Uncommit..."));
|
||||
uncommit.setContext(context);
|
||||
uncommit.setContainer(bazaarMenuId);
|
||||
uncommit.addToContainer(bazaarMenuId);
|
||||
uncommit.setOnTriggered(this, [this] { this->uncommit(); });
|
||||
m_repositoryActionList.append(uncommit.contextAction());
|
||||
m_commandLocator->appendCommand(uncommit.command());
|
||||
|
||||
ActionBuilder createRepository(this, CREATE_REPOSITORY);
|
||||
createRepository.setText(Tr::tr("Create Repository..."));
|
||||
createRepository.setContainer(bazaarMenuId);
|
||||
createRepository.addToContainer(bazaarMenuId);
|
||||
createRepository.setOnTriggered(this, [this] { this->createRepository(); });
|
||||
|
||||
bazaarMenu->addSeparator(context);
|
||||
|
@@ -246,7 +246,7 @@ public:
|
||||
Core::ActionBuilder formatFile(this, "ArtisticStyle.FormatFile");
|
||||
formatFile.setText(msgFormatCurrentFile());
|
||||
formatFile.bindContextAction(&m_formatFile);
|
||||
formatFile.setContainer(menuId);
|
||||
formatFile.addToContainer(menuId);
|
||||
formatFile.setOnTriggered(this, [this] { this->formatFile(); });
|
||||
|
||||
Core::ActionManager::actionContainer(Constants::MENU_ID)->addMenu(menu);
|
||||
|
@@ -322,25 +322,25 @@ public:
|
||||
Core::ActionBuilder formatFile(this, "ClangFormat.FormatFile");
|
||||
formatFile.setText(msgFormatCurrentFile());
|
||||
formatFile.bindContextAction(&m_formatFile);
|
||||
formatFile.setContainer(menuId);
|
||||
formatFile.addToContainer(menuId);
|
||||
formatFile.setOnTriggered(this, [this] { this->formatFile(); });
|
||||
|
||||
Core::ActionBuilder formatLines(this, "ClangFormat.FormatLines");
|
||||
formatLines.setText(msgFormatLines());
|
||||
formatLines.bindContextAction(&m_formatLines);
|
||||
formatLines.setContainer(menuId);
|
||||
formatLines.addToContainer(menuId);
|
||||
formatLines.setOnTriggered(this, [this] { this->formatLines(); });
|
||||
|
||||
Core::ActionBuilder formatAtCursor(this, "ClangFormat.FormatAtCursor");
|
||||
formatAtCursor.setText(msgFormatAtCursor());
|
||||
formatAtCursor.bindContextAction(&m_formatRange);
|
||||
formatAtCursor.setContainer(menuId);
|
||||
formatAtCursor.addToContainer(menuId);
|
||||
formatAtCursor.setOnTriggered(this, [this] { this->formatAtCursor(); });
|
||||
|
||||
Core::ActionBuilder formatDisable(this, "ClangFormat.DisableFormattingSelectedText");
|
||||
formatDisable.setText(msgDisableFormattingSelectedText());
|
||||
formatDisable.bindContextAction(&m_disableFormattingSelectedText);
|
||||
formatDisable.setContainer(menuId);
|
||||
formatDisable.addToContainer(menuId);
|
||||
formatDisable.setOnTriggered(this, [this] { disableFormattingSelectedText(); });
|
||||
|
||||
Core::ActionManager::actionContainer(Constants::MENU_ID)->addMenu(menu);
|
||||
|
@@ -242,13 +242,13 @@ public:
|
||||
Core::ActionBuilder formatFile(this, "Uncrustify.FormatFile");
|
||||
formatFile.setText(msgFormatCurrentFile());
|
||||
formatFile.bindContextAction(&m_formatFile);
|
||||
formatFile.setContainer(menuId);
|
||||
formatFile.addToContainer(menuId);
|
||||
formatFile.setOnTriggered(this, [this] { this->formatFile(); });
|
||||
|
||||
Core::ActionBuilder formatRange(this, "Uncrustify.FormatSelectedText");
|
||||
formatRange.setText(msgFormatSelectedText());
|
||||
formatRange.bindContextAction(&m_formatRange);
|
||||
formatRange.setContainer(menuId);
|
||||
formatRange.addToContainer(menuId);
|
||||
formatRange.setOnTriggered(this, [this] { this->formatSelectedText(); });
|
||||
|
||||
Core::ActionManager::actionContainer(Constants::MENU_ID)->addMenu(menu);
|
||||
|
@@ -84,7 +84,7 @@ void registerFlashAction(QObject *parentForAction)
|
||||
|
||||
ActionBuilder flashAction(parentForAction, flashActionId);
|
||||
flashAction.setText(Tr::tr("Flash Boot to Qt Device"));
|
||||
flashAction.setContainer(Core::Constants::M_TOOLS, flashActionId);
|
||||
flashAction.addToContainer(Core::Constants::M_TOOLS, flashActionId);
|
||||
flashAction.setOnTriggered(&startFlashingWizard);
|
||||
}
|
||||
|
||||
|
@@ -87,8 +87,8 @@ void ClangCodeModelPlugin::initialize()
|
||||
ActionBuilder updateStaleIndexEntries(this, "ClangCodeModel.UpdateStaleIndexEntries");
|
||||
updateStaleIndexEntries.setText(Tr::tr("Update Potentially Stale Clangd Index Entries"));
|
||||
updateStaleIndexEntries.setOnTriggered(this, &ClangModelManagerSupport::updateStaleIndexEntries);
|
||||
updateStaleIndexEntries.setContainer(CppEditor::Constants::M_TOOLS_CPP);
|
||||
updateStaleIndexEntries.setContainer(CppEditor::Constants::M_CONTEXT);
|
||||
updateStaleIndexEntries.addToContainer(CppEditor::Constants::M_TOOLS_CPP);
|
||||
updateStaleIndexEntries.addToContainer(CppEditor::Constants::M_CONTEXT);
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
addTest<Tests::ActivationSequenceProcessorTest>();
|
||||
|
@@ -75,7 +75,7 @@ void ClangFormatPlugin::initialize()
|
||||
|
||||
ActionBuilder openConfig(this, Constants::OPEN_CURRENT_CONFIG_ID);
|
||||
openConfig.setText(Tr::tr("Open Used .clang-format Configuration File"));
|
||||
openConfig.setContainer(CppEditor::Constants::M_CONTEXT);
|
||||
openConfig.addToContainer(CppEditor::Constants::M_CONTEXT);
|
||||
openConfig.setOnTriggered([action=openConfig.contextAction()] {
|
||||
const FilePath fileName = FilePath::fromVariant(action->data());
|
||||
if (!fileName.isEmpty())
|
||||
|
@@ -61,14 +61,14 @@ CMakeManager::CMakeManager()
|
||||
runCMakeAction.setIcon(ProjectExplorer::Icons::CMAKE_LOGO.icon());
|
||||
runCMakeAction.bindContextAction(&m_runCMakeAction);
|
||||
runCMakeAction.setCommandAttribute(Command::CA_Hide);
|
||||
runCMakeAction.setContainer(PEC::M_BUILDPROJECT, PEC::G_BUILD_BUILD);
|
||||
runCMakeAction.addToContainer(PEC::M_BUILDPROJECT, PEC::G_BUILD_BUILD);
|
||||
runCMakeAction.setOnTriggered(this, [this] { runCMake(ProjectManager::startupBuildSystem()); });
|
||||
|
||||
ActionBuilder clearCMakeCacheAction(this, Constants::CLEAR_CMAKE_CACHE);
|
||||
clearCMakeCacheAction.setText(Tr::tr("Clear CMake Configuration"));
|
||||
clearCMakeCacheAction.bindContextAction(&m_clearCMakeCacheAction);
|
||||
clearCMakeCacheAction.setCommandAttribute(Command::CA_Hide);
|
||||
clearCMakeCacheAction.setContainer(PEC::M_BUILDPROJECT, PEC::G_BUILD_BUILD);
|
||||
clearCMakeCacheAction.addToContainer(PEC::M_BUILDPROJECT, PEC::G_BUILD_BUILD);
|
||||
clearCMakeCacheAction.setOnTriggered(this, [this] {
|
||||
clearCMakeCache(ProjectManager::startupBuildSystem());
|
||||
});
|
||||
@@ -79,7 +79,7 @@ CMakeManager::CMakeManager()
|
||||
runCMakeActionContextMenu.setContext(projectContext);
|
||||
runCMakeActionContextMenu.bindContextAction(&m_runCMakeActionContextMenu);
|
||||
runCMakeActionContextMenu.setCommandAttribute(Command::CA_Hide);
|
||||
runCMakeActionContextMenu.setContainer(PEC::M_PROJECTCONTEXT, PEC::G_PROJECT_BUILD);
|
||||
runCMakeActionContextMenu.addToContainer(PEC::M_PROJECTCONTEXT, PEC::G_PROJECT_BUILD);
|
||||
runCMakeActionContextMenu.setOnTriggered(this, [this] {
|
||||
runCMake(ProjectTree::currentBuildSystem());
|
||||
});
|
||||
@@ -89,14 +89,14 @@ CMakeManager::CMakeManager()
|
||||
buildFileContextAction.bindContextAction(&m_buildFileContextMenu);
|
||||
buildFileContextAction.setContext(projectContext);
|
||||
buildFileContextAction.setCommandAttribute(Command::CA_Hide);
|
||||
buildFileContextAction.setContainer(PEC::M_FILECONTEXT, PEC::G_FILE_OTHER);
|
||||
buildFileContextAction.addToContainer(PEC::M_FILECONTEXT, PEC::G_FILE_OTHER);
|
||||
buildFileContextAction.setOnTriggered(this, [this] { buildFileContextMenu(); });
|
||||
|
||||
ActionBuilder rescanProjectAction(this, Constants::RESCAN_PROJECT);
|
||||
rescanProjectAction.setText(Tr::tr("Rescan Project"));
|
||||
rescanProjectAction.bindContextAction(&m_rescanProjectAction);
|
||||
rescanProjectAction.setCommandAttribute(Command::CA_Hide);
|
||||
rescanProjectAction.setContainer(PEC::M_BUILDPROJECT, PEC::G_BUILD_BUILD);
|
||||
rescanProjectAction.addToContainer(PEC::M_BUILDPROJECT, PEC::G_BUILD_BUILD);
|
||||
rescanProjectAction.setOnTriggered(this, [this] {
|
||||
rescanProject(ProjectTree::currentBuildSystem());
|
||||
});
|
||||
@@ -106,7 +106,7 @@ CMakeManager::CMakeManager()
|
||||
reloadCMakePresetsAction.setIcon(Utils::Icons::RELOAD.icon());
|
||||
reloadCMakePresetsAction.bindContextAction(&m_reloadCMakePresetsAction);
|
||||
reloadCMakePresetsAction.setCommandAttribute(Command::CA_Hide);
|
||||
reloadCMakePresetsAction.setContainer(PEC::M_BUILDPROJECT, PEC::G_BUILD_BUILD);
|
||||
reloadCMakePresetsAction.addToContainer(PEC::M_BUILDPROJECT, PEC::G_BUILD_BUILD);
|
||||
reloadCMakePresetsAction.setOnTriggered(this, [this] { reloadCMakePresets(); });
|
||||
|
||||
m_buildFileAction = new Utils::ParameterAction(Tr::tr("Build File"),
|
||||
@@ -128,7 +128,7 @@ CMakeManager::CMakeManager()
|
||||
cmakeProfilerAction.setText(Tr::tr("CMake Profiler"));
|
||||
cmakeProfilerAction.bindContextAction(&m_cmakeProfilerAction);
|
||||
cmakeProfilerAction.setCommandDescription(m_cmakeProfilerAction->text());
|
||||
cmakeProfilerAction.setContainer(Debugger::Constants::M_DEBUG_ANALYZER,
|
||||
cmakeProfilerAction.addToContainer(Debugger::Constants::M_DEBUG_ANALYZER,
|
||||
Debugger::Constants::G_ANALYZER_TOOLS,
|
||||
false);
|
||||
cmakeProfilerAction.setOnTriggered(this, [this] {
|
||||
@@ -147,7 +147,7 @@ CMakeManager::CMakeManager()
|
||||
cmakeDebuggerAction.setIcon(ProjectExplorer::Icons::CMAKE_LOGO.icon());
|
||||
cmakeDebuggerAction.bindContextAction(&m_cmakeDebuggerAction);
|
||||
cmakeDebuggerAction.setCommandDescription(m_cmakeDebuggerAction->text());
|
||||
cmakeDebuggerAction.setContainer(PEC::M_DEBUG_STARTDEBUGGING, Constants::CMAKE_DEBUGGING_GROUP);
|
||||
cmakeDebuggerAction.addToContainer(PEC::M_DEBUG_STARTDEBUGGING, Constants::CMAKE_DEBUGGING_GROUP);
|
||||
cmakeDebuggerAction.setOnTriggered(this, [] {
|
||||
ProjectExplorerPlugin::runStartupProject(PEC::DAP_CMAKE_DEBUG_RUN_MODE,
|
||||
/*forceSkipDeploy=*/true);
|
||||
|
@@ -131,7 +131,7 @@ void ActionBuilder::setCommandDescription(const QString &desc)
|
||||
d->command->setDescription(desc);
|
||||
}
|
||||
|
||||
void ActionBuilder::setContainer(Id containerId, Id groupId, bool needsToExist)
|
||||
void ActionBuilder::addToContainer(Id containerId, Id groupId, bool needsToExist)
|
||||
{
|
||||
QTC_ASSERT(containerId.isValid(), return);
|
||||
if (ActionContainer *container = ActionManager::actionContainer(containerId)) {
|
||||
|
@@ -42,7 +42,7 @@ public:
|
||||
void setToolTip(const QString &toolTip);
|
||||
void setCommandAttribute(Core::Command::CommandAttribute attr);
|
||||
void setCommandDescription(const QString &desc);
|
||||
void setContainer(Utils::Id containerId, Utils::Id groupId = {}, bool needsToExist = true);
|
||||
void addToContainer(Utils::Id containerId, Utils::Id groupId = {}, bool needsToExist = true);
|
||||
void setOnTriggered(const std::function<void()> &func);
|
||||
|
||||
template<class T, typename F>
|
||||
|
@@ -422,7 +422,7 @@ void EditorManagerPrivate::init()
|
||||
revertToSaved.bindContextAction(&m_revertToSavedAction);
|
||||
revertToSaved.setCommandAttribute(Command::CA_UpdateText);
|
||||
revertToSaved.setCommandDescription(::Core::Tr::tr("Revert File to Saved"));
|
||||
revertToSaved.setContainer(Constants::M_FILE, Constants::G_FILE_SAVE);
|
||||
revertToSaved.addToContainer(Constants::M_FILE, Constants::G_FILE_SAVE);
|
||||
revertToSaved.setOnTriggered(this, &EditorManager::revertToSaved);
|
||||
|
||||
// Save Action
|
||||
@@ -452,7 +452,7 @@ void EditorManagerPrivate::init()
|
||||
closeCurrentEditor.setDefaultKeySequence(::Core::Tr::tr("Ctrl+W"));
|
||||
closeCurrentEditor.setCommandAttribute(Command::CA_UpdateText);
|
||||
closeCurrentEditor.setCommandDescription(m_closeCurrentEditorAction->text());
|
||||
closeCurrentEditor.setContainer(Constants::M_FILE, Constants::G_FILE_CLOSE);
|
||||
closeCurrentEditor.addToContainer(Constants::M_FILE, Constants::G_FILE_CLOSE);
|
||||
closeCurrentEditor.setOnTriggered(this, &EditorManager::slotCloseCurrentEditorOrDocument);
|
||||
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
@@ -471,7 +471,7 @@ void EditorManagerPrivate::init()
|
||||
closeAll.setScriptable(true);
|
||||
closeAll.bindContextAction(&m_closeAllEditorsAction);
|
||||
closeAll.setDefaultKeySequence(::Core::Tr::tr("Ctrl+Shift+W"));
|
||||
closeAll.setContainer(Constants::M_FILE, Constants::G_FILE_CLOSE);
|
||||
closeAll.addToContainer(Constants::M_FILE, Constants::G_FILE_CLOSE);
|
||||
closeAll.setOnTriggered(this, &EditorManager::closeAllDocuments);
|
||||
|
||||
// Close All Others Action
|
||||
@@ -480,7 +480,7 @@ void EditorManagerPrivate::init()
|
||||
closeOthers.bindContextAction(&m_closeOtherDocumentsAction);
|
||||
closeOthers.setContext(editManagerContext);
|
||||
closeOthers.setScriptable(true);
|
||||
closeOthers.setContainer(Constants::M_FILE, Constants::G_FILE_CLOSE);
|
||||
closeOthers.addToContainer(Constants::M_FILE, Constants::G_FILE_CLOSE);
|
||||
closeOthers.setCommandAttribute(Command::CA_UpdateText);
|
||||
closeOthers.setOnTriggered(this, [] { EditorManager::closeOtherDocuments(); });
|
||||
|
||||
@@ -490,7 +490,7 @@ void EditorManagerPrivate::init()
|
||||
closeAllExceptVisible.bindContextAction(&m_closeAllEditorsExceptVisibleAction);
|
||||
closeAllExceptVisible.setContext(editManagerContext);
|
||||
closeAllExceptVisible.setScriptable(true);
|
||||
closeAllExceptVisible.setContainer(Constants::M_FILE, Constants::G_FILE_CLOSE);
|
||||
closeAllExceptVisible.addToContainer(Constants::M_FILE, Constants::G_FILE_CLOSE);
|
||||
closeAllExceptVisible.setOnTriggered(this, &EditorManagerPrivate::closeAllEditorsExceptVisible);
|
||||
|
||||
ActionBuilder openGraphicalShell(this, Constants::SHOWINGRAPHICALSHELL);
|
||||
@@ -567,7 +567,7 @@ void EditorManagerPrivate::init()
|
||||
gotoPrevInHistory.bindContextAction(&m_gotoPreviousDocHistoryAction);
|
||||
gotoPrevInHistory.setContext(editDesignContext);
|
||||
gotoPrevInHistory.setDefaultKeySequence(::Core::Tr::tr("Alt+Tab"), ::Core::Tr::tr("Ctrl+Tab"));
|
||||
gotoPrevInHistory.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_NAVIGATE);
|
||||
gotoPrevInHistory.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_NAVIGATE);
|
||||
gotoPrevInHistory.setOnTriggered(this, &EditorManagerPrivate::gotoPreviousDocHistory);
|
||||
|
||||
// Goto Next In History Action
|
||||
@@ -576,7 +576,7 @@ void EditorManagerPrivate::init()
|
||||
gotoNextInHistory.bindContextAction(&m_gotoNextDocHistoryAction);
|
||||
gotoNextInHistory.setContext(editDesignContext);
|
||||
gotoNextInHistory.setDefaultKeySequence(::Core::Tr::tr("Alt+Shift+Tab"), ::Core::Tr::tr("Ctrl+Shift+Tab"));
|
||||
gotoNextInHistory.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_NAVIGATE);
|
||||
gotoNextInHistory.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_NAVIGATE);
|
||||
gotoNextInHistory.setOnTriggered(this, &EditorManagerPrivate::gotoNextDocHistory);
|
||||
|
||||
// Go back in navigation history
|
||||
@@ -586,7 +586,7 @@ void EditorManagerPrivate::init()
|
||||
goBack.bindContextAction(&m_goBackAction);
|
||||
goBack.setContext(editDesignContext);
|
||||
goBack.setDefaultKeySequence(::Core::Tr::tr("Ctrl+Alt+Left"), ::Core::Tr::tr("Alt+Left"));
|
||||
goBack.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_NAVIGATE);
|
||||
goBack.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_NAVIGATE);
|
||||
goBack.setOnTriggered(this, &EditorManager::goBackInNavigationHistory);
|
||||
|
||||
// Go forward in navigation history
|
||||
@@ -596,7 +596,7 @@ void EditorManagerPrivate::init()
|
||||
goForward.bindContextAction(&m_goForwardAction);
|
||||
goForward.setContext(editDesignContext);
|
||||
goForward.setDefaultKeySequence(::Core::Tr::tr("Ctrl+Alt+Right"), ::Core::Tr::tr("Alt+Right"));
|
||||
goForward.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_NAVIGATE);
|
||||
goForward.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_NAVIGATE);
|
||||
goForward.setOnTriggered(this, &EditorManager::goForwardInNavigationHistory);
|
||||
|
||||
// Go to last edit
|
||||
@@ -604,7 +604,7 @@ void EditorManagerPrivate::init()
|
||||
gotoLastEdit.setText(::Core::Tr::tr("Go to Last Edit"));
|
||||
gotoLastEdit.bindContextAction(&m_gotoLastEditAction);
|
||||
gotoLastEdit.setContext(editDesignContext);
|
||||
gotoLastEdit.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_NAVIGATE);
|
||||
gotoLastEdit.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_NAVIGATE);
|
||||
gotoLastEdit.setOnTriggered(this, &EditorManagerPrivate::gotoLastEditLocation);
|
||||
|
||||
ActionBuilder split(this, Constants::SPLIT);
|
||||
@@ -613,7 +613,7 @@ void EditorManagerPrivate::init()
|
||||
split.bindContextAction(&m_splitAction);
|
||||
split.setContext(editManagerContext);
|
||||
split.setDefaultKeySequence(::Core::Tr::tr("Meta+E,2"), ::Core::Tr::tr("Ctrl+E,2"));
|
||||
split.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
split.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
split.setOnTriggered(this, [this] { this->split(Qt::Vertical); });
|
||||
|
||||
ActionBuilder splitSideBySide(this, Constants::SPLIT_SIDE_BY_SIDE);
|
||||
@@ -622,7 +622,7 @@ void EditorManagerPrivate::init()
|
||||
splitSideBySide.bindContextAction(&m_splitSideBySideAction);
|
||||
splitSideBySide.setContext(editManagerContext);
|
||||
splitSideBySide.setDefaultKeySequence(::Core::Tr::tr("Meta+E,3"), Core::Tr::tr("Ctrl+E,3"));
|
||||
splitSideBySide.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
splitSideBySide.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
splitSideBySide.setOnTriggered(this, &EditorManager::splitSideBySide);
|
||||
|
||||
ActionBuilder splitNewWindow(this, Constants::SPLIT_NEW_WINDOW);
|
||||
@@ -630,7 +630,7 @@ void EditorManagerPrivate::init()
|
||||
splitNewWindow.bindContextAction(&m_splitNewWindowAction);
|
||||
splitNewWindow.setContext(editManagerContext);
|
||||
splitNewWindow.setDefaultKeySequence(::Core::Tr::tr("Meta+E,4"), ::Core::Tr::tr("Ctrl+E,4"));
|
||||
splitNewWindow.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
splitNewWindow.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
splitNewWindow.setOnTriggered(this, [this] { this->splitNewWindow(currentEditorView()); });
|
||||
|
||||
ActionBuilder removeCurrentSplit(this, Constants::REMOVE_CURRENT_SPLIT);
|
||||
@@ -638,7 +638,7 @@ void EditorManagerPrivate::init()
|
||||
removeCurrentSplit.bindContextAction(&m_removeCurrentSplitAction);
|
||||
removeCurrentSplit.setContext(editManagerContext);
|
||||
removeCurrentSplit.setDefaultKeySequence(::Core::Tr::tr("Meta+E,0"), ::Core::Tr::tr("Ctrl+E,0"));
|
||||
removeCurrentSplit.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
removeCurrentSplit.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
removeCurrentSplit.setOnTriggered(this, &EditorManagerPrivate::removeCurrentSplit);
|
||||
|
||||
ActionBuilder removeAllSplits(this, Constants::REMOVE_ALL_SPLITS);
|
||||
@@ -646,7 +646,7 @@ void EditorManagerPrivate::init()
|
||||
removeAllSplits.bindContextAction(&m_removeAllSplitsAction);
|
||||
removeAllSplits.setContext(editManagerContext);
|
||||
removeAllSplits.setDefaultKeySequence(::Core::Tr::tr("Meta+E,1"), ::Core::Tr::tr("Ctrl+E,1"));
|
||||
removeAllSplits.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
removeAllSplits.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
removeAllSplits.setOnTriggered(this, &EditorManagerPrivate::removeAllSplits);
|
||||
|
||||
ActionBuilder gotoPreviousSplit(this, Constants::GOTO_PREV_SPLIT);
|
||||
@@ -654,7 +654,7 @@ void EditorManagerPrivate::init()
|
||||
gotoPreviousSplit.bindContextAction(&m_gotoPreviousSplitAction);
|
||||
gotoPreviousSplit.setContext(editManagerContext);
|
||||
gotoPreviousSplit.setDefaultKeySequence(::Core::Tr::tr("Meta+E,i"), ::Core::Tr::tr("Ctrl+E,i"));
|
||||
gotoPreviousSplit.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
gotoPreviousSplit.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
gotoPreviousSplit.setOnTriggered(this, &EditorManagerPrivate::gotoPreviousSplit);
|
||||
|
||||
ActionBuilder gotoNextSplit(this, Constants::GOTO_NEXT_SPLIT);
|
||||
@@ -662,7 +662,7 @@ void EditorManagerPrivate::init()
|
||||
gotoNextSplit.bindContextAction(&m_gotoNextSplitAction);
|
||||
gotoNextSplit.setContext(editManagerContext);
|
||||
gotoNextSplit.setDefaultKeySequence(QKeySequence(useMacShortcuts ? ::Core::Tr::tr("Meta+E,o") : ::Core::Tr::tr("Ctrl+E,o")));
|
||||
gotoNextSplit.setContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
gotoNextSplit.addToContainer(Constants::M_WINDOW, Constants::G_WINDOW_SPLIT);
|
||||
gotoNextSplit.setOnTriggered(this, &EditorManagerPrivate::gotoNextSplit);
|
||||
|
||||
ActionContainer *medit = ActionManager::actionContainer(Constants::M_EDIT);
|
||||
|
@@ -279,7 +279,7 @@ void FindPrivate::setupMenu()
|
||||
openFindDialog.setIconText(Tr::tr("Advanced..."));
|
||||
openFindDialog.bindContextAction(&m_openFindDialog);
|
||||
openFindDialog.setDefaultKeySequence(Tr::tr("Ctrl+Shift+F"));
|
||||
openFindDialog.setContainer(Constants::M_FIND_ADVANCED);
|
||||
openFindDialog.addToContainer(Constants::M_FIND_ADVANCED);
|
||||
openFindDialog.setOnTriggered(this, [] { Find::openFindDialog(nullptr); });
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ void FindPrivate::setupFilterMenuItems()
|
||||
findScope.setEnabled(isEnabled);
|
||||
findScope.setDefaultKeySequence(filter->defaultShortcut());
|
||||
findScope.setCommandAttribute(Command::CA_UpdateText);
|
||||
findScope.setContainer(Constants::M_FIND_ADVANCED);
|
||||
findScope.addToContainer(Constants::M_FIND_ADVANCED);
|
||||
findScope.setOnTriggered(this, [filter] { Find::openFindDialog(filter); });
|
||||
|
||||
QAction *findScopeAction = findScope.contextAction();
|
||||
|
@@ -257,7 +257,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
findInDocumentAction.setIcon(Icon::fromTheme("edit-find-replace"));
|
||||
findInDocumentAction.bindContextAction(&m_findInDocumentAction);
|
||||
findInDocumentAction.setDefaultKeySequence(QKeySequence::Find);
|
||||
findInDocumentAction.setContainer(Constants::M_FIND, Constants::G_FIND_CURRENTDOCUMENT);
|
||||
findInDocumentAction.addToContainer(Constants::M_FIND, Constants::G_FIND_CURRENTDOCUMENT);
|
||||
findInDocumentAction.setOnTriggered(this, [this] { openFind(); });
|
||||
|
||||
// Pressing the find shortcut while focus is in the tool bar should not change the search text,
|
||||
@@ -273,7 +273,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
ActionBuilder enterFindStringAction(this, "Find.EnterFindString");
|
||||
enterFindStringAction.setText(Tr::tr("Enter Find String"));
|
||||
enterFindStringAction.setDefaultKeySequence(Tr::tr("Ctrl+E"));
|
||||
enterFindStringAction.setContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
enterFindStringAction.addToContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
enterFindStringAction.bindContextAction(&m_enterFindStringAction);
|
||||
enterFindStringAction.setOnTriggered(this, [this] { putSelectionToFindClipboard(); });
|
||||
connect(QApplication::clipboard(), &QClipboard::findBufferChanged, this, &FindToolBar::updateFromFindClipboard);
|
||||
@@ -283,7 +283,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
findNextAction.setText(Tr::tr("Find Next"));
|
||||
findNextAction.bindContextAction(&m_findNextAction);
|
||||
findNextAction.setDefaultKeySequence(QKeySequence::FindNext);
|
||||
findNextAction.setContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
findNextAction.addToContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
findNextAction.setOnTriggered(this, [this] { invokeGlobalFindNext(); });
|
||||
|
||||
ActionBuilder localFindNextAction(this, Constants::FIND_NEXT);
|
||||
@@ -298,7 +298,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
findPreviousAction.setText(Tr::tr("Find Previous"));
|
||||
findPreviousAction.bindContextAction(&m_findPreviousAction);
|
||||
findPreviousAction.setDefaultKeySequence(QKeySequence::FindPrevious);
|
||||
findPreviousAction.setContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
findPreviousAction.addToContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
findPreviousAction.setOnTriggered(this, [this] { invokeGlobalFindPrevious(); });
|
||||
|
||||
ActionBuilder localFindPreviousAction(this, Constants::FIND_PREVIOUS);
|
||||
@@ -313,21 +313,21 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
findNextSelectedAction.setText(Tr::tr("Find Next (Selected)"));
|
||||
findNextSelectedAction.bindContextAction(&m_findNextSelectedAction);
|
||||
findNextSelectedAction.setDefaultKeySequence(Tr::tr("Ctrl+F3"));
|
||||
findNextSelectedAction.setContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
findNextSelectedAction.addToContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
findNextSelectedAction.setOnTriggered(this, [this] { findNextSelected(); });
|
||||
|
||||
ActionBuilder findPreviousSelectedAction(this, Constants::FIND_PREV_SELECTED);
|
||||
findPreviousSelectedAction.setText(Tr::tr("Find Previous (Selected)"));
|
||||
findPreviousSelectedAction.bindContextAction(&m_findPreviousSelectedAction);
|
||||
findPreviousSelectedAction.setDefaultKeySequence(Tr::tr("Ctrl+Shift+F3"));
|
||||
findPreviousSelectedAction.setContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
findPreviousSelectedAction.addToContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
findPreviousSelectedAction.setOnTriggered(this, [this] { findPreviousSelected(); });
|
||||
|
||||
ActionBuilder selectAllAction(this, Constants::FIND_SELECT_ALL);
|
||||
selectAllAction.setText(Tr::tr("Select All"));
|
||||
selectAllAction.bindContextAction(&m_selectAllAction);
|
||||
selectAllAction.setDefaultKeySequence(Tr::tr("Ctrl+Alt+Return"));
|
||||
selectAllAction.setContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
selectAllAction.addToContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
selectAllAction.setOnTriggered(this, [this] { selectAll(); });
|
||||
|
||||
ActionBuilder localSelectAllAction(this, Constants::FIND_SELECT_ALL);
|
||||
@@ -342,7 +342,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
replaceAction.setText(Tr::tr("Replace"));
|
||||
replaceAction.bindContextAction(&m_replaceAction);
|
||||
replaceAction.setDefaultKeySequence({});
|
||||
replaceAction.setContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
replaceAction.addToContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
replaceAction.setOnTriggered(this, [this] { invokeGlobalReplace(); });
|
||||
|
||||
ActionBuilder localReplaceAction(this, Constants::REPLACE);
|
||||
@@ -357,7 +357,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
replaceNextAction.setText(Tr::tr("Replace && Find"));
|
||||
replaceNextAction.bindContextAction(&m_replaceNextAction);
|
||||
replaceNextAction.setDefaultKeySequence(Tr::tr("Ctrl+="));
|
||||
replaceNextAction.setContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
replaceNextAction.addToContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
replaceNextAction.setOnTriggered(this, [this] { invokeGlobalReplaceNext(); });
|
||||
|
||||
ActionBuilder localReplaceNextAction(this, Constants::REPLACE_NEXT);
|
||||
@@ -372,7 +372,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
ActionBuilder replacePreviousAction(this, Constants::REPLACE_PREVIOUS);
|
||||
replacePreviousAction.setText(Tr::tr("Replace && Find Previous"));
|
||||
replacePreviousAction.bindContextAction(&m_replacePreviousAction);
|
||||
replacePreviousAction.setContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
replacePreviousAction.addToContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
replacePreviousAction.setOnTriggered(this, [this] { invokeGlobalReplacePrevious(); });
|
||||
|
||||
ActionBuilder localReplacePreviousAction(this, Constants::REPLACE_PREVIOUS);
|
||||
@@ -386,7 +386,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
replaceAllAction.setText(Tr::tr("Replace All"));
|
||||
replaceAllAction.bindContextAction(&m_replaceAllAction);
|
||||
replaceAllAction.setDefaultKeySequence(Tr::tr("Ctrl+Alt+Return"));
|
||||
replaceAllAction.setContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
replaceAllAction.addToContainer(Constants::M_FIND, Constants::G_FIND_ACTIONS);
|
||||
replaceAllAction.setOnTriggered(this, [this] { invokeGlobalReplaceAll(); });
|
||||
|
||||
ActionBuilder localReplaceAllAction(this, Constants::REPLACE_ALL);
|
||||
@@ -403,7 +403,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
caseSensitiveAction.setIcon(Icons::FIND_CASE_INSENSITIVELY.icon());
|
||||
caseSensitiveAction.setCheckable(true);
|
||||
caseSensitiveAction.setChecked(false);
|
||||
caseSensitiveAction.setContainer(Constants::M_FIND, Constants::G_FIND_FLAGS);
|
||||
caseSensitiveAction.addToContainer(Constants::M_FIND, Constants::G_FIND_FLAGS);
|
||||
caseSensitiveAction.setOnToggled(this, [this](bool on) { setCaseSensitive(on); });
|
||||
|
||||
ActionBuilder wholeWordAction(this, Constants::WHOLE_WORDS);
|
||||
@@ -412,7 +412,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
wholeWordAction.setIcon(Icons::FIND_WHOLE_WORD.icon());
|
||||
wholeWordAction.setCheckable(true);
|
||||
wholeWordAction.setChecked(false);
|
||||
wholeWordAction.setContainer(Constants::M_FIND, Constants::G_FIND_FLAGS);
|
||||
wholeWordAction.addToContainer(Constants::M_FIND, Constants::G_FIND_FLAGS);
|
||||
wholeWordAction.setOnToggled(this, [this](bool on) { setWholeWord(on); });
|
||||
|
||||
ActionBuilder regularExpressionAction(this, Constants::REGULAR_EXPRESSIONS);
|
||||
@@ -421,7 +421,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
regularExpressionAction.setIcon(Icons::FIND_REGEXP.icon());
|
||||
regularExpressionAction.setCheckable(true);
|
||||
regularExpressionAction.setChecked(false);
|
||||
regularExpressionAction.setContainer(Constants::M_FIND, Constants::G_FIND_FLAGS);
|
||||
regularExpressionAction.addToContainer(Constants::M_FIND, Constants::G_FIND_FLAGS);
|
||||
regularExpressionAction.setOnToggled(this, [this](bool on) { setRegularExpressions(on); });
|
||||
|
||||
ActionBuilder preserveCaseAction(this, Constants::PRESERVE_CASE);
|
||||
@@ -430,7 +430,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
||||
preserveCaseAction.setIcon(Icons::FIND_PRESERVE_CASE.icon());
|
||||
preserveCaseAction.setCheckable(true);
|
||||
preserveCaseAction.setChecked(false);
|
||||
preserveCaseAction.setContainer(Constants::M_FIND, Constants::G_FIND_FLAGS);
|
||||
preserveCaseAction.addToContainer(Constants::M_FIND, Constants::G_FIND_FLAGS);
|
||||
preserveCaseAction.setOnToggled(this, [this](bool on) { setPreserveCase(on); });
|
||||
|
||||
connect(m_currentDocumentFind, &CurrentDocumentFind::candidateChanged,
|
||||
|
@@ -1628,7 +1628,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
newProjectAction.setText(Tr::tr("&New Project..."));
|
||||
newProjectAction.setIcon(Icon::fromTheme("document-new"));
|
||||
newProjectAction.setDefaultKeySequence(QKeySequence("Ctrl+Shift+N"));
|
||||
newProjectAction.setContainer(Constants::M_FILE, Constants::G_FILE_NEW);
|
||||
newProjectAction.addToContainer(Constants::M_FILE, Constants::G_FILE_NEW);
|
||||
newProjectAction.setOnTriggered(this, [] {
|
||||
if (!ICore::isNewItemDialogRunning()) {
|
||||
ICore::showNewItemDialog(
|
||||
@@ -1647,7 +1647,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
newFileAction.setText(Tr::tr("New File..."));
|
||||
newFileAction.setIcon(Icon::fromTheme("document-new"));
|
||||
newFileAction.setDefaultKeySequence(QKeySequence::New);
|
||||
newFileAction.setContainer(Constants::M_FILE, Constants::G_FILE_NEW);
|
||||
newFileAction.addToContainer(Constants::M_FILE, Constants::G_FILE_NEW);
|
||||
newFileAction.setOnTriggered(this, [] {
|
||||
if (!ICore::isNewItemDialogRunning()) {
|
||||
ICore::showNewItemDialog(
|
||||
@@ -1666,20 +1666,20 @@ void ICorePrivate::registerDefaultActions()
|
||||
openAction.setText(Tr::tr("&Open File or Project..."));
|
||||
openAction.setIcon(Icon::fromTheme("document-open"));
|
||||
openAction.setDefaultKeySequence(QKeySequence::Open);
|
||||
openAction.setContainer(Constants::M_FILE, Constants::G_FILE_OPEN);
|
||||
openAction.addToContainer(Constants::M_FILE, Constants::G_FILE_OPEN);
|
||||
openAction.setOnTriggered(this, [] { openFile(); });
|
||||
|
||||
// Open With Action
|
||||
ActionBuilder openWithAction(this, Constants::OPEN_WITH);
|
||||
openWithAction.setText(Tr::tr("Open File &With..."));
|
||||
openWithAction.setContainer(Constants::M_FILE, Constants::G_FILE_OPEN);
|
||||
openWithAction.addToContainer(Constants::M_FILE, Constants::G_FILE_OPEN);
|
||||
openWithAction.setOnTriggered(this, &ICore::openFileWith);
|
||||
|
||||
if (FSEngine::isAvailable()) {
|
||||
// Open From Device Action
|
||||
ActionBuilder openFromDeviceAction(this, Constants::OPEN_FROM_DEVICE);
|
||||
openFromDeviceAction.setText(Tr::tr("Open From Device..."));
|
||||
openFromDeviceAction.setContainer(Constants::M_FILE, Constants::G_FILE_OPEN);
|
||||
openFromDeviceAction.addToContainer(Constants::M_FILE, Constants::G_FILE_OPEN);
|
||||
openFromDeviceAction.setOnTriggered(this, [this] { openFileFromDevice(); });
|
||||
}
|
||||
|
||||
@@ -1697,7 +1697,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
saveAction.setDefaultKeySequence(QKeySequence::Save);
|
||||
saveAction.setCommandAttribute(Command::CA_UpdateText);
|
||||
saveAction.setCommandDescription(Tr::tr("Save"));
|
||||
saveAction.setContainer(Constants::M_FILE, Constants::G_FILE_SAVE);
|
||||
saveAction.addToContainer(Constants::M_FILE, Constants::G_FILE_SAVE);
|
||||
|
||||
// Save As Action
|
||||
ActionBuilder saveAsAction(this, Constants::SAVEAS);
|
||||
@@ -1707,7 +1707,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
saveAsAction.setDefaultKeySequence(Tr::tr("Ctrl+Shift+S"), QString());
|
||||
saveAsAction.setCommandAttribute(Command::CA_UpdateText);
|
||||
saveAsAction.setCommandDescription(Tr::tr("Save As..."));
|
||||
saveAsAction.setContainer(Constants::M_FILE, Constants::G_FILE_SAVE);
|
||||
saveAsAction.addToContainer(Constants::M_FILE, Constants::G_FILE_SAVE);
|
||||
|
||||
// SaveAll Action
|
||||
DocumentManager::registerSaveAllAction();
|
||||
@@ -1718,7 +1718,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
printAction.setIcon(Icon::fromTheme("document-print"));
|
||||
printAction.setEnabled(false);
|
||||
printAction.setDefaultKeySequence(QKeySequence::Print);
|
||||
printAction.setContainer(Constants::M_FILE, Constants::G_FILE_PRINT);
|
||||
printAction.addToContainer(Constants::M_FILE, Constants::G_FILE_PRINT);
|
||||
|
||||
// Exit Action
|
||||
ActionBuilder exitAction(this, Constants::EXIT);
|
||||
@@ -1726,7 +1726,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
exitAction.setIcon(Icon::fromTheme("application-exit"));
|
||||
exitAction.setMenuRole(QAction::QuitRole);
|
||||
exitAction.setDefaultKeySequence(Tr::tr("Ctrl+Q"));
|
||||
exitAction.setContainer(Constants::M_FILE, Constants::G_FILE_OTHER);
|
||||
exitAction.addToContainer(Constants::M_FILE, Constants::G_FILE_OTHER);
|
||||
exitAction.setOnTriggered(this, &ICore::exit);
|
||||
|
||||
// Undo Action
|
||||
@@ -1736,7 +1736,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
undoAction.setDefaultKeySequence(QKeySequence::Undo);
|
||||
undoAction.setCommandAttribute(Command::CA_UpdateText);
|
||||
undoAction.setCommandDescription(Tr::tr("Undo"));
|
||||
undoAction.setContainer(Constants::M_EDIT, Constants::G_EDIT_UNDOREDO);
|
||||
undoAction.addToContainer(Constants::M_EDIT, Constants::G_EDIT_UNDOREDO);
|
||||
undoAction.setEnabled(false);
|
||||
|
||||
// Redo Action
|
||||
@@ -1746,7 +1746,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
redoAction.setDefaultKeySequence(QKeySequence::Redo);
|
||||
redoAction.setCommandAttribute(Command::CA_UpdateText);
|
||||
redoAction.setCommandDescription(Tr::tr("Redo"));
|
||||
redoAction.setContainer(Constants::M_EDIT, Constants::G_EDIT_UNDOREDO);
|
||||
redoAction.addToContainer(Constants::M_EDIT, Constants::G_EDIT_UNDOREDO);
|
||||
redoAction.setEnabled(false);
|
||||
|
||||
// Cut Action
|
||||
@@ -1754,7 +1754,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
cutAction.setText(Tr::tr("Cu&t"));
|
||||
cutAction.setIcon(Icon::fromTheme("edit-cut"));
|
||||
cutAction.setDefaultKeySequence(QKeySequence::Cut);
|
||||
cutAction.setContainer(Constants::M_EDIT, Constants::G_EDIT_COPYPASTE);
|
||||
cutAction.addToContainer(Constants::M_EDIT, Constants::G_EDIT_COPYPASTE);
|
||||
cutAction.setEnabled(false);
|
||||
|
||||
// Copy Action
|
||||
@@ -1762,7 +1762,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
copyAction.setText(Tr::tr("&Copy"));
|
||||
copyAction.setIcon(Icon::fromTheme("edit-copy"));
|
||||
copyAction.setDefaultKeySequence(QKeySequence::Copy);
|
||||
copyAction.setContainer(Constants::M_EDIT, Constants::G_EDIT_COPYPASTE);
|
||||
copyAction.addToContainer(Constants::M_EDIT, Constants::G_EDIT_COPYPASTE);
|
||||
copyAction.setEnabled(false);
|
||||
|
||||
// Paste Action
|
||||
@@ -1770,7 +1770,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
pasteAction.setText(Tr::tr("&Paste"));
|
||||
pasteAction.setIcon(Icon::fromTheme("edit-paste"));
|
||||
pasteAction.setDefaultKeySequence(QKeySequence::Paste);
|
||||
pasteAction.setContainer(Constants::M_EDIT, Constants::G_EDIT_COPYPASTE);
|
||||
pasteAction.addToContainer(Constants::M_EDIT, Constants::G_EDIT_COPYPASTE);
|
||||
pasteAction.setEnabled(false);
|
||||
|
||||
// Select All
|
||||
@@ -1778,7 +1778,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
selectAllAction.setText(Tr::tr("Select &All"));
|
||||
selectAllAction.setIcon(Icon::fromTheme("edit-select-all"));
|
||||
selectAllAction.setDefaultKeySequence(QKeySequence::SelectAll);
|
||||
selectAllAction.setContainer(Constants::M_EDIT, Constants::G_EDIT_SELECTALL);
|
||||
selectAllAction.addToContainer(Constants::M_EDIT, Constants::G_EDIT_SELECTALL);
|
||||
selectAllAction.setEnabled(false);
|
||||
|
||||
// Goto Action
|
||||
@@ -1786,7 +1786,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
gotoLineAction.setText(Tr::tr("&Go to Line..."));
|
||||
gotoLineAction.setIcon(Icon::fromTheme("go-jump"));
|
||||
gotoLineAction.setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+L")));
|
||||
gotoLineAction.setContainer(Constants::M_EDIT, Constants::G_EDIT_OTHER);
|
||||
gotoLineAction.addToContainer(Constants::M_EDIT, Constants::G_EDIT_OTHER);
|
||||
gotoLineAction.setEnabled(false);
|
||||
|
||||
// Zoom In Action
|
||||
@@ -1821,7 +1821,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
|
||||
ActionBuilder loggerAction(this, Constants::LOGGER);
|
||||
loggerAction.setText(Tr::tr("Show Logs..."));
|
||||
loggerAction.setContainer(Constants::M_TOOLS_DEBUG);
|
||||
loggerAction.addToContainer(Constants::M_TOOLS_DEBUG);
|
||||
loggerAction.setOnTriggered(this, &LoggingViewer::showLoggingView);
|
||||
|
||||
// Options Action
|
||||
@@ -1832,7 +1832,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
optionsAction.setText(Tr::tr("Pr&eferences..."));
|
||||
optionsAction.setMenuRole(QAction::PreferencesRole);
|
||||
optionsAction.setDefaultKeySequence(QKeySequence::Preferences);
|
||||
optionsAction.setContainer(Constants::M_EDIT, Constants::G_EDIT_PREFERENCES);
|
||||
optionsAction.addToContainer(Constants::M_EDIT, Constants::G_EDIT_PREFERENCES);
|
||||
optionsAction.setOnTriggered(this, [] { ICore::showOptionsDialog(Id()); });
|
||||
|
||||
mwindow->addSeparator(Constants::G_WINDOW_LIST);
|
||||
@@ -1881,7 +1881,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
toggleLeftSideBarAction.setCheckable(true);
|
||||
toggleLeftSideBarAction.setCommandAttribute(Command::CA_UpdateText);
|
||||
toggleLeftSideBarAction.setDefaultKeySequence(Tr::tr("Ctrl+0"), Tr::tr("Alt+0"));
|
||||
toggleLeftSideBarAction.setContainer(Constants::M_VIEW, Constants::G_VIEW_VIEWS);
|
||||
toggleLeftSideBarAction.addToContainer(Constants::M_VIEW, Constants::G_VIEW_VIEWS);
|
||||
toggleLeftSideBarAction.setOnTriggered(this,
|
||||
[this](bool visible) { setSidebarVisible(visible, Side::Left); });
|
||||
|
||||
@@ -1897,7 +1897,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
toggleRightSideBarAction.setCheckable(true);
|
||||
toggleRightSideBarAction.setCommandAttribute(Command::CA_UpdateText);
|
||||
toggleRightSideBarAction.setDefaultKeySequence(Tr::tr("Ctrl+Shift+0"), Tr::tr("Alt+Shift+0"));
|
||||
toggleRightSideBarAction.setContainer(Constants::M_VIEW, Constants::G_VIEW_VIEWS);
|
||||
toggleRightSideBarAction.addToContainer(Constants::M_VIEW, Constants::G_VIEW_VIEWS);
|
||||
toggleRightSideBarAction.setEnabled(false);
|
||||
toggleRightSideBarAction.setOnTriggered(this,
|
||||
[this](bool visible) { setSidebarVisible(visible, Side::Right); });
|
||||
@@ -1946,7 +1946,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
(HostOsInfo::isMacHost() ? Tr::tr("About &%1") : Tr::tr("About &%1..."))
|
||||
.arg(QGuiApplication::applicationDisplayName()));
|
||||
aboutIdeAction.setMenuRole(QAction::AboutRole);
|
||||
aboutIdeAction.setContainer(Constants::M_HELP, Constants::G_HELP_ABOUT);
|
||||
aboutIdeAction.addToContainer(Constants::M_HELP, Constants::G_HELP_ABOUT);
|
||||
aboutIdeAction.setEnabled(true);
|
||||
aboutIdeAction.setOnTriggered(this, [this] { aboutQtCreator(); });
|
||||
|
||||
@@ -1954,7 +1954,7 @@ void ICorePrivate::registerDefaultActions()
|
||||
ActionBuilder aboutPluginsAction(this, Constants::ABOUT_PLUGINS);
|
||||
aboutPluginsAction.setText(Tr::tr("About &Plugins..."));
|
||||
aboutPluginsAction.setMenuRole(QAction::ApplicationSpecificRole);
|
||||
aboutPluginsAction.setContainer(Constants::M_HELP, Constants::G_HELP_ABOUT);
|
||||
aboutPluginsAction.addToContainer(Constants::M_HELP, Constants::G_HELP_ABOUT);
|
||||
aboutPluginsAction.setEnabled(true);
|
||||
aboutPluginsAction.setOnTriggered(this, [this] { aboutPlugins(); });
|
||||
|
||||
@@ -1962,14 +1962,14 @@ void ICorePrivate::registerDefaultActions()
|
||||
ActionBuilder changeLogAction(this, Constants::CHANGE_LOG);
|
||||
changeLogAction.setText(Tr::tr("Change Log..."));
|
||||
changeLogAction.setMenuRole(QAction::ApplicationSpecificRole);
|
||||
changeLogAction.setContainer(Constants::M_HELP, Constants::G_HELP_ABOUT);
|
||||
changeLogAction.addToContainer(Constants::M_HELP, Constants::G_HELP_ABOUT);
|
||||
changeLogAction.setEnabled(true);
|
||||
changeLogAction.setOnTriggered(this, [this] { changeLog(); });
|
||||
|
||||
// Contact
|
||||
ActionBuilder contactAction(this, "QtCreator.Contact");
|
||||
contactAction.setText(Tr::tr("Contact..."));
|
||||
contactAction.setContainer(Constants::M_HELP, Constants::G_HELP_ABOUT);
|
||||
contactAction.addToContainer(Constants::M_HELP, Constants::G_HELP_ABOUT);
|
||||
contactAction.setEnabled(true);
|
||||
contactAction.setOnTriggered(this, [this] { contact(); });
|
||||
|
||||
|
@@ -711,7 +711,7 @@ void setupGenericProject(QObject *guard)
|
||||
editAction.setContext(Constants::GENERICPROJECT_ID);
|
||||
editAction.setText(Tr::tr("Edit Files..."));
|
||||
editAction.setCommandAttribute(Command::CA_Hide);
|
||||
editAction.setContainer(PEC::M_PROJECTCONTEXT, PEC::G_PROJECT_FILES);
|
||||
editAction.addToContainer(PEC::M_PROJECTCONTEXT, PEC::G_PROJECT_FILES);
|
||||
editAction.setOnTriggered([] {
|
||||
if (auto genericProject = qobject_cast<GenericProject *>(ProjectTree::currentProject()))
|
||||
genericProject->editFilesTriggered();
|
||||
@@ -720,7 +720,7 @@ void setupGenericProject(QObject *guard)
|
||||
ActionBuilder removeDirAction(guard, "GenericProject.RemoveDir");
|
||||
removeDirAction.setContext(PEC::C_PROJECT_TREE);
|
||||
removeDirAction.setText(Tr::tr("Remove Directory"));
|
||||
removeDirAction.setContainer(PEC::M_FOLDERCONTEXT, PEC::G_FOLDER_OTHER);
|
||||
removeDirAction.addToContainer(PEC::M_FOLDERCONTEXT, PEC::G_FOLDER_OTHER);
|
||||
removeDirAction.setOnTriggered([] {
|
||||
const auto folderNode = ProjectTree::currentNode()->asFolderNode();
|
||||
QTC_ASSERT(folderNode, return);
|
||||
|
@@ -86,7 +86,7 @@ void HelloWorldPlugin::initialize()
|
||||
hello.setOnTriggered(this, [this] { sayHelloWorld(); });
|
||||
|
||||
// Add the Hello World action command to the menu
|
||||
hello.setContainer(menuId);
|
||||
hello.addToContainer(menuId);
|
||||
|
||||
// Add a mode with a push button based on BaseMode.
|
||||
m_helloMode = new HelloMode;
|
||||
|
@@ -216,20 +216,20 @@ HelpPluginPrivate::HelpPluginPrivate()
|
||||
ActionBuilder helpContents(this, "Help.ContentsMenu");
|
||||
helpContents.setText(Tr::tr(Constants::SB_CONTENTS));
|
||||
helpContents.setIcon(QIcon::fromTheme("help-contents"));
|
||||
helpContents.setContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_HELP);
|
||||
helpContents.addToContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_HELP);
|
||||
helpContents.setOnTriggered(this, &HelpPluginPrivate::activateContents);
|
||||
|
||||
ActionBuilder helpIndex(this, "Help.IndexMenu");
|
||||
helpIndex.setText(Tr::tr(Constants::SB_INDEX));
|
||||
helpIndex.setContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_HELP);
|
||||
helpIndex.addToContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_HELP);
|
||||
helpIndex.setOnTriggered(this, &HelpPluginPrivate::activateIndex);
|
||||
|
||||
ActionBuilder helpContext(this, Help::Constants::CONTEXT_HELP);
|
||||
helpContext.setText(Tr::tr("Context Help"));
|
||||
helpContext.setContext(Context(kToolTipHelpContext, Core::Constants::C_GLOBAL));
|
||||
helpContext.setTouchBarIcon(Icons::MACOS_TOUCHBAR_HELP.icon());
|
||||
helpContext.setContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_HELP);
|
||||
helpContext.setContainer(Core::Constants::TOUCH_BAR, Core::Constants::G_TOUCHBAR_HELP);
|
||||
helpContext.addToContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_HELP);
|
||||
helpContext.addToContainer(Core::Constants::TOUCH_BAR, Core::Constants::G_TOUCHBAR_HELP);
|
||||
helpContext.setDefaultKeySequence(Qt::Key_F1);
|
||||
helpContext.setOnTriggered(this, &HelpPluginPrivate::requestContextHelp);
|
||||
|
||||
@@ -239,12 +239,12 @@ HelpPluginPrivate::HelpPluginPrivate()
|
||||
textEditorContextMenu->insertGroup(TextEditor::Constants::G_BOM,
|
||||
Core::Constants::G_HELP);
|
||||
textEditorContextMenu->addSeparator(Core::Constants::G_HELP);
|
||||
helpContext.setContainer(TextEditor::Constants::M_STANDARDCONTEXTMENU, Core::Constants::G_HELP);
|
||||
helpContext.addToContainer(TextEditor::Constants::M_STANDARDCONTEXTMENU, Core::Constants::G_HELP);
|
||||
}
|
||||
|
||||
ActionBuilder techSupport(this, "Help.TechSupport");
|
||||
techSupport.setText(Tr::tr("Technical Support..."));
|
||||
techSupport.setContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_SUPPORT);
|
||||
techSupport.addToContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_SUPPORT);
|
||||
techSupport.setOnTriggered(this, [this] {
|
||||
showHelpUrl(QUrl("qthelp://org.qt-project.qtcreator/doc/technical-support.html"),
|
||||
Core::HelpManager::HelpModeAlways);
|
||||
@@ -255,7 +255,7 @@ HelpPluginPrivate::HelpPluginPrivate()
|
||||
|
||||
ActionBuilder reportBug(this, "Help.ReportBug");
|
||||
reportBug.setText(Tr::tr("Report Bug..."));
|
||||
reportBug.setContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_SUPPORT);
|
||||
reportBug.addToContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_SUPPORT);
|
||||
reportBug.setOnTriggered(this, [isDesigner] {
|
||||
const QUrl bugreportUrl = isDesigner ? QString("https://bugreports.qt.io/secure/CreateIssue.jspa?pid=11740") //QDS
|
||||
: QString("https://bugreports.qt.io/secure/CreateIssue.jspa?pid=10512"); //QtC
|
||||
@@ -264,7 +264,7 @@ HelpPluginPrivate::HelpPluginPrivate()
|
||||
|
||||
ActionBuilder systemInformation(this, "Help.SystemInformation");
|
||||
systemInformation.setText(Tr::tr("System Information..."));
|
||||
systemInformation.setContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_SUPPORT);
|
||||
systemInformation.addToContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_SUPPORT);
|
||||
systemInformation.setOnTriggered(this, &HelpPluginPrivate::slotSystemInformation);
|
||||
|
||||
connect(ModeManager::instance(), &ModeManager::currentModeChanged,
|
||||
|
@@ -47,7 +47,7 @@ void LanguageClientPlugin::initialize()
|
||||
|
||||
ActionBuilder inspectAction(this, "LanguageClient.InspectLanguageClients");
|
||||
inspectAction.setText(Tr::tr("Inspect Language Clients..."));
|
||||
inspectAction.setContainer(Core::Constants::M_TOOLS_DEBUG);
|
||||
inspectAction.addToContainer(Core::Constants::M_TOOLS_DEBUG);
|
||||
inspectAction.setOnTriggered(this, &LanguageClientManager::showInspector);
|
||||
}
|
||||
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
startMacro.setText(Tr::tr("Record Macro"));
|
||||
startMacro.setContext(textContext);
|
||||
startMacro.setDefaultKeySequence(Tr::tr("Ctrl+["), Tr::tr("Alt+["));
|
||||
startMacro.setContainer(Constants::M_TOOLS_MACRO);
|
||||
startMacro.addToContainer(Constants::M_TOOLS_MACRO);
|
||||
startMacro.setOnTriggered(this, [this] { d->macroManager.startMacro(); });
|
||||
|
||||
ActionBuilder endMacro(this, Constants::END_MACRO);
|
||||
@@ -68,21 +68,21 @@ public:
|
||||
endMacro.setContext(textContext);
|
||||
endMacro.setEnabled(false);
|
||||
endMacro.setDefaultKeySequence(Tr::tr("Ctrl+]"), Tr::tr("Alt+]"));
|
||||
endMacro.setContainer(Constants::M_TOOLS_MACRO);
|
||||
endMacro.addToContainer(Constants::M_TOOLS_MACRO);
|
||||
endMacro.setOnTriggered(this, [this] { d->macroManager.endMacro(); });
|
||||
|
||||
ActionBuilder executeLastMacro(this, Constants::EXECUTE_LAST_MACRO);
|
||||
executeLastMacro.setText(Tr::tr("Play Last Macro"));
|
||||
executeLastMacro.setContext(textContext);
|
||||
executeLastMacro.setDefaultKeySequence(Tr::tr("Meta+R"), Tr::tr("Alt+R"));
|
||||
executeLastMacro.setContainer(Constants::M_TOOLS_MACRO);
|
||||
executeLastMacro.addToContainer(Constants::M_TOOLS_MACRO);
|
||||
executeLastMacro.setOnTriggered(this, [this] { d->macroManager.executeLastMacro(); });
|
||||
|
||||
ActionBuilder saveLastMacro(this, Constants::SAVE_LAST_MACRO);
|
||||
saveLastMacro.setContext(textContext);
|
||||
saveLastMacro.setText(Tr::tr("Save Last Macro"));
|
||||
saveLastMacro.setEnabled(false);
|
||||
saveLastMacro.setContainer(Constants::M_TOOLS_MACRO);
|
||||
saveLastMacro.addToContainer(Constants::M_TOOLS_MACRO);
|
||||
saveLastMacro.setOnTriggered(this, [this] { d->macroManager.saveLastMacro(); });
|
||||
}
|
||||
|
||||
|
@@ -56,7 +56,7 @@ SquishPluginPrivate::SquishPluginPrivate()
|
||||
|
||||
ActionBuilder serverSettings(this, "Squish.ServerSettings");
|
||||
serverSettings.setText(Tr::tr("&Server Settings..."));
|
||||
serverSettings.setContainer(menuId);
|
||||
serverSettings.addToContainer(menuId);
|
||||
serverSettings.setOnTriggered(this, [] {
|
||||
if (!settings().squishPath().exists()) {
|
||||
SquishMessages::criticalMessage(Tr::tr("Invalid Squish settings. Configure Squish "
|
||||
|
@@ -126,7 +126,7 @@ TextEditorPluginPrivate::TextEditorPluginPrivate()
|
||||
toggleAction.setText(Tr::tr("Toggle Bookmark"));
|
||||
toggleAction.setDefaultKeySequence(Tr::tr("Meta+M"), Tr::tr("Ctrl+M"));
|
||||
toggleAction.setTouchBarIcon(Icons::MACOS_TOUCHBAR_BOOKMARK.icon());
|
||||
toggleAction.setContainer(bookmarkMenuId);
|
||||
toggleAction.addToContainer(bookmarkMenuId);
|
||||
toggleAction.bindContextAction(&m_toggleAction);
|
||||
toggleAction.setOnTriggered(this, [this] {
|
||||
IEditor *editor = EditorManager::currentEditor();
|
||||
@@ -139,7 +139,7 @@ TextEditorPluginPrivate::TextEditorPluginPrivate()
|
||||
editAction.setContext(editorManagerContext);
|
||||
editAction.setText(Tr::tr("Edit Bookmark"));
|
||||
editAction.setDefaultKeySequence(Tr::tr("Meta+Shift+M"), Tr::tr("Ctrl+Shift+M"));
|
||||
editAction.setContainer(bookmarkMenuId);
|
||||
editAction.addToContainer(bookmarkMenuId);
|
||||
editAction.bindContextAction(&m_editAction);
|
||||
editAction.setOnTriggered(this, [this] {
|
||||
IEditor *editor = EditorManager::currentEditor();
|
||||
@@ -159,7 +159,7 @@ TextEditorPluginPrivate::TextEditorPluginPrivate()
|
||||
prevAction.setContext(editorManagerContext);
|
||||
prevAction.setText(Tr::tr("Previous Bookmark"));
|
||||
prevAction.setDefaultKeySequence(Tr::tr("Meta+,"), Tr::tr("Ctrl+,"));
|
||||
prevAction.setContainer(bookmarkMenuId);
|
||||
prevAction.addToContainer(bookmarkMenuId);
|
||||
prevAction.setIcon(Icons::PREV_TOOLBAR.icon());
|
||||
prevAction.setIconVisibleInMenu(false);
|
||||
prevAction.bindContextAction(&m_prevAction);
|
||||
@@ -171,7 +171,7 @@ TextEditorPluginPrivate::TextEditorPluginPrivate()
|
||||
nextAction.setIcon(Icons::NEXT_TOOLBAR.icon());
|
||||
nextAction.setIconVisibleInMenu(false);
|
||||
nextAction.setDefaultKeySequence(Tr::tr("Meta+."), Tr::tr("Ctrl+."));
|
||||
nextAction.setContainer(bookmarkMenuId);
|
||||
nextAction.addToContainer(bookmarkMenuId);
|
||||
nextAction.bindContextAction(&m_nextAction);
|
||||
nextAction.setOnTriggered(this, [this] { m_bookmarkManager.next(); });
|
||||
|
||||
@@ -180,14 +180,14 @@ TextEditorPluginPrivate::TextEditorPluginPrivate()
|
||||
ActionBuilder docPrevAction(this, "Bookmarks.PreviousDocument");
|
||||
docPrevAction.setContext(editorManagerContext);
|
||||
docPrevAction.setText(Tr::tr("Previous Bookmark in Document"));
|
||||
docPrevAction.setContainer(bookmarkMenuId);
|
||||
docPrevAction.addToContainer(bookmarkMenuId);
|
||||
docPrevAction.bindContextAction(&m_docPrevAction);
|
||||
docPrevAction.setOnTriggered(this, [this] { m_bookmarkManager.prevInDocument(); });
|
||||
|
||||
ActionBuilder docNextAction(this, "Bookmarks.NextDocument");
|
||||
docNextAction.setContext(Core::Constants::C_EDITORMANAGER);
|
||||
docNextAction.setText(Tr::tr("Next Bookmark in Document"));
|
||||
docNextAction.setContainer(bookmarkMenuId);
|
||||
docNextAction.addToContainer(bookmarkMenuId);
|
||||
docNextAction.bindContextAction(&m_docNextAction);
|
||||
docNextAction.setOnTriggered(this, [this] { m_bookmarkManager.nextInDocument(); });
|
||||
|
||||
|
Reference in New Issue
Block a user