]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Thu, 7 May 2009 23:00:33 +0000 (23:00 +0000)
committersr55 <sr55.hb@outlook.com>
Thu, 7 May 2009 23:00:33 +0000 (23:00 +0000)
- Notify users that built-in presets have been updated (when preset version < handbrake version.)
- Option to disable that alert in Options > Advanced tab

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2401 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Presets/PresetsHandler.cs
win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/app.config
win/C#/frmMain.cs
win/C#/frmOptions.Designer.cs
win/C#/frmOptions.cs

index cbd654558119d431f9e666aea32bd7f469725a09..2ba6acc37b36c2023cd6c8880c213fb433ff480d 100644 (file)
@@ -220,13 +220,7 @@ namespace Handbrake.Presets
                 }\r
             }\r
 \r
-            // Update built-in presets if the built-in presets belong to an older version.\r
-            if (presets.Count != 0)\r
-                if (presets[0].Version != Properties.Settings.Default.hb_version)\r
-                    updateBuiltInPresets();\r
-\r
             // Load in the users presets from user_presets.xml\r
-\r
             if (File.Exists(userPresetFile))\r
             {\r
                 using (FileStream strm = new FileStream(userPresetFile, FileMode.Open, FileAccess.Read))\r
@@ -389,5 +383,19 @@ namespace Handbrake.Presets
 \r
             return false;\r
         }\r
+\r
+        public Boolean checkIfPresetsAreOutOfDate()\r
+        {\r
+            loadPresetData();\r
+            // Update built-in presets if the built-in presets belong to an older version.\r
+            if (presets.Count != 0)\r
+                if (presets[0].Version != Properties.Settings.Default.hb_version)\r
+                {\r
+                    updateBuiltInPresets();\r
+                    return true;\r
+                }\r
+\r
+            return false;\r
+        }\r
     }\r
 }
\ No newline at end of file
index c54d0be30c722a4e84c474464784193a95bdb4ec..4b8fffbea25d734121619eacecad8efa3ddc84d0 100644 (file)
@@ -346,5 +346,17 @@ namespace Handbrake.Properties {
                 this["dvdnav"] = value;\r
             }\r
         }\r
+        \r
+        [global::System.Configuration.UserScopedSettingAttribute()]\r
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
+        [global::System.Configuration.DefaultSettingValueAttribute("")]\r
+        public string presetNotification {\r
+            get {\r
+                return ((string)(this["presetNotification"]));\r
+            }\r
+            set {\r
+                this["presetNotification"] = value;\r
+            }\r
+        }\r
     }\r
 }\r
index 62894d2de96b51fbcb8dc94ea52d4602a2493824..a5766339d5127edf1a8ae963d1f3c75fcb086b19 100644 (file)
@@ -83,5 +83,8 @@
     <Setting Name="dvdnav" Type="System.String" Scope="User">\r
       <Value Profile="(Default)" />\r
     </Setting>\r
+    <Setting Name="presetNotification" Type="System.String" Scope="User">\r
+      <Value Profile="(Default)" />\r
+    </Setting>\r
   </Settings>\r
 </SettingsFile>
\ No newline at end of file
index 4789bc858be7742977a28cce2eac5206c31ce5a2..f095d50d4e8cbf964b0788e5b81c0ea6803281d2 100644 (file)
@@ -88,6 +88,9 @@
             <setting name="dvdnav" serializeAs="String">\r
                 <value />\r
             </setting>\r
+            <setting name="presetNotification" serializeAs="String">\r
+                <value />\r
+            </setting>\r
         </Handbrake.Properties.Settings>\r
     </userSettings>\r
 <startup><supportedRuntime version="v2.0.50727"/></startup></configuration>\r
index 78074b1437f5218e2056b02b79a2ed25a745fb48..a8c7a8a7a64515f8935f5d71afacbf7f74b05a0c 100644 (file)
@@ -894,7 +894,8 @@ namespace Handbrake
                 DataGridView chapterGridView = Main.chapterNaming(data_chpt, drop_chapterFinish.Text);\r
                 if (chapterGridView != null)\r
                     data_chpt = chapterGridView;\r
