]> granicus.if.org Git - handbrake/commitdiff
WinGui: Options screen refactoring.
authorsr55 <sr55.hb@outlook.com>
Sun, 13 Jan 2013 17:51:42 +0000 (17:51 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 13 Jan 2013 17:51:42 +0000 (17:51 +0000)
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

17 files changed:
win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs [new file with mode: 0644]
win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs [new file with mode: 0644]
win/CS/HandBrakeWPF/HandBrakeWPF.csproj
win/CS/HandBrakeWPF/Model/OptionsTab.cs [new file with mode: 0644]
win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
win/CS/HandBrakeWPF/Properties/Resources.resx
win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
win/CS/HandBrakeWPF/Views/AboutView.xaml
win/CS/HandBrakeWPF/Views/AboutView.xaml.cs
win/CS/HandBrakeWPF/Views/AudioView.xaml
win/CS/HandBrakeWPF/Views/OptionsView.xaml
win/CS/HandBrakeWPF/Views/SubtitlesView.xaml

diff --git a/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs b/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs
new file mode 100644 (file)
index 0000000..30a473d
--- /dev/null
@@ -0,0 +1,62 @@
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="OpenOptionsScreen.cs" company="HandBrake Project (http://handbrake.fr)">\r
+//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+//   A Command to display the options window.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Commands\r
+{\r
+    using System;\r
+    using System.Windows.Input;\r
+\r
+    using Caliburn.Micro;\r
+\r
+    using HandBrakeWPF.Model;\r
+    using HandBrakeWPF.ViewModels.Interfaces;\r
+\r
+    /// <summary>\r
+    ///     A Command to display the options window.\r
+    /// </summary>\r
+    public class OpenOptionsScreenCommand : ICommand\r
+    {\r
+        /// <summary>\r
+        /// The can execute changed.\r
+        /// </summary>\r
+        public event EventHandler CanExecuteChanged;\r
+\r
+        /// <summary>\r
+        /// The can execute.\r
+        /// </summary>\r
+        /// <param name="parameter">\r
+        /// The parameter.\r
+        /// </param>\r
+        /// <returns>\r
+        /// The <see cref="bool"/>.\r
+        /// </returns>\r
+        public bool CanExecute(object parameter)\r
+        {\r
+            return true;\r
+        }\r
+\r
+        /// <summary>\r
+        /// The execute.\r
+        /// </summary>\r
+        /// <param name="parameter">\r
+        /// The parameter.\r
+        /// </param>\r
+        public void Execute(object parameter)\r
+        {\r
+            var shellViewModel = IoC.Get<IShellViewModel>();\r
+            shellViewModel.DisplayWindow(ShellWindow.OptionsWindow);\r
+\r
+            if (parameter != null && parameter.GetType() == typeof(OptionsTab))\r
+            {\r
+                var optionsViewModel = IoC.Get<IOptionsViewModel>();\r
+                optionsViewModel.GotoTab((OptionsTab)parameter);\r
+            }\r
+        }\r
+    }\r
+}
\ No newline at end of file
index 9c561e549385a9d608c8b561678f5c5774f61be4..128596f3f786a49d6a5cded609a64bf069c32ae2 100644 (file)
@@ -15,6 +15,8 @@ namespace HandBrakeWPF.Converters.Options
     using System.Windows;\r
     using System.Windows.Data;\r
 \r
+    using HandBrakeWPF.Model;\r
+\r
     /// <summary>\r
     /// The Options Tab Converter. Controls which tab is dispalyed.\r
     /// </summary>\r
@@ -31,22 +33,25 @@ namespace HandBrakeWPF.Converters.Options
         {\r
             if (value != null && parameter != null)\r
             {\r
-                switch (value.ToString())\r
+                switch ((OptionsTab)value)\r
                 {\r
-                    case "General":\r
-                        if (parameter.ToString() == "General") return Visibility.Visible;\r
+                    case OptionsTab.General:\r
+                        if ((OptionsTab)parameter == OptionsTab.General) return Visibility.Visible;\r
+                        break;\r
+                    case OptionsTab.OutputFiles:\r
+                        if ((OptionsTab)parameter == OptionsTab.OutputFiles) return Visibility.Visible;\r
                         break;\r
-                    case "Output Files":\r
-                        if (parameter.ToString() == "Output Files") return Visibility.Visible;\r
+                    case OptionsTab.AudioAndSubtitles:\r
+                        if ((OptionsTab)parameter == OptionsTab.AudioAndSubtitles) return Visibility.Visible;\r
                         break;\r
-                    case "Audio and Subtitles":\r
-                        if (parameter.ToString() == "Audio and Subtitles") return Visibility.Visible;\r
+                    case OptionsTab.Advanced:\r
+                        if ((OptionsTab)parameter == OptionsTab.Advanced) return Visibility.Visible;\r
                         break;\r
-                    case "Advanced":\r
-                        if (parameter.ToString() == "Advanced") return Visibility.Visible;\r
+                    case OptionsTab.Updates:\r
+                        if ((OptionsTab)parameter == OptionsTab.Updates) return Visibility.Visible;\r
                         break;\r
-                    case "Updates":\r
-                        if (parameter.ToString() == "Updates") return Visibility.Visible;\r
+                    case OptionsTab.About:\r
+                        if ((OptionsTab)parameter == OptionsTab.About) return Visibility.Visible;\r
                         break;\r
                 }\r
             }\r
diff --git a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs
new file mode 100644 (file)
index 0000000..beddd18
--- /dev/null
@@ -0,0 +1,71 @@
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="OptionsTabNameConverter.cs" company="HandBrake Project (http://handbrake.fr)">\r
+//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+//   A Converter to get the Display Name of each options tab.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Converters.Options\r
+{\r
+    using System;\r
+    using System.Globalization;\r
+    using System.Windows.Data;\r
+\r
+    using HandBrake.ApplicationServices.Utilities;\r
+\r
+    using HandBrakeWPF.Model;\r
+\r
+    /// <summary>\r
+    /// A Converter to get the Display Name of each options tab.\r
+    /// </summary>\r
+    public class OptionsTabNameConverter : IValueConverter\r
+    {\r
+        /// <summary>\r
+        /// The convert.\r
+        /// </summary>\r
+        /// <param name="value">\r
+        /// The value.\r
+        /// </param>\r
+        /// <param name="targetType">\r
+        /// The target type.\r
+        /// </param>\r
+        /// <param name="parameter">\r
+        /// The parameter.\r
+        /// </param>\r
+        /// <param name="culture">\r
+        /// The culture.\r
+        /// </param>\r
+        /// <returns>\r
+        /// The <see cref="object"/>.\r
+        /// </returns>\r
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)\r
+        {\r
+            return EnumHelper<OptionsTab>.GetDisplay((OptionsTab)value);\r
+        }\r
+\r
+        /// <summary>\r
+        /// The convert back.\r
+        /// </summary>\r
+        /// <param name="value">\r
+        /// The value.\r
+        /// </param>\r
+        /// <param name="targetType">\r
+        /// The target type.\r
+        /// </param>\r
+        /// <param name="parameter">\r
+        /// The parameter.\r
+        /// </param>\r
+        /// <param name="culture">\r
+        /// The culture.\r
+        /// </param>\r
+        /// <returns>\r
+        /// The <see cref="object"/>.\r
+        /// </returns>\r
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)\r
+        {\r
+            return EnumHelper<OptionsTab>.GetValue(value.ToString());\r
+        }\r
+    }\r
+}
\ No newline at end of file
index fe4287bda8030113a20b974c42f2e61ae3dace81..e11f8e8f98d0ac3140748518a602d61ffdbd0a5c 100644 (file)
     </Reference>\r
     <Reference Include="PresentationFramework" />\r
     <Reference Include="System" />\r
