McuSupport: Improve message box warning

The message box might show up when applying changes in other settings
pages if the user left the Devices > MCU tab with invalid fields.
Improve the warning message with settings page and target name.

Change-Id: I335fadd3b5d4c6be10c6bd5100d6aac3c50017f2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Daniele Bortolotti
2022-11-02 16:41:59 +01:00
parent 0d1e1ebab6
commit 8de9892c4e

View File

@@ -293,7 +293,7 @@ void McuSupportOptionsWidget::apply()
QMessageBox warningPopup(QMessageBox::Icon::Warning,
Tr::tr("Warning"),
Tr::tr("Unable to apply changes."),
Tr::tr("Unable to apply changes in Devices > MCU."),
QMessageBox::Ok,
this);
@@ -304,7 +304,9 @@ void McuSupportOptionsWidget::apply()
return;
}
if (!target->isValid()) {
warningPopup.setInformativeText(Tr::tr("Invalid path(s) present."));
warningPopup.setInformativeText(
Tr::tr("Invalid paths present for target\n%1")
.arg(McuKitManager::generateKitNameFromTarget(target.get())));
warningPopup.exec();
return;
}