Commit 3057c6ec authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Offer to force quit an application when closing its output window

Reviewed-by: dt
Task-number: QTCREATORBUG-1093
parent 70153d1c
......@@ -257,9 +257,19 @@ void OutputPane::closeTab(int index)
RunControl *rc = m_outputWindows.key(ow);
if (rc->isRunning()) {
QString msg = tr("The application is still running. Close it first.");
QMessageBox::critical(0, tr("Unable to close"), msg);
return;
QMessageBox messageBox(QMessageBox::Warning,
tr("Unable to close"),
tr("The application is still running."),
QMessageBox::Cancel | QMessageBox::Yes,
ow->window());
messageBox.setInformativeText(tr("Force it to quit?"));
messageBox.setDefaultButton(QMessageBox::Yes);
messageBox.button(QMessageBox::Yes)->setText(tr("Force Quit"));
if (messageBox.exec() != QMessageBox::Yes)
return;
rc->stop();
}
m_tabWidget->removeTab(index);
......
......@@ -162,7 +162,7 @@ public:
explicit RunControl(RunConfiguration *runConfiguration);
virtual ~RunControl();
virtual void start() = 0;
virtual void stop() = 0;
virtual void stop() = 0; // Warning: assumed to be synchroneous!
virtual bool isRunning() const = 0;
virtual QString displayName() const;
......
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