+    <Reference Include="System.ComponentModel.DataAnnotations" />\r
     <Reference Include="System.Drawing" />\r
     <Reference Include="System.Management" />\r
     <Reference Include="System.Runtime.Serialization" />\r
     <Compile Include="AttachedProperties\MenuItemExtensions.cs" />\r
     <Compile Include="Commands\CancelScanCommand.cs" />\r
     <Compile Include="Commands\Interfaces\IAdvancedEncoderOptionsCommand.cs" />\r
+    <Compile Include="Commands\OpenOptionsScreenCommand.cs" />\r
     <Compile Include="Commands\ProcessShortcutCommand.cs" />\r
     <Compile Include="Commands\SourceMenuCommand.cs" />\r
     <Compile Include="Commands\AdvancedEncoderOptionsCommand.cs" />\r
     <Compile Include="Converters\Audio\AudioQueueDisplayConverter.cs" />\r
     <Compile Include="Converters\BooleanToHiddenVisibilityConverter.cs" />\r
     <Compile Include="Converters\Options\OptionsTabConverter.cs" />\r
+    <Compile Include="Converters\Options\OptionsTabNameConverter.cs" />\r
     <Compile Include="Converters\Subtitles\SubtitlesQueueDisplayConverter.cs" />\r
     <Compile Include="Converters\Video\VideoEncoderConverter.cs" />\r
     <Compile Include="Helpers\GrayscaleImage.cs" />\r
     <Compile Include="Helpers\GrowlCommunicator.cs" />\r
