ProjectExplorer: Split RunControl states further

This adds enough hooks to enable the base RunControl to take over
the task of most of the current ad-hoc "state machine" implementations
in derived RunControls (only exception is "intra-debugger" Start/Stop
handling), including error reporting.

The idea is to migrate "downstream" uses and finally remove the custom
state handling everywhere.

With this setup here, both varieties of RunControls can co-exist
for a while: New-style uses the Tool/Target state handling triggered
by the base RunControl::start implementation, old-style had this
function = 0, so all have their custom start() implementation.

'SimpleRunControl' derived cases (Local/RemoteLinux/Python run)
already use new-style with this patch SimpleRunControl doesn't
re-implement start().

Change-Id: I508f5ed05c557ca7188af92f9d9c8d00e2a4acfe
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2017-03-29 14:08:44 +02:00
parent bac2e6c17a
commit 54d49432f5
6 changed files with 277 additions and 98 deletions

View File

@@ -399,7 +399,7 @@ void AppOutputPane::updateBehaviorSettings()
void AppOutputPane::createNewOutputWindow(RunControl *rc)
{
connect(rc, &RunControl::started,
connect(rc, &RunControl::aboutToStart,
this, &AppOutputPane::slotRunControlStarted);
connect(rc, &RunControl::finished,
this, &AppOutputPane::slotRunControlFinished);
@@ -703,7 +703,6 @@ void AppOutputPane::slotRunControlStarted()
if (current && current == sender())
enableButtons(current, true); // RunControl::isRunning() cannot be trusted in signal handler.
emit runControlStarted(current);
}
void AppOutputPane::slotRunControlFinished()
@@ -734,7 +733,7 @@ void AppOutputPane::slotRunControlFinished2(RunControl *sender)
m_runControlTabs.at(senderIndex).window->setFormatter(nullptr); // Reset formater for this RC
emit runControlFinished(sender);
ProjectExplorerPlugin::instance()->updateRunActions();
if (!isRunning())
emit allRunControlsFinished();