summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-05-22 19:03:53 +0000
committersr55 <[email protected]>2013-05-22 19:03:53 +0000
commitb4439911971a0801b944ad87aee08ea7f3bb8616 (patch)
tree0adfc42576d1a41ae084edf693cce2cbf9487001 /win/CS
parent58e8804f56c0d7e18c65b12fec16c14dae93ea76 (diff)
WinGui: Make the AutoNaming feature less trigger happy. It should not run for cases where it's not going to change the underlying filename.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5498 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrakeWPF/Constants.cs10
-rw-r--r--win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs4
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs15
3 files changed, 24 insertions, 5 deletions
diff --git a/win/CS/HandBrakeWPF/Constants.cs b/win/CS/HandBrakeWPF/Constants.cs
index 7295c9339..1d279427a 100644
--- a/win/CS/HandBrakeWPF/Constants.cs
+++ b/win/CS/HandBrakeWPF/Constants.cs
@@ -28,5 +28,15 @@ namespace HandBrakeWPF
/// The any.
/// </summary>
public const string Any = "(Any)";
+
+ /// <summary>
+ /// The chapters.
+ /// </summary>
+ public const string Chapters = "{chapters}";
+
+ /// <summary>
+ /// The title.
+ /// </summary>
+ public const string Title = "{title}";
}
}
diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
index 5c4e83cb1..2298eb4ab 100644
--- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
@@ -79,8 +79,8 @@ namespace HandBrakeWPF.Helpers
{
destinationFilename = userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat);
destinationFilename = destinationFilename.Replace("{source}", sourceName)
- .Replace("{title}", dvdTitle)
- .Replace("{chapters}", combinedChapterTag)
+ .Replace(Constants.Title, dvdTitle)
+ .Replace(Constants.Chapters, combinedChapterTag)
.Replace("{date}", DateTime.Now.Date.ToShortDateString().Replace('/', '-'));
}
else
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index fb14cd9a1..e3fd2dfc1 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -700,7 +700,11 @@ namespace HandBrakeWPF.ViewModels
if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming))
{
- this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ if (this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat) != null &&
+ this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat).Contains(Constants.Title))
+ {
+ this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ }
}
this.NotifyOfPropertyChange(() => this.CurrentTask);
@@ -751,7 +755,11 @@ namespace HandBrakeWPF.ViewModels
if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming) && this.ScannedSource.ScanPath != null)
{
- this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ if (this.SelectedPointToPoint == PointToPointMode.Chapters && this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat) != null &&
+ this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat).Contains(Constants.Chapters))
+ {
+ this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ }
}
}
}
@@ -771,7 +779,8 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.SelectedEndPoint);
this.Duration = this.DurationCalculation();
- if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming) && this.ScannedSource.ScanPath != null)
+ if (this.SelectedPointToPoint == PointToPointMode.Chapters && this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat) != null &&
+ this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat).Contains(Constants.Chapters))
{
this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
}