summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2014-08-02 15:18:50 +0000
committersr55 <[email protected]>2014-08-02 15:18:50 +0000
commit6ea78897d46244337d7b857555b843451cc7aeea (patch)
tree24ef639cca12251bc4b7c004aa2b86185fcaa7c1 /win/CS/HandBrakeWPF
parent872a601d453f16a41c8994f9f98453a5ecadad64 (diff)
WinGui: Fix a styling issue on the preview window. Disable libhb encode for the upcoming release so that users don't inadvertently turn it on. Made the new preview window an optional setting, off by default as it's a Alpha feature. (See Preferences)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6256 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/App.xaml.cs9
-rw-r--r--win/CS/HandBrakeWPF/AppArguments.cs5
-rw-r--r--win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs2
-rw-r--r--win/CS/HandBrakeWPF/UserSettingConstants.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs25
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs11
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml15
-rw-r--r--win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml3
-rw-r--r--win/CS/HandBrakeWPF/Views/PreviewView.xaml22
9 files changed, 73 insertions, 24 deletions
diff --git a/win/CS/HandBrakeWPF/App.xaml.cs b/win/CS/HandBrakeWPF/App.xaml.cs
index b8ddfaff1..a744d859c 100644
--- a/win/CS/HandBrakeWPF/App.xaml.cs
+++ b/win/CS/HandBrakeWPF/App.xaml.cs
@@ -46,9 +46,9 @@ namespace HandBrakeWPF
protected override void OnStartup(StartupEventArgs e)
{
OperatingSystem OS = Environment.OSVersion;
- if ((OS.Platform == PlatformID.Win32NT) && (OS.Version.Major == 5 && OS.Version.Minor == 1))
+ if ((OS.Platform == PlatformID.Win32NT) && (OS.Version.Major == 5 && OS.Version.Minor <= 1))
{
- MessageBox.Show("Windows XP support is currently broken. It is not known if or when it will be fixed.", "Notice", MessageBoxButton.OK, MessageBoxImage.Warning);
+ MessageBox.Show("Windows XP and earlier are no longer supported. Version 0.9.9 was the last version to support these versions. ", "Notice", MessageBoxButton.OK, MessageBoxImage.Warning);
Application.Current.Shutdown();
return;
}
@@ -66,6 +66,11 @@ namespace HandBrakeWPF
return;
}
+ if (e.Args.Any(f => f.Equals("--enable-libhb")))
+ {
+ AppArguments.EnableLibHB = true;
+ }
+
base.OnStartup(e);
// If we have a file dropped on the icon, try scanning it.
diff --git a/win/CS/HandBrakeWPF/AppArguments.cs b/win/CS/HandBrakeWPF/AppArguments.cs
index 970ba9957..107eb7e5c 100644
--- a/win/CS/HandBrakeWPF/AppArguments.cs
+++ b/win/CS/HandBrakeWPF/AppArguments.cs
@@ -18,5 +18,10 @@ namespace HandBrakeWPF
/// Gets or sets a value indicating whether is instant hand brake.
/// </summary>
public static bool IsInstantHandBrake { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether enable lib hb.
+ /// </summary>
+ public static bool EnableLibHB { get; set; }
}
}
diff --git a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs
index 796689781..0f2fa702c 100644
--- a/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs
+++ b/win/CS/HandBrakeWPF/Services/EncodeServiceWrapper.cs
@@ -51,7 +51,7 @@ namespace HandBrakeWPF.Services
/// </param>
public EncodeServiceWrapper(IUserSettingService userSettingService)
{
- var useLibHb = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableLibHb);
+ var useLibHb = AppArguments.EnableLibHB ? AppArguments.EnableLibHB : userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableLibHb);
var useProcessIsolation =
userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);
var port = userSettingService.GetUserSetting<string>(UserSettingConstants.ServerPort);
diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs
index 80bebe4b3..77f45379f 100644
--- a/win/CS/HandBrakeWPF/UserSettingConstants.cs
+++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs
@@ -256,6 +256,11 @@ namespace HandBrakeWPF
/// </summary>
public const string ClearCompletedFromQueue = "ClearCompletedFromQueue";
+ /// <summary>
+ /// The enable static preview.
+ /// </summary>
+ public const string EnableStaticPreview = "EnableStaticPreview";
+
#endregion
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index 9cf6c694b..af4243b93 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -281,6 +281,11 @@ namespace HandBrakeWPF.ViewModels
private bool showAdvancedTab;
/// <summary>
+ /// The enable static preview.
+ /// </summary>
+ private bool enableStaticPreview;
+
+ /// <summary>
/// The remove punctuation.
/// </summary>
private bool removePunctuation;
@@ -1129,6 +1134,22 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Gets or sets a value indicating whether enable static preview.
+ /// </summary>
+ public bool EnableStaticPreview
+ {
+ get
+ {
+ return this.enableStaticPreview;
+ }
+ set
+ {
+ this.enableStaticPreview = value;
+ this.NotifyOfPropertyChange(() => this.EnableStaticPreview);
+ }
+ }
+
#endregion
#region Video
@@ -1572,6 +1593,8 @@ namespace HandBrakeWPF.ViewModels
// Use dvdnav
this.DisableLibdvdNav = userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibDvdNav);
+ this.EnableStaticPreview = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableStaticPreview);
+
int port;
int.TryParse(userSettingService.GetUserSetting<string>(UserSettingConstants.ServerPort), out port);
this.ServerPort = port;
@@ -1629,7 +1652,7 @@ namespace HandBrakeWPF.ViewModels
userSettingService.SetUserSetting(UserSettingConstants.PreviewScanCount, this.SelectedPreviewCount);
userSettingService.SetUserSetting(UserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture));
userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, this.ShowAdvancedTab);
- userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, this.ShowAdvancedTab);
+ userSettingService.SetUserSetting(UserSettingConstants.EnableStaticPreview, this.EnableStaticPreview);
int value;
if (int.TryParse(this.MinLength.ToString(CultureInfo.InvariantCulture), out value))
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index 51c018ad9..1bcc43c36 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -611,6 +611,17 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Gets a value indicating whether is picture preview enabled.
+ /// </summary>
+ public bool IsPicturePreviewEnabled
+ {
+ get
+ {
+ return this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.EnableStaticPreview);
+ }
+ }
+
#endregion
#region Public Methods
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
index 69f57ab74..b36557a32 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
@@ -326,15 +326,16 @@
</StackPanel>
- <StackPanel Orientation="Vertical" Margin="0,10,0,20">
-
- <TextBlock Text="Beta Features" Grid.Column="0" FontSize="14" Margin="0,0,0,10"/>
+ <StackPanel Orientation="Vertical" Margin="0,10,0,20" Visibility="Visible">
- <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">
+ <TextBlock Text="Alpha Features" FontSize="14" Margin="0,0,0,10"/>
- <CheckBox Content="Use LibHB for Encoding (uses hb.dll instead of HandBrakeCLI.exe)" Margin="0,5,0,0" IsChecked="{Binding EnableLibHb}" />
- <CheckBox Content="Enable Process Isolation (Run Encodes via an intermediate service)" Margin="20,10,0,0" IsChecked="{Binding EnableProcessIsolation}" />
- <StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Column="1">
+ <StackPanel Orientation="Vertical" Margin="20,0,0,0">
+ <CheckBox Content="Enable Static Preview" Margin="0,5,0,0" IsChecked="{Binding EnableStaticPreview}" />
+
+ <CheckBox Content="Use LibHB for Encoding (uses hb.dll instead of HandBrakeCLI.exe)" Margin="0,5,0,0" IsChecked="{Binding EnableLibHb}" Visibility="Collapsed" />
+ <CheckBox Content="Enable Process Isolation (Run Encodes via an intermediate service)" Margin="20,10,0,0" IsChecked="{Binding EnableProcessIsolation}" Visibility="Collapsed" />
+ <StackPanel Orientation="Horizontal" Margin="0,10,0,0" Visibility="Collapsed">
<TextBlock Text="Server Port:" VerticalAlignment="Center" />
<TextBox Width="50" MaxLength="5" Text="{Binding ServerPort}" />
</StackPanel>
diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
index 53aae130a..93e630381 100644
--- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
@@ -151,7 +151,8 @@
</StackPanel>
<!-- Preview Panel -->
- <StackPanel Name="PreviewPanel" Margin="0,5,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0">
+ <StackPanel Name="PreviewPanel" Margin="0,5,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0"
+ Visibility="{Binding IsPicturePreviewEnabled, Converter={StaticResource boolToVisConverter}}">
<Label Content="Output" FontWeight="Bold" />
<Grid Margin="5,0,0,0">
diff --git a/win/CS/HandBrakeWPF/Views/PreviewView.xaml b/win/CS/HandBrakeWPF/Views/PreviewView.xaml
index bb15e7ce4..c38a5dc2c 100644
--- a/win/CS/HandBrakeWPF/Views/PreviewView.xaml
+++ b/win/CS/HandBrakeWPF/Views/PreviewView.xaml
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="{Binding Title}"
- Width="380"
+ Width="390"
Style="{StaticResource windowStyle}"
ResizeMode="NoResize"
SizeToContent="Height"
@@ -64,18 +64,16 @@
SelectedItem="{Binding Duration}" />
</StackPanel>
- <StackPanel Margin="10,10,0,0" Orientation="Horizontal">
- <ProgressBar Width="310"
- Height="22"
- Maximum="100"
- Minimum="0"
- Value="{Binding PercentageValue}" />
- <TextBlock Margin="5,0,0,0" Text="{Binding Percentage}" />
- </StackPanel>
+ <Grid Margin="10,10,10,0">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" MinWidth="50" />
+ </Grid.ColumnDefinitions>
+ <ProgressBar MinHeight="22" Maximum="100" Minimum="0" Value="{Binding PercentageValue}" Grid.Column="0" />
+ <TextBlock Margin="5,0,0,0" Text="{Binding Percentage}" Grid.Column="1" />
+ </Grid>
- <StackPanel Width="360"
- Margin="10,10,0,10"
- Orientation="Horizontal">
+ <StackPanel Margin="10,10,0,10" Orientation="Horizontal">
<CheckBox VerticalAlignment="Center"
Content="Use system default player"
IsChecked="{Binding UseSystemDefaultPlayer}" />