+    <Compile Include="Model\OptionsTab.cs" />\r
     <Compile Include="Services\DriveDetectService.cs" />\r
     <Compile Include="Services\EncodeServiceWrapper.cs" />\r
     <Compile Include="Services\Interfaces\IDriveDetectService.cs" />\r
diff --git a/win/CS/HandBrakeWPF/Model/OptionsTab.cs b/win/CS/HandBrakeWPF/Model/OptionsTab.cs
new file mode 100644 (file)
index 0000000..93692d1
--- /dev/null
@@ -0,0 +1,37 @@
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="OptionsTab.cs" company="HandBrake Project (http://handbrake.fr)">\r
+//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+//   A enum representing each tab on the options screen.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Model\r
+{\r
+    using System.ComponentModel.DataAnnotations;\r
+\r
+    /// <summary>\r
+    /// A enum representing each tab on the options screen.\r
+    /// </summary>\r
+    public enum OptionsTab\r
+    {\r
+        [Display(Name = "General")]\r
+        General = 0,\r
+\r
+        [Display(Name = "Output Files")]\r
+        OutputFiles,\r
+\r
+        [Display(Name = "Audio and Subtitles")]\r
+        AudioAndSubtitles,\r
+\r
+        [Display(Name = "Advanced")]\r
+        Advanced,\r
+\r
+        [Display(Name = "Updates")]\r
+        Updates,\r
+\r
+        [Display(Name = "About HandBrake")]\r
+        About,\r
+    }\r
+}\r
index 3b5ef0e3cdab9132c17307e7b6842244f4af3226..5adc3801106efac1e70f8d2ad96fb9bb56ca4304 100644 (file)
@@ -60,6 +60,25 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Copyright (C) 2003-2013 The HandBrake Team\r
+        ///\r
+        ///This program is free software; you can redistribute it and/or\r
+        ///modify it under the terms of the GNU General Public License\r
+        ///as published by the Free Software Foundation; either version 2\r
+        ///of the License, or (at your option) any later version.\r
+        ///\r
+        ///This program is distributed in the hope that it will be useful,\r
+        ///but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+        ///MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+        ///GNU General Public License f [rest of string was truncated]&quot;;.\r
+        /// </summary>\r
+        public static string About_GPL {\r
+            get {\r
+                return ResourceManager.GetString("About_GPL", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to You can optionally store a maximum resolution for encodes that use this preset. There are 3 modes:\r
         ///\r
index 2d4c9f8a3fb479cb259f8485e0259a6e10c6aeb5..6148d29c600edeb2080c4345c162189a2164a2de 100644 (file)
@@ -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. \r
 This box allows you to add or modify additional or current parameters as desired. </value>\r
   </data>\r
+  <data name="About_GPL" xml:space="preserve">\r
+    <value>Copyright (C) 2003-2013 The HandBrake Team\r
+\r
+This program is free software; you can redistribute it and/or\r
+modify it under the terms of the GNU General Public License\r
+as published by the Free Software Foundation; either version 2\r
+of the License, or (at your option) any later version.\r
+\r
+This program is distributed in the hope that it will be useful,\r
+but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+GNU General Public License for more details.\r
+\r
+You should have received a copy of the GNU General Public License\r
+along with this program; if not, write to the Free Software\r
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.</value>\r
+  </data>\r
 </root>
\ No newline at end of file
index eeb3def77e7115e26693263ac87d00be1caa1b85..516fc7642ea5833d01e25895663afe24392d0c56 100644 (file)
@@ -23,6 +23,8 @@ namespace HandBrakeWPF.ViewModels
     using HandBrake.ApplicationServices.Utilities;\r
     using HandBrake.Interop.Model.Encoding;\r
 \r
+    using HandBrakeWPF.Commands;\r
+    using HandBrakeWPF.Model;\r
     using HandBrakeWPF.ViewModels.Interfaces;\r
 \r
     /// <summary>\r
@@ -167,6 +169,15 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Open the options screen to the Audio and Subtitles tab.\r
+        /// </summary>\r
+        public void SetDefaultBehaviour()\r
+        {\r
+            OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();\r
+            command.Execute(OptionsTab.AudioAndSubtitles);\r
+        }\r
+\r
         #endregion\r
 \r
         #region Implemented Interfaces\r
index 7805aea63b650eab8adefd3256a5c2492160e5f9..c2d48f8e51f231368c11d852d36d574faeea93f6 100644 (file)
@@ -9,10 +9,19 @@
 \r
 namespace HandBrakeWPF.ViewModels.Interfaces\r
 {\r
+    using HandBrakeWPF.Model;\r
+\r
     /// <summary>\r
     /// The Options Screen View Model Interface\r
     /// </summary>\r
     public interface IOptionsViewModel\r
     {\r
+        /// <summary>\r
+        /// The goto tab.\r
+        /// </summary>\r
+        /// <param name="tab">\r
+        /// The tab.\r
+        /// </param>\r
+        void GotoTab(OptionsTab tab);\r
     }\r
 }
\ No newline at end of file
index 7a9461b256d650808c0b1260e00fad4a7ec36eb8..3355091503c20646c3bebb49c16780717ee5308c 100644 (file)
@@ -896,16 +896,8 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         public void OpenAboutApplication()\r
         {\r
-            Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(AboutView));\r
-\r
-            if (window != null)\r
-            {\r
-                window.Activate();\r
-            }\r
-            else\r
-            {\r
-                this.WindowManager.ShowWindow(IoC.Get<IAboutViewModel>());\r
-            }\r
+            OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();\r
+            command.Execute(OptionsTab.About);\r
         }\r
 \r
         /// <summary>\r
@@ -983,8 +975,8 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         public void CheckForUpdates()\r
         {\r
-            this.ProgramStatusLabel = "Checking for Updates ...";\r
-            this.updateService.CheckForUpdates(this.HandleManualUpdateCheckResults);\r
+            OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();\r
+            command.Execute(OptionsTab.Updates);\r
         }\r
 \r
         /// <summary>\r
@@ -1614,27 +1606,6 @@ namespace HandBrakeWPF.ViewModels
                 this.ProgramStatusLabel = "A New Update is Available. Goto Tools Menu > Options to Install";\r
             }\r
         }\r
