Improve grouping and order in the build menu

Build related menu items are sorted by tasks, then configurations.
e.g.
+ Build
  + Build All Projects
  + Build All Projects for All Configurations
  ...
  + Rebuild All Projects
  + Rebuild All Projects for All Configurations
  ...
  + Clean All Projects
  + Clean All Projects for All Configurations
  ...

This patch changes the order to configuration > task like below

+ Build
  + ...
  + qmake / cmake
  + -
  + Build All Projects
  + Deploy
  + Rebuild
  + Clean
  + -
  + Build Project
  + Deploy
  + Rebuild
  + Clean
  + -
  + Build Subproject
  + Deploy
  + Rebuild
  + Clean
  + -
  + Build File
  + -
  + Build All Projects for All Configurations
  + Rebuild
  + Clean
  + -
  + Build Project for All Configurations
  + Rebuild
  + Clean
  + -
  + ...

Change-Id: I95844e51d2ae164ed9f29fdb1c51509611c514fe
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tasuku Suzuki
2021-03-17 16:49:15 +09:00
parent bfe398072d
commit 3bd490acdb
8 changed files with 79 additions and 81 deletions

View File

@@ -103,11 +103,10 @@
You can also use the \c cm filter in the \l {Searching with the Locator}
{locator}.
To remove all build artifacts, select \uicontrol {Clean Project} or one
of its variants.
To remove all build artifacts, select one of \uicontrol {Clean} menu commands.
To clean the build directory and then build the project, select
\uicontrol {Rebuild Project} or one of its variants.
one of \uicontrol {Rebuild} menu commands.
To build and clean projects without dependencies, select the
\uicontrol {Build Without Dependencies},

View File

@@ -172,7 +172,7 @@
\section2 Cleaning Projects
To clean the working directory, select \uicontrol {Clean Project}.
To clean the working directory, select \uicontrol {Build Project} > \uicontrol {Clean}.
All files that are not under version control are displayed in
the \uicontrol {Clean Repository} dialog. Ignored files are
deselected by default. Select the files to delete and click

View File

@@ -76,7 +76,7 @@ CMakeManager::CMakeManager()
Constants::RUN_CMAKE,
globalContext);
command->setAttribute(Core::Command::CA_Hide);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_DEPLOY);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_runCMakeAction, &QAction::triggered, [this]() {
runCMake(SessionManager::startupBuildSystem());
});
@@ -85,7 +85,7 @@ CMakeManager::CMakeManager()
Constants::CLEAR_CMAKE_CACHE,
globalContext);
command->setAttribute(Core::Command::CA_Hide);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_DEPLOY);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_clearCMakeCacheAction, &QAction::triggered, [this]() {
clearCMakeCache(SessionManager::startupBuildSystem());
});
@@ -113,7 +113,7 @@ CMakeManager::CMakeManager()
Constants::RESCAN_PROJECT,
globalContext);
command->setAttribute(Core::Command::CA_Hide);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_DEPLOY);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_rescanProjectAction, &QAction::triggered, [this]() {
rescanProject(ProjectTree::currentBuildSystem());
});

View File

