From: sr55 <sr55.hb@outlook.com>
Date: Wed, 7 Jun 2017 19:37:21 +0000 (+0100)
Subject: WinGui: Prevent the export of built-in presets. There is little point in allowing... 
X-Git-Tag: 1.1.0~540
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b97eca8ba68e4e5aaf6f13b8f1eefa62a3fd86bd;p=handbrake

WinGui: Prevent the export of built-in presets. There is little point in allowing this. The UI does not allow importing them. #768
---

diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index a2b1d136a..1700e98bf 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -1001,7 +1001,7 @@ namespace HandBrakeWPF.Properties {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Please select a preset..
+        ///   Looks up a localized string similar to Please select make sure you have selected one of your own presets. Please note that you cannot export built-in presets..
         /// </summary>
         public static string Main_SelectPreset {
             get {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index 2e318f3cd..ad0ffd029 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -419,7 +419,7 @@ The previous user_presets.xml file was backed up.</value>
     <value>You must first scan a source and setup your job before starting an encode. Click the 'Source' button on the toolbar to continue.</value>
   </data>
   <data name="Main_SelectPreset" xml:space="preserve">
-    <value>Please select a preset.</value>
+    <value>Please select make sure you have selected one of your own presets. Please note that you cannot export built-in presets.</value>
   </data>
   <data name="Main_SelectPresetForUpdate" xml:space="preserve">
     <value>Please select a preset to update.</value>
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 31efc4d9b..0a8d0b297 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -2031,17 +2031,18 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>
         public void PresetExport()
         {
-            SaveFileDialog savefiledialog = new SaveFileDialog
-            {
-                Filter = "json|*.json", 
-                CheckPathExists = true, 
-                AddExtension = true, 
-                DefaultExt = ".json", 
-                OverwritePrompt = true, 
-                FilterIndex = 0
-            };
-            if (this.selectedPreset != null)
-            {
+            if (this.selectedPreset != null && !this.selectedPreset.IsBuildIn)
+            {
+                SaveFileDialog savefiledialog = new SaveFileDialog
+                                                {
+                                                    Filter = "json|*.json",
+                                                    CheckPathExists = true,
+                                                    AddExtension = true,
+                                                    DefaultExt = ".json",
+                                                    OverwritePrompt = true,
+                                                    FilterIndex = 0
+                                                };
+
                 savefiledialog.ShowDialog();
                 string filename = savefiledialog.FileName;