]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Sat, 7 Mar 2009 12:53:48 +0000 (12:53 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 7 Mar 2009 12:53:48 +0000 (12:53 +0000)
- Remove old decomb option from the Options windows
- Added patch by ExDeus which allows multi-select on the queue window, and re-adding of the currently running job.

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

win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/Queue/QueueHandler.cs
win/C#/app.config
win/C#/frmOptions.Designer.cs
win/C#/frmOptions.cs
win/C#/frmQueue.Designer.cs
win/C#/frmQueue.cs

index aa02382f5d9a5583294ccb0f4d35a5acb8304903..543397699bb33039d04407b95f8573273e435f60 100644 (file)
@@ -227,30 +227,6 @@ namespace Handbrake.Properties {
             }\r
         }\r
         \r
-        [global::System.Configuration.UserScopedSettingAttribute()]\r
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
-        [global::System.Configuration.DefaultSettingValueAttribute("4:10:15:9:10:35:9")]\r
-        public string decomb {\r
-            get {\r
-                return ((string)(this["decomb"]));\r
-            }\r
-            set {\r
-                this["decomb"] = value;\r
-            }\r
-        }\r
-        \r
-        [global::System.Configuration.UserScopedSettingAttribute()]\r
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
-        [global::System.Configuration.DefaultSettingValueAttribute("4:10:15:9:10:35:9")]\r
-        public string default_decomb {\r
-            get {\r
-                return ((string)(this["default_decomb"]));\r
-            }\r
-            set {\r
-                this["default_decomb"] = value;\r
-            }\r
-        }\r
-        \r
         [global::System.Configuration.UserScopedSettingAttribute()]\r
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
         [global::System.Configuration.DefaultSettingValueAttribute("{source}-{title}-{chapters}")]\r
index 9cf3031ef160729c20dea2f55faebab3eb82eb15..4af4a7454dddb339f8903ace53122b769316a611 100644 (file)
     <Setting Name="checkSnapshot" Type="System.String" Scope="User">\r
       <Value Profile="(Default)" />\r
     </Setting>\r
-    <Setting Name="decomb" Type="System.String" Scope="User">\r
-      <Value Profile="(Default)">4:10:15:9:10:35:9</Value>\r
-    </Setting>\r
-    <Setting Name="default_decomb" Type="System.String" Scope="User">\r
-      <Value Profile="(Default)">4:10:15:9:10:35:9</Value>\r
-    </Setting>\r
     <Setting Name="autoNameFormat" Type="System.String" Scope="User">\r
       <Value Profile="(Default)">{source}-{title}-{chapters}</Value>\r
     </Setting>\r
index 2b36a9712a24f6bd15054f7c00b5300963d0bffc..3486e233a2bb3a5add5755450d54920edb7fd053 100644 (file)
@@ -92,12 +92,12 @@ namespace Handbrake.Queue
         /// <param name="index">Int</param>\r
         public void moveUp(int index)\r
         {\r
-            if (index != 0)\r
+            if (index > 0)\r
             {\r
                 QueueItem item = (QueueItem)queue[index];\r
 \r
+                queue.RemoveAt(index);\r
                 queue.Insert((index - 1), item);\r
-                queue.RemoveAt((index + 1));\r
             }\r
         }\r
 \r
@@ -107,12 +107,12 @@ namespace Handbrake.Queue
         /// <param name="index">Int</param>\r
         public void moveDown(int index)\r
         {\r
-            if (index != queue.Count - 1)\r
+            if (index < queue.Count - 1)\r
             {\r
                 QueueItem item = (QueueItem)queue[index];\r
 \r
-                queue.Insert((index + 2), item);\r
-                queue.RemoveAt((index));\r
+                queue.RemoveAt(index);\r
+                queue.Insert((index + 1), item);\r
             }\r
         }\r
 \r
@@ -338,4 +338,4 @@ namespace Handbrake.Queue
         #endregion\r
 \r
     }\r