-            } else\r
+            }\r
+            else\r
             {\r
                 Check_ChapterMarkers.Checked = false;\r
                 Check_ChapterMarkers.Enabled = false;\r
@@ -930,7 +931,7 @@ namespace Handbrake
             if (c_start == c_end)\r
             {\r
                 Check_ChapterMarkers.Checked = false;\r
-                Check_ChapterMarkers.Enabled = false; \r
+                Check_ChapterMarkers.Enabled = false;\r
             }\r
             else\r
                 Check_ChapterMarkers.Enabled = true;\r
@@ -2002,6 +2003,12 @@ namespace Handbrake
         /// </summary>\r
         public void loadPresetPanel()\r
         {\r
+            if (presetHandler.checkIfPresetsAreOutOfDate())\r
+                if (Properties.Settings.Default.presetNotification == "Unchecked")\r
+                    MessageBox.Show(\r
+                    "HandBrake has determined your built-in presets are out of date... These presets will now be updated.",\r
+                    "Preset Update", MessageBoxButtons.OK, MessageBoxIcon.Information);\r
+\r
             presetHandler.getPresetPanel(ref treeView_presets);\r
             treeView_presets.Update();\r
         }\r
index e4f0cb98f54615792fc81f0b0ab3f421af593d15..14cc9c731140b599667b507bde01775243a81d5d 100644 (file)
@@ -58,6 +58,7 @@ namespace Handbrake
             this.txt_vlcPath = new System.Windows.Forms.TextBox();\r
             this.label29 = new System.Windows.Forms.Label();\r
             this.tab_cli = new System.Windows.Forms.TabPage();\r
+            this.check_logsInSpecifiedLocation = new System.Windows.Forms.CheckBox();\r
             this.cb_logVerboseLvl = new System.Windows.Forms.ComboBox();\r
             this.label3 = new System.Windows.Forms.Label();\r
             this.check_saveLogWithVideo = new System.Windows.Forms.CheckBox();\r
@@ -116,7 +117,7 @@ namespace Handbrake
             this.label26 = new System.Windows.Forms.Label();\r
             this.label27 = new System.Windows.Forms.Label();\r
             this.openFile_vlc = new System.Windows.Forms.OpenFileDialog();\r
-            this.check_logsInSpecifiedLocation = new System.Windows.Forms.CheckBox();\r
+            this.check_disablePresetNotification = new System.Windows.Forms.CheckBox();\r
             this.tab_options.SuspendLayout();\r
             this.tab_general.SuspendLayout();\r
             this.tab_picture.SuspendLayout();\r
@@ -412,6 +413,19 @@ namespace Handbrake
             this.tab_cli.Text = "CLI";\r
             this.tab_cli.UseVisualStyleBackColor = true;\r
             // \r
+            // check_logsInSpecifiedLocation\r
+            // \r
+            this.check_logsInSpecifiedLocation.AutoSize = true;\r
+            this.check_logsInSpecifiedLocation.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.check_logsInSpecifiedLocation.Location = new System.Drawing.Point(71, 201);\r
+            this.check_logsInSpecifiedLocation.Name = "check_logsInSpecifiedLocation";\r
+            this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(306, 17);\r
+            this.check_logsInSpecifiedLocation.TabIndex = 87;\r
+            this.check_logsInSpecifiedLocation.Text = "Put individual encode logs in a specified location:";\r
+            this.ToolTip.SetToolTip(this.check_logsInSpecifiedLocation, "Place a copy of the encode log in the same folder as the encoded movie.");\r
+            this.check_logsInSpecifiedLocation.UseVisualStyleBackColor = true;\r
+            this.check_logsInSpecifiedLocation.CheckedChanged += new System.EventHandler(this.check_logsInSpecifiedLocation_CheckedChanged);\r
+            // \r
             // cb_logVerboseLvl\r
             // \r
             this.cb_logVerboseLvl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
@@ -584,6 +598,7 @@ namespace Handbrake
             // \r
             // tab_advanced\r
             // \r
+            this.tab_advanced.Controls.Add(this.check_disablePresetNotification);\r
             this.tab_advanced.Controls.Add(this.check_dvdnav);\r
             this.tab_advanced.Controls.Add(this.label32);\r
             this.tab_advanced.Controls.Add(this.label30);\r
@@ -608,7 +623,7 @@ namespace Handbrake
             this.check_dvdnav.AutoSize = true;\r
             this.check_dvdnav.BackColor = System.Drawing.Color.Transparent;\r
             this.check_dvdnav.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.check_dvdnav.Location = new System.Drawing.Point(76, 184);\r
+            this.check_dvdnav.Location = new System.Drawing.Point(76, 209);\r
             this.check_dvdnav.Name = "check_dvdnav";\r
             this.check_dvdnav.Size = new System.Drawing.Size(297, 17);\r
             this.check_dvdnav.TabIndex = 90;\r
@@ -620,7 +635,7 @@ namespace Handbrake
             // \r
             this.label32.AutoSize = true;\r
             this.label32.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label32.Location = new System.Drawing.Point(38, 184);\r
+            this.label32.Location = new System.Drawing.Point(38, 209);\r
             this.label32.Name = "label32";\r
             this.label32.Size = new System.Drawing.Size(32, 13);\r
             this.label32.TabIndex = 89;\r
@@ -629,7 +644,7 @@ namespace Handbrake
             // label30\r
             // \r
             this.label30.AutoSize = true;\r
-            this.label30.Location = new System.Drawing.Point(73, 142);\r
+            this.label30.Location = new System.Drawing.Point(73, 167);\r
             this.label30.Name = "label30";\r
             this.label30.Size = new System.Drawing.Size(230, 13);\r
             this.label30.TabIndex = 87;\r
@@ -645,7 +660,7 @@ namespace Handbrake
             "0.50",\r
             "0.25",\r
             "0.20"});\r
