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);
|
||||
connect(&m_killTimer, &QTimer::timeout, this, [this] {
|
||||
m_killTimer.stop();
|
||||
emit q->stoppingForcefully();
|
||||
sendControlSignal(ControlSignal::Kill);
|
||||
});
|
||||
setupDebugLog();
|
||||
@@ -1658,6 +1659,7 @@ void Process::stop()
|
||||
if (state() == QProcess::NotRunning)
|
||||
return;
|
||||
|
||||
emit requestingStop();
|
||||
d->sendControlSignal(ControlSignal::Terminate);
|
||||
d->m_killTimer.start(d->m_process->m_setup.m_reaperTimeout);
|
||||
}
|
||||
|
@@ -199,6 +199,8 @@ signals:
|
||||
void readyReadStandardError();
|
||||
void textOnStandardOutput(const QString &text);
|
||||
void textOnStandardError(const QString &text);
|
||||
void requestingStop();
|
||||
void stoppingForcefully();
|
||||
|
||||
private:
|
||||
friend QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const Process &r);
|
||||
|
@@ -1296,6 +1296,12 @@ SimpleTargetRunnerPrivate::SimpleTargetRunnerPrivate(SimpleTargetRunner *parent)
|
||||
this, &SimpleTargetRunnerPrivate::handleStandardError);
|
||||
connect(&m_process, &Process::readyReadStandardOutput,
|
||||
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);
|
||||
connect(&m_waitForDoneTimer, &QTimer::timeout, this, [this] {
|
||||
|
Reference in New Issue
Block a user