]> granicus.if.org Git - handbrake/commitdiff
WinGui: (WPF) Further work on the options screen. Initial rough styling and Load...
authorsr55 <sr55.hb@outlook.com>
Tue, 25 Oct 2011 21:31:15 +0000 (21:31 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 25 Oct 2011 21:31:15 +0000 (21:31 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4319 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrakeWPF/HandBrakeWPF.csproj
win/CS/HandBrakeWPF/UserSettingConstants.cs [new file with mode: 0644]
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/Views/OptionsView.xaml

index 272d09ab4eb60f593a2d926fbc30f74f01518934..830f6b55fe810b5f2cba1b8ee2784e02040f3ce6 100644 (file)
@@ -73,6 +73,7 @@
     </ApplicationDefinition>\r
     <Compile Include="Startup\CastleBootstrapper.cs" />\r
     <Compile Include="Startup\MefBootstrapper.cs" />\r
+    <Compile Include="UserSettingConstants.cs" />\r
     <Compile Include="ViewModels\AboutViewModel.cs" />\r
     <Compile Include="ViewModels\AddPresetViewModel.cs" />\r
     <Compile Include="ViewModels\Interfaces\IAboutViewModel.cs" />\r
diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs
new file mode 100644 (file)
index 0000000..41997ff
--- /dev/null
@@ -0,0 +1,52 @@
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="UserSettingConstants.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
+//   Constants for the User Settings Service\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF\r
+{\r
+    /// <summary>\r
+    /// Constants for the User Settings Service\r
+    /// </summary>\r
+    public class UserSettingConstants\r
+    {\r
+        public const string UpdateStatus = "updateStatus";\r
+        public const string TooltipEnable = "tooltipEnable";\r
+        public const string Skipversion = "skipversion";\r
+        public const string AutoNaming = "autoNaming";\r
+        public const string AutoNamePath = "autoNamePath";\r
+        public const string Appcast = "appcast";\r
+        public const string Appcast_unstable = "appcast_unstable";\r
+        public const string AutoNameFormat = "autoNameFormat";\r
+        public const string VLC_Path = "VLC_Path";\r
+        public const string MainWindowMinimize = "MainWindowMinimize";\r
+        public const string QueryEditorTab = "QueryEditorTab";\r
+        public const string PresetNotification = "presetNotification";\r
+        public const string TrayIconAlerts = "trayIconAlerts";\r
+        public const string LastUpdateCheckDate = "lastUpdateCheckDate";\r
+        public const string DaysBetweenUpdateCheck = "daysBetweenUpdateCheck";\r
+        public const string UseM4v = "useM4v";\r
+        public const string PromptOnUnmatchingQueries = "PromptOnUnmatchingQueries";\r
+        public const string NativeLanguage = "NativeLanguage";\r
+        public const string DubMode = "DubMode";\r
+        public const string CliExeHash = "CliExeHash";\r
+        public const string PreviewScanCount = "previewScanCount";\r
+        public const string ClearOldLogs = "clearOldLogs";\r
+        public const string AutoNameTitleCase = "AutoNameTitleCase";\r
+        public const string AutoNameRemoveUnderscore = "AutoNameRemoveUnderscore";\r
+        public const string ActivityWindowLastMode = "ActivityWindowLastMode";\r
+        public const string UseClosedCaption = "useClosedCaption";\r
+        public const string BatchMinDuration = "batchMinDuration";\r
+        public const string BatchMaxDuration = "batchMaxDuration";\r
+        public const string DefaultPlayer = "defaultPlayer";\r
+        public const string SelectedLanguages = "SelectedLanguages";\r
+        public const string DubModeAudio = "DubModeAudio";\r
+        public const string DubModeSubtitle = "DubModeSubtitle";\r
+        public const string AddOnlyOneAudioPerLanguage = "addOnlyOneAudioPerLanguage";\r
+        public const string MinTitleLength = "MinTitleLength";\r
+    }\r
+}\r
index ddc0f4472bd5c1862ed3f933d55134a98a452041..e1976cbdd49b545fbdea1e10be432b7b66da0fe7 100644 (file)
@@ -217,7 +217,7 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         public void OpenOptionsWindow()\r
         {\r
-            this.WindowManager.ShowWindow(new OptionsViewModel(this.WindowManager));\r
+            this.WindowManager.ShowWindow(new OptionsViewModel(this.WindowManager, this.userSettingService));\r
         }\r
 \r
         /// <summary>\r
index 2e945a008159303720cb9027bffe6e89c20c45cc..be2ed51e8aa524495ef1d6432c3ddbcc52ded9d8 100644 (file)
@@ -9,11 +9,19 @@
 \r
 namespace HandBrakeWPF.ViewModels\r
 {\r
+    using System.Collections.Generic;\r
+    using System.Collections.Specialized;\r
     using System.ComponentModel;\r
     using System.ComponentModel.Composition;\r
+    using System.Globalization;\r
+    using System.IO;\r
 \r
     using Caliburn.Micro;\r
 \r
+    using HandBrake.ApplicationServices;\r
+    using HandBrake.ApplicationServices.Services.Interfaces;\r
+    using HandBrake.ApplicationServices.Utilities;\r
+\r
     using HandBrakeWPF.ViewModels.Interfaces;\r
 \r
     /// <summary>\r
@@ -24,10 +32,20 @@ namespace HandBrakeWPF.ViewModels
     {\r
         #region Constants and Fields\r
 \r
+        /// <summary>\r
+        /// Backing field for the user setting service.\r
+        /// </summary>\r
+        private readonly IUserSettingService userSettingService;\r
+\r
+        /// <summary>\r
+        /// A Property to block Saving while the screen is loading.\r
+        /// </summary>\r
+        private bool isLoading = true;\r
+\r
         /// <summary>\r
         /// The add audio mode options.\r
         /// </summary>\r
-        private BindingList<string> addAudioModeOptions;\r
+        private BindingList<string> addAudioModeOptions = new BindingList<string>();\r
 \r
         /// <summary>\r
         /// The add closed captions.\r
@@ -42,7 +60,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The add subtitle mode options.\r
         /// </summary>\r
-        private BindingList<string> addSubtitleModeOptions;\r
+        private BindingList<string> addSubtitleModeOptions = new BindingList<string>();\r
 \r
         /// <summary>\r
         /// The arguments.\r
@@ -67,7 +85,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The available languages.\r
         /// </summary>\r
-        private BindingList<string> availableLanguages;\r
+        private BindingList<string> availableLanguages = new BindingList<string>();\r
 \r
         /// <summary>\r
         /// The change to title case.\r
@@ -82,12 +100,12 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The check for updates frequencies.\r
         /// </summary>\r
-        private BindingList<string> checkForUpdatesFrequencies;\r
+        private BindingList<string> checkForUpdatesFrequencies = new BindingList<string>();\r
 \r
         /// <summary>\r
         /// The check for updates frequency.\r
         /// </summary>\r
-        private bool checkForUpdatesFrequency;\r
+        private int checkForUpdatesFrequency;\r
 \r
         /// <summary>\r
         /// The clear old olgs.\r
@@ -97,7 +115,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The constant quality granularity.\r
         /// </summary>\r
-        private BindingList<string> constantQualityGranularity;\r
+        private BindingList<string> constantQualityGranularity = new BindingList<string>();\r
 \r
         /// <summary>\r
         /// The copy log to encode directory.\r
@@ -117,7 +135,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The disable p reset update check notification.\r
         /// </summary>\r
-        private bool disablePResetUpdateCheckNotification;\r
+        private bool disablePresetUpdateCheckNotification;\r
 \r
         /// <summary>\r
         /// The display status messages tray icon.\r
@@ -152,7 +170,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The log verbosity options.\r
         /// </summary>\r
-        private BindingList<string> logVerbosityOptions;\r
+        private BindingList<int> logVerbosityOptions = new BindingList<int>();\r
 \r
         /// <summary>\r
         /// The min length.\r
@@ -167,7 +185,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The mp 4 extension options.\r
         /// </summary>\r
-        private BindingList<string> mp4ExtensionOptions;\r
+        private BindingList<string> mp4ExtensionOptions = new BindingList<string>();\r
 \r
         /// <summary>\r
         /// The prevent sleep.\r
@@ -177,12 +195,12 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The preview pictures to scan.\r
         /// </summary>\r
-        private BindingList<int> previewPicturesToScan;\r
+        private BindingList<int> previewPicturesToScan = new BindingList<int>();\r
 \r
         /// <summary>\r
         /// The priority level options.\r
         /// </summary>\r
-        private BindingList<string> priorityLevelOptions;\r
+        private BindingList<string> priorityLevelOptions = new BindingList<string>();\r
 \r
         /// <summary>\r
         /// The prompt on different query.\r
@@ -197,27 +215,27 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The selected add audio mode.\r
         /// </summary>\r
-        private string selectedAddAudioMode;\r
+        private int selectedAddAudioMode;\r
 \r
         /// <summary>\r
         /// The selected add subtitle mode.\r
         /// </summary>\r
-        private string selectedAddSubtitleMode;\r
+        private int selectedAddSubtitleMode;\r
 \r
         /// <summary>\r
         /// The selected granulairty.\r
         /// </summary>\r
-        private bool selectedGranulairty;\r
+        private string selectedGranulairty;\r
 \r
         /// <summary>\r
         /// The selected mp 4 extension.\r
         /// </summary>\r
-        private string selectedMp4Extension;\r
+        private int selectedMp4Extension;\r
 \r
         /// <summary>\r
         /// The selected preferred languages.\r
         /// </summary>\r
-        private BindingList<string> selectedPreferredLanguages;\r
+        private BindingList<string> selectedPreferredLanguages = new BindingList<string>();\r
 \r
         /// <summary>\r
         /// The selected preferreed langauge.\r
@@ -237,7 +255,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The selected verbosity.\r
         /// </summary>\r
-        private string selectedVerbosity;\r
+        private int selectedVerbosity;\r
 \r
         /// <summary>\r
         /// The send file after encode.\r
@@ -267,7 +285,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The when done options.\r
         /// </summary>\r
-        private BindingList<string> whenDoneOptions;\r
+        private BindingList<string> whenDoneOptions = new BindingList<string>();\r
 \r
         #endregion\r
 \r
@@ -279,15 +297,19 @@ namespace HandBrakeWPF.ViewModels
         /// <param name="windowManager">\r
         /// The window manager.\r
         /// </param>\r
-        public OptionsViewModel(IWindowManager windowManager)\r
+        /// <param name="userSettingService">\r
+        /// The user Setting Service.\r
+        /// </param>\r
+        public OptionsViewModel(IWindowManager windowManager, IUserSettingService userSettingService)\r
             : base(windowManager)\r
         {\r
+            this.userSettingService = userSettingService;\r
+            this.Load();\r
         }\r
 \r
         #endregion\r
 \r
         #region Properties\r
-        /* General */\r
 \r
         /// <summary>\r
         /// Gets or sets AddAudioModeOptions.\r
@@ -374,8 +396,6 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
-        /* Output Files */\r
-\r
         /// <summary>\r
         /// Gets or sets AutoNameDefaultPath.\r
         /// </summary>\r
@@ -498,7 +518,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Gets or sets a value indicating whether CheckForUpdatesFrequency.\r
         /// </summary>\r
-        public bool CheckForUpdatesFrequency\r
+        public int CheckForUpdatesFrequency\r
         {\r
             get\r
             {\r
@@ -598,19 +618,19 @@ namespace HandBrakeWPF.ViewModels
         }\r
 \r
         /// <summary>\r
-        /// Gets or sets a value indicating whether DisablePResetUpdateCheckNotification.\r
+        /// Gets or sets a value indicating whether disablePresetUpdateCheckNotification.\r
         /// </summary>\r
-        public bool DisablePResetUpdateCheckNotification\r
+        public bool DisablePresetUpdateCheckNotification\r
         {\r
             get\r
             {\r
-                return this.disablePResetUpdateCheckNotification;\r
+                return this.disablePresetUpdateCheckNotification;\r
             }\r
 \r
             set\r
             {\r
-                this.disablePResetUpdateCheckNotification = value;\r
-                this.NotifyOfPropertyChange("DisablePResetUpdateCheckNotification");\r
+                this.disablePresetUpdateCheckNotification = value;\r
+                this.NotifyOfPropertyChange("DisablePresetUpdateCheckNotification");\r
             }\r
         }\r
 \r
@@ -719,7 +739,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Gets or sets LogVerbosityOptions.\r
         /// </summary>\r
-        public BindingList<string> LogVerbosityOptions\r
+        public BindingList<int> LogVerbosityOptions\r
         {\r
             get\r
             {\r
@@ -872,7 +892,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Gets or sets SelectedAddAudioMode.\r
         /// </summary>\r
-        public string SelectedAddAudioMode\r
+        public int SelectedAddAudioMode\r
         {\r
             get\r
             {\r
@@ -889,7 +909,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Gets or sets SelectedAddSubtitleMode.\r
         /// </summary>\r
-        public string SelectedAddSubtitleMode\r
+        public int SelectedAddSubtitleMode\r
         {\r
             get\r
             {\r
@@ -906,7 +926,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Gets or sets a value indicating whether SelectedGranulairty.\r
         /// </summary>\r
-        public bool SelectedGranulairty\r
+        public string SelectedGranulairty\r
         {\r
             get\r
             {\r
@@ -923,7 +943,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Gets or sets SelectedMp4Extension.\r
         /// </summary>\r
-        public string SelectedMp4Extension\r
+        public int SelectedMp4Extension\r
         {\r
             get\r
             {\r
@@ -1008,7 +1028,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Gets or sets SelectedVerbosity.\r
         /// </summary>\r
-        public string SelectedVerbosity\r
+        public int SelectedVerbosity\r
         {\r
             get\r
             {\r
@@ -1128,6 +1148,241 @@ namespace HandBrakeWPF.ViewModels
 \r
         #region Public Methods\r
 \r
+        /// <summary>\r
+        /// Load User Settings\r
+        /// </summary>\r
+        public void Load()\r
+        {\r
+            // #############################\r
+            // Screen Setup\r
+            // #############################\r
+\r
+            IDictionary<string, string> langList = LanguageUtilities.MapLanguages();\r
+\r
+            foreach (string selectedItem in this.userSettingService.GetUserSetting<StringCollection>(UserSettingConstants.SelectedLanguages))\r
+            {\r
+                // removing wrong keys when a new Language list comes out.\r
+                if (langList.ContainsKey(selectedItem))\r
+                {\r
+                    this.selectedPreferredLanguages.Add(selectedItem);\r
+                }\r
+            }\r
+\r
+            foreach (string item in langList.Keys)\r
+            {\r
+                this.selectedPreferredLanguages.Add(item);\r
+\r
+                // In the available languages should be no "Any" and no selected language.\r
+                if ((item != "Any") && (!this.userSettingService.GetUserSetting<StringCollection>(UserSettingConstants.SelectedLanguages).Contains(item)))\r
+                {\r
+                    this.availableLanguages.Add(item);\r
+                }\r
+            }\r
+\r
+            // #############################\r
+            // General\r
+            // #############################\r
+\r
+            // Enable Tooltips.\r
+            if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.TooltipEnable))\r
+            {\r
+                this.enableGuiTooltips = true;\r
+            }\r
+\r
+            // Update Check\r
+            if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.UpdateStatus))\r
+            {\r
+                this.checkForUpdates = true;\r
+            }\r
+   \r
+            // Days between update checks\r
+            this.checkForUpdatesFrequency =\r
+                        this.userSettingService.GetUserSetting<int>(UserSettingConstants.DaysBetweenUpdateCheck);\r
+\r
+            // On Encode Completeion Action\r
+            this.whenDoneOptions.Add("Do nothing");\r
+            this.whenDoneOptions.Add("Shutdown");\r
+            this.whenDoneOptions.Add("Suspend");\r
+            this.whenDoneOptions.Add("Hibernate");\r
+            this.whenDoneOptions.Add("Lock system");\r
+            this.whenDoneOptions.Add("Log off");\r
+            this.whenDoneOptions.Add("Quit HandBrake");\r
+            this.whenDone = userSettingService.GetUserSetting<string>("WhenCompleteAction");\r
+            \r
+            // Growl.\r
+            if (userSettingService.GetUserSetting<bool>(ASUserSettingConstants.GrowlEncode))\r
+            {\r
+                this.growlAfterEncode = true;\r
+            }\r
+\r
+            if (userSettingService.GetUserSetting<bool>(ASUserSettingConstants.GrowlQueue))\r
+            {\r
+                this.growlAfterQueue = true;\r
+            }\r
+\r
+            this.SendFileAfterEncode = this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.SendFile);\r
+            this.sendFileTo = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileTo));\r
+            this.arguments = this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileToArgs);\r
+\r
+            // #############################\r
+            // Output Settings\r
+            // #############################\r
+\r
+            // Enable auto naming feature.)\r
+            if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming))\r
+            {\r
+                this.AutomaticallyNameFiles = true;\r
+            }\r
+\r
+            // Store the auto name path\r
+            this.autoNameDefaultPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath);\r
+            if (string.IsNullOrEmpty(this.autoNameDefaultPath))\r
+                this.autoNameDefaultPath = "Click 'Browse' to set the default location";\r
+\r
+            // Store auto name format\r
+            this.autonameFormat = this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat);\r
+\r
+            // Use iPod/iTunes friendly .m4v extension for MP4 files.\r
+            this.mp4ExtensionOptions.Add("Automatic");\r
+            this.mp4ExtensionOptions.Add("Always use MP4");\r
+            this.mp4ExtensionOptions.Add("Always use M4V");\r
+            this.selectedMp4Extension = this.userSettingService.GetUserSetting<int>(UserSettingConstants.UseM4v);\r
+\r
+            // Remove Underscores\r
+            this.removeUnderscores = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNameRemoveUnderscore);\r
+\r
+            // Title case\r
+            this.changeToTitleCase = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNameTitleCase);\r
+\r
+            // #############################\r
+            // Picture Tab\r
+            // #############################\r
+\r
+            // VLC Path\r
+            this.vlcPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.VLC_Path);\r
+\r
+            // #############################\r
+            // Audio and Subtitles Tab\r
+            // #############################\r
+\r
+            this.selectedPreferreedLangauge = this.userSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage);\r
+\r
+            this.AddAudioModeOptions.Add("None");\r
+            this.AddAudioModeOptions.Add("All Remaining Tracks");\r
+            this.AddAudioModeOptions.Add("All for Selected Languages");\r
+\r
+            this.AddSubtitleModeOptions.Add("None");\r
+            this.AddSubtitleModeOptions.Add("All");\r
+            this.AddSubtitleModeOptions.Add("First");\r
+            this.AddSubtitleModeOptions.Add("Selected");\r
+            this.AddSubtitleModeOptions.Add("Preferred Only");\r
+\r
+            this.selectedAddAudioMode = this.userSettingService.GetUserSetting<int>(UserSettingConstants.DubModeAudio);\r
+            this.selectedAddSubtitleMode = this.userSettingService.GetUserSetting<int>(UserSettingConstants.DubModeSubtitle);\r
+\r
+            this.addOnlyOneAudioTrackPerLanguage = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.AddOnlyOneAudioPerLanguage);\r
+\r
+            this.addClosedCaptions = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.UseClosedCaption);\r
+\r
+            // #############################\r
+            // CLI\r
+            // #############################\r
+\r
+            // Priority level for encodes\r
+            this.priorityLevelOptions.Add("Realtime");\r
+            this.priorityLevelOptions.Add("High");\r
+            this.priorityLevelOptions.Add("Above Normal");\r
+            this.priorityLevelOptions.Add("Normal");\r
+            this.priorityLevelOptions.Add("Below Normal");\r
+            this.priorityLevelOptions.Add("Low");\r
+            this.selectedPriority = userSettingService.GetUserSetting<string>(ASUserSettingConstants.ProcessPriority);\r
+\r
+            this.preventSleep = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.PreventSleep);\r
+\r
+            // Log Verbosity Level\r
+            this.logVerbosityOptions.Add(0);\r
+            this.logVerbosityOptions.Add(1);\r
+            this.logVerbosityOptions.Add(2);\r
+            this.selectedVerbosity = userSettingService.GetUserSetting<int>(ASUserSettingConstants.Verbosity);\r
+\r
+            // Save logs in the same directory as encoded files\r
+            if (userSettingService.GetUserSetting<bool>(ASUserSettingConstants.SaveLogWithVideo))\r
+            {\r
+                this.copyLogToEncodeDirectory = true;\r
+            }\r
+\r
+            // Save Logs in a specified path\r
+            if (userSettingService.GetUserSetting<bool>(ASUserSettingConstants.SaveLogToCopyDirectory))\r
+            {\r
+                this.copyLogToSepcficedLocation = true;\r
+            }\r
+\r
+            // The saved log path\r
+            this.logDirectory = userSettingService.GetUserSetting<string>(ASUserSettingConstants.SaveLogCopyDirectory);\r
+\r
+            this.clearOldOlgs = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearOldLogs);\r
+\r
+            // #############################\r
+            // Advanced\r
+            // #############################\r
+\r
+            // Minimise to Tray\r
+            if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.TrayIconAlerts))\r
+            {\r
+                this.DisplayStatusMessagesTrayIcon = true;\r
+            }\r
+\r
+            // Tray Balloon popups\r
+            if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.MainWindowMinimize))\r
+            {\r
+                this.minimiseToTray = true;\r
+            }\r
+\r
+            // Enable / Disable Query editor tab\r
+            if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.QueryEditorTab))\r
+            {\r
+                this.enableQueryEditor = true;\r
+            }\r
+            \r
+            // Prompt on inconsistant queries\r
+            this.promptOnDifferentQuery = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PromptOnUnmatchingQueries);\r
+\r
+            // Preset update notification\r
+            if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PresetNotification))\r
+            {\r
+                this.disablePresetUpdateCheckNotification = true;\r
+            }\r
+\r
+            // Show CLI Window\r
+            this.showCliWindow = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.ShowCLI);\r
+\r
+            // Set the preview count\r
+            this.PreviewPicturesToScan.Add(10);\r
+            this.PreviewPicturesToScan.Add(15);\r
+            this.PreviewPicturesToScan.Add(20);\r
+            this.PreviewPicturesToScan.Add(25);\r
+            this.PreviewPicturesToScan.Add(30);\r
+            this.selectedPreviewCount = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount);\r
+\r
+            // x264 step\r
+            this.ConstantQualityGranularity.Add("1.0");\r
+            this.ConstantQualityGranularity.Add("0.50");\r
+            this.ConstantQualityGranularity.Add("0.25");\r
+            this.ConstantQualityGranularity.Add("0.20");\r
+            this.SelectedGranulairty = userSettingService.GetUserSetting<double>(ASUserSettingConstants.X264Step).ToString(new CultureInfo("en-US"));\r
+\r
+            // Min Title Length\r
+            this.minLength = this.userSettingService.GetUserSetting<int>(ASUserSettingConstants.MinScanDuration);\r
+\r
+            // Use Experimental dvdnav\r
+            if (userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav))\r
+            {\r
+                this.disableLibdvdNav = true;\r
+            }\r
+\r
+            this.isLoading = false;\r
+        }\r
+\r
         /// <summary>\r
         /// Close this window.\r
         /// </summary>\r
index 9c465d7f87bab42690fe4b36190dba28e127bd4f..814b62d63068c27a87ef5b8ec121d1c6ca63ea47 100644 (file)
@@ -3,6 +3,24 @@
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.caliburnproject.org"\r
         Title="OptionsView" MinWidth="620" MinHeight="520" Width="620" Height="520">\r
 \r
+    <Window.Resources>\r
+        <Style TargetType="Button">\r
+            <Setter Property="Foreground" Value="DarkOrange" />\r
+            <Setter Property="FontWeight" Value="Bold" />\r
+            <Setter Property="Padding" Value="5,1" />\r
+            <Setter Property="FontSize" Value="12" />\r
+        </Style>\r
+        \r
+        <Style TargetType="CheckBox">\r
+            <Setter Property="Margin" Value="0,0,0,5" />\r
+        </Style>\r
+        \r
+        <Style TargetType="StackPanel">\r
+            <Setter Property="Margin" Value="0,0,0,5" />\r
+        </Style>\r
+    </Window.Resources>\r
+    \r
+    \r
     <StackPanel Orientation="Vertical" Background="LightGray">\r
         <!-- Header -->\r
         <StackPanel Orientation="Horizontal"  Background="White" Height="50" >\r