-}
\ No newline at end of file
+}\r
index 694345cf7f73b14f0f5a2b97489554ba06af8a3e..ef5c4ad17eeb9e972d1083a798968744b60d66f4 100644 (file)
             <setting name="checkSnapshot" serializeAs="String">\r
                 <value />\r
             </setting>\r
-            <setting name="decomb" serializeAs="String">\r
-                <value>4:10:15:9:10:35:9</value>\r
-            </setting>\r
-            <setting name="default_decomb" serializeAs="String">\r
-                <value>4:10:15:9:10:35:9</value>\r
-            </setting>\r
             <setting name="autoNameFormat" serializeAs="String">\r
                 <value>{source}-{title}-{chapters}</value>\r
             </setting>\r
index fc6eecc25bbc6c5ae279a0ee277955cc40aaef1d..91c0222bf5850b1f112d3ea0799bb4d1516d2207 100644 (file)
@@ -57,8 +57,6 @@ namespace Handbrake
             this.btn_vlcPath = new System.Windows.Forms.Button();\r
             this.txt_vlcPath = new System.Windows.Forms.TextBox();\r
             this.label29 = new System.Windows.Forms.Label();\r
-            this.txt_decomb = new System.Windows.Forms.TextBox();\r
-            this.label3 = new System.Windows.Forms.Label();\r
             this.tab_cli = new System.Windows.Forms.TabPage();\r
             this.label15 = new System.Windows.Forms.Label();\r
             this.check_saveLogWithVideo = new System.Windows.Forms.CheckBox();\r
@@ -348,8 +346,6 @@ namespace Handbrake
             this.tab_picture.Controls.Add(this.btn_vlcPath);\r
             this.tab_picture.Controls.Add(this.txt_vlcPath);\r
             this.tab_picture.Controls.Add(this.label29);\r
-            this.tab_picture.Controls.Add(this.txt_decomb);\r
-            this.tab_picture.Controls.Add(this.label3);\r
             this.tab_picture.Location = new System.Drawing.Point(4, 22);\r
             this.tab_picture.Name = "tab_picture";\r
             this.tab_picture.Size = new System.Drawing.Size(482, 259);\r
@@ -362,7 +358,7 @@ namespace Handbrake
             this.btn_vlcPath.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
             this.btn_vlcPath.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_vlcPath.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_vlcPath.Location = new System.Drawing.Point(398, 56);\r
+            this.btn_vlcPath.Location = new System.Drawing.Point(398, 15);\r
             this.btn_vlcPath.Name = "btn_vlcPath";\r
             this.btn_vlcPath.Size = new System.Drawing.Size(68, 22);\r
             this.btn_vlcPath.TabIndex = 83;\r
@@ -372,7 +368,7 @@ namespace Handbrake
             // \r
             // txt_vlcPath\r
             // \r
-            this.txt_vlcPath.Location = new System.Drawing.Point(98, 56);\r
+            this.txt_vlcPath.Location = new System.Drawing.Point(98, 15);\r
             this.txt_vlcPath.Name = "txt_vlcPath";\r
             this.txt_vlcPath.Size = new System.Drawing.Size(294, 21);\r
             this.txt_vlcPath.TabIndex = 81;\r
@@ -383,31 +379,12 @@ namespace Handbrake
             // \r
             this.label29.AutoSize = true;\r
             this.label29.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label29.Location = new System.Drawing.Point(17, 61);\r
+            this.label29.Location = new System.Drawing.Point(17, 20);\r
             this.label29.Name = "label29";\r
             this.label29.Size = new System.Drawing.Size(67, 13);\r
             this.label29.TabIndex = 79;\r
             this.label29.Text = "VLC Path:";\r
             // \r