@@ -499,19 +499,19 @@ public:
QAction *m_buildSessionAction;
QAction *m_buildSessionForAllConfigsAction;
QAction *m_rebuildProjectOnlyAction;
Utils::ParameterAction *m_rebuildAction;
Utils::ParameterAction *m_rebuildProjectForAllConfigsAction;
QAction *m_rebuildAction;
QAction *m_rebuildProjectForAllConfigsAction;
QAction *m_rebuildActionContextMenu;
QAction *m_rebuildDependenciesActionContextMenu;
QAction *m_rebuildSessionAction;
QAction *m_rebuildSessionForAllConfigsAction;
QAction *m_cleanProjectOnlyAction;
QAction *m_deployProjectOnlyAction;
Utils::ParameterAction *m_deployAction;
QAction *m_deployAction;
QAction *m_deployActionContextMenu;
QAction *m_deploySessionAction;
Utils::ParameterAction *m_cleanAction;
Utils::ParameterAction *m_cleanProjectForAllConfigsAction;
QAction *m_cleanAction;
QAction *m_cleanProjectForAllConfigsAction;
QAction *m_cleanActionContextMenu;
QAction *m_cleanDependenciesActionContextMenu;
QAction *m_cleanSessionAction;
@@ -888,9 +888,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
//
mbuild->appendGroup(Constants::G_BUILD_BUILD);
mbuild->appendGroup(Constants::G_BUILD_DEPLOY);
mbuild->appendGroup(Constants::G_BUILD_REBUILD);
mbuild->appendGroup(Constants::G_BUILD_CLEAN);
mbuild->appendGroup(Constants::G_BUILD_ALLPROJECTS);
mbuild->appendGroup(Constants::G_BUILD_PROJECT);
mbuild->appendGroup(Constants::G_BUILD_PRODUCT);
mbuild->appendGroup(Constants::G_BUILD_SUBPROJECT);
mbuild->appendGroup(Constants::G_BUILD_FILE);
mbuild->appendGroup(Constants::G_BUILD_ALLPROJECTS_ALLCONFIGURATIONS);
mbuild->appendGroup(Constants::G_BUILD_PROJECT_ALLCONFIGURATIONS);
mbuild->appendGroup(Constants::G_BUILD_CANCEL);
mbuild->appendGroup(Constants::G_BUILD_RUN);
@@ -976,7 +980,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mprojectContextMenu->addSeparator(projectTreeContext, Constants::G_PROJECT_FILES);
msubProjectContextMenu->addSeparator(projectTreeContext, Constants::G_PROJECT_FILES);
mfile->addSeparator(Core::Constants::G_FILE_PROJECT);
mbuild->addSeparator(Constants::G_BUILD_REBUILD);
mbuild->addSeparator(Constants::G_BUILD_BUILD);
mbuild->addSeparator(Constants::G_BUILD_ALLPROJECTS);
mbuild->addSeparator(Constants::G_BUILD_PROJECT);
mbuild->addSeparator(Constants::G_BUILD_PRODUCT);
mbuild->addSeparator(Constants::G_BUILD_SUBPROJECT);
mbuild->addSeparator(Constants::G_BUILD_FILE);
mbuild->addSeparator(Constants::G_BUILD_ALLPROJECTS_ALLCONFIGURATIONS);
mbuild->addSeparator(Constants::G_BUILD_PROJECT_ALLCONFIGURATIONS);
msessionContextMenu->addSeparator(Constants::G_SESSION_OTHER);
mbuild->addSeparator(Constants::G_BUILD_CANCEL);
mbuild->addSeparator(Constants::G_BUILD_RUN);
@@ -1113,49 +1124,49 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
dd->m_buildSessionAction = new QAction(buildIcon, tr("Build All Projects"), this);
cmd = ActionManager::registerAction(dd->m_buildSessionAction, Constants::BUILDSESSION);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B")));
mbuild->addAction(cmd, Constants::G_BUILD_BUILD);
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);
dd->m_buildSessionForAllConfigsAction
= new QAction(buildIcon, tr("Build All Projects for All Configurations"), this);
cmd = ActionManager::registerAction(dd->m_buildSessionForAllConfigsAction,
Constants::BUILDSESSIONALLCONFIGS);
mbuild->addAction(cmd, Constants::G_BUILD_BUILD);
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS_ALLCONFIGURATIONS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);
// deploy session
dd->m_deploySessionAction = new QAction(tr("Deploy All Projects"), this);
dd->m_deploySessionAction = new QAction(tr("Deploy"), this);
cmd = ActionManager::registerAction(dd->m_deploySessionAction, Constants::DEPLOYSESSION);
mbuild->addAction(cmd, Constants::G_BUILD_DEPLOY);
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);
// rebuild session action
dd->m_rebuildSessionAction = new QAction(Icons::REBUILD.icon(), tr("Rebuild All Projects"),
dd->m_rebuildSessionAction = new QAction(Icons::REBUILD.icon(), tr("Rebuild"),
this);
cmd = ActionManager::registerAction(dd->m_rebuildSessionAction, Constants::REBUILDSESSION);
mbuild->addAction(cmd, Constants::G_BUILD_REBUILD);
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
dd->m_rebuildSessionForAllConfigsAction
= new QAction(Icons::REBUILD.icon(), tr("Rebuild All Projects for All Configurations"),
= new QAction(Icons::REBUILD.icon(), tr("Rebuild"),
this);
cmd = ActionManager::registerAction(dd->m_rebuildSessionForAllConfigsAction,
Constants::REBUILDSESSIONALLCONFIGS);
mbuild->addAction(cmd, Constants::G_BUILD_REBUILD);
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS_ALLCONFIGURATIONS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
// clean session
dd->m_cleanSessionAction = new QAction(Utils::Icons::CLEAN.icon(), tr("Clean All Projects"),
dd->m_cleanSessionAction = new QAction(Utils::Icons::CLEAN.icon(), tr("Clean"),
this);
cmd = ActionManager::registerAction(dd->m_cleanSessionAction, Constants::CLEANSESSION);
mbuild->addAction(cmd, Constants::G_BUILD_CLEAN);
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
dd->m_cleanSessionForAllConfigsAction = new QAction(Utils::Icons::CLEAN.icon(),
tr("Clean All Projects for All Configurations"), this);
tr("Clean"), this);
cmd = ActionManager::registerAction(dd->m_cleanSessionForAllConfigsAction,
Constants::CLEANSESSIONALLCONFIGS);
mbuild->addAction(cmd, Constants::G_BUILD_CLEAN);
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS_ALLCONFIGURATIONS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
// build action
@@ -1166,7 +1177,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_buildAction->text());
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+B")));
mbuild->addAction(cmd, Constants::G_BUILD_BUILD);
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
dd->m_buildProjectForAllConfigsAction
= new Utils::ParameterAction(tr("Build Project for All Configurations"),
@@ -1177,7 +1188,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
Constants::BUILDALLCONFIGS);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_buildProjectForAllConfigsAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_BUILD);
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT_ALLCONFIGURATIONS);
// Add to mode bar
dd->m_modeBarBuildAction = new Utils::ProxyAction(this);
@@ -1199,48 +1210,41 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mbuild->addAction(cmd, Constants::G_BUILD_BUILD);
// deploy action
dd->m_deployAction = new Utils::ParameterAction(tr("Deploy Project"), tr("Deploy Project \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
dd->m_deployAction = new QAction(tr("Deploy"), this);
cmd = ActionManager::registerAction(dd->m_deployAction, Constants::DEPLOY);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_deployAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_DEPLOY);
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
// rebuild action
dd->m_rebuildAction = new Utils::ParameterAction(tr("Rebuild Project"), tr("Rebuild Project \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
dd->m_rebuildAction = new QAction(Icons::REBUILD.icon(), tr("Rebuild"), this);
cmd = ActionManager::registerAction(dd->m_rebuildAction, Constants::REBUILD);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_rebuildAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_REBUILD);
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
dd->m_rebuildProjectForAllConfigsAction
= new Utils::ParameterAction(tr("Rebuild Project for All Configurations"),
tr("Rebuild Project \"%1\" for All Configurations"),
Utils::ParameterAction::AlwaysEnabled, this);
= new QAction(Icons::REBUILD.icon(), tr("Rebuild"), this);
cmd = ActionManager::registerAction(dd->m_rebuildProjectForAllConfigsAction,
Constants::REBUILDALLCONFIGS);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_rebuildProjectForAllConfigsAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_REBUILD);
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT_ALLCONFIGURATIONS);
// clean action
dd->m_cleanAction = new Utils::ParameterAction(tr("Clean Project"), tr("Clean Project \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
dd->m_cleanAction = new QAction(Utils::Icons::CLEAN.icon(), tr("Clean"), this);
cmd = ActionManager::registerAction(dd->m_cleanAction, Constants::CLEAN);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_cleanAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_CLEAN);
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
dd->m_cleanProjectForAllConfigsAction
= new Utils::ParameterAction(tr("Clean Project for All Configurations"),
tr("Clean Project \"%1\" for All Configurations"),
Utils::ParameterAction::AlwaysEnabled, this);
= new QAction(Utils::Icons::CLEAN.icon(), tr("Clean"), this);
cmd = ActionManager::registerAction(dd->m_cleanProjectForAllConfigsAction,
Constants::CLEANALLCONFIGS);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_cleanProjectForAllConfigsAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_CLEAN);
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT_ALLCONFIGURATIONS);
// cancel build action
dd->m_cancelBuildAction = new QAction(Utils::Icons::STOP_SMALL.icon(), tr("Cancel Build"), this);
@@ -2674,10 +2678,6 @@ void ProjectExplorerPluginPrivate::updateActions()
m_buildProjectForAllConfigsAction->setParameter(projectName);
if (runConfig)
m_buildForRunConfigAction->setParameter(runConfig->displayName());
m_rebuildAction->setParameter(projectName);
m_rebuildProjectForAllConfigsAction->setParameter(projectName);
m_cleanAction->setParameter(projectName);
m_cleanProjectForAllConfigsAction->setParameter(projectName);
m_buildAction->setEnabled(buildActionState.first);
m_buildProjectForAllConfigsAction->setEnabled(buildActionState.first);
@@ -3048,7 +3048,6 @@ void ProjectExplorerPluginPrivate::updateDeployActions()
const QString projectName = project ? project->displayName() : QString();
bool hasProjects = SessionManager::hasProjects();
m_deployAction->setParameter(projectName);
m_deployAction->setEnabled(enableDeployActions);
m_deployActionContextMenu->setEnabled(enableDeployActionsContextMenu);

