diff options
author | sr55 <[email protected]> | 2010-07-03 14:41:32 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-07-03 14:41:32 +0000 |
commit | ed057cf5f804bb497910aac61040e3ba6325147b (patch) | |
tree | 71f83c3efedccc3c9f05c5213ed2c89142092010 /win/C#/Functions | |
parent | e71a5fc9de03802003f9c683b84367fee14e43a5 (diff) |
WinGui:
- Improve the way Custom queries are handled form the query editor. It's now hooked up so that the "Add to Queue" feature can warn of duplicates and it will now also display the correct source and destination in the queue window when encoding a custom job.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3421 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r-- | win/C#/Functions/Main.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index d0c82cd1a..2bf6e6f5c 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -833,5 +833,45 @@ namespace Handbrake.Functions exceptionWindow.Setup(shortError, longError);
exceptionWindow.Show();
}
+
+ /// <summary>
+ /// Get The Source from the CLI Query
+ /// </summary>
+ /// <param name="query">Full CLI Query</param>
+ /// <returns>The Source Path</returns>
+ public static string GetSourceFromQuery(string query)
+ {
+ int startIndex = query.IndexOf("-i \"");
+ if (startIndex != -1)
+ {
+ string input = query.Substring(startIndex).Replace("-i \"", string.Empty).Trim();
+
+ int closeIndex = input.IndexOf('"');
+
+ return closeIndex == -1 ? "Unknown" : input.Substring(0, closeIndex);
+ }
+
+ return "Unknown";
+ }
+
+ /// <summary>
+ /// Get the Destination from the CLI Query
+ /// </summary>
+ /// <param name="query">Full CLI Query</param>
+ /// <returns>The Destination path</returns>
+ public static string GetDestinationFromQuery(string query)
+ {
+ int startIndex = query.IndexOf("-o \"");
+ if (startIndex != -1)
+ {
+ string output = query.Substring(startIndex).Replace("-o \"", string.Empty).Trim();
+
+ int closeIndex = output.IndexOf('"');
+
+ return closeIndex == -1 ? "Unknown" : output.Substring(0, closeIndex);
+ }
+
+ return "Unknown";
+ }
}
}
\ No newline at end of file |