-\r
-        /// <summary>\r
-        /// Handle Update Check Results\r
-        /// </summary>\r
-        /// <param name="information">\r
-        /// The information.\r
-        /// </param>\r
-        private void HandleManualUpdateCheckResults(UpdateCheckInformation information)\r
-        {\r
-            if (information.NewVersionAvailable)\r
-            {\r
-                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);\r
-            }\r
-            else\r
-            {\r
-                MessageBox.Show("There is no new updates at this time.", "No Update Available", MessageBoxButton.OK, MessageBoxImage.Information);\r
-            }\r
-\r
-            this.ProgramStatusLabel = "Ready";\r
-        }\r
-\r
         #endregion\r
 \r
         #region Event Handlers\r
index 6dc2a44dc6863527e30a097a833296691e04f49c..36fa359854c903227d04f46c0406e3206ba0f25a 100644 (file)
@@ -309,7 +309,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The options tab that is selected.\r
         /// </summary>\r
-        private string selectedTab;\r
+        private OptionsTab selectedTab;\r
 \r
         /// <summary>\r
         /// Update Message\r
@@ -380,7 +380,7 @@ namespace HandBrakeWPF.ViewModels
             this.updateService = updateService;\r
             this.OnLoad();\r
 \r
-            this.SelectedTab = "General";\r
+            this.SelectedTab = OptionsTab.General;\r
             this.UpdateMessage = "Click 'Check for Updates' to check for new versions";\r
         }\r
 \r
@@ -388,21 +388,10 @@ namespace HandBrakeWPF.ViewModels
 \r
         #region Window Properties\r
 \r
-        /// <summary>\r
-        /// Gets OptionTabs.\r
-        /// </summary>\r
-        public IEnumerable<string> OptionTabs\r
-        {\r
-            get\r
-            {\r
-                return new List<string> { "General", "Output Files", "Audio and Subtitles", "Advanced", "Updates" };\r
-            }\r
-        }\r
-\r
         /// <summary>\r
         /// Gets or sets SelectedTab.\r
         /// </summary>\r