-            // txt_decomb\r
-            // \r
-            this.txt_decomb.Location = new System.Drawing.Point(98, 16);\r
-            this.txt_decomb.Name = "txt_decomb";\r
-            this.txt_decomb.Size = new System.Drawing.Size(181, 21);\r
-            this.txt_decomb.TabIndex = 78;\r
-            this.ToolTip.SetToolTip(this.txt_decomb, "Default: 4:10:15:9:10:35:9");\r
-            this.txt_decomb.TextChanged += new System.EventHandler(this.txt_decomb_TextChanged);\r
-            // \r
-            // label3\r
-            // \r
-            this.label3.AutoSize = true;\r
-            this.label3.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label3.Location = new System.Drawing.Point(21, 19);\r
-            this.label3.Name = "label3";\r
-            this.label3.Size = new System.Drawing.Size(63, 13);\r
-            this.label3.TabIndex = 77;\r
-            this.label3.Text = "Decomb:";\r
-            // \r
             // tab_cli\r
             // \r
             this.tab_cli.Controls.Add(this.label15);\r
@@ -1149,8 +1126,6 @@ namespace Handbrake
         internal System.Windows.Forms.ToolTip ToolTip;\r
         internal System.Windows.Forms.CheckBox check_snapshot;\r
         private System.Windows.Forms.TabPage tab_picture;\r
-        private System.Windows.Forms.TextBox txt_decomb;\r
-        private System.Windows.Forms.Label label3;\r
         internal System.Windows.Forms.Label label5;\r
         private System.Windows.Forms.TextBox txt_autoNameFormat;\r
         private System.Windows.Forms.Label label7;\r
index d6ee3a3ef8026b47357b0e5ba150f919382e5eb4..3f781758e07c10988f86bc5e1ee0faad0abfdebd 100644 (file)
@@ -56,9 +56,6 @@ namespace Handbrake
             // Picture Tab\r
             // #############################\r
 \r
-            // Store decomb value string\r
-            txt_decomb.Text = Properties.Settings.Default.decomb;\r
-\r
             // VLC Path\r
             txt_vlcPath.Text = Properties.Settings.Default.VLC_Path;\r
 \r
@@ -166,11 +163,6 @@ namespace Handbrake
         #endregion\r
 \r
         #region Picture\r
-        private void txt_decomb_TextChanged(object sender, EventArgs e)\r
-        {\r
-            Properties.Settings.Default.decomb = txt_decomb.Text;\r
-        }\r
-\r
         private void btn_vlcPath_Click(object sender, EventArgs e)\r
         {\r
             openFile_vlc.ShowDialog();\r
index a775c9648a1500b1956c89140cc0188fdec17f7d..c67872b8bb35469fba09209832543d3996e3c5b2 100644 (file)
@@ -40,6 +40,7 @@ namespace Handbrake
             this.btn_up = new System.Windows.Forms.Button();\r
             this.btn_delete = new System.Windows.Forms.Button();\r
             this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);\r
+            this.btn_re_add = new System.Windows.Forms.Button();\r
             this.label4 = new System.Windows.Forms.Label();\r
             this.lbl_chapt = new System.Windows.Forms.Label();\r
             this.lbl_title = new System.Windows.Forms.Label();\r
@@ -127,6 +128,22 @@ namespace Handbrake
             this.btn_delete.UseVisualStyleBackColor = true;\r
             this.btn_delete.Click += new System.EventHandler(this.btn_delete_Click);\r
             // \r
+            // btn_re_add\r
+            // \r
+            this.btn_re_add.BackColor = System.Drawing.SystemColors.ControlLight;\r
+            this.btn_re_add.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
+            this.btn_re_add.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.btn_re_add.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
+            this.btn_re_add.Location = new System.Drawing.Point(607, 39);\r
+            this.btn_re_add.Name = "btn_re_add";\r
+            this.btn_re_add.Size = new System.Drawing.Size(157, 22);\r
+            this.btn_re_add.TabIndex = 71;\r
+            this.btn_re_add.TabStop = false;\r
+            this.btn_re_add.Text = "Re-Add Current";\r
+            this.toolTip1.SetToolTip(this.btn_re_add, "Re-add the current or last job to the queue");\r
+            this.btn_re_add.UseVisualStyleBackColor = true;\r
+            this.btn_re_add.Click += new System.EventHandler(this.btn_re_add_Click);\r
+            // \r
             // label4\r
             // \r
             this.label4.AutoSize = true;\r
