From 37897e9ed4608d8f3e400d4090220f3a92a55fc3 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 27 Sep 2008 22:42:23 +0000 Subject: WinGui: - Refined the Queue look. - Fixed bug which cause the move up and down buttons to cause an exception. - When you select an item on the queue and move it up or down, it will now remain selected. This saves re-selecting the item every time you want to move it up or down. - Added pending encodes counter. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1780 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmQueue.cs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'win/C#/frmQueue.cs') diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index e27241921..07f4717c6 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -41,6 +41,7 @@ namespace Handbrake { queue = qw; redrawQueue(); + lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending"; } /// @@ -59,7 +60,8 @@ namespace Handbrake private void redrawQueue() { list_queue.Items.Clear(); - foreach (ArrayList queue_item in queue.getQueue()) + ArrayList theQueue = queue.getQueue(); + foreach (ArrayList queue_item in theQueue) { string q_item = queue_item[1].ToString(); Functions.QueryParser parsed = Functions.QueryParser.Parse(q_item); @@ -195,6 +197,8 @@ namespace Handbrake lbl_aEnc.Text = "-"; lbl_title.Text = "-"; lbl_chapt.Text = "-"; + + lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending"; } catch (Exception exc) { @@ -226,6 +230,7 @@ namespace Handbrake progressBar.PerformStep(); lbl_progressValue.Text = string.Format("{0} %", progressBar.Value); + lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending"; } catch (Exception exc) { @@ -281,9 +286,16 @@ namespace Handbrake { if (list_queue.SelectedIndices.Count != 0) { - queue.moveUp(list_queue.SelectedIndices[0]); + int selected = list_queue.SelectedIndices[0]; + + queue.moveUp(selected); queue.write2disk("hb_queue_recovery.dat"); // Update the queue recovery file redrawQueue(); + + if (selected - 1 > 0) + list_queue.Items[selected -1].Selected = true; + + list_queue.Select(); } } @@ -292,9 +304,16 @@ namespace Handbrake { if (list_queue.SelectedIndices.Count != 0) { + int selected = list_queue.SelectedIndices[0]; + queue.moveDown(list_queue.SelectedIndices[0]); queue.write2disk("hb_queue_recovery.dat"); // Update the queue recovery file redrawQueue(); + + if (selected +1 < list_queue.Items.Count) + list_queue.Items[selected + 1].Selected = true; + + list_queue.Select(); } } @@ -306,6 +325,7 @@ namespace Handbrake queue.remove(list_queue.SelectedIndices[0]); queue.write2disk("hb_queue_recovery.dat"); // Update the queue recovery file redrawQueue(); + lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending"; } } -- cgit v1.2.3