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