diff options
author | sr55 <[email protected]> | 2011-08-15 13:05:50 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-08-15 13:05:50 +0000 |
commit | bb6b6007ea2111cac17ff5fff2f2105bb5b7e6e9 (patch) | |
tree | e952bee01b33c5bbb7dc600f724dcc10d25ad6aa | |
parent | 689e8917e82cae5d68341f5d618dba050ddfc0b9 (diff) |
WinGui: Clear all option on the queue.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4173 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/CS/Controls/Subtitles.Designer.cs | 1 | ||||
-rw-r--r-- | win/CS/Controls/Subtitles.resx | 3 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueManager.cs | 5 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/LibScan.cs | 6 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs | 13 | ||||
-rw-r--r-- | win/CS/frmMain.cs | 1 | ||||
-rw-r--r-- | win/CS/frmQueue.Designer.cs | 48 | ||||
-rw-r--r-- | win/CS/frmQueue.cs | 20 |
8 files changed, 74 insertions, 23 deletions
diff --git a/win/CS/Controls/Subtitles.Designer.cs b/win/CS/Controls/Subtitles.Designer.cs index e8e70cf51..d4d08b700 100644 --- a/win/CS/Controls/Subtitles.Designer.cs +++ b/win/CS/Controls/Subtitles.Designer.cs @@ -205,6 +205,7 @@ this.srt_offset.Name = "srt_offset";
this.srt_offset.Size = new System.Drawing.Size(58, 21);
this.srt_offset.TabIndex = 79;
+ this.toolTip.SetToolTip(this.srt_offset, "Adjust the offset in milliseconds between video and srt timestamps");
this.srt_offset.ValueChanged += new System.EventHandler(this.SrtOffsetValueChanged);
//
// srt_lang
diff --git a/win/CS/Controls/Subtitles.resx b/win/CS/Controls/Subtitles.resx index e492eea54..1254679cb 100644 --- a/win/CS/Controls/Subtitles.resx +++ b/win/CS/Controls/Subtitles.resx @@ -126,9 +126,6 @@ <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>113, 17</value>
</metadata>
- <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>237, 17</value>
- </metadata>
<metadata name="SubtitleTrackMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>317, 20</value>
</metadata>
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueManager.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueManager.cs index be87b3705..e53871d53 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueManager.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueManager.cs @@ -69,6 +69,11 @@ namespace HandBrake.ApplicationServices.Services.Interfaces void ClearCompleted();
/// <summary>
+ /// Clear down all Queue Items
+ /// </summary>
+ void Clear();
+
+ /// <summary>
/// Get the first job on the queue for processing.
/// This also removes the job from the Queue and sets the LastProcessedJob
/// </summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs index 854a561bd..33459a0dd 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs @@ -161,16 +161,14 @@ namespace HandBrake.ApplicationServices.Services {
try
{
- // TODO Support Preview Count
-
IsScanning = true;
if (this.ScanStared != null)
this.ScanStared(this, new EventArgs());
if (title != 0)
- instance.StartScan(sourcePath.ToString(), 10, title);
+ instance.StartScan(sourcePath.ToString(), previewCount, title);
else
- instance.StartScan(sourcePath.ToString(), 10);
+ instance.StartScan(sourcePath.ToString(), previewCount);
}
catch (Exception exc)
{
diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs index da8ac5433..e2f81b7c5 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs @@ -198,6 +198,19 @@ namespace HandBrake.ApplicationServices.Services }
/// <summary>
+ /// Clear down all Queue Items
+ /// </summary>
+ public void Clear()
+ {
+ List<QueueTask> deleteList = this.queue.ToList();
+ foreach (QueueTask item in deleteList)
+ {
+ this.queue.Remove(item);
+ }
+ this.InvokeQueueChanged(EventArgs.Empty);
+ }
+
+ /// <summary>
/// Get the first job on the queue for processing.
/// This also removes the job from the Queue and sets the LastProcessedJob
/// </summary>
diff --git a/win/CS/frmMain.cs b/win/CS/frmMain.cs index bcdd6aaec..0a01b6571 100644 --- a/win/CS/frmMain.cs +++ b/win/CS/frmMain.cs @@ -310,7 +310,6 @@ namespace Handbrake private void changePresetLabel(object sender, EventArgs e)
{
labelPreset.Text = "Output Settings (Preset: Custom)";
- this.currentlySelectedPreset = null;
}
private static void frmMain_DragEnter(object sender, DragEventArgs e)
diff --git a/win/CS/frmQueue.Designer.cs b/win/CS/frmQueue.Designer.cs index 9beaf0a5e..6dbd68269 100644 --- a/win/CS/frmQueue.Designer.cs +++ b/win/CS/frmQueue.Designer.cs @@ -66,9 +66,10 @@ namespace Handbrake this.mnu_Down = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.mnu_edit = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnu_Retry = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
- this.mnu_delete = new System.Windows.Forms.ToolStripMenuItem();
this.mnuClearCompleted = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnu_delete = new System.Windows.Forms.ToolStripMenuItem();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.lbl_encodesPending = new System.Windows.Forms.ToolStripStatusLabel();
this.OpenFile = new System.Windows.Forms.OpenFileDialog();
@@ -78,7 +79,8 @@ namespace Handbrake this.panel3 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.panel1 = new System.Windows.Forms.Panel();
- this.mnu_Retry = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuClearAll = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.toolStrip1.SuspendLayout();
this.mnu_queue.SuspendLayout();
this.statusStrip1.SuspendLayout();
@@ -325,10 +327,12 @@ namespace Handbrake this.mnu_edit,
this.mnu_Retry,
this.toolStripSeparator4,
+ this.mnuClearAll,
this.mnuClearCompleted,
+ this.toolStripSeparator5,
this.mnu_delete});
this.mnu_queue.Name = "mnu_queue";
- this.mnu_queue.Size = new System.Drawing.Size(164, 148);
+ this.mnu_queue.Size = new System.Drawing.Size(164, 176);
//
// mnu_up
//
@@ -356,18 +360,18 @@ namespace Handbrake this.mnu_edit.Text = "Edit";
this.mnu_edit.Click += new System.EventHandler(this.MnuEditClick);
//
+ // mnu_Retry
+ //
+ this.mnu_Retry.Name = "mnu_Retry";
+ this.mnu_Retry.Size = new System.Drawing.Size(163, 22);
+ this.mnu_Retry.Text = "Retry Encode";
+ this.mnu_Retry.Click += new System.EventHandler(this.mnu_Retry_Click);
+ //
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(160, 6);
//
- // mnu_delete
- //
- this.mnu_delete.Name = "mnu_delete";
- this.mnu_delete.Size = new System.Drawing.Size(163, 22);
- this.mnu_delete.Text = "Delete";
- this.mnu_delete.Click += new System.EventHandler(this.MnuDeleteClick);
- //
// mnuClearCompleted
//
this.mnuClearCompleted.Name = "mnuClearCompleted";
@@ -375,6 +379,13 @@ namespace Handbrake this.mnuClearCompleted.Text = "Clear Completed";
this.mnuClearCompleted.Click += new System.EventHandler(this.mnuClearCompleted_Click);
//
+ // mnu_delete
+ //
+ this.mnu_delete.Name = "mnu_delete";
+ this.mnu_delete.Size = new System.Drawing.Size(163, 22);
+ this.mnu_delete.Text = "Delete";
+ this.mnu_delete.Click += new System.EventHandler(this.MnuDeleteClick);
+ //
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -477,12 +488,17 @@ namespace Handbrake this.panel1.Size = new System.Drawing.Size(15, 214);
this.panel1.TabIndex = 0;
//
- // mnu_Retry
+ // mnuClearAll
//
- this.mnu_Retry.Name = "mnu_Retry";
- this.mnu_Retry.Size = new System.Drawing.Size(163, 22);
- this.mnu_Retry.Text = "Retry Encode";
- this.mnu_Retry.Click += new System.EventHandler(this.mnu_Retry_Click);
+ this.mnuClearAll.Name = "mnuClearAll";
+ this.mnuClearAll.Size = new System.Drawing.Size(163, 22);
+ this.mnuClearAll.Text = "Clear All";
+ this.mnuClearAll.Click += new System.EventHandler(this.mnuClearAll_Click);
+ //
+ // toolStripSeparator5
+ //
+ this.toolStripSeparator5.Name = "toolStripSeparator5";
+ this.toolStripSeparator5.Size = new System.Drawing.Size(160, 6);
//
// frmQueue
//
@@ -559,5 +575,7 @@ namespace Handbrake private System.Windows.Forms.ColumnHeader Status;
private System.Windows.Forms.ToolStripMenuItem mnuClearCompleted;
private System.Windows.Forms.ToolStripMenuItem mnu_Retry;
+ private System.Windows.Forms.ToolStripMenuItem mnuClearAll;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
}
}
diff --git a/win/CS/frmQueue.cs b/win/CS/frmQueue.cs index bd86f18f2..04cb91276 100644 --- a/win/CS/frmQueue.cs +++ b/win/CS/frmQueue.cs @@ -532,6 +532,26 @@ namespace Handbrake DeleteSelectedItems();
}
+ /// <summary>
+ /// Clear down the Queue
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The EventArgs.
+ /// </param>
+ private void mnuClearAll_Click(object sender, EventArgs e)
+ {
+ DialogResult result = MessageBox.Show(
+ "Are you sure you wish to clear down the queue?",
+ "Clear the Queue", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+ if (result == DialogResult.Yes)
+ {
+ queue.QueueManager.Clear();
+ }
+ }
+
/* Keyboard Shortcuts */
/// <summary>
|