@@ -311,7 +328,6 @@ namespace Handbrake
             this.list_queue.GridLines = true;\r
             this.list_queue.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;\r
             this.list_queue.Location = new System.Drawing.Point(15, 0);\r
-            this.list_queue.MultiSelect = false;\r
             this.list_queue.Name = "list_queue";\r
             this.list_queue.Size = new System.Drawing.Size(749, 219);\r
             this.list_queue.TabIndex = 72;\r
@@ -382,6 +398,7 @@ namespace Handbrake
             // \r
             // splitContainer1.Panel1\r
             // \r
+            this.splitContainer1.Panel1.Controls.Add(this.btn_re_add);\r
             this.splitContainer1.Panel1.Controls.Add(this.label3);\r
             this.splitContainer1.Panel1.Controls.Add(this.label1);\r
             this.splitContainer1.Panel1.Controls.Add(this.btn_down);\r
@@ -495,5 +512,6 @@ namespace Handbrake
         private System.Windows.Forms.Panel panel2;\r
         private System.Windows.Forms.Panel panel1;\r
         private System.Windows.Forms.Panel panel3;\r
+        internal System.Windows.Forms.Button btn_re_add;\r
     }\r
-}
\ No newline at end of file
+}\r
index 86549a20fb2e62b249423f476f094127a05d20d8..ceb127fb4f574bcae27429d0ec91145e32a00c7c 100644 (file)
@@ -215,61 +215,108 @@ namespace Handbrake
                 // Do Nothing\r
             }\r
         }\r
-\r
-        // Queue Management\r
-        private void btn_up_Click(object sender, EventArgs e)\r
+        private void deleteSelectedItems()\r
         {\r
-            if (list_queue.SelectedIndices.Count != 0)\r
+            // If there are selected items\r
+            if (list_queue.SelectedIndices.Count > 0)\r
             {\r
-                int selected = list_queue.SelectedIndices[0];\r
+                // Save the selected indices to select them after the move\r
+                List<int> selectedIndices = new List<int>(list_queue.SelectedIndices.Count);\r
+                foreach (int selectedIndex in list_queue.SelectedIndices)\r
+                    selectedIndices.Add(selectedIndex);\r
+\r
+                int firstSelectedIndex = selectedIndices[0];\r
+\r
+                // Reverse the list to delete the items from last to first (preserves indices)\r
+                selectedIndices.Reverse();\r
+                \r
+                // Remove each selected item\r
+                foreach (int selectedIndex in selectedIndices)\r
+                    queue.remove(selectedIndex);\r
 \r
-                queue.moveUp(selected);\r
                 queue.write2disk("hb_queue_recovery.xml"); // Update the queue recovery file\r
                 updateUIElements();\r
 \r
-                if (selected - 1 > 0)\r
-                    list_queue.Items[selected - 1].Selected = true;\r
+                // Select the item where the first deleted item was previously\r
+                if (firstSelectedIndex < list_queue.Items.Count) \r
+                    list_queue.Items[firstSelectedIndex].Selected = true;\r
+            }\r
+\r
+            list_queue.Select(); // Activate the control to show the selected items\r
+        }\r
 \r
-                list_queue.Select();\r
+        // Queue Management\r
+        private void btn_re_add_Click(object sender, EventArgs e)\r
+        {\r
+            if (queue.getLastQueryItem() != null)\r
+            {\r
+                queue.add(queue.getLastQueryItem().Query, queue.getLastQueryItem().Source, queue.getLastQueryItem().Destination);\r
+                queue.write2disk("hb_queue_recovery.xml"); // Update the queue recovery file\r
+                updateUIElements();\r
             }\r
         }\r
