forked from qt-creator/qt-creator
ProjectExplorer: Move build step name mapping to BuildManager
... and add some translation hints. Looks like a more natural place to live in. Change-Id: I3e8917d826baaa7277dde744f3843d5ab7fe0afd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -442,6 +442,20 @@ const Internal::CompileOutputSettings &BuildManager::compileOutputSettings()
|
|||||||
return d->m_outputWindow->settings();
|
return d->m_outputWindow->settings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString BuildManager::displayNameForStepId(Id stepId)
|
||||||
|
{
|
||||||
|
if (stepId == Constants::BUILDSTEPS_CLEAN) {
|
||||||
|
//: Displayed name for a "cleaning" build step
|
||||||
|
return tr("Clean");
|
||||||
|
}
|
||||||
|
if (stepId == Constants::BUILDSTEPS_DEPLOY) {
|
||||||
|
//: Displayed name for a deploy step
|
||||||
|
return tr("Deploy");
|
||||||
|
}
|
||||||
|
//: Displayed name for a normal build step
|
||||||
|
return tr("Build");
|
||||||
|
}
|
||||||
|
|
||||||
void BuildManager::cancel()
|
void BuildManager::cancel()
|
||||||
{
|
{
|
||||||
if (d->m_running) {
|
if (d->m_running) {
|
||||||
@@ -775,7 +789,7 @@ bool BuildManager::buildLists(const QList<BuildStepList *> bsls, const QStringLi
|
|||||||
QStringList stepListNames;
|
QStringList stepListNames;
|
||||||
for (BuildStepList *list : bsls) {
|
for (BuildStepList *list : bsls) {
|
||||||
steps.append(list->steps());
|
steps.append(list->steps());
|
||||||
stepListNames.append(ProjectExplorerPlugin::displayNameForStepId(list->id()));
|
stepListNames.append(displayNameForStepId(list->id()));
|
||||||
d->m_isDeploying = d->m_isDeploying || list->id() == Constants::BUILDSTEPS_DEPLOY;
|
d->m_isDeploying = d->m_isDeploying || list->id() == Constants::BUILDSTEPS_DEPLOY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -91,6 +91,8 @@ public:
|
|||||||
static void setCompileOutputSettings(const Internal::CompileOutputSettings &settings);
|
static void setCompileOutputSettings(const Internal::CompileOutputSettings &settings);
|
||||||
static const Internal::CompileOutputSettings &compileOutputSettings();
|
static const Internal::CompileOutputSettings &compileOutputSettings();
|
||||||
|
|
||||||
|
static QString displayNameForStepId(Core::Id stepId);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
static void cancel();
|
static void cancel();
|
||||||
// Shows without focus
|
// Shows without focus
|
||||||
|
@@ -2713,17 +2713,6 @@ ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate()
|
|||||||
m_allProjectDirectoriesFilter.setIsCustomFilter(false);
|
m_allProjectDirectoriesFilter.setIsCustomFilter(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ProjectExplorerPlugin::displayNameForStepId(Id stepId)
|
|
||||||
{
|
|
||||||
if (stepId == Constants::BUILDSTEPS_CLEAN)
|
|
||||||
return tr("Clean");
|
|
||||||
if (stepId == Constants::BUILDSTEPS_BUILD)
|
|
||||||
return tr("Build", "Build step");
|
|
||||||
if (stepId == Constants::BUILDSTEPS_DEPLOY)
|
|
||||||
return tr("Deploy");
|
|
||||||
return tr("Build", "Build step");
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProjectExplorerPluginPrivate::runProjectContextMenu()
|
void ProjectExplorerPluginPrivate::runProjectContextMenu()
|
||||||
{
|
{
|
||||||
const Node *node = ProjectTree::currentNode();
|
const Node *node = ProjectTree::currentNode();
|
||||||
|
@@ -162,8 +162,6 @@ public:
|
|||||||
|
|
||||||
static void initiateInlineRenaming();
|
static void initiateInlineRenaming();
|
||||||
|
|
||||||
static QString displayNameForStepId(Core::Id stepId);
|
|
||||||
|
|
||||||
static QStringList projectFileGlobs();
|
static QStringList projectFileGlobs();
|
||||||
|
|
||||||
static QThreadPool *sharedThreadPool();
|
static QThreadPool *sharedThreadPool();
|
||||||
|
@@ -850,7 +850,7 @@ bool QmakeBuildConfiguration::regenerateBuildFiles(Node *node)
|
|||||||
qs->setForced(true);
|
qs->setForced(true);
|
||||||
|
|
||||||
BuildManager::buildList(cleanSteps());
|
BuildManager::buildList(cleanSteps());
|
||||||
BuildManager::appendStep(qs, ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
|
BuildManager::appendStep(qs, BuildManager::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
|
||||||
|
|
||||||
QmakeProFileNode *proFile = nullptr;
|
QmakeProFileNode *proFile = nullptr;
|
||||||
if (node && node != target()->project()->rootProjectNode())
|
if (node && node != target()->project()->rootProjectNode())
|
||||||
|
Reference in New Issue
Block a user