diff options
author | sr55 <[email protected]> | 2012-05-20 01:11:36 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-05-20 01:11:36 +0000 |
commit | 332f03f3f68dca799a2e50ceb7e34578ac0bcd5f (patch) | |
tree | 8763d26c3f7b77fe2a0e1b4aaf59497da720d87d /win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs | |
parent | a8c98d2da676d507a0754ec191d53a1122a40220 (diff) |
WinGui: Initial Implementation of Add All to Queue. Fix the Queue so that it processes everything correctly rather than just the last job added.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4689 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs index 3fb62e151..bf39d859a 100644 --- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs @@ -52,7 +52,7 @@ namespace HandBrakeWPF.Helpers {
// Get the Source Name and remove any invalid characters
string sourceName = Path.GetInvalidFileNameChars().Aggregate(sourceOrLabelName, (current, character) => current.Replace(character.ToString(), string.Empty));
-
+
// Remove Underscores
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNameRemoveUnderscore))
sourceName = sourceName.Replace("_", " ");
@@ -161,5 +161,31 @@ namespace HandBrakeWPF.Helpers return autoNamePath;
}
+
+ /// <summary>
+ /// Check if there is a valid autoname path.
+ /// </summary>
+ /// <returns>
+ /// True if there is a valid path
+ /// </returns>
+ public static bool IsAutonamingEnabled()
+ {
+ IUserSettingService userSettingService = IoC.Get<IUserSettingService>();
+ // If there is an auto name path, use it...
+ if (userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Trim().StartsWith("{source_path}"))
+ {
+ return true;
+ }
+ else if (userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Contains("{source_folder_name}"))
+ {
+ return true;
+ }
+ else
+ {
+ return
+ Directory.Exists(
+ userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Trim());
+ }
+ }
}
}
|