-            this.drop_x264step.Location = new System.Drawing.Point(312, 139);\r
+            this.drop_x264step.Location = new System.Drawing.Point(312, 164);\r
             this.drop_x264step.Name = "drop_x264step";\r
             this.drop_x264step.Size = new System.Drawing.Size(111, 21);\r
             this.drop_x264step.TabIndex = 86;\r
@@ -657,7 +672,7 @@ namespace Handbrake
             // \r
             this.label28.AutoSize = true;\r
             this.label28.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label28.Location = new System.Drawing.Point(27, 142);\r
+            this.label28.Location = new System.Drawing.Point(27, 167);\r
             this.label28.Name = "label28";\r
             this.label28.Size = new System.Drawing.Size(43, 13);\r
             this.label28.TabIndex = 85;\r
@@ -682,7 +697,7 @@ namespace Handbrake
             // \r
             this.lbl_appcastUnstable.AutoSize = true;\r
             this.lbl_appcastUnstable.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_appcastUnstable.Location = new System.Drawing.Point(6, 105);\r
+            this.lbl_appcastUnstable.Location = new System.Drawing.Point(6, 130);\r
             this.lbl_appcastUnstable.Name = "lbl_appcastUnstable";\r
             this.lbl_appcastUnstable.Size = new System.Drawing.Size(64, 13);\r
             this.lbl_appcastUnstable.TabIndex = 83;\r
@@ -709,7 +724,7 @@ namespace Handbrake
             this.check_snapshot.AutoSize = true;\r
             this.check_snapshot.BackColor = System.Drawing.Color.Transparent;\r
             this.check_snapshot.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.check_snapshot.Location = new System.Drawing.Point(76, 104);\r
+            this.check_snapshot.Location = new System.Drawing.Point(76, 129);\r
             this.check_snapshot.Name = "check_snapshot";\r
             this.check_snapshot.Size = new System.Drawing.Size(273, 17);\r
             this.check_snapshot.TabIndex = 80;\r
@@ -1098,18 +1113,20 @@ namespace Handbrake
             this.openFile_vlc.DefaultExt = "exe";\r
             this.openFile_vlc.Filter = "exe|*.exe";\r
             // \r
