Commit 9fe7f657 authored by Daniel Teske's avatar Daniel Teske
Browse files

Show a more descriptive "Clean" or "Deploy" while doing that.



Change-Id: I706cf262e655c75f60008f78e660843d57bee345
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent f36fc6e1
......@@ -80,6 +80,7 @@ struct BuildManagerPrivate {
Internal::TaskWindow *m_taskWindow;
QList<BuildStep *> m_buildQueue;
QStringList m_stepNames;
QStringList m_configurations; // the corresponding configuration to the m_buildQueue
ProjectExplorerPlugin *m_projectExplorerPlugin;
bool m_running;
......@@ -102,6 +103,7 @@ struct BuildManagerPrivate {
int m_maxProgress;
QFutureInterface<void> *m_progressFutureInterface;
QFutureWatcher<void> m_progressWatcher;
QWeakPointer<Core::FutureProgress> m_futureProgress;
};
BuildManagerPrivate::BuildManagerPrivate() :
......@@ -268,6 +270,7 @@ void BuildManager::clearBuildQueue()
disconnectOutput(bs);
}
d->m_stepNames.clear();
d->m_buildQueue.clear();
d->m_running = false;
d->m_previousBuildStepProject = 0;
......@@ -278,6 +281,7 @@ void BuildManager::clearBuildQueue()
d->m_progressWatcher.setFuture(QFuture<void>());
delete d->m_progressFutureInterface;
d->m_progressFutureInterface = 0;
d->m_futureProgress.clear();
d->m_maxProgress = 0;
emit buildQueueFinished(false);
......@@ -322,12 +326,12 @@ void BuildManager::startBuildQueue()
d->m_taskHub->clearTasks(Constants::TASK_CATEGORY_COMPILE);
d->m_taskHub->clearTasks(Constants::TASK_CATEGORY_BUILDSYSTEM);
progressManager->setApplicationLabel(QString());
Core::FutureProgress *progress = progressManager->addTask(d->m_progressFutureInterface->future(),
tr("Build"),
d->m_futureProgress = QWeakPointer<Core::FutureProgress>(progressManager->addTask(d->m_progressFutureInterface->future(),
"",
Constants::TASK_BUILD,
Core::ProgressManager::KeepOnFinish | Core::ProgressManager::ShowInApplicationIcon);
connect(progress, SIGNAL(clicked()), this, SLOT(showBuildResults()));
progress->setWidget(new Internal::BuildProgress(d->m_taskWindow));
Core::ProgressManager::KeepOnFinish | Core::ProgressManager::ShowInApplicationIcon));
connect(d->m_futureProgress.data(), SIGNAL(clicked()), this, SLOT(showBuildResults()));
d->m_futureProgress.data()->setWidget(new Internal::BuildProgress(d->m_taskWindow));
d->m_progress = 0;
d->m_progressFutureInterface->setProgressRange(0, d->m_maxProgress * 100);
......@@ -441,6 +445,9 @@ void BuildManager::nextStep()
if (!d->m_buildQueue.empty()) {
d->m_currentBuildStep = d->m_buildQueue.front();
d->m_buildQueue.pop_front();
QString name = d->m_stepNames.takeFirst();
if (d->m_futureProgress)
d->m_futureProgress.data()->setTitle(name);
if (d->m_currentBuildStep->project() != d->m_previousBuildStepProject) {
const QString projectName = d->m_currentBuildStep->project()->displayName();
......@@ -469,7 +476,7 @@ void BuildManager::nextStep()
}
}
bool BuildManager::buildQueueAppend(QList<BuildStep *> steps)
bool BuildManager::buildQueueAppend(QList<BuildStep *> steps, const QStringList &names)
{
int count = steps.size();
bool init = true;
......@@ -504,23 +511,32 @@ bool BuildManager::buildQueueAppend(QList<BuildStep *> steps)
for (i = 0; i < count; ++i) {
++d->m_maxProgress;
d->m_buildQueue.append(steps.at(i));
d->m_stepNames.append(names.at(i));
incrementActiveBuildSteps(steps.at(i));
}
return true;
}
bool BuildManager::buildList(BuildStepList *bsl)
bool BuildManager::buildList(BuildStepList *bsl, const QString &stepListName)
{
return buildLists(QList<BuildStepList *>() << bsl);
return buildLists(QList<BuildStepList *>() << bsl, QStringList() << stepListName);
}
bool BuildManager::buildLists(QList<BuildStepList *> bsls)
bool BuildManager::buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames)
{
QList<BuildStep *> steps;
foreach(BuildStepList *list, bsls)
steps.append(list->steps());
bool success = buildQueueAppend(steps);
QStringList names;
names.reserve(steps.size());
for (int i = 0; i < bsls.size(); ++i) {
for (int j = 0; j < bsls.at(i)->steps().size(); ++j) {
names.append(stepListNames.at(i));
}
}
bool success = buildQueueAppend(steps, names);
if (!success) {
d->m_outputWindow->popup(false);
return false;
......@@ -532,9 +548,9 @@ bool BuildManager::buildLists(QList<BuildStepList *> bsls)
return true;
}
void BuildManager::appendStep(BuildStep *step)
void BuildManager::appendStep(BuildStep *step, const QString &name)
{
bool success = buildQueueAppend(QList<BuildStep *>() << step);
bool success = buildQueueAppend(QList<BuildStep *>() << step, QStringList() << name);
if (!success) {
d->m_outputWindow->popup(false);
return;
......
......@@ -60,15 +60,16 @@ public:
bool tasksAvailable() const;
bool buildLists(QList<BuildStepList *> bsls);
bool buildList(BuildStepList *bsl);
bool buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames);
bool buildList(BuildStepList *bsl, const QString &stepListName);
bool isBuilding(Project *p);
bool isBuilding(Target *t);
bool isBuilding(ProjectConfiguration *p);
bool isBuilding(BuildStep *step);
// Append any build step to the list of build steps (currently only used to add the QMakeStep)
void appendStep(BuildStep *step);
void appendStep(BuildStep *step, const QString &name);
int getErrorTaskCount() const;
......@@ -105,7 +106,7 @@ private:
void startBuildQueue();
void nextStep();
void clearBuildQueue();
bool buildQueueAppend(QList<BuildStep *> steps);
bool buildQueueAppend(QList<BuildStep *> steps, const QStringList &names);
void incrementActiveBuildSteps(BuildStep *bs);
void decrementActiveBuildSteps(BuildStep *bs);
void disconnectOutput(BuildStep *bs);
......
......@@ -1769,6 +1769,17 @@ void ProjectExplorerPlugin::deploy(QList<Project *> projects)
queue(projects, steps);
}
QString ProjectExplorerPlugin::displayNameForStepId(const QString &stepId)
{
if (stepId == Constants::BUILDSTEPS_CLEAN)
return tr("Clean");
else if (stepId == Constants::BUILDSTEPS_BUILD)
return tr("Build");
else if (stepId == Constants::BUILDSTEPS_DEPLOY)
return tr("Deploy");
return tr("Build");
}
int ProjectExplorerPlugin::queue(QList<Project *> projects, QStringList stepIds)
{
if (debug) {
......@@ -1801,7 +1812,12 @@ int ProjectExplorerPlugin::queue(QList<Project *> projects, QStringList stepIds)
if (stepLists.isEmpty())
return 0;
if (!d->m_buildManager->buildLists(stepLists))
QStringList names;
foreach (const QString &stepId, stepIds)
names << displayNameForStepId(stepId);
if (!d->m_buildManager->buildLists(stepLists, names))
return -1;
return stepLists.count();
}
......
......@@ -128,6 +128,8 @@ public:
QList<RunControl *> runControls() const;
static QString displayNameForStepId(const QString &stepId);
signals:
void runControlStarted(ProjectExplorer::RunControl *rc);
void runControlFinished(ProjectExplorer::RunControl *rc);
......
......@@ -731,7 +731,9 @@ void QMakeStepConfigWidget::recompileMessageBoxFinished(int button)
QList<ProjectExplorer::BuildStepList *> stepLists;
stepLists << bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
stepLists << bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
ProjectExplorerPlugin::instance()->buildManager()->buildLists(stepLists);
ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager();
bm->buildLists(stepLists, QStringList() << ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)
<< ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_BUILD));
}
}
......
......@@ -366,7 +366,7 @@ void Qt4Manager::runQMake(ProjectExplorer::Project *p, ProjectExplorer::Node *no
if (Qt4ProFileNode *profile = qobject_cast<Qt4ProFileNode *>(node))
bc->setSubNodeBuild(profile);
projectExplorer()->buildManager()->appendStep(qs);
projectExplorer()->buildManager()->appendStep(qs, tr("QMake"));
bc->setSubNodeBuild(0);
}
......@@ -401,14 +401,20 @@ void Qt4Manager::handleSubDirContexMenu(Qt4Manager::Action action)
if (projectExplorer()->saveModifiedFiles()) {
if (action == BUILD) {
projectExplorer()->buildManager()->buildList(bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD));
QString name = ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
projectExplorer()->buildManager()->buildList(bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD), name);
} else if (action == CLEAN) {
projectExplorer()->buildManager()->buildList(bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
QString name = ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
projectExplorer()->buildManager()->buildList(bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN), name);
} else if (action == REBUILD) {
QStringList names;
names << ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)
<< ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
QList<ProjectExplorer::BuildStepList *> stepLists;
stepLists << bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
stepLists << bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
projectExplorer()->buildManager()->buildLists(stepLists);
projectExplorer()->buildManager()->buildLists(stepLists, names);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment