summaryrefslogtreecommitdiffstats
path: root/win/C#/Queue
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-04-02 15:10:21 +0000
committersr55 <[email protected]>2009-04-02 15:10:21 +0000
commitdf3c74d3c2c64781f119d1b0c80f0f744be6bc0b (patch)
tree4f49670c1c12745c96d43fa9c44bc78c18c811cd /win/C#/Queue
parent85f4f0c7ca4b5c07ca9a71c0f3067ec86c2915a9 (diff)
WinGui:
- Fix for Destination Browse button exception is destination is empty. (http://forum.handbrake.fr/viewtopic.php?f=12&t=10140) - Added warning if user is about to add 2 or more items to the queue with the same destination path. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2294 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Queue')
-rw-r--r--win/C#/Queue/QueueHandler.cs23
1 files changed, 17 insertions, 6 deletions
diff --git a/win/C#/Queue/QueueHandler.cs b/win/C#/Queue/QueueHandler.cs
index 8008d17ea..945a2ae4d 100644
--- a/win/C#/Queue/QueueHandler.cs
+++ b/win/C#/Queue/QueueHandler.cs
@@ -57,18 +57,29 @@ namespace Handbrake.Queue
/// <param name="destination"></param>
public void add(string query, string source, string destination)
{
- QueueItem newJob = new QueueItem();
- newJob.Id = id;
- newJob.Query = query;
- newJob.Source = source;
- newJob.Destination = destination;
+ QueueItem newJob = new QueueItem {Id = id, Query = query, Source = source, Destination = destination};
id++;
- // Adds the job to the queue
queue.Add(newJob);
}
/// <summary>
+ /// Check to see if a destination path is already on the queue
+ /// </summary>
+ /// <param name="destination">Destination path</param>
+ /// <returns>Boolean True/False. True = Path Exists</returns>
+ public Boolean checkDestinationPath(string destination)
+ {
+ foreach (QueueItem checkItem in queue)
+ {
+
+ if (checkItem.Destination.Contains(destination.Replace("\\\\", "\\")))
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
/// Removes an item from the queue.
/// </summary>
/// <param name="index">Index</param>