-            // check_logsInSpecifiedLocation\r
-            // \r
-            this.check_logsInSpecifiedLocation.AutoSize = true;\r
-            this.check_logsInSpecifiedLocation.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.check_logsInSpecifiedLocation.Location = new System.Drawing.Point(71, 201);\r
-            this.check_logsInSpecifiedLocation.Name = "check_logsInSpecifiedLocation";\r
-            this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(306, 17);\r
-            this.check_logsInSpecifiedLocation.TabIndex = 87;\r
-            this.check_logsInSpecifiedLocation.Text = "Put individual encode logs in a specified location:";\r
-            this.ToolTip.SetToolTip(this.check_logsInSpecifiedLocation, "Place a copy of the encode log in the same folder as the encoded movie.");\r
-            this.check_logsInSpecifiedLocation.UseVisualStyleBackColor = true;\r
-            this.check_logsInSpecifiedLocation.CheckedChanged += new System.EventHandler(this.check_logsInSpecifiedLocation_CheckedChanged);\r
+            // check_disablePresetNotification\r
+            // \r
+            this.check_disablePresetNotification.AutoSize = true;\r
+            this.check_disablePresetNotification.BackColor = System.Drawing.Color.Transparent;\r
+            this.check_disablePresetNotification.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.check_disablePresetNotification.Location = new System.Drawing.Point(76, 87);\r
+            this.check_disablePresetNotification.Name = "check_disablePresetNotification";\r
+            this.check_disablePresetNotification.Size = new System.Drawing.Size(261, 17);\r
+            this.check_disablePresetNotification.TabIndex = 91;\r
+            this.check_disablePresetNotification.Text = "Disable Built-in preset update notification";\r
+            this.ToolTip.SetToolTip(this.check_disablePresetNotification, "Disables the notification you recieve when presets are updated when a new version" +\r
+                    " of HandBrake is installed.");\r
+            this.check_disablePresetNotification.UseVisualStyleBackColor = false;\r
+            this.check_disablePresetNotification.CheckedChanged += new System.EventHandler(this.check_disablePresetNotification_CheckedChanged);\r
             // \r
             // frmOptions\r
             // \r
@@ -1224,5 +1241,6 @@ namespace Handbrake
         internal System.Windows.Forms.CheckBox check_dvdnav;\r
         private System.Windows.Forms.Label label32;\r
         internal System.Windows.Forms.CheckBox check_logsInSpecifiedLocation;\r
+        internal System.Windows.Forms.CheckBox check_disablePresetNotification;\r
     }\r
 }
\ No newline at end of file
index c33cc22c2e2df4a7a0256661c923c1fa297197c2..289fdb79839ac68be3cbd095109bc1d922ee9bdf 100644 (file)
@@ -109,6 +109,9 @@ namespace Handbrake
             if (Properties.Settings.Default.QueryEditorTab == "Checked")\r
                 check_queryEditorTab.CheckState = CheckState.Checked;\r
 \r
+            if (Properties.Settings.Default.presetNotification == "Checked")\r
+                check_disablePresetNotification.CheckState = CheckState.Checked;\r
+\r
             // Enable snapshot updating\r
             if (Properties.Settings.Default.MainWindowMinimize == "Checked")\r
                 check_mainMinimize.CheckState = CheckState.Checked;\r
@@ -243,6 +246,11 @@ namespace Handbrake
             Properties.Settings.Default.QueryEditorTab = check_queryEditorTab.CheckState.ToString();\r
         }\r
 \r
+        private void check_disablePresetNotification_CheckedChanged(object sender, EventArgs e)\r
+        {\r
+            Properties.Settings.Default.presetNotification = check_disablePresetNotification.CheckState.ToString();\r
+        }\r
+\r
         private void check_snapshot_CheckedChanged(object sender, EventArgs e)\r
         {\r
             Properties.Settings.Default.checkSnapshot = check_snapshot.CheckState.ToString();\r
@@ -263,10 +271,6 @@ namespace Handbrake
         {\r
             Properties.Settings.Default.Save(); // Small hack for Vista. Seems to work fine on XP without this\r
             this.Close();\r
-        }\r
-\r
-        \r
-\r
-               \r
+        } \r
     }\r
 }
\ No newline at end of file