View File

@@ -52,9 +52,13 @@ const char M_DEBUG_STARTDEBUGGING[] = "ProjectExplorer.Menu.Debug.StartDebugging
// Menu groups
const char G_BUILD_BUILD[] = "ProjectExplorer.Group.Build";
const char G_BUILD_DEPLOY[] = "ProjectExplorer.Group.Deploy";
const char G_BUILD_REBUILD[] = "ProjectExplorer.Group.Rebuild";
const char G_BUILD_CLEAN[] = "ProjectExplorer.Group.Clean";
const char G_BUILD_ALLPROJECTS[] = "ProjectExplorer.Group.AllProjects";
const char G_BUILD_PROJECT[] = "ProjectExplorer.Group.Project";
const char G_BUILD_PRODUCT[] = "ProjectExplorer.Group.Product";
const char G_BUILD_SUBPROJECT[] = "ProjectExplorer.Group.SubProject";
const char G_BUILD_FILE[] = "ProjectExplorer.Group.File";
const char G_BUILD_ALLPROJECTS_ALLCONFIGURATIONS[] = "ProjectExplorer.Group.AllProjects.AllConfigurations";
const char G_BUILD_PROJECT_ALLCONFIGURATIONS[] = "ProjectExplorer.Group.Project.AllConfigurations";
const char G_BUILD_RUN[] = "ProjectExplorer.Group.Run";
const char G_BUILD_CANCEL[] = "ProjectExplorer.Group.BuildCancel";

