From 683505eb8228641be1d206f9a1e0a5c060bb0ed9 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 14 Sep 2018 21:59:25 +0100 Subject: WinGui: Add a prompt on Stop Encode to confirm. Fixes #1571 --- win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs | 18 ++++++++++++++++++ win/CS/HandBrakeWPF/Properties/ResourcesUI.resx | 6 ++++++ win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 11 ++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) (limited to 'win/CS') diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index 59ccc80ac..30e22c278 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -1068,6 +1068,24 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Stop Encode. + /// + public static string MainView_StopEncode { + get { + return ResourceManager.GetString("MainView_StopEncode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you wish to stop thie encode?. + /// + public static string MainView_StopEncodeConfirm { + get { + return ResourceManager.GetString("MainView_StopEncodeConfirm", resourceCulture); + } + } + /// /// Looks up a localized string similar to Please choose a source to encode before trying to import a subtitle file.. /// diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 67aa94343..804475873 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -1040,4 +1040,10 @@ This will not affect your current settings in the Subtitle tab. Encoding + + Stop Encode + + + Are you sure you wish to stop thie encode? + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index a41fb01dc..e31a8bb98 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1782,7 +1782,16 @@ namespace HandBrakeWPF.ViewModels /// public void StopEncode() { - this.queueProcessor.Stop(); + MessageBoxResult result = this.errorService.ShowMessageBox( + ResourcesUI.MainView_StopEncodeConfirm, + ResourcesUI.MainView_StopEncode, + MessageBoxButton.YesNo, + MessageBoxImage.Question); + + if (result == MessageBoxResult.Yes) + { + this.queueProcessor.Stop(); + } } /// -- cgit v1.2.3