Commit 3c759ad5 authored by Yuchen Deng's avatar Yuchen Deng Committed by Daniel Teske
Browse files

Abort running is possible if any build error occured



If we have always deploy project before running option, we need make sure
there not have any build error occured.
If there still exist some build error, we should make a choice for user,
To continue or abort by showing QMessage::question.

Change-Id: I99844494076ce471fb66c059146f5a196bff1451
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent ba15f8ec
......@@ -193,6 +193,14 @@ bool BuildManager::isBuilding() const
return !d->m_buildQueue.isEmpty() || d->m_running;
}
int BuildManager::getErrorTaskCount() const
{
const int errors =
d->m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_BUILDSYSTEM)
+ d->m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_COMPILE);
return errors;
}
void BuildManager::cancel()
{
if (d->m_running) {
......@@ -231,9 +239,7 @@ void BuildManager::cancel()
void BuildManager::updateTaskCount()
{
Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager();
const int errors =
d->m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_BUILDSYSTEM)
+ d->m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_COMPILE);
const int errors = getErrorTaskCount();
if (errors > 0) {
progressManager->setApplicationLabel(QString::number(errors));
} else {
......
......@@ -68,6 +68,8 @@ public:
// Append any build step to the list of build steps (currently only used to add the QMakeStep)
void appendStep(BuildStep *step);
int getErrorTaskCount() const;
public slots:
void cancel();
// Shows without focus
......
......@@ -1557,7 +1557,19 @@ void ProjectExplorerPlugin::buildQueueFinished(bool success)
updateActions();
if (success && d->m_delayedRunConfiguration) {
bool ignoreErrors = true;
if (d->m_delayedRunConfiguration) {
if (d->m_buildManager->getErrorTaskCount() > 0) {
ignoreErrors = QMessageBox::question(Core::ICore::instance()->mainWindow(),
tr("Ignore all errors?"),
tr("Found some build errors in current task.\n"
"Do you want to ignore them?"),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No) == QMessageBox::Yes;
}
}
if (success && ignoreErrors && d->m_delayedRunConfiguration) {
executeRunConfiguration(d->m_delayedRunConfiguration, d->m_runMode);
} else {
if (d->m_buildManager->tasksAvailable())
......
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