View File

@@ -52,6 +52,7 @@
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectexplorericons.h>
#include <projectexplorer/projectmanager.h>
#include <projectexplorer/projecttree.h>
#include <projectexplorer/runcontrol.h>
@@ -63,6 +64,7 @@
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/utilsicons.h>
#include <QAction>
@@ -141,7 +143,7 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
m_reparseQbsCtx = new QAction(tr("Reparse Qbs"), this);
command = Core::ActionManager::registerAction(m_reparseQbsCtx, Constants::ACTION_REPARSE_QBS_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide);
mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
mproject->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_reparseQbsCtx, &QAction::triggered,
this, &QbsProjectManagerPlugin::reparseSelectedProject);
@@ -159,7 +161,7 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setAttribute(Core::Command::CA_UpdateText);
command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_FILE);
connect(m_buildFile, &QAction::triggered, this, &QbsProjectManagerPlugin::buildFile);
m_buildProductCtx = new QAction(tr("Build"), this);
@@ -176,7 +178,7 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setAttribute(Core::Command::CA_UpdateText);
command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Shift+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_PRODUCT);
connect(m_buildProduct, &QAction::triggered, this, &QbsProjectManagerPlugin::buildProduct);
m_cleanProductCtx = new QAction(tr("Clean"), this);
@@ -187,12 +189,11 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
connect(m_cleanProductCtx, &QAction::triggered,
this, &QbsProjectManagerPlugin::cleanProductContextMenu);
m_cleanProduct = new Utils::ParameterAction(tr("Clean Product"), tr("Clean Product \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
m_cleanProduct = new QAction(Utils::Icons::CLEAN.icon(), tr("Clean"), this);
command = Core::ActionManager::registerAction(m_cleanProduct, Constants::ACTION_CLEAN_PRODUCT);
command->setAttribute(Core::Command::CA_Hide);
command->setAttribute(Core::Command::CA_UpdateText);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_CLEAN);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_PRODUCT);
connect(m_cleanProduct, &QAction::triggered, this, &QbsProjectManagerPlugin::cleanProduct);
m_rebuildProductCtx = new QAction(tr("Rebuild"), this);
@@ -203,14 +204,12 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
connect(m_rebuildProductCtx, &QAction::triggered,
this, &QbsProjectManagerPlugin::rebuildProductContextMenu);
m_rebuildProduct = new Utils::ParameterAction(
tr("Rebuild Product"), tr("Rebuild Product \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
m_rebuildProduct = new QAction(ProjectExplorer::Icons::REBUILD.icon(), tr("Rebuild"), this);
command = Core::ActionManager::registerAction(m_rebuildProduct,
Constants::ACTION_REBUILD_PRODUCT);
command->setAttribute(Core::Command::CA_Hide);
command->setAttribute(Core::Command::CA_UpdateText);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_REBUILD);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_PRODUCT);
connect(m_rebuildProduct, &QAction::triggered, this, &QbsProjectManagerPlugin::rebuildProduct);
m_buildSubprojectCtx = new QAction(tr("Build"), this);
@@ -358,10 +357,8 @@ void QbsProjectManagerPlugin::updateBuildActions()
m_buildProduct->setParameter(productName);
m_cleanProduct->setEnabled(enabled);
m_cleanProduct->setVisible(productVisible);
m_cleanProduct->setParameter(productName);
m_rebuildProduct->setEnabled(enabled);
m_rebuildProduct->setVisible(productVisible);
m_rebuildProduct->setParameter(productName);
}
void QbsProjectManagerPlugin::projectChanged()

