summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-01-13 17:51:42 +0000
committersr55 <[email protected]>2013-01-13 17:51:42 +0000
commitf3fcc49085f080ad5f075da4a87bbaff47f92572 (patch)
tree2b483848c6111e73958d4f69af03e790a8abadc3
parentb62992bfb1623ae6c0930c41e00c2b150ea780d9 (diff)
WinGui: Options screen refactoring.
Help -> Check for updates now takes the user to the options screen update tab. Help -> About now takes the user to the options screen about tab. Saves popping up annoying window. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5169 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs62
-rw-r--r--win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs27
-rw-r--r--win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs71
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj4
-rw-r--r--win/CS/HandBrakeWPF/Model/OptionsTab.cs37
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs19
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx17
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs11
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs9
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs37
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs36
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs11
-rw-r--r--win/CS/HandBrakeWPF/Views/AboutView.xaml55
-rw-r--r--win/CS/HandBrakeWPF/Views/AboutView.xaml.cs4
-rw-r--r--win/CS/HandBrakeWPF/Views/AudioView.xaml7
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml43
-rw-r--r--win/CS/HandBrakeWPF/Views/SubtitlesView.xaml2
17 files changed, 333 insertions, 119 deletions
diff --git a/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs b/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs
new file mode 100644
index 000000000..30a473d90
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs
@@ -0,0 +1,62 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="OpenOptionsScreen.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// A Command to display the options window.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Commands
+{
+ using System;
+ using System.Windows.Input;
+
+ using Caliburn.Micro;
+
+ using HandBrakeWPF.Model;
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// A Command to display the options window.
+ /// </summary>
+ public class OpenOptionsScreenCommand : ICommand
+ {
+ /// <summary>
+ /// The can execute changed.
+ /// </summary>
+ public event EventHandler CanExecuteChanged;
+
+ /// <summary>
+ /// The can execute.
+ /// </summary>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <returns>
+ /// The <see cref="bool"/>.
+ /// </returns>
+ public bool CanExecute(object parameter)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// The execute.
+ /// </summary>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ public void Execute(object parameter)
+ {
+ var shellViewModel = IoC.Get<IShellViewModel>();
+ shellViewModel.DisplayWindow(ShellWindow.OptionsWindow);
+
+ if (parameter != null && parameter.GetType() == typeof(OptionsTab))
+ {
+ var optionsViewModel = IoC.Get<IOptionsViewModel>();
+ optionsViewModel.GotoTab((OptionsTab)parameter);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
index 9c561e549..128596f3f 100644
--- a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
@@ -15,6 +15,8 @@ namespace HandBrakeWPF.Converters.Options
using System.Windows;
using System.Windows.Data;
+ using HandBrakeWPF.Model;
+
/// <summary>
/// The Options Tab Converter. Controls which tab is dispalyed.
/// </summary>
@@ -31,22 +33,25 @@ namespace HandBrakeWPF.Converters.Options
{
if (value != null && parameter != null)
{
- switch (value.ToString())
+ switch ((OptionsTab)value)
{
- case "General":
- if (parameter.ToString() == "General") return Visibility.Visible;
+ case OptionsTab.General:
+ if ((OptionsTab)parameter == OptionsTab.General) return Visibility.Visible;
+ break;
+ case OptionsTab.OutputFiles:
+ if ((OptionsTab)parameter == OptionsTab.OutputFiles) return Visibility.Visible;
break;
- case "Output Files":
- if (parameter.ToString() == "Output Files") return Visibility.Visible;
+ case OptionsTab.AudioAndSubtitles:
+ if ((OptionsTab)parameter == OptionsTab.AudioAndSubtitles) return Visibility.Visible;
break;
- case "Audio and Subtitles":
- if (parameter.ToString() == "Audio and Subtitles") return Visibility.Visible;
+ case OptionsTab.Advanced:
+ if ((OptionsTab)parameter == OptionsTab.Advanced) return Visibility.Visible;
break;
- case "Advanced":
- if (parameter.ToString() == "Advanced") return Visibility.Visible;
+ case OptionsTab.Updates:
+ if ((OptionsTab)parameter == OptionsTab.Updates) return Visibility.Visible;
break;
- case "Updates":
- if (parameter.ToString() == "Updates") return Visibility.Visible;
+ case OptionsTab.About:
+ if ((OptionsTab)parameter == OptionsTab.About) return Visibility.Visible;
break;
}
}
diff --git a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs
new file mode 100644
index 000000000..beddd18be
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs
@@ -0,0 +1,71 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="OptionsTabNameConverter.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// A Converter to get the Display Name of each options tab.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters.Options
+{
+ using System;
+ using System.Globalization;
+ using System.Windows.Data;
+
+ using HandBrake.ApplicationServices.Utilities;
+
+ using HandBrakeWPF.Model;
+
+ /// <summary>
+ /// A Converter to get the Display Name of each options tab.
+ /// </summary>
+ public class OptionsTabNameConverter : IValueConverter
+ {
+ /// <summary>
+ /// The convert.
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetType">
+ /// The target type.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// The <see cref="object"/>.
+ /// </returns>
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return EnumHelper<OptionsTab>.GetDisplay((OptionsTab)value);
+ }
+
+ /// <summary>
+ /// The convert back.
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetType">
+ /// The target type.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// The <see cref="object"/>.
+ /// </returns>
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return EnumHelper<OptionsTab>.GetValue(value.ToString());
+ }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index fe4287bda..e11f8e8f9 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -101,6 +101,7 @@
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Runtime.Serialization" />
@@ -124,6 +125,7 @@
<Compile Include="AttachedProperties\MenuItemExtensions.cs" />
<Compile Include="Commands\CancelScanCommand.cs" />
<Compile Include="Commands\Interfaces\IAdvancedEncoderOptionsCommand.cs" />
+ <Compile Include="Commands\OpenOptionsScreenCommand.cs" />
<Compile Include="Commands\ProcessShortcutCommand.cs" />
<Compile Include="Commands\SourceMenuCommand.cs" />
<Compile Include="Commands\AdvancedEncoderOptionsCommand.cs" />
@@ -142,10 +144,12 @@
<Compile Include="Converters\Audio\AudioQueueDisplayConverter.cs" />
<Compile Include="Converters\BooleanToHiddenVisibilityConverter.cs" />
<Compile Include="Converters\Options\OptionsTabConverter.cs" />
+ <Compile Include="Converters\Options\OptionsTabNameConverter.cs" />
<Compile Include="Converters\Subtitles\SubtitlesQueueDisplayConverter.cs" />
<Compile Include="Converters\Video\VideoEncoderConverter.cs" />
<Compile Include="Helpers\GrayscaleImage.cs" />
<Compile Include="Helpers\GrowlCommunicator.cs" />
+ <Compile Include="Model\OptionsTab.cs" />
<Compile Include="Services\DriveDetectService.cs" />
<Compile Include="Services\EncodeServiceWrapper.cs" />
<Compile Include="Services\Interfaces\IDriveDetectService.cs" />
diff --git a/win/CS/HandBrakeWPF/Model/OptionsTab.cs b/win/CS/HandBrakeWPF/Model/OptionsTab.cs
new file mode 100644
index 000000000..93692d13d
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Model/OptionsTab.cs
@@ -0,0 +1,37 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="OptionsTab.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// A enum representing each tab on the options screen.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// A enum representing each tab on the options screen.
+ /// </summary>
+ public enum OptionsTab
+ {
+ [Display(Name = "General")]
+ General = 0,
+
+ [Display(Name = "Output Files")]
+ OutputFiles,
+
+ [Display(Name = "Audio and Subtitles")]
+ AudioAndSubtitles,
+
+ [Display(Name = "Advanced")]
+ Advanced,
+
+ [Display(Name = "Updates")]
+ Updates,
+
+ [Display(Name = "About HandBrake")]
+ About,
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index 3b5ef0e3c..5adc38011 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -61,6 +61,25 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to Copyright (C) 2003-2013 The HandBrake Team
+ ///
+ ///This program is free software; you can redistribute it and/or
+ ///modify it under the terms of the GNU General Public License
+ ///as published by the Free Software Foundation; either version 2
+ ///of the License, or (at your option) any later version.
+ ///
+ ///This program is distributed in the hope that it will be useful,
+ ///but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ///MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ///GNU General Public License f [rest of string was truncated]&quot;;.
+ /// </summary>
+ public static string About_GPL {
+ get {
+ return ResourceManager.GetString("About_GPL", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to You can optionally store a maximum resolution for encodes that use this preset. There are 3 modes:
///
///None: There is no maximum resolution for encodes using this preset. They will always use the source resolution minus any cropping that may be applied.
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index 2d4c9f8a3..6148d29c6 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -304,4 +304,21 @@ Source Maximum: Similar to custom, but the resolution of your current source is
The above controls are only a subset of useful x264 parameters.
This box allows you to add or modify additional or current parameters as desired. </value>
</data>
+ <data name="About_GPL" xml:space="preserve">
+ <value>Copyright (C) 2003-2013 The HandBrake Team
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index eeb3def77..516fc7642 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -23,6 +23,8 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
+ using HandBrakeWPF.Commands;
+ using HandBrakeWPF.Model;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -167,6 +169,15 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Open the options screen to the Audio and Subtitles tab.
+ /// </summary>
+ public void SetDefaultBehaviour()
+ {
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.AudioAndSubtitles);
+ }
+
#endregion
#region Implemented Interfaces
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
index 7805aea63..c2d48f8e5 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
@@ -9,10 +9,19 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
+ using HandBrakeWPF.Model;
+
/// <summary>
/// The Options Screen View Model Interface
/// </summary>
public interface IOptionsViewModel
{
+ /// <summary>
+ /// The goto tab.
+ /// </summary>
+ /// <param name="tab">
+ /// The tab.
+ /// </param>
+ void GotoTab(OptionsTab tab);
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 7a9461b25..335509150 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -896,16 +896,8 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void OpenAboutApplication()
{
- Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(AboutView));
-
- if (window != null)
- {
- window.Activate();
- }
- else
- {
- this.WindowManager.ShowWindow(IoC.Get<IAboutViewModel>());
- }
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.About);
}
/// <summary>
@@ -983,8 +975,8 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void CheckForUpdates()
{
- this.ProgramStatusLabel = "Checking for Updates ...";
- this.updateService.CheckForUpdates(this.HandleManualUpdateCheckResults);
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.Updates);
}
/// <summary>
@@ -1614,27 +1606,6 @@ namespace HandBrakeWPF.ViewModels
this.ProgramStatusLabel = "A New Update is Available. Goto Tools Menu > Options to Install";
}
}
-
- /// <summary>
- /// Handle Update Check Results
- /// </summary>
- /// <param name="information">
- /// The information.
- /// </param>
- private void HandleManualUpdateCheckResults(UpdateCheckInformation information)
- {
- if (information.NewVersionAvailable)
- {
- MessageBox.Show("A New Version is available. Goto Tools Menu > Options to Install or visit http://handbrake.fr for details.", "Update Available", MessageBoxButton.OK, MessageBoxImage.Information);
- }
- else
- {
- MessageBox.Show("There is no new updates at this time.", "No Update Available", MessageBoxButton.OK, MessageBoxImage.Information);
- }
-
- this.ProgramStatusLabel = "Ready";
- }
-
#endregion
#region Event Handlers
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index 6dc2a44dc..36fa35985 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -309,7 +309,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// The options tab that is selected.
/// </summary>
- private string selectedTab;
+ private OptionsTab selectedTab;
/// <summary>
/// Update Message
@@ -380,7 +380,7 @@ namespace HandBrakeWPF.ViewModels
this.updateService = updateService;
this.OnLoad();
- this.SelectedTab = "General";
+ this.SelectedTab = OptionsTab.General;
this.UpdateMessage = "Click 'Check for Updates' to check for new versions";
}
@@ -389,20 +389,9 @@ namespace HandBrakeWPF.ViewModels
#region Window Properties
/// <summary>
- /// Gets OptionTabs.
- /// </summary>
- public IEnumerable<string> OptionTabs
- {
- get
- {
- return new List<string> { "General", "Output Files", "Audio and Subtitles", "Advanced", "Updates" };
- }
- }
-
- /// <summary>
/// Gets or sets SelectedTab.
/// </summary>
- public string SelectedTab
+ public OptionsTab SelectedTab
{
get
{
@@ -415,6 +404,12 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.SelectedTab);
}
}
+
+ /// <summary>
+ /// Gets or sets the about view model.
+ /// </summary>
+ public IAboutViewModel AboutViewModel { get; set; }
+
#endregion
#region Properties
@@ -1344,7 +1339,7 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Enable Debugging features in the UI.
+ /// Gets or sets a value indicating whether debug features are enabled.
/// </summary>
public bool EnableDebugFeatures
{
@@ -1962,5 +1957,16 @@ namespace HandBrakeWPF.ViewModels
Process.Start(Path.Combine(Path.GetTempPath(), "handbrake-setup.exe"));
Application.Current.Shutdown();
}
+
+ /// <summary>
+ /// The goto tab.
+ /// </summary>
+ /// <param name="tab">
+ /// The tab.
+ /// </param>
+ public void GotoTab(OptionsTab tab)
+ {
+ this.SelectedTab = tab;
+ }
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
index b52dd961a..3fcca18aa 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
@@ -22,6 +22,8 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
+ using HandBrakeWPF.Commands;
+ using HandBrakeWPF.Model;
using HandBrakeWPF.ViewModels.Interfaces;
using Ookii.Dialogs.Wpf;
@@ -279,6 +281,15 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Open the options screen to the Audio and Subtitles tab.
+ /// </summary>
+ public void SetDefaultBehaviour()
+ {
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.AudioAndSubtitles);
+ }
+
#endregion
#region Implemented Interfaces
diff --git a/win/CS/HandBrakeWPF/Views/AboutView.xaml b/win/CS/HandBrakeWPF/Views/AboutView.xaml
index a9e7e4319..d7b63c08b 100644
--- a/win/CS/HandBrakeWPF/Views/AboutView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AboutView.xaml
@@ -1,13 +1,7 @@
-<Window x:Class="HandBrakeWPF.Views.AboutView"
+<UserControl x:Class="HandBrakeWPF.Views.AboutView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
- Title="{Binding Title}"
- Width="600"
- Height="320"
- ResizeMode="NoResize"
- TextOptions.TextFormattingMode="Display"
- WindowStartupLocation="CenterScreen">
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
+ TextOptions.TextFormattingMode="Display">
<Grid>
<Grid.RowDefinitions>
@@ -34,54 +28,23 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0"
Margin="5,10,0,0"
Orientation="Horizontal">
- <TextBlock Margin="0,0,5,0"
- FontSize="14"
- FontWeight="Bold"
- Text="HandBrake" />
- <TextBlock Margin="0,0,0,1"
- VerticalAlignment="Bottom"
- Text="{Binding Version}" />
+ <TextBlock Margin="0,0,5,0" FontSize="12" FontWeight="Bold" Text="HandBrake " />
+ <TextBlock Margin="0,0,0,1" FontSize="12" VerticalAlignment="Bottom" Text="{Binding Version}" />
</StackPanel>
- <TextBlock Grid.Row="1"
- Margin="5,0,0,0 "
- Text="Copyright 2003-2013 HandBrake Team" />
+ <TextBlock Grid.Row="1" Margin="5,10,0,5" Text="License: " />
- <TextBlock Grid.Row="2"
- Margin="5,10,0,5"
- Text="License:" />
- <TextBox Grid.Row="3"
- Margin="10,0,10,10"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- IsReadOnly="True"
- TextWrapping="Wrap"
- VerticalScrollBarVisibility="Auto">
- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- </TextBox>
+ <TextBox Text="{x:Static Properties:Resources.About_GPL}" Grid.Row="2" Margin="10,0,10,10" HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch" IsReadOnly="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" />
</Grid>
</Grid>
- <StackPanel Grid.Row="1"
- HorizontalAlignment="Stretch"
- Background="LightGray">
- <Button Margin="0,5,10,5"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Content="Close"
- IsDefault="True"
- Micro:Message.Attach="[Event Click] = [Action Close]"
- Padding="12,2" />
- </StackPanel>
</Grid>
-</Window>
+</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs b/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs
index 55665fc8b..2be3fd009 100644
--- a/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs
@@ -9,12 +9,12 @@
namespace HandBrakeWPF.Views
{
- using System.Windows;
+ using System.Windows.Controls;
/// <summary>
/// Interaction logic for AboutView.xaml
/// </summary>
- public partial class AboutView : Window
+ public partial class AboutView : UserControl
{
/// <summary>
/// Initializes a new instance of the <see cref="AboutView"/> class.
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml
index d90e5643f..af5b81514 100644
--- a/win/CS/HandBrakeWPF/Views/AudioView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml
@@ -111,15 +111,14 @@
<MenuItem Header="Add All Remaining Selected Languages" cal:Message.Attach="[Event Click] = [Action AddAllRemainingForSelectedLanguages]" />
<Separator />
<MenuItem Header="Clear All" cal:Message.Attach="[Event Click] = [Action Clear]" />
+ <Separator />
+ <MenuItem Header="Configure Default Behaviours" cal:Message.Attach="[Event Click] = [Action SetDefaultBehaviour]" />
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
-
-
-
-
+
<Grid HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
index 9c2080db5..99d857bdc 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
@@ -3,7 +3,8 @@
xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers"
xmlns:Options="clr-namespace:HandBrakeWPF.Converters.Options"
xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
- xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" Background="White">
+ xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" xmlns:local="clr-namespace:HandBrakeWPF.Model"
+ Background="White">
<UserControl.Resources>
<Style TargetType="Button">
@@ -30,7 +31,17 @@
</Style>
<Options:OptionsTabConverter x:Key="tabConverter" />
+ <Options:OptionsTabNameConverter x:Key="tabNameConverter" />
+
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+
+ <ObjectDataProvider MethodName="GetValues"
+ ObjectType="{x:Type local:OptionsTab}"
+ x:Key="OptionTabsList">
+ <ObjectDataProvider.MethodParameters>
+ <x:Type TypeName="local:OptionsTab" />
+ </ObjectDataProvider.MethodParameters>
+ </ObjectDataProvider>
</UserControl.Resources>
<Grid>
@@ -44,14 +55,18 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
-
<StackPanel Orientation="Vertical" Grid.Column="0" Margin="10,10,0,0">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray" Margin="0,0,0,10">
<TextBlock Text="Preferences" FontSize="16" />
</Border>
- <ListBox ItemsSource="{Binding OptionTabs}" SelectedItem="{Binding SelectedTab}"
+ <ListBox ItemsSource="{Binding Source={StaticResource OptionTabsList}}" SelectedItem="{Binding SelectedTab}"
BorderThickness="0" Background="Transparent">
+ <ListBox.ItemTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Converter={StaticResource tabNameConverter}}"/>
+ </DataTemplate>
+ </ListBox.ItemTemplate>
</ListBox>
</StackPanel>
@@ -60,7 +75,7 @@
<StackPanel Orientation="Vertical">
<StackPanel Name="General" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='General'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.General}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="General" FontSize="16" />
@@ -121,7 +136,7 @@
</StackPanel>
<StackPanel Name="Output" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Output Files'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.OutputFiles}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="Output Files" FontSize="16" />
@@ -161,7 +176,7 @@
</StackPanel>
<StackPanel Name="Audio" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Audio and Subtitles'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.AudioAndSubtitles}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
@@ -263,7 +278,7 @@
</StackPanel>
<StackPanel Name="Advanced" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Advanced'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Advanced}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="Advanced" FontSize="16" />
@@ -364,7 +379,7 @@
</StackPanel>
<StackPanel Name="Updates" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Updates'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Updates}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
@@ -398,6 +413,18 @@
</StackPanel>
</StackPanel>
+
+ <StackPanel Name="About" Orientation="Vertical" Margin="10,10,0,0"
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.About}}">
+
+
+ <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
+ <TextBlock Text="About HandBrake" FontSize="16" />
+ </Border>
+
+ <ContentControl x:Name="AboutViewModel" />
+
+ </StackPanel>
</StackPanel>
</ScrollViewer>
diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
index 83dabf50f..362734851 100644
--- a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
+++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
@@ -69,6 +69,8 @@
<MenuItem Header="Add All Remaining Selected Languages" cal:Message.Attach="[Event Click] = [Action AddAllRemainingForSelectedLanguages]" />
<Separator />
<MenuItem Header="Clear All" cal:Message.Attach="[Event Click] = [Action Clear]" />
+ <Separator />
+ <MenuItem Header="Configure Default Behaviours" cal:Message.Attach="[Event Click] = [Action SetDefaultBehaviour]" />
</ContextMenu>
</ListBox.ContextMenu>