Skip to content

Commit 6f563be

Browse files
committed
#49 Settings - Reset dialog enhanced
1 parent 0112336 commit 6f563be

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

Source/NETworkManager/Resources/Localization/Resources.de-DE.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@
161161
<system:String x:Key="String_ApplicationSettings">Anwendungseinstellungen</system:String>
162162
<system:String x:Key="String_NetworkInterfaceProfiles">Netzwerkinterface Profile</system:String>
163163
<system:String x:Key="String_WakeOnLANClients">Wake on LAN Clients</system:String>
164-
<system:String x:Key="String_SelectedSettingsAreReset">Die ausgewählten Einstellungen werden zurückgesetzt. (Der Speicherpfad ist hiervon nicht betroffen.)</system:String>
165-
<system:String x:Key="String_ApplicationIsRestartedAfterwards">* Die Anwendung wird danach neu gestartet</system:String>
164+
<system:String x:Key="String_SelectedSettingsAreReset">Die ausgewählten Einstellungen werden zurückgesetzt.</system:String>
165+
<system:String x:Key="String_TheSettingsLocationIsNotAffected">Der Speicherpfad ist hiervon nicht betroffen</system:String>
166+
<system:String x:Key="String_ApplicationIsRestartedAfterwards">Die Anwendung wird danach neu gestartet</system:String>
166167
<system:String x:Key="String_SelectTheSettingsYouWantToImport">Wählen Sie die Einstellungen aus, die Sie importieren möchten:</system:String>
167168
<system:String x:Key="String_SelectTheSettingsYouWantToExport">Wählen Sie die Einstellungen aus, die Sie exportieren möchten:</system:String>
168169
<system:String x:Key="String_SelectTheSettingsYouWantToReset">Wählen Sie die Einstellungen aus, die Sie zurücksetzen möchten:</system:String>

Source/NETworkManager/Resources/Localization/Resources.en-US.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@
161161
<system:String x:Key="String_ApplicationSettings">Application settings</system:String>
162162
<system:String x:Key="String_NetworkInterfaceProfiles">Network interface profiles</system:String>
163163
<system:String x:Key="String_WakeOnLANClients">Wake on LAN clients</system:String>
164-
<system:String x:Key="String_SelectedSettingsAreReset">The selected settings are reset (The settings location is not affected.)</system:String>
165-
<system:String x:Key="String_ApplicationIsRestartedAfterwards">* Application is restarted afterwards</system:String>
164+
<system:String x:Key="String_SelectedSettingsAreReset">The selected settings are reset.</system:String>
165+
<system:String x:Key="String_TheSettingsLocationIsNotAffected">The settings location is not affected</system:String>
166+
<system:String x:Key="String_ApplicationIsRestartedAfterwards">Application is restarted afterwards</system:String>
166167
<system:String x:Key="String_SelectTheSettingsYouWantToImport">Select the settings you want to import:</system:String>
167168
<system:String x:Key="String_SelectTheSettingsYouWantToExport">Select the settings you want to export:</system:String>
168169
<system:String x:Key="String_SelectTheSettingsYouWantToReset">Select the settings you want to reset:</system:String>

Source/NETworkManager/ViewModels/Settings/SettingsGeneralSettingsViewModel.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ private async void ChangeSettingsAction()
241241

242242
LocationSelectedPath = string.Empty;
243243
LocationSelectedPath = Properties.Settings.Default.Settings_CustomSettingsLocation;
244-
244+
245245
MovingFiles = false;
246246
}
247247

@@ -272,7 +272,10 @@ public async void ResetSettingsAction()
272272
string message = Application.Current.Resources["String_SelectedSettingsAreReset"] as string;
273273

274274
if (ResetEverything || ResetApplicationSettings)
275-
message += Environment.NewLine + Environment.NewLine + Application.Current.Resources["String_ApplicationIsRestartedAfterwards"] as string;
275+
{
276+
message += Environment.NewLine + Environment.NewLine + string.Format("* {0}", Application.Current.Resources["String_TheSettingsLocationIsNotAffected"] as string);
277+
message += Environment.NewLine + string.Format("* {0}", Application.Current.Resources["String_ApplicationIsRestartedAfterwards"] as string);
278+
}
276279

277280
if (await dialogCoordinator.ShowMessageAsync(this, Application.Current.Resources["String_Header_AreYouSure"] as string, message, MessageDialogStyle.AffirmativeAndNegative, settings) != MessageDialogResult.Affirmative)
278281
return;
@@ -291,10 +294,17 @@ public async void ResetSettingsAction()
291294
if (WakeOnLANClientsExists && (ResetEverything || ResetWakeOnLANClients))
292295
WakeOnLANClientManager.Reset();
293296

297+
// Restart after reset or show a completed message
294298
if (forceRestart)
299+
{
295300
CloseAction();
301+
}
296302
else
297-
await dialogCoordinator.ShowMessageAsync(this, Application.Current.Resources["String_Header_Success"] as string, Application.Current.Resources["String_SettingsSuccessfullyReset"] as string, MessageDialogStyle.Affirmative, AppearanceManager.MetroDialog);
303+
{
304+
settings.AffirmativeButtonText = Application.Current.Resources["String_Button_OK"] as string;
305+
306+
await dialogCoordinator.ShowMessageAsync(this, Application.Current.Resources["String_Header_Success"] as string, Application.Current.Resources["String_SettingsSuccessfullyReset"] as string, MessageDialogStyle.Affirmative, settings);
307+
}
298308
}
299309
#endregion
300310

0 commit comments

Comments
 (0)