summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-08-18 08:49:16 +0200
committerhjk <hjk@qt.io>2017-08-18 10:11:14 +0000
commitdb005bf5eb269d621b5ead1fb38ae993c7f91713 (patch)
treee3d2e92e14200f99372c274682aff3225fad26a2 /src/plugins/projectexplorer
parent98c48a4779e834e11ff568e0e6741cefa8e59570 (diff)
downloadqt-creator-db005bf5eb269d621b5ead1fb38ae993c7f91713.tar.gz
ProjectExplorer: Workaround for displaying startup failures
Failures during RunControl construction currently get not to the user as the Application output pane is not yet available. In theory it should not happen, rather the condition should be checked to disable running entirely, but in practice it can happen e.g. in the BareMetal setup right now. To avoid pre-release code restructuring, force a message box in such cases. Change-Id: I703c47b270d153afff34e08dad7833540a5983a2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r--src/plugins/projectexplorer/runconfiguration.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index 9ab4421ff4..e70f93a707 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -45,6 +45,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/icontext.h>
+#include <coreplugin/icore.h>
#include <QDir>
#include <QPushButton>
@@ -922,10 +923,29 @@ void RunControlPrivate::onWorkerFailed(RunWorker *worker, const QString &msg)
worker->d->state = RunWorkerState::Done;
showError(msg);
- if (state == RunControlState::Running || state == RunControlState::Starting)
+ switch (state) {
+ case RunControlState::Initialized:
+ // FIXME 1: We don't have an output pane yet, so use some other mechanism for now.
+ // FIXME 2: Translation...
+ QMessageBox::critical(Core::ICore::dialogParent(),
+ QCoreApplication::translate("TaskHub", "Error"),
+ QString("Failure during startup. Aborting.") + "<p>" + msg);
+ continueStopOrFinish();
+ break;
+ case RunControlState::Starting:
+ case RunControlState::Running:
initiateStop();
- else
+ break;
+ case RunControlState::Stopping:
+ case RunControlState::Finishing:
+ continueStopOrFinish();
+ break;
+ case RunControlState::Stopped:
+ case RunControlState::Finished:
+ QTC_CHECK(false); // Should not happen.
continueStopOrFinish();
+ break;
+ }
}
void RunControlPrivate::onWorkerStopped(RunWorker *worker)