-        public string SelectedTab\r
+        public OptionsTab SelectedTab\r
         {\r
             get\r
             {\r
@@ -415,6 +404,12 @@ namespace HandBrakeWPF.ViewModels
                 this.NotifyOfPropertyChange(() => this.SelectedTab);\r
             }\r
         }\r
+\r
+        /// <summary>\r
+        /// Gets or sets the about view model.\r
+        /// </summary>\r
+        public IAboutViewModel AboutViewModel { get; set; }\r
+\r
         #endregion\r
 \r
         #region Properties\r
@@ -1344,7 +1339,7 @@ namespace HandBrakeWPF.ViewModels
         }\r
 \r
         /// <summary>\r
-        /// Enable Debugging features in the UI.\r
+        /// Gets or sets a value indicating whether debug features are enabled.\r
         /// </summary>\r
         public bool EnableDebugFeatures\r
         {\r
@@ -1962,5 +1957,16 @@ namespace HandBrakeWPF.ViewModels
             Process.Start(Path.Combine(Path.GetTempPath(), "handbrake-setup.exe"));\r
             Application.Current.Shutdown();\r
         }\r
+\r
+        /// <summary>\r
+        /// The goto tab.\r
+        /// </summary>\r
+        /// <param name="tab">\r
+        /// The tab.\r
+        /// </param>\r
+        public void GotoTab(OptionsTab tab)\r
+        {\r
+            this.SelectedTab = tab;\r
+        }\r
     }\r
 }
\ No newline at end of file
index b52dd961a14c2b306ab45c2d2ab2c3c1b95177b9..3fcca18aa66488092f332157bd334ff6abc66538 100644 (file)
@@ -22,6 +22,8 @@ namespace HandBrakeWPF.ViewModels
     using HandBrake.ApplicationServices.Services.Interfaces;\r
     using HandBrake.ApplicationServices.Utilities;\r
 \r
+    using HandBrakeWPF.Commands;\r
+    using HandBrakeWPF.Model;\r
     using HandBrakeWPF.ViewModels.Interfaces;\r
 \r
     using Ookii.Dialogs.Wpf;\r
@@ -279,6 +281,15 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Open the options screen to the Audio and Subtitles tab.\r
+        /// </summary>\r
+        public void SetDefaultBehaviour()\r
+        {\r
+            OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();\r
+            command.Execute(OptionsTab.AudioAndSubtitles);\r
+        }\r
+\r
         #endregion\r
 \r
         #region Implemented Interfaces\r
index a9e7e4319ac9f58b8af06a2ed29e5b98af90648c..d7b63c08bdc9a31f1d6a4dcd67e7dfe367480c8a 100644 (file)
@@ -1,13 +1,7 @@
-<Window x:Class="HandBrakeWPF.Views.AboutView"\r
+<UserControl x:Class="HandBrakeWPF.Views.AboutView"\r
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\r
-        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
-        xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"\r
-        Title="{Binding Title}"\r
-        Width="600"\r
-        Height="320"\r
-        ResizeMode="NoResize"\r
-        TextOptions.TextFormattingMode="Display"\r
-        WindowStartupLocation="CenterScreen">\r
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"\r
+             TextOptions.TextFormattingMode="Display">\r
 \r
     <Grid>\r
         <Grid.RowDefinitions>\r
@@ -32,7 +26,6 @@
 \r
             <Grid Grid.Column="1">\r
                 <Grid.RowDefinitions>\r
-                    <RowDefinition Height="Auto" />\r
                     <RowDefinition Height="Auto" />\r
                     <RowDefinition Height="Auto" />\r
                     <RowDefinition Height="*" />\r
                 <StackPanel Grid.Row="0"\r
                             Margin="5,10,0,0"\r
                             Orientation="Horizontal">\r
-                    <TextBlock Margin="0,0,5,0"\r
-                               FontSize="14"\r
-                               FontWeight="Bold"\r
-                               Text="HandBrake" />\r
-                    <TextBlock Margin="0,0,0,1"\r
-                               VerticalAlignment="Bottom"\r
-                               Text="{Binding Version}" />\r
+                    <TextBlock Margin="0,0,5,0" FontSize="12" FontWeight="Bold" Text="HandBrake " />\r
+                    <TextBlock Margin="0,0,0,1" FontSize="12" VerticalAlignment="Bottom" Text="{Binding Version}" />\r
                 </StackPanel>\r
 \r
