}\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
<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
/// <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
/// <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
#endregion\r
\r
}\r
-}
\ No newline at end of file
+}\r
<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
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
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
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
// \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
// \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
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
// 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
#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
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
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
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
// \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
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
// 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
this.Hide();\r
base.OnClosing(e);\r
}\r
+\r
+ \r
}\r
}\r