diff options
author | sr55 <[email protected]> | 2013-04-12 20:07:08 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-04-12 20:07:08 +0000 |
commit | da8a0f3ace2b71ef1cbb911d194dd1f9561017b0 (patch) | |
tree | c13e4d1e2826a881100bf36502fe3840760644a9 /win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | |
parent | ee69423b2777934d1fc19b41cd428c9e28f1b65f (diff) |
WinGui: Fix the x264 preset/tune/profile tooltip so that it now shows the equivalent x264 query. Also added an option to disable libhb features such as this incase this turns out to be problematic.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5397 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index a59105084..514b45d5d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -28,6 +28,7 @@ namespace HandBrakeWPF.ViewModels using HandBrakeWPF.Commands.Interfaces;
using HandBrakeWPF.Model;
+ using HandBrakeWPF.Properties;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -497,6 +498,7 @@ namespace HandBrakeWPF.ViewModels {
this.Task.ExtraAdvancedArguments = value;
this.NotifyOfPropertyChange(() => this.ExtraArguments);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -514,6 +516,7 @@ namespace HandBrakeWPF.ViewModels {
this.displayX264Options = value;
this.NotifyOfPropertyChange(() => this.DisplayX264Options);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
@@ -533,6 +536,7 @@ namespace HandBrakeWPF.ViewModels this.x264PresetValue = value;
this.X264Preset = this.X264Presets[value];
this.NotifyOfPropertyChange(() => this.x264PresetValue);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -553,6 +557,7 @@ namespace HandBrakeWPF.ViewModels this.Task.X264Preset = value;
this.NotifyOfPropertyChange(() => this.X264Preset);
ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -574,6 +579,7 @@ namespace HandBrakeWPF.ViewModels this.Task.H264Profile = value;
this.NotifyOfPropertyChange(() => this.H264Profile);
ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -594,6 +600,7 @@ namespace HandBrakeWPF.ViewModels this.Task.H264Level = value;
this.NotifyOfPropertyChange(() => this.H264Level);
ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -614,6 +621,7 @@ namespace HandBrakeWPF.ViewModels this.Task.X264Tune = value;
this.NotifyOfPropertyChange(() => this.X264Tune);
ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -634,6 +642,7 @@ namespace HandBrakeWPF.ViewModels this.Task.FastDecode = value;
this.NotifyOfPropertyChange(() => this.FastDecode);
ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -665,7 +674,7 @@ namespace HandBrakeWPF.ViewModels {
get
{
- return "You can provide additional arguments using the standard x264 format"; // string.Format(Resources.Video_x264ExtraArgs, this.GetActualx264Query());
+ return string.Format(Resources.Video_x264ExtraArgs, this.GetActualx264Query()); // "You can provide additional arguments using the standard x264 format";
}
}
@@ -897,13 +906,18 @@ namespace HandBrakeWPF.ViewModels /// </returns>
private string GetActualx264Query()
{
- string preset = EnumHelper<x264Preset>.GetDisplay(this.X264Preset);
- string profile = EnumHelper<x264Profile>.GetDisplay(this.H264Profile);
+ if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibHbFeatures))
+ {
+ return string.Empty; // Feature is disabled.
+ }
+
+ string preset = EnumHelper<x264Preset>.GetDisplay(this.X264Preset).ToLower().Replace(" ", string.Empty);
+ string profile = EnumHelper<x264Profile>.GetDisplay(this.H264Profile).ToLower();
List<string> tunes = new List<string>();
if (X264Tune != x264Tune.None)
{
- tunes.Add(EnumHelper<x264Tune>.GetDisplay(this.X264Tune));
+ tunes.Add(this.X264Tune.ToString().ToLower().Replace(" ", string.Empty)); // TODO tidy this sillyness up.
}
if (this.FastDecode)
{
@@ -914,6 +928,16 @@ namespace HandBrakeWPF.ViewModels int width = this.Task.Width.HasValue ? this.Task.Width.Value : 720;
int height = this.Task.Height.HasValue ? this.Task.Height.Value : 576;
+ if (height == 0)
+ {
+ height = 576;
+ }
+
+ if (width == 0)
+ {
+ width = 720;
+ }
+
// TODO figure out what is wrong with this??
return HandBrakeUtils.CreateX264OptionsString(preset, tunes, this.ExtraArguments, profile, this.H264Level, width, height);
}
|