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)
|
void AppOutputPane::createNewOutputWindow(RunControl *rc)
|
||||||
{
|
{
|
||||||
connect(rc, SIGNAL(started()),
|
connect(rc, SIGNAL(started()),
|
||||||
this, SLOT(runControlStarted()));
|
this, SLOT(slotRunControlStarted()));
|
||||||
connect(rc, SIGNAL(finished()),
|
connect(rc, SIGNAL(finished()),
|
||||||
this, SLOT(runControlFinished()), Qt::QueuedConnection);
|
this, SLOT(slotRunControlFinished()), Qt::QueuedConnection);
|
||||||
connect(rc, SIGNAL(applicationProcessHandleChanged()),
|
connect(rc, SIGNAL(applicationProcessHandleChanged()),
|
||||||
this, SLOT(enableButtons()));
|
this, SLOT(enableButtons()));
|
||||||
connect(rc, SIGNAL(appendMessage(ProjectExplorer::RunControl*,QString,Utils::OutputFormat)),
|
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();
|
RunControl *current = currentRunControl();
|
||||||
if (current && current == sender())
|
if (current && current == sender())
|
||||||
enableButtons(current, true); // RunControl::isRunning() cannot be trusted in signal handler.
|
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());
|
RunControl *senderRunControl = qobject_cast<RunControl *>(sender());
|
||||||
const int senderIndex = indexOf(senderRunControl);
|
const int senderIndex = indexOf(senderRunControl);
|
||||||
@@ -559,6 +560,8 @@ void AppOutputPane::runControlFinished()
|
|||||||
if (m_runControlTabs.at(senderIndex).asyncClosing)
|
if (m_runControlTabs.at(senderIndex).asyncClosing)
|
||||||
closeTab(tabWidgetIndexOf(senderIndex), CloseTabNoPrompt);
|
closeTab(tabWidgetIndexOf(senderIndex), CloseTabNoPrompt);
|
||||||
|
|
||||||
|
emit runControlFinished(senderRunControl);
|
||||||
|
|
||||||
if (!isRunning())
|
if (!isRunning())
|
||||||
emit allRunControlsFinished();
|
emit allRunControlsFinished();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void allRunControlsFinished();
|
void allRunControlsFinished();
|
||||||
|
void runControlStarted(ProjectExplorer::RunControl *rc);
|
||||||
|
void runControlFinished(ProjectExplorer::RunControl *rc);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// ApplicationOutput specifics
|
// ApplicationOutput specifics
|
||||||
@@ -103,8 +105,8 @@ private slots:
|
|||||||
bool closeTab(int index);
|
bool closeTab(int index);
|
||||||
void tabChanged(int);
|
void tabChanged(int);
|
||||||
void contextMenuRequested(const QPoint &pos, int index);
|
void contextMenuRequested(const QPoint &pos, int index);
|
||||||
void runControlStarted();
|
void slotRunControlStarted();
|
||||||
void runControlFinished();
|
void slotRunControlFinished();
|
||||||
|
|
||||||
void aboutToUnloadSession();
|
void aboutToUnloadSession();
|
||||||
void updateFromSettings();
|
void updateFromSettings();
|
||||||
|
|||||||
@@ -385,6 +385,11 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)),
|
connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)),
|
||||||
d->m_outputPane, SLOT(projectRemoved()));
|
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);
|
AllProjectsFilter *allProjectsFilter = new AllProjectsFilter(this);
|
||||||
addAutoReleasedObject(allProjectsFilter);
|
addAutoReleasedObject(allProjectsFilter);
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,8 @@ public:
|
|||||||
QList<RunControl *> runControls() const;
|
QList<RunControl *> runControls() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void runControlStarted(ProjectExplorer::RunControl *rc);
|
||||||
|
void runControlFinished(ProjectExplorer::RunControl *rc);
|
||||||
void aboutToShowContextMenu(ProjectExplorer::Project *project,
|
void aboutToShowContextMenu(ProjectExplorer::Project *project,
|
||||||
ProjectExplorer::Node *node);
|
ProjectExplorer::Node *node);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user