Add runControl started/finished signals to the projectexplorer

Change-Id: I17e6f09af61d4acf490eb48be690ddeacc10aac3
Reviewed-by: Paweł Polański <jaggernod@gmail.com>
This commit is contained in:
Daniel Teske
2011-10-20 12:59:13 +00:00
committed by Paweł Polański
parent b70f30a911
commit bf80aca831
4 changed files with 18 additions and 6 deletions

View File

@@ -299,9 +299,9 @@ void AppOutputPane::setFocus()
void AppOutputPane::createNewOutputWindow(RunControl *rc)
{
connect(rc, SIGNAL(started()),
this, SLOT(runControlStarted()));
this, SLOT(slotRunControlStarted()));
connect(rc, SIGNAL(finished()),
this, SLOT(runControlFinished()), Qt::QueuedConnection);
this, SLOT(slotRunControlFinished()), Qt::QueuedConnection);
connect(rc, SIGNAL(applicationProcessHandleChanged()),
this, SLOT(enableButtons()));
connect(rc, SIGNAL(appendMessage(ProjectExplorer::RunControl*,QString,Utils::OutputFormat)),
@@ -531,14 +531,15 @@ void AppOutputPane::contextMenuRequested(const QPoint &pos, int index)
}
}
void AppOutputPane::runControlStarted()
void AppOutputPane::slotRunControlStarted()
{
RunControl *current = currentRunControl();
if (current && current == sender())
enableButtons(current, true); // RunControl::isRunning() cannot be trusted in signal handler.
emit runControlStarted(current);
}
void AppOutputPane::runControlFinished()
void AppOutputPane::slotRunControlFinished()
{
RunControl *senderRunControl = qobject_cast<RunControl *>(sender());
const int senderIndex = indexOf(senderRunControl);
@@ -559,6 +560,8 @@ void AppOutputPane::runControlFinished()
if (m_runControlTabs.at(senderIndex).asyncClosing)
closeTab(tabWidgetIndexOf(senderIndex), CloseTabNoPrompt);
emit runControlFinished(senderRunControl);
if (!isRunning())
emit allRunControlsFinished();
}