diff options
author | sr55 <[email protected]> | 2018-11-18 13:51:55 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2018-11-18 14:06:41 +0000 |
commit | fed19278e06db4a5fa2dffd5a5e513e6c1608197 (patch) | |
tree | b037a9a5b0ee1e93d12894e689ce1b1133ab63bc | |
parent | 3339b9f6ac0fe00ee5f086ac7335433badeb1c0a (diff) |
WinGui: Save Options when the app closes, if the options window was last open and unsaved.
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs index 827d0a0fb..ee2379045 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs @@ -33,5 +33,7 @@ namespace HandBrakeWPF.ViewModels.Interfaces /// Refresh certain UI controls that can be updated outside preferences.
/// </summary>
void UpdateSettings();
+
+ void Close();
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs index b646bf552..60706c3fd 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs @@ -202,20 +202,17 @@ namespace HandBrakeWPF.ViewModels if (result == MessageBoxResult.Yes)
{
processor.Stop();
- if (this.MainViewModel != null)
- {
- this.MainViewModel.Shutdown();
- }
+ this.MainViewModel?.Shutdown();
return true;
}
return false;
}
- if (this.MainViewModel != null)
- {
- this.MainViewModel.Shutdown();
- }
+ this.OptionsViewModel?.Close();
+
+ this.MainViewModel?.Shutdown();
+
return true;
}
}
|