forked from qt-creator/qt-creator
ProjectExplorer: Be more transparent about how we stop a process
Forward the information about the two-stage stop procedure to the user. Change-Id: I5facd44d2fa6a4db3de09936f07f69840344eb03 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -784,6 +784,7 @@ public:
|
|||||||
m_killTimer.setSingleShot(true);
|
m_killTimer.setSingleShot(true);
|
||||||
connect(&m_killTimer, &QTimer::timeout, this, [this] {
|
connect(&m_killTimer, &QTimer::timeout, this, [this] {
|
||||||
m_killTimer.stop();
|
m_killTimer.stop();
|
||||||
|
emit q->stoppingForcefully();
|
||||||
sendControlSignal(ControlSignal::Kill);
|
sendControlSignal(ControlSignal::Kill);
|
||||||
});
|
});
|
||||||
setupDebugLog();
|
setupDebugLog();
|
||||||
@@ -1658,6 +1659,7 @@ void Process::stop()
|
|||||||
if (state() == QProcess::NotRunning)
|
if (state() == QProcess::NotRunning)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
emit requestingStop();
|
||||||
d->sendControlSignal(ControlSignal::Terminate);
|
d->sendControlSignal(ControlSignal::Terminate);
|
||||||
d->m_killTimer.start(d->m_process->m_setup.m_reaperTimeout);
|
d->m_killTimer.start(d->m_process->m_setup.m_reaperTimeout);
|
||||||
}
|
}
|
||||||
|
@@ -199,6 +199,8 @@ signals:
|
|||||||
void readyReadStandardError();
|
void readyReadStandardError();
|
||||||
void textOnStandardOutput(const QString &text);
|
void textOnStandardOutput(const QString &text);
|
||||||
void textOnStandardError(const QString &text);
|
void textOnStandardError(const QString &text);
|
||||||
|
void requestingStop();
|
||||||
|
void stoppingForcefully();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const Process &r);
|
friend QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const Process &r);
|
||||||
|
@@ -1296,6 +1296,12 @@ SimpleTargetRunnerPrivate::SimpleTargetRunnerPrivate(SimpleTargetRunner *parent)
|
|||||||
this, &SimpleTargetRunnerPrivate::handleStandardError);
|
this, &SimpleTargetRunnerPrivate::handleStandardError);
|
||||||
connect(&m_process, &Process::readyReadStandardOutput,
|
connect(&m_process, &Process::readyReadStandardOutput,
|
||||||
this, &SimpleTargetRunnerPrivate::handleStandardOutput);
|
this, &SimpleTargetRunnerPrivate::handleStandardOutput);
|
||||||
|
connect(&m_process, &Process::requestingStop, this, [this] {
|
||||||
|
q->appendMessage(Tr::tr("Requesting process to stop ...."), NormalMessageFormat);
|
||||||
|
});
|
||||||
|
connect(&m_process, &Process::stoppingForcefully, this, [this] {
|
||||||
|
q->appendMessage(Tr::tr("Stopping process forcefully ...."), NormalMessageFormat);
|
||||||
|
});
|
||||||
|
|
||||||
m_waitForDoneTimer.setSingleShot(true);
|
m_waitForDoneTimer.setSingleShot(true);
|
||||||
connect(&m_waitForDoneTimer, &QTimer::timeout, this, [this] {
|
connect(&m_waitForDoneTimer, &QTimer::timeout, this, [this] {
|
||||||
|
Reference in New Issue
Block a user