View File

@@ -96,8 +96,8 @@ private:
QAction *m_rebuildSubprojectCtx = nullptr;
Utils::ParameterAction *m_buildFile = nullptr;
Utils::ParameterAction *m_buildProduct = nullptr;
Utils::ParameterAction *m_cleanProduct = nullptr;
Utils::ParameterAction *m_rebuildProduct = nullptr;
QAction *m_cleanProduct = nullptr;
QAction *m_rebuildProduct = nullptr;
};
} // namespace Internal

View File

@@ -56,6 +56,7 @@
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorericons.h>
#include <texteditor/texteditor.h>
#include <texteditor/texteditoractionhandler.h>
@@ -63,6 +64,7 @@
#include <utils/hostosinfo.h>
#include <utils/parameteraction.h>
#include <utils/utilsicons.h>
#ifdef WITH_TESTS
# include <QTest>
@@ -118,8 +120,8 @@ public:
QAction *m_cleanSubProjectContextMenu = nullptr;
QAction *m_buildFileContextMenu = nullptr;
Utils::ParameterAction *m_buildSubProjectAction = nullptr;
Utils::ParameterAction *m_rebuildSubProjectAction = nullptr;
Utils::ParameterAction *m_cleanSubProjectAction = nullptr;
QAction *m_rebuildSubProjectAction = nullptr;
QAction *m_cleanSubProjectAction = nullptr;
Utils::ParameterAction *m_buildFileAction = nullptr;
QAction *m_addLibraryAction = nullptr;
QAction *m_addLibraryActionContextMenu = nullptr;
@@ -231,7 +233,7 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
command->setAttribute(Command::CA_Hide);
command->setAttribute(Command::CA_UpdateText);
command->setDescription(d->m_buildSubProjectAction->text());
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_SUBPROJECT);
connect(d->m_buildSubProjectAction, &QAction::triggered,
d, &QmakeProjectManagerPluginPrivate::buildSubDirContextMenu);
@@ -242,23 +244,22 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
connect(d->m_runQMakeAction, &QAction::triggered,
d, &QmakeProjectManagerPluginPrivate::runQMake);
d->m_rebuildSubProjectAction = new Utils::ParameterAction(tr("Rebuild Subproject"), tr("Rebuild Subproject \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
d->m_rebuildSubProjectAction = new QAction(Icons::REBUILD.icon(), tr("Rebuild"),
this);
command = ActionManager::registerAction(d->m_rebuildSubProjectAction, Constants::REBUILDSUBDIR, projectContext);
command->setAttribute(Command::CA_Hide);
command->setAttribute(Command::CA_UpdateText);
command->setDescription(d->m_rebuildSubProjectAction->text());
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_REBUILD);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_SUBPROJECT);
connect(d->m_rebuildSubProjectAction, &QAction::triggered,
d, &QmakeProjectManagerPluginPrivate::rebuildSubDirContextMenu);
d->m_cleanSubProjectAction = new Utils::ParameterAction(tr("Clean Subproject"), tr("Clean Subproject \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
d->m_cleanSubProjectAction = new QAction(Utils::Icons::CLEAN.icon(),tr("Clean"), this);
command = ActionManager::registerAction(d->m_cleanSubProjectAction, Constants::CLEANSUBDIR, projectContext);
command->setAttribute(Command::CA_Hide);
command->setAttribute(Command::CA_UpdateText);
command->setDescription(d->m_cleanSubProjectAction->text());
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_CLEAN);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_SUBPROJECT);
connect(d->m_cleanSubProjectAction, &QAction::triggered,
d, &QmakeProjectManagerPluginPrivate::cleanSubDirContextMenu);
@@ -269,7 +270,7 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
command->setAttribute(Command::CA_UpdateText);
command->setDescription(d->m_buildFileAction->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_FILE);
connect(d->m_buildFileAction, &QAction::triggered,
d, &QmakeProjectManagerPluginPrivate::buildFile);
@@ -547,8 +548,6 @@ void QmakeProjectManagerPluginPrivate::updateContextActions()
subProjectName = subProjectNode->displayName();
m_buildSubProjectAction->setParameter(subProjectName);
m_rebuildSubProjectAction->setParameter(subProjectName);
m_cleanSubProjectAction->setParameter(subProjectName);
m_buildSubProjectContextMenu->setParameter(proFileNode ? proFileNode->displayName() : QString());
auto buildConfiguration = (qmakeProject && qmakeProject->activeTarget()) ?