From d18bbf25b4ed9561ca06f11ce151c1ab22cf2824 Mon Sep 17 00:00:00 2001 From: Roderick Griffioen Date: Sat, 21 Jan 2023 17:27:31 +0100 Subject: [PATCH] When clicking on the reset board you are now asked if you are sure (#1085) * When clicking on the reset board you are now asked if you are sure you want to reset the config as per request #1084. * Changes to the text as requested. * Fixes #1085 When clicking on the reset board you are now asked if you are sure you want to reset the config as per request. --- ProjectMessages/ProjectMessages.Designer.cs | 18 ++++++++++++++++++ ProjectMessages/ProjectMessages.de.resx | 6 ++++++ ProjectMessages/ProjectMessages.resx | 6 ++++++ UI/Panels/Settings/MobiFlightPanel.cs | 7 +++++++ 4 files changed, 37 insertions(+) diff --git a/ProjectMessages/ProjectMessages.Designer.cs b/ProjectMessages/ProjectMessages.Designer.cs index 247ec12c5..0ec976f7f 100644 --- a/ProjectMessages/ProjectMessages.Designer.cs +++ b/ProjectMessages/ProjectMessages.Designer.cs @@ -992,6 +992,24 @@ internal static string uiMessageProblemLoadingConfig { } } + /// + /// Looks up a localized string similar to Do you really want to uninstall the MobiFlight firmware? All your data will be removed from the board.. + /// + internal static string uiMessageResetConfirm { + get { + return ResourceManager.GetString("uiMessageResetConfirm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reset Board. + /// + internal static string uiMessageResetHint { + get { + return ResourceManager.GetString("uiMessageResetHint", resourceCulture); + } + } + /// /// Looks up a localized string similar to This change will require a restart of MobiFlight to become effective.. /// diff --git a/ProjectMessages/ProjectMessages.de.resx b/ProjectMessages/ProjectMessages.de.resx index 148a416a0..551bfd908 100644 --- a/ProjectMessages/ProjectMessages.de.resx +++ b/ProjectMessages/ProjectMessages.de.resx @@ -560,4 +560,10 @@ Please manually flash the boards using "upload firmware" and select the correct Der Wert muss eine gültige Zahl sein. The value must be a valid number. + + Möchtest Du wirklich die MobiFlight Firmware deinstallieren? Alle Deine Daten werden vom Board gelöscht. + + + Board zurücksetzen + \ No newline at end of file diff --git a/ProjectMessages/ProjectMessages.resx b/ProjectMessages/ProjectMessages.resx index ac4b45d03..719f55cd3 100644 --- a/ProjectMessages/ProjectMessages.resx +++ b/ProjectMessages/ProjectMessages.resx @@ -559,4 +559,10 @@ Check log for more details. The value must be a valid number. + + Do you really want to uninstall the MobiFlight firmware? All your data will be removed from the board. + + + Reset Board + \ No newline at end of file diff --git a/UI/Panels/Settings/MobiFlightPanel.cs b/UI/Panels/Settings/MobiFlightPanel.cs index 5e7a67b52..5078e1656 100644 --- a/UI/Panels/Settings/MobiFlightPanel.cs +++ b/UI/Panels/Settings/MobiFlightPanel.cs @@ -1406,6 +1406,13 @@ private void removePortFormIgnoreList(string port) private void resetBoardToolStripMenuItem_Click(object sender, EventArgs e) { + if (MessageBox.Show(i18n._tr("uiMessageResetConfirm"), + i18n._tr("uiMessageResetHint"), + MessageBoxButtons.OKCancel) != System.Windows.Forms.DialogResult.OK) + { + return; + } + TreeNode moduleNode = getModuleNode(); MobiFlightModule module = moduleNode.Tag as MobiFlightModule; List modules = new List();