-        private void btn_down_Click(object sender, EventArgs e)\r
+        private void btn_up_Click(object sender, EventArgs e)\r
         {\r
-            if (list_queue.SelectedIndices.Count != 0)\r
+            // If there are selected items and the first item is not selected\r
+            if (list_queue.SelectedIndices.Count > 0 && ! list_queue.SelectedIndices.Contains(0))\r
             {\r
-                int selected = list_queue.SelectedIndices[0];\r
+                // Copy the selected indices to preserve them during the movement\r
+                List<int> selectedIndices = new List<int>(list_queue.SelectedIndices.Count);\r
+                foreach (int selectedIndex in list_queue.SelectedIndices)\r
+                    selectedIndices.Add(selectedIndex);\r
+\r
+                // Move up each selected item\r
+                foreach (int selectedIndex in selectedIndices)\r
+                    queue.moveUp(selectedIndex);\r
 \r
-                queue.moveDown(list_queue.SelectedIndices[0]);\r
                 queue.write2disk("hb_queue_recovery.xml"); // Update the queue recovery file\r
                 updateUIElements();\r
 \r
-                if (selected + 1 < list_queue.Items.Count)\r
-                    list_queue.Items[selected + 1].Selected = true;\r
-\r
-                list_queue.Select();\r
+                // Keep the selected item(s) selected, now moved up one index\r
+                foreach (int selectedIndex in selectedIndices)\r
+                    if (selectedIndex - 1 > -1) // Defensive programming: ensure index is good\r
+                        list_queue.Items[selectedIndex - 1].Selected = true;\r
             }\r
+\r
+            list_queue.Select(); // Activate the control to show the selected items\r
         }\r
-        private void btn_delete_Click(object sender, EventArgs e)\r
+        private void btn_down_Click(object sender, EventArgs e)\r
         {\r
-            if (list_queue.SelectedIndices.Count != 0)\r
+            // If there are selected items and the last item is not selected\r
+            if (list_queue.SelectedIndices.Count > 0 && \r
+                ! list_queue.SelectedIndices.Contains(list_queue.Items[list_queue.Items.Count-1].Index))\r
             {\r
-                queue.remove(list_queue.SelectedIndices[0]);\r
+                // Copy the selected indices to preserve them during the movement\r
+                List<int> selectedIndices = new List<int>(list_queue.SelectedIndices.Count);\r
+                foreach (int selectedIndex in list_queue.SelectedIndices)\r
+                    selectedIndices.Add(selectedIndex);\r
+\r
+                // Reverse the indices to move the items down from last to first (preserves indices)\r
+                selectedIndices.Reverse();\r
+\r
+                // Move down each selected item\r
+                foreach (int selectedIndex in selectedIndices)\r
+                    queue.moveDown(selectedIndex);\r
+                \r
                 queue.write2disk("hb_queue_recovery.xml"); // Update the queue recovery file\r
                 updateUIElements();\r
-                lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending";\r
+\r
+                // Keep the selected item(s) selected, now moved down one index\r
+                foreach (int selectedIndex in selectedIndices)\r
+                    if (selectedIndex + 1 < list_queue.Items.Count) // Defensive programming: ensure index is good\r
+                        list_queue.Items[selectedIndex + 1].Selected = true; \r
             }\r
+\r
+            list_queue.Select(); // Activate the control to show the selected items\r
+        }\r
+        private void btn_delete_Click(object sender, EventArgs e)\r
+        {\r
+            deleteSelectedItems();\r
         }\r
         private void list_queue_deleteKey(object sender, KeyEventArgs e)\r
         {\r
             if (e.KeyCode == Keys.Delete)\r
-            {\r
-                if (list_queue.SelectedIndices.Count != 0)\r
-                {\r
-                    queue.remove(list_queue.SelectedIndices[0]);\r
-                    queue.write2disk("hb_queue_recovery.xml"); // Update the queue recovery file\r
-                    updateUIElements();\r
-                }\r
-            }\r
+                deleteSelectedItems();\r
         }\r
 \r
         // Queue Import/Export Features\r
@@ -305,5 +352,7 @@ namespace Handbrake
             this.Hide();\r
             base.OnClosing(e);\r
         }\r
+\r
+        \r
     }\r
 }\r