forked from qt-creator/qt-creator
Add runControl started/finished signals to the projectexplorer
Change-Id: I17e6f09af61d4acf490eb48be690ddeacc10aac3 Reviewed-by: Paweł Polański <jaggernod@gmail.com>
This commit is contained in:
committed by
Paweł Polański
parent
b70f30a911
commit
bf80aca831
@@ -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();
|
||||
}
|
||||
|
||||
@@ -88,6 +88,8 @@ public:
|
||||
|
||||
signals:
|
||||
void allRunControlsFinished();
|
||||
void runControlStarted(ProjectExplorer::RunControl *rc);
|
||||
void runControlFinished(ProjectExplorer::RunControl *rc);
|
||||
|
||||
public slots:
|
||||
// ApplicationOutput specifics
|
||||
@@ -103,8 +105,8 @@ private slots:
|
||||
bool closeTab(int index);
|
||||
void tabChanged(int);
|
||||
void contextMenuRequested(const QPoint &pos, int index);
|
||||
void runControlStarted();
|
||||
void runControlFinished();
|
||||
void slotRunControlStarted();
|
||||
void slotRunControlFinished();
|
||||
|
||||
void aboutToUnloadSession();
|
||||
void updateFromSettings();
|
||||
|
||||
@@ -385,6 +385,11 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)),
|
||||
d->m_outputPane, SLOT(projectRemoved()));
|
||||
|
||||
connect(d->m_outputPane, SIGNAL(runControlStarted(ProjectExplorer::RunControl*)),
|
||||
this, SIGNAL(runControlStarted(ProjectExplorer::RunControl*)));
|
||||
connect(d->m_outputPane, SIGNAL(runControlFinished(ProjectExplorer::RunControl*)),
|
||||
this, SIGNAL(runControlFinished(ProjectExplorer::RunControl*)));
|
||||
|
||||
AllProjectsFilter *allProjectsFilter = new AllProjectsFilter(this);
|
||||
addAutoReleasedObject(allProjectsFilter);
|
||||
|
||||
|
||||
@@ -128,6 +128,8 @@ public:
|
||||
QList<RunControl *> runControls() const;
|
||||
|
||||
signals:
|
||||
void runControlStarted(ProjectExplorer::RunControl *rc);
|
||||
void runControlFinished(ProjectExplorer::RunControl *rc);
|
||||
void aboutToShowContextMenu(ProjectExplorer::Project *project,
|
||||
ProjectExplorer::Node *node);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user