// --------------------------------------------------------------------------------------------------------------------
//
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
//
//
// The Options View Model
//
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrakeWPF.ViewModels
{
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Globalization;
using System.IO;
using Caliburn.Micro;
using HandBrake.ApplicationServices;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
using HandBrakeWPF.ViewModels.Interfaces;
///
/// The Options View Model
///
[Export(typeof(IOptionsViewModel))]
public class OptionsViewModel : ViewModelBase, IOptionsViewModel
{
#region Constants and Fields
///
/// Backing field for the user setting service.
///
private readonly IUserSettingService userSettingService;
///
/// A Property to block Saving while the screen is loading.
///
private bool isLoading = true;
///
/// The add audio mode options.
///
private BindingList addAudioModeOptions = new BindingList();
///
/// The add closed captions.
///
private bool addClosedCaptions;
///
/// The add only one audio track per language.
///
private bool addOnlyOneAudioTrackPerLanguage;
///
/// The add subtitle mode options.
///
private BindingList addSubtitleModeOptions = new BindingList();
///
/// The arguments.
///
private string arguments;
///
/// The auto name default path.
///
private string autoNameDefaultPath;
///
/// The automatically name files.
///
private bool automaticallyNameFiles;
///
/// The autoname format.
///
private string autonameFormat;
///
/// The available languages.
///
private BindingList availableLanguages = new BindingList();
///
/// The change to title case.
///
private bool changeToTitleCase;
///
/// The check for updates.
///
private bool checkForUpdates;
///
/// The check for updates frequencies.
///
private BindingList checkForUpdatesFrequencies = new BindingList();
///
/// The check for updates frequency.
///
private int checkForUpdatesFrequency;
///
/// The clear old olgs.
///
private bool clearOldOlgs;
///
/// The constant quality granularity.
///
private BindingList constantQualityGranularity = new BindingList();
///
/// The copy log to encode directory.
///
private bool copyLogToEncodeDirectory;
///
/// The copy log to sepcficed location.
///
private bool copyLogToSepcficedLocation;
///
/// The disable libdvd nav.
///
private bool disableLibdvdNav;
///
/// The disable p reset update check notification.
///
private bool disablePresetUpdateCheckNotification;
///
/// The display status messages tray icon.
///
private bool displayStatusMessagesTrayIcon;
///
/// The enable gui tooltips.
///
private bool enableGuiTooltips;
///
/// The enable query editor.
///
private bool enableQueryEditor;
///
/// The growl after encode.
///
private bool growlAfterEncode;
///
/// The growl after queue.
///
private bool growlAfterQueue;
///
/// The log directory.
///
private string logDirectory;
///
/// The log verbosity options.
///
private BindingList logVerbosityOptions = new BindingList();
///
/// The min length.
///
private long minLength;
///
/// The minimise to tray.
///
private bool minimiseToTray;
///
/// The mp 4 extension options.
///
private BindingList mp4ExtensionOptions = new BindingList();
///
/// The prevent sleep.
///
private bool preventSleep;
///
/// The preview pictures to scan.
///
private BindingList previewPicturesToScan = new BindingList();
///
/// The priority level options.
///
private BindingList priorityLevelOptions = new BindingList();
///
/// The prompt on different query.
///
private bool promptOnDifferentQuery;
///
/// The remove underscores.
///
private bool removeUnderscores;
///
/// The selected add audio mode.
///
private int selectedAddAudioMode;
///
/// The selected add subtitle mode.
///
private int selectedAddSubtitleMode;
///
/// The selected granulairty.
///
private string selectedGranulairty;
///
/// The selected mp 4 extension.
///
private int selectedMp4Extension;
///
/// The selected preferred languages.
///
private BindingList selectedPreferredLanguages = new BindingList();
///
/// The selected preferreed langauge.
///
private string selectedPreferreedLangauge;
///
/// The selected preview count.
///
private int selectedPreviewCount;
///
/// The selected priority.
///
private string selectedPriority;
///
/// The selected verbosity.
///
private int selectedVerbosity;
///
/// The send file after encode.
///
private bool sendFileAfterEncode;
///
/// The send file to.
///
private string sendFileTo;
///
/// The show cli window.
///
private bool showCliWindow;
///
/// The vlc path.
///
private string vlcPath;
///
/// The when done.
///
private string whenDone;
///
/// The when done options.
///
private BindingList whenDoneOptions = new BindingList();
#endregion
#region Constructors and Destructors
///
/// Initializes a new instance of the class.
///
///
/// The window manager.
///
///
/// The user Setting Service.
///
public OptionsViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
: base(windowManager)
{
this.userSettingService = userSettingService;
this.Load();
}
#endregion
#region Properties
///
/// Gets or sets AddAudioModeOptions.
///
public BindingList AddAudioModeOptions
{
get
{
return this.addAudioModeOptions;
}
set
{
this.addAudioModeOptions = value;
this.NotifyOfPropertyChange("AddAudioModeOptions");
}
}
///
/// Gets or sets a value indicating whether AddClosedCaptions.
///
public bool AddClosedCaptions
{
get
{
return this.addClosedCaptions;
}
set
{
this.addClosedCaptions = value;
this.NotifyOfPropertyChange("AddClosedCaptions");
}
}
///
/// Gets or sets a value indicating whether AddOnlyOneAudioTrackPerLanguage.
///
public bool AddOnlyOneAudioTrackPerLanguage
{
get
{
return this.addOnlyOneAudioTrackPerLanguage;
}
set
{
this.addOnlyOneAudioTrackPerLanguage = value;
this.NotifyOfPropertyChange("AddOnlyOneAudioTrackPerLanguage");
}
}
///
/// Gets or sets AddSubtitleModeOptions.
///
public BindingList AddSubtitleModeOptions
{
get
{
return this.addSubtitleModeOptions;
}
set
{
this.addSubtitleModeOptions = value;
this.NotifyOfPropertyChange("AddSubtitleModeOptions");
}
}
///
/// Gets or sets Arguments.
///
public string Arguments
{
get
{
return this.arguments;
}
set
{
this.arguments = value;
this.NotifyOfPropertyChange("Arguments");
}
}
///
/// Gets or sets AutoNameDefaultPath.
///
public string AutoNameDefaultPath
{
get
{
return this.autoNameDefaultPath;
}
set
{
this.autoNameDefaultPath = value;
this.NotifyOfPropertyChange("AutoNameDefaultPath");
}
}
///
/// Gets or sets a value indicating whether AutomaticallyNameFiles.
///
public bool AutomaticallyNameFiles
{
get
{
return this.automaticallyNameFiles;
}
set
{
this.automaticallyNameFiles = value;
this.NotifyOfPropertyChange("AutomaticallyNameFiles");
}
}
///
/// Gets or sets AutonameFormat.
///
public string AutonameFormat
{
get
{
return this.autonameFormat;
}
set
{
this.autonameFormat = value;
this.NotifyOfPropertyChange("AutonameFormat");
}
}
///
/// Gets or sets AvailableLanguages.
///
public BindingList AvailableLanguages
{
get
{
return this.availableLanguages;
}
set
{
this.availableLanguages = value;
this.NotifyOfPropertyChange("AvailableLanguages");
}
}
///
/// Gets or sets a value indicating whether ChangeToTitleCase.
///
public bool ChangeToTitleCase
{
get
{
return this.changeToTitleCase;
}
set
{
this.changeToTitleCase = value;
this.NotifyOfPropertyChange("ChangeToTitleCase");
}
}
///
/// Gets or sets a value indicating whether CheckForUpdates.
///
public bool CheckForUpdates
{
get
{
return this.checkForUpdates;
}
set
{
this.checkForUpdates = value;
this.NotifyOfPropertyChange("CheckForUpdates");
}
}
///
/// Gets or sets CheckForUpdatesFrequencies.
///
public BindingList CheckForUpdatesFrequencies
{
get
{
return this.checkForUpdatesFrequencies;
}
set
{
this.checkForUpdatesFrequencies = value;
this.NotifyOfPropertyChange("CheckForUpdatesFrequencies");
}
}
///
/// Gets or sets a value indicating whether CheckForUpdatesFrequency.
///
public int CheckForUpdatesFrequency
{
get
{
return this.checkForUpdatesFrequency;
}
set
{
this.checkForUpdatesFrequency = value;
this.NotifyOfPropertyChange("CheckForUpdatesFrequency");
}
}
///
/// Gets or sets a value indicating whether ClearOldOlgs.
///
public bool ClearOldOlgs
{
get
{
return this.clearOldOlgs;
}
set
{
this.clearOldOlgs = value;
this.NotifyOfPropertyChange("ClearOldOlgs");
}
}
///
/// Gets or sets ConstantQualityGranularity.
///
public BindingList ConstantQualityGranularity
{
get
{
return this.constantQualityGranularity;
}
set
{
this.constantQualityGranularity = value;
this.NotifyOfPropertyChange("ConstantQualityGranularity");
}
}
///
/// Gets or sets a value indicating whether CopyLogToEncodeDirectory.
///
public bool CopyLogToEncodeDirectory
{
get
{
return this.copyLogToEncodeDirectory;
}
set
{
this.copyLogToEncodeDirectory = value;
this.NotifyOfPropertyChange("CopyLogToEncodeDirectory");
}
}
///
/// Gets or sets a value indicating whether CopyLogToSepcficedLocation.
///
public bool CopyLogToSepcficedLocation
{
get
{
return this.copyLogToSepcficedLocation;
}
set
{
this.copyLogToSepcficedLocation = value;
this.NotifyOfPropertyChange("CopyLogToSepcficedLocation");
}
}
///
/// Gets or sets a value indicating whether DisableLibdvdNav.
///
public bool DisableLibdvdNav
{
get
{
return this.disableLibdvdNav;
}
set
{
this.disableLibdvdNav = value;
this.NotifyOfPropertyChange("DisableLibdvdNav");
}
}
///
/// Gets or sets a value indicating whether disablePresetUpdateCheckNotification.
///
public bool DisablePresetUpdateCheckNotification
{
get
{
return this.disablePresetUpdateCheckNotification;
}
set
{
this.disablePresetUpdateCheckNotification = value;
this.NotifyOfPropertyChange("DisablePresetUpdateCheckNotification");
}
}
///
/// Gets or sets a value indicating whether DisplayStatusMessagesTrayIcon.
///
public bool DisplayStatusMessagesTrayIcon
{
get
{
return this.displayStatusMessagesTrayIcon;
}
set
{
this.displayStatusMessagesTrayIcon = value;
this.NotifyOfPropertyChange("DisplayStatusMessagesTrayIcon");
}
}
///
/// Gets or sets a value indicating whether EnableGuiTooltips.
///
public bool EnableGuiTooltips
{
get
{
return this.enableGuiTooltips;
}
set
{
this.enableGuiTooltips = value;
this.NotifyOfPropertyChange("EnableGuiTooltips");
}
}
///
/// Gets or sets a value indicating whether EnableQueryEditor.
///
public bool EnableQueryEditor
{
get
{
return this.enableQueryEditor;
}
set
{
this.enableQueryEditor = value;
this.NotifyOfPropertyChange("EnableQueryEditor");
}
}
///
/// Gets or sets a value indicating whether GrowlAfterEncode.
///
public bool GrowlAfterEncode
{
get
{
return this.growlAfterEncode;
}
set
{
this.growlAfterEncode = value;
this.NotifyOfPropertyChange("GrowlAfterEncode");
}
}
///
/// Gets or sets a value indicating whether GrowlAfterQueue.
///
public bool GrowlAfterQueue
{
get
{
return this.growlAfterQueue;
}
set
{
this.growlAfterQueue = value;
this.NotifyOfPropertyChange("GrowlAfterQueue");
}
}
///
/// Gets or sets LogDirectory.
///
public string LogDirectory
{
get
{
return this.logDirectory;
}
set
{
this.logDirectory = value;
this.NotifyOfPropertyChange("LogDirectory");
}
}
///
/// Gets or sets LogVerbosityOptions.
///
public BindingList LogVerbosityOptions
{
get
{
return this.logVerbosityOptions;
}
set
{
this.logVerbosityOptions = value;
this.NotifyOfPropertyChange("LogVerbosityOptions");
}
}
///
/// Gets or sets MinLength.
///
public long MinLength
{
get
{
return this.minLength;
}
set
{
this.minLength = value;
this.NotifyOfPropertyChange("MinLength");
}
}
///
/// Gets or sets a value indicating whether MinimiseToTray.
///
public bool MinimiseToTray
{
get
{
return this.minimiseToTray;
}
set
{
this.minimiseToTray = value;
this.NotifyOfPropertyChange("MinimiseToTray");
}
}
///
/// Gets or sets Mp4ExtensionOptions.
///
public BindingList Mp4ExtensionOptions
{
get
{
return this.mp4ExtensionOptions;
}
set
{
this.mp4ExtensionOptions = value;
this.NotifyOfPropertyChange("Mp4ExtensionOptions");
}
}
///
/// Gets or sets a value indicating whether PreventSleep.
///
public bool PreventSleep
{
get
{
return this.preventSleep;
}
set
{
this.preventSleep = value;
this.NotifyOfPropertyChange("PreventSleep");
}
}
///
/// Gets or sets PreviewPicturesToScan.
///
public BindingList PreviewPicturesToScan
{
get
{
return this.previewPicturesToScan;
}
set
{
this.previewPicturesToScan = value;
this.NotifyOfPropertyChange("PreviewPicturesToScan");
}
}
///
/// Gets or sets PriorityLevelOptions.
///
public BindingList PriorityLevelOptions
{
get
{
return this.priorityLevelOptions;
}
set
{
this.priorityLevelOptions = value;
this.NotifyOfPropertyChange("PriorityLevelOptions");
}
}
///
/// Gets or sets a value indicating whether PromptOnDifferentQuery.
///
public bool PromptOnDifferentQuery
{
get
{
return this.promptOnDifferentQuery;
}
set
{
this.promptOnDifferentQuery = value;
this.NotifyOfPropertyChange("PromptOnDifferentQuery");
}
}
///
/// Gets or sets a value indicating whether RemoveUnderscores.
///
public bool RemoveUnderscores
{
get
{
return this.removeUnderscores;
}
set
{
this.removeUnderscores = value;
this.NotifyOfPropertyChange("RemoveUnderscores");
}
}
///
/// Gets or sets SelectedAddAudioMode.
///
public int SelectedAddAudioMode
{
get
{
return this.selectedAddAudioMode;
}
set
{
this.selectedAddAudioMode = value;
this.NotifyOfPropertyChange("SelectedAddAudioMode");
}
}
///
/// Gets or sets SelectedAddSubtitleMode.
///
public int SelectedAddSubtitleMode
{
get
{
return this.selectedAddSubtitleMode;
}
set
{
this.selectedAddSubtitleMode = value;
this.NotifyOfPropertyChange("SelectedAddSubtitleMode");
}
}
///
/// Gets or sets a value indicating whether SelectedGranulairty.
///
public string SelectedGranulairty
{
get
{
return this.selectedGranulairty;
}
set
{
this.selectedGranulairty = value;
this.NotifyOfPropertyChange("SelectedGranulairty");
}
}
///
/// Gets or sets SelectedMp4Extension.
///
public int SelectedMp4Extension
{
get
{
return this.selectedMp4Extension;
}
set
{
this.selectedMp4Extension = value;
this.NotifyOfPropertyChange("SelectedMp4Extension");
}
}
///
/// Gets or sets SelectedPreferredLanguages.
///
public BindingList SelectedPreferredLanguages
{
get
{
return this.selectedPreferredLanguages;
}
set
{
this.selectedPreferredLanguages = value;
this.NotifyOfPropertyChange("SelectedPreferredLanguages");
}
}
///
/// Gets or sets SelectedPreferreedLangauge.
///
public string SelectedPreferreedLangauge
{
get
{
return this.selectedPreferreedLangauge;
}
set
{
this.selectedPreferreedLangauge = value;
this.NotifyOfPropertyChange("SelectedPreferreedLangauge");
}
}
///
/// Gets or sets SelectedPreviewCount.
///
public int SelectedPreviewCount
{
get
{
return this.selectedPreviewCount;
}
set
{
this.selectedPreviewCount = value;
this.NotifyOfPropertyChange("SelectedPreviewCount");
}
}
///
/// Gets or sets SelectedPriority.
///
public string SelectedPriority
{
get
{
return this.selectedPriority;
}
set
{
this.selectedPriority = value;
this.NotifyOfPropertyChange("SelectedPriority");
}
}
///
/// Gets or sets SelectedVerbosity.
///
public int SelectedVerbosity
{
get
{
return this.selectedVerbosity;
}
set
{
this.selectedVerbosity = value;
this.NotifyOfPropertyChange("SelectedVerbosity");
}
}
///
/// Gets or sets a value indicating whether SendFileAfterEncode.
///
public bool SendFileAfterEncode
{
get
{
return this.sendFileAfterEncode;
}
set
{
this.sendFileAfterEncode = value;
this.NotifyOfPropertyChange("SendFileAfterEncode");
}
}
///
/// Gets or sets SendFileTo.
///
public string SendFileTo
{
get
{
return this.sendFileTo;
}
set
{
this.sendFileTo = value;
this.NotifyOfPropertyChange("SendFileTo");
}
}
///
/// Gets or sets a value indicating whether ShowCliWindow.
///
public bool ShowCliWindow
{
get
{
return this.showCliWindow;
}
set
{
this.showCliWindow = value;
this.NotifyOfPropertyChange("ShowCliWindow");
}
}
///
/// Gets or sets VLCPath.
///
public string VLCPath
{
get
{
return this.vlcPath;
}
set
{
this.vlcPath = value;
this.NotifyOfPropertyChange("VLCPath");
}
}
///
/// Gets or sets WhenDone.
///
public string WhenDone
{
get
{
return this.whenDone;
}
set
{
this.whenDone = value;
this.NotifyOfPropertyChange("WhenDone");
}
}
///
/// Gets or sets WhenDoneOptions.
///
public BindingList WhenDoneOptions
{
get
{
return this.whenDoneOptions;
}
set
{
this.whenDoneOptions = value;
this.NotifyOfPropertyChange("WhenDoneOptions");
}
}
#endregion
#region Public Methods
///
/// Load User Settings
///
public void Load()
{
// #############################
// Screen Setup
// #############################
IDictionary langList = LanguageUtilities.MapLanguages();
foreach (string selectedItem in this.userSettingService.GetUserSetting(UserSettingConstants.SelectedLanguages))
{
// removing wrong keys when a new Language list comes out.
if (langList.ContainsKey(selectedItem))
{
this.selectedPreferredLanguages.Add(selectedItem);
}
}
foreach (string item in langList.Keys)
{
this.selectedPreferredLanguages.Add(item);
// In the available languages should be no "Any" and no selected language.
if ((item != "Any") && (!this.userSettingService.GetUserSetting(UserSettingConstants.SelectedLanguages).Contains(item)))
{
this.availableLanguages.Add(item);
}
}
// #############################
// General
// #############################
// Enable Tooltips.
if (this.userSettingService.GetUserSetting(UserSettingConstants.TooltipEnable))
{
this.enableGuiTooltips = true;
}
// Update Check
if (this.userSettingService.GetUserSetting(UserSettingConstants.UpdateStatus))
{
this.checkForUpdates = true;
}
// Days between update checks
this.checkForUpdatesFrequency =
this.userSettingService.GetUserSetting(UserSettingConstants.DaysBetweenUpdateCheck);
// On Encode Completeion Action
this.whenDoneOptions.Add("Do nothing");
this.whenDoneOptions.Add("Shutdown");
this.whenDoneOptions.Add("Suspend");
this.whenDoneOptions.Add("Hibernate");
this.whenDoneOptions.Add("Lock system");
this.whenDoneOptions.Add("Log off");
this.whenDoneOptions.Add("Quit HandBrake");
this.whenDone = userSettingService.GetUserSetting("WhenCompleteAction");
// Growl.
if (userSettingService.GetUserSetting(ASUserSettingConstants.GrowlEncode))
{
this.growlAfterEncode = true;
}
if (userSettingService.GetUserSetting(ASUserSettingConstants.GrowlQueue))
{
this.growlAfterQueue = true;
}
this.SendFileAfterEncode = this.userSettingService.GetUserSetting(ASUserSettingConstants.SendFile);
this.sendFileTo = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSetting(ASUserSettingConstants.SendFileTo));
this.arguments = this.userSettingService.GetUserSetting(ASUserSettingConstants.SendFileToArgs);
// #############################
// Output Settings
// #############################
// Enable auto naming feature.)
if (this.userSettingService.GetUserSetting(UserSettingConstants.AutoNaming))
{
this.AutomaticallyNameFiles = true;
}
// Store the auto name path
this.autoNameDefaultPath = this.userSettingService.GetUserSetting(UserSettingConstants.AutoNamePath);
if (string.IsNullOrEmpty(this.autoNameDefaultPath))
this.autoNameDefaultPath = "Click 'Browse' to set the default location";
// Store auto name format
this.autonameFormat = this.userSettingService.GetUserSetting(UserSettingConstants.AutoNameFormat);
// Use iPod/iTunes friendly .m4v extension for MP4 files.
this.mp4ExtensionOptions.Add("Automatic");
this.mp4ExtensionOptions.Add("Always use MP4");
this.mp4ExtensionOptions.Add("Always use M4V");
this.selectedMp4Extension = this.userSettingService.GetUserSetting(UserSettingConstants.UseM4v);
// Remove Underscores
this.removeUnderscores = this.userSettingService.GetUserSetting(UserSettingConstants.AutoNameRemoveUnderscore);
// Title case
this.changeToTitleCase = this.userSettingService.GetUserSetting(UserSettingConstants.AutoNameTitleCase);
// #############################
// Picture Tab
// #############################
// VLC Path
this.vlcPath = this.userSettingService.GetUserSetting(UserSettingConstants.VLC_Path);
// #############################
// Audio and Subtitles Tab
// #############################
this.selectedPreferreedLangauge = this.userSettingService.GetUserSetting(UserSettingConstants.NativeLanguage);
this.AddAudioModeOptions.Add("None");
this.AddAudioModeOptions.Add("All Remaining Tracks");
this.AddAudioModeOptions.Add("All for Selected Languages");
this.AddSubtitleModeOptions.Add("None");
this.AddSubtitleModeOptions.Add("All");
this.AddSubtitleModeOptions.Add("First");
this.AddSubtitleModeOptions.Add("Selected");
this.AddSubtitleModeOptions.Add("Preferred Only");
this.selectedAddAudioMode = this.userSettingService.GetUserSetting(UserSettingConstants.DubModeAudio);
this.selectedAddSubtitleMode = this.userSettingService.GetUserSetting(UserSettingConstants.DubModeSubtitle);
this.addOnlyOneAudioTrackPerLanguage = this.userSettingService.GetUserSetting(UserSettingConstants.AddOnlyOneAudioPerLanguage);
this.addClosedCaptions = this.userSettingService.GetUserSetting(UserSettingConstants.UseClosedCaption);
// #############################
// CLI
// #############################
// Priority level for encodes
this.priorityLevelOptions.Add("Realtime");
this.priorityLevelOptions.Add("High");
this.priorityLevelOptions.Add("Above Normal");
this.priorityLevelOptions.Add("Normal");
this.priorityLevelOptions.Add("Below Normal");
this.priorityLevelOptions.Add("Low");
this.selectedPriority = userSettingService.GetUserSetting(ASUserSettingConstants.ProcessPriority);
this.preventSleep = userSettingService.GetUserSetting(ASUserSettingConstants.PreventSleep);
// Log Verbosity Level
this.logVerbosityOptions.Add(0);
this.logVerbosityOptions.Add(1);
this.logVerbosityOptions.Add(2);
this.selectedVerbosity = userSettingService.GetUserSetting(ASUserSettingConstants.Verbosity);
// Save logs in the same directory as encoded files
if (userSettingService.GetUserSetting(ASUserSettingConstants.SaveLogWithVideo))
{
this.copyLogToEncodeDirectory = true;
}
// Save Logs in a specified path
if (userSettingService.GetUserSetting(ASUserSettingConstants.SaveLogToCopyDirectory))
{
this.copyLogToSepcficedLocation = true;
}
// The saved log path
this.logDirectory = userSettingService.GetUserSetting(ASUserSettingConstants.SaveLogCopyDirectory);
this.clearOldOlgs = this.userSettingService.GetUserSetting(UserSettingConstants.ClearOldLogs);
// #############################
// Advanced
// #############################
// Minimise to Tray
if (this.userSettingService.GetUserSetting(UserSettingConstants.TrayIconAlerts))
{
this.DisplayStatusMessagesTrayIcon = true;
}
// Tray Balloon popups
if (this.userSettingService.GetUserSetting(UserSettingConstants.MainWindowMinimize))
{
this.minimiseToTray = true;
}
// Enable / Disable Query editor tab
if (this.userSettingService.GetUserSetting(UserSettingConstants.QueryEditorTab))
{
this.enableQueryEditor = true;
}
// Prompt on inconsistant queries
this.promptOnDifferentQuery = this.userSettingService.GetUserSetting(UserSettingConstants.PromptOnUnmatchingQueries);
// Preset update notification
if (this.userSettingService.GetUserSetting(UserSettingConstants.PresetNotification))
{
this.disablePresetUpdateCheckNotification = true;
}
// Show CLI Window
this.showCliWindow = userSettingService.GetUserSetting(ASUserSettingConstants.ShowCLI);
// Set the preview count
this.PreviewPicturesToScan.Add(10);
this.PreviewPicturesToScan.Add(15);
this.PreviewPicturesToScan.Add(20);
this.PreviewPicturesToScan.Add(25);
this.PreviewPicturesToScan.Add(30);
this.selectedPreviewCount = this.userSettingService.GetUserSetting(UserSettingConstants.PreviewScanCount);
// x264 step
this.ConstantQualityGranularity.Add("1.0");
this.ConstantQualityGranularity.Add("0.50");
this.ConstantQualityGranularity.Add("0.25");
this.ConstantQualityGranularity.Add("0.20");
this.SelectedGranulairty = userSettingService.GetUserSetting(ASUserSettingConstants.X264Step).ToString(new CultureInfo("en-US"));
// Min Title Length
this.minLength = this.userSettingService.GetUserSetting(ASUserSettingConstants.MinScanDuration);
// Use Experimental dvdnav
if (userSettingService.GetUserSetting(ASUserSettingConstants.DisableLibDvdNav))
{
this.disableLibdvdNav = true;
}
this.isLoading = false;
}
///
/// Close this window.
///
public void Close()
{
this.TryClose();
}
#endregion
}
}