/// <param name="destination"></param>\r
public void add(string query, string source, string destination)\r
{\r
- QueueItem newJob = new QueueItem();\r
- newJob.Id = id;\r
- newJob.Query = query;\r
- newJob.Source = source;\r
- newJob.Destination = destination;\r
+ QueueItem newJob = new QueueItem {Id = id, Query = query, Source = source, Destination = destination};\r
id++;\r
\r
- // Adds the job to the queue\r
queue.Add(newJob);\r
}\r
\r
+ /// <summary>\r
+ /// Check to see if a destination path is already on the queue\r
+ /// </summary>\r
+ /// <param name="destination">Destination path</param>\r
+ /// <returns>Boolean True/False. True = Path Exists</returns>\r
+ public Boolean checkDestinationPath(string destination)\r
+ {\r
+ foreach (QueueItem checkItem in queue)\r
+ {\r
+\r
+ if (checkItem.Destination.Contains(destination.Replace("\\\\", "\\")))\r
+ return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
/// <summary>\r
/// Removes an item from the queue.\r
/// </summary>\r
if (rtf_query.Text != "")\r
query = rtf_query.Text;\r
\r
- encodeQueue.add(query, text_source.Text, text_destination.Text);\r
- encodeQueue.write2disk("hb_queue_recovery.xml"); // Writes the queue to the recovery file, just incase the GUI crashes.\r
\r
+ if (encodeQueue.checkDestinationPath(text_destination.Text))\r
+ {\r
+ DialogResult result = MessageBox.Show("There is already a queue item for this destination path. \n\n If you continue, the encode will be overwritten. Do you wish to continue?",\r
+ "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);\r
+ if (result == DialogResult.Yes)\r
+ encodeQueue.add(query, text_source.Text, text_destination.Text);\r
+\r
+ } else\r
+ encodeQueue.add(query, text_source.Text, text_destination.Text);\r
+\r
+ encodeQueue.write2disk("hb_queue_recovery.xml"); // Writes the queue to the recovery file, just incase the GUI crashes.\r
queueWindow.Show();\r
}\r
}\r
{\r
// This removes the file extension from the filename box on the save file dialog.\r
// It's daft but some users don't realise that typing an extension overrides the dropdown extension selected.\r
- DVD_Save.FileName = Path.Combine(Path.GetDirectoryName(text_destination.Text), Path.GetFileNameWithoutExtension(text_destination.Text));\r
-\r
+ if (Path.HasExtension(text_destination.Text))\r
+ DVD_Save.FileName = Path.Combine(Path.GetDirectoryName(text_destination.Text), Path.GetFileNameWithoutExtension(text_destination.Text));\r
\r
// Show the dialog and set the main form file path\r
if (drop_format.SelectedIndex.Equals(0))\r
this.check_cli_minimized.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
this.check_cli_minimized.Location = new System.Drawing.Point(71, 18);\r
this.check_cli_minimized.Name = "check_cli_minimized";\r
- this.check_cli_minimized.Size = new System.Drawing.Size(155, 17);\r
+ this.check_cli_minimized.Size = new System.Drawing.Size(162, 17);\r
this.check_cli_minimized.TabIndex = 76;\r
- this.check_cli_minimized.Text = "Use window minimized";\r
+ this.check_cli_minimized.Text = "Start window minimized";\r
this.ToolTip.SetToolTip(this.check_cli_minimized, "Starts a CLI window minimized.");\r
this.check_cli_minimized.UseVisualStyleBackColor = true;\r
this.check_cli_minimized.CheckedChanged += new System.EventHandler(this.check_cli_minimized_CheckedChanged);\r