]> granicus.if.org Git - handbrake/commitdiff
WinGui: Save Options when the app closes, if the options window was last open and...
authorsr55 <sr55.hb@outlook.com>
Sun, 18 Nov 2018 13:51:55 +0000 (13:51 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 18 Nov 2018 14:06:41 +0000 (14:06 +0000)
win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs

index 827d0a0fbad17726cd94e8b7df4c71cd804cef97..ee2379045d205e3bb63a457cdc55befbf76b4d2e 100644 (file)
@@ -33,5 +33,7 @@ namespace HandBrakeWPF.ViewModels.Interfaces
         /// Refresh certain UI controls that can be updated outside preferences.\r
         /// </summary>\r
         void UpdateSettings();\r
+\r
+        void Close();\r
     }\r
 }
\ No newline at end of file
index b646bf5524fe3608de0c5b247173780104573703..60706c3fdfedfbd75a911fd2e929487f7f30bc9b 100644 (file)
@@ -202,20 +202,17 @@ namespace HandBrakeWPF.ViewModels
                 if (result == MessageBoxResult.Yes)\r
                 {\r
                     processor.Stop();\r
-                    if (this.MainViewModel != null)\r
-                    {\r
-                        this.MainViewModel.Shutdown();\r
-                    }\r
+                    this.MainViewModel?.Shutdown();\r
 \r
                     return true;\r
                 }\r
                 return false;\r
             }\r
 \r
-            if (this.MainViewModel != null)\r
-            {\r
-                this.MainViewModel.Shutdown();\r
-            }\r
+            this.OptionsViewModel?.Close();\r
+\r
+            this.MainViewModel?.Shutdown();\r
+\r
             return true;\r
         }\r
     }\r