Devices: Do not pop up general messages pane

That should only happen on direct user interaction.
Also use new message manager API.

Task-number: QTCREATORBUG-24430
Change-Id: I87297b2ec7191b88210d3a2037afe27b8a3f40e9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Eike Ziller
2020-12-17 09:20:20 +01:00
parent c7e57ced3a
commit 6263a58ef3
3 changed files with 10 additions and 12 deletions

View File

@@ -87,9 +87,10 @@ const char *overridingEnvironmentVariable(QdbTool tool)
void showMessage(const QString &message, bool important) void showMessage(const QString &message, bool important)
{ {
const QString fullMessage = QCoreApplication::translate("Boot2Qt", "Boot2Qt: %1").arg(message); const QString fullMessage = QCoreApplication::translate("Boot2Qt", "Boot2Qt: %1").arg(message);
const Core::MessageManager::PrintToOutputPaneFlags flags = important if (important)
? Core::MessageManager::ModeSwitch : Core::MessageManager::Silent; Core::MessageManager::writeFlashing(fullMessage);
Core::MessageManager::write(fullMessage, flags); else
Core::MessageManager::writeSilently(fullMessage);
} }
QString settingsGroupKey() QString settingsGroupKey()

View File

@@ -193,15 +193,13 @@ LinuxDevice::LinuxDevice()
DeviceProcess * const proc = createProcess(nullptr); DeviceProcess * const proc = createProcess(nullptr);
QObject::connect(proc, &DeviceProcess::finished, [proc] { QObject::connect(proc, &DeviceProcess::finished, [proc] {
if (!proc->errorString().isEmpty()) { if (!proc->errorString().isEmpty()) {
Core::MessageManager::write(tr("Error running remote shell: %1") Core::MessageManager::writeDisrupting(
.arg(proc->errorString()), tr("Error running remote shell: %1").arg(proc->errorString()));
Core::MessageManager::ModeSwitch);
} }
proc->deleteLater(); proc->deleteLater();
}); });
QObject::connect(proc, &DeviceProcess::error, [proc] { QObject::connect(proc, &DeviceProcess::error, [proc] {
Core::MessageManager::write(tr("Error starting remote shell."), Core::MessageManager::writeDisrupting(tr("Error starting remote shell."));
Core::MessageManager::ModeSwitch);
proc->deleteLater(); proc->deleteLater();
}); });
Runnable runnable; Runnable runnable;

View File

@@ -176,8 +176,8 @@ void WinRtDeviceFactory::onPrerequisitesLoaded()
void WinRtDeviceFactory::onProcessError() void WinRtDeviceFactory::onProcessError()
{ {
MessageManager::write(tr("Error while executing winrtrunner: %1") MessageManager::writeDisrupting(
.arg(m_process->errorString()), MessageManager::Flash); tr("Error while executing winrtrunner: %1").arg(m_process->errorString()));
} }
void WinRtDeviceFactory::onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) void WinRtDeviceFactory::onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
@@ -190,8 +190,7 @@ void WinRtDeviceFactory::onProcessFinished(int exitCode, QProcess::ExitStatus ex
} }
if (exitCode != 0) { if (exitCode != 0) {
MessageManager::write(tr("winrtrunner returned with exit code %1.") MessageManager::writeFlashing(tr("winrtrunner returned with exit code %1.").arg(exitCode));
.arg(exitCode), MessageManager::Flash);
return; return;
} }