-                <TextBlock Grid.Row="1"\r
-                           Margin="5,0,0,0 "\r
-                           Text="Copyright 2003-2013 HandBrake Team" />\r
+                <TextBlock Grid.Row="1" Margin="5,10,0,5" Text="License: " />\r
 \r
-                <TextBlock Grid.Row="2"\r
-                           Margin="5,10,0,5"\r
-                           Text="License:" />\r
-                <TextBox Grid.Row="3"\r
-                         Margin="10,0,10,10"\r
-                         HorizontalAlignment="Stretch"\r
-                         VerticalAlignment="Stretch"\r
-                         IsReadOnly="True"\r
-                         TextWrapping="Wrap"\r
-                         VerticalScrollBarVisibility="Auto">\r
-                    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.\r
-                    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.\r
-                    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\r
-                </TextBox>\r
+                <TextBox Text="{x:Static Properties:Resources.About_GPL}" Grid.Row="2" Margin="10,0,10,10" HorizontalAlignment="Stretch"\r
+                         VerticalAlignment="Stretch" IsReadOnly="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" />\r
 \r
             </Grid>\r
         </Grid>\r
 \r
-        <StackPanel Grid.Row="1"\r
-                    HorizontalAlignment="Stretch"\r
-                    Background="LightGray">\r
-            <Button Margin="0,5,10,5"\r
-                    HorizontalAlignment="Right"\r
-                    VerticalAlignment="Center"\r
-                    Content="Close"\r
-                    IsDefault="True"\r
-                    Micro:Message.Attach="[Event Click] = [Action Close]"\r
-                    Padding="12,2" />\r
-        </StackPanel>\r
     </Grid>\r
-</Window>\r
+</UserControl>\r
index 55665fc8b29c0889df3453f235171825c4d8ed17..2be3fd0098113f7f3933a8dfd8f4168e52166615 100644 (file)
@@ -9,12 +9,12 @@
 \r
 namespace HandBrakeWPF.Views\r
 {\r
-    using System.Windows;\r
+    using System.Windows.Controls;\r
 \r
     /// <summary>\r
     /// Interaction logic for AboutView.xaml\r
     /// </summary>\r
-    public partial class AboutView : Window\r
+    public partial class AboutView : UserControl\r
     {\r
         /// <summary>\r
         /// Initializes a new instance of the <see cref="AboutView"/> class.\r
index d90e5643f27e8506358c2a018030173443e0ceb7..af5b81514137016285ea9dcea3e55404072d7544 100644 (file)
                     <MenuItem Header="Add All Remaining Selected Languages" cal:Message.Attach="[Event Click] = [Action AddAllRemainingForSelectedLanguages]" />\r
                     <Separator />\r
                     <MenuItem Header="Clear All" cal:Message.Attach="[Event Click] = [Action Clear]" />\r
+                    <Separator />\r
+                    <MenuItem Header="Configure Default Behaviours" cal:Message.Attach="[Event Click] = [Action SetDefaultBehaviour]" />\r
                 </ContextMenu>\r
             </ListBox.ContextMenu>\r
 \r
             <ListBox.ItemTemplate>\r
                 <DataTemplate>\r
-\r
-                    \r
-                  \r
-                    \r
+                   \r
                     <Grid HorizontalAlignment="Stretch">\r
                         <Grid.RowDefinitions>\r
                             <RowDefinition Height="Auto" />\r
index 9c2080db5426a822bff81c5d07a63e20bfdb695c..99d857bdcf8c5ea5867e45188ace8610f5372426 100644 (file)
@@ -3,7 +3,8 @@
         xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers"\r
               xmlns:Options="clr-namespace:HandBrakeWPF.Converters.Options"\r
               xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"\r
-              xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" Background="White">\r
+              xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" xmlns:local="clr-namespace:HandBrakeWPF.Model"\r
+              Background="White">\r
 \r
     <UserControl.Resources>\r
         <Style TargetType="Button">\r
         </Style>\r
 \r
         <Options:OptionsTabConverter x:Key="tabConverter" />\r
+        <Options:OptionsTabNameConverter x:Key="tabNameConverter" />\r
+        \r
         <Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />\r
+\r
+        <ObjectDataProvider MethodName="GetValues"\r
+                        ObjectType="{x:Type local:OptionsTab}"\r
+                        x:Key="OptionTabsList">\r
+            <ObjectDataProvider.MethodParameters>\r
+                <x:Type TypeName="local:OptionsTab" />\r
+            </ObjectDataProvider.MethodParameters>\r
+        </ObjectDataProvider>\r
     </UserControl.Resources>\r
 \r
     <Grid>\r
             <RowDefinition Height="Auto" />\r
         </Grid.RowDefinitions>\r
 \r
-\r
         <StackPanel Orientation="Vertical" Grid.Column="0" Margin="10,10,0,0">\r
             <Border BorderThickness="0 0 0 1" BorderBrush="LightGray" Margin="0,0,0,10">\r
                 <TextBlock Text="Preferences" FontSize="16" />\r
             </Border>\r
 \r
-            <ListBox ItemsSource="{Binding OptionTabs}" SelectedItem="{Binding SelectedTab}"\r
+            <ListBox ItemsSource="{Binding Source={StaticResource OptionTabsList}}" SelectedItem="{Binding SelectedTab}"\r
                      BorderThickness="0" Background="Transparent">\r
+                <ListBox.ItemTemplate>\r
+                    <DataTemplate>\r
+                        <TextBlock Text="{Binding Converter={StaticResource tabNameConverter}}"/>\r
+                    </DataTemplate>\r
+                </ListBox.ItemTemplate>\r
             </ListBox>\r
 \r
         </StackPanel>\r
@@ -60,7 +75,7 @@
             <StackPanel Orientation="Vertical">\r
 \r
                 <StackPanel Name="General" Orientation="Vertical" Margin="10,10,0,0"\r
-                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='General'}">\r
+                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.General}}">\r
 \r
                     <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">\r
                         <TextBlock Text="General" FontSize="16" />\r
                 </StackPanel>\r
 \r
                 <StackPanel Name="Output" Orientation="Vertical" Margin="10,10,0,0"\r
-                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Output Files'}">\r
+                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.OutputFiles}}">\r
 \r
                     <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">\r
                         <TextBlock Text="Output Files" FontSize="16" />\r
                 </StackPanel>\r
 \r
                 <StackPanel Name="Audio" Orientation="Vertical" Margin="10,10,0,0"\r
-                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Audio and Subtitles'}">\r
+                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.AudioAndSubtitles}}">\r
                    \r
                     \r
                     <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">\r
                 </StackPanel>\r
 \r
                 <StackPanel Name="Advanced" Orientation="Vertical" Margin="10,10,0,0"\r
-                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Advanced'}">\r
+                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Advanced}}">\r
 \r
                     <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">\r
                         <TextBlock Text="Advanced" FontSize="16" />\r
                 </StackPanel>\r
 \r
                 <StackPanel Name="Updates" Orientation="Vertical" Margin="10,10,0,0"\r
-                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Updates'}">\r
+                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Updates}}">\r
 \r
 \r
                     <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">\r
                     </StackPanel>\r
 \r
                 </StackPanel>\r
+\r
+                <StackPanel Name="About" Orientation="Vertical" Margin="10,10,0,0"\r
+                            Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.About}}">\r
+\r
+\r
+                    <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">\r
+                        <TextBlock Text="About HandBrake" FontSize="16" />\r
+                    </Border>\r
+\r
+                    <ContentControl x:Name="AboutViewModel" />\r
+\r
+                </StackPanel>\r
             </StackPanel>\r
         </ScrollViewer>\r
 \r
index 83dabf50faa785c27adffed619dabc47914d0c19..362734851e6344fdc7fa46b5db29e7f466f11edb 100644 (file)
@@ -69,6 +69,8 @@
                     <MenuItem Header="Add All Remaining Selected Languages" cal:Message.Attach="[Event Click] = [Action AddAllRemainingForSelectedLanguages]" />    \r
                     <Separator />\r
                     <MenuItem Header="Clear All" cal:Message.Attach="[Event Click] = [Action Clear]" />\r
+                    <Separator />\r
+                    <MenuItem Header="Configure Default Behaviours" cal:Message.Attach="[Event Click] = [Action SetDefaultBehaviour]" />\r
                 </ContextMenu>\r
             </ListBox.ContextMenu>\r
 \r