diff options
author | sr55 <[email protected]> | 2011-10-29 20:17:24 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-10-29 20:17:24 +0000 |
commit | 2f0f372b09897e703a8d01fe9774aa59c936a013 (patch) | |
tree | 2dcac02179e264e6f22745e28d1492b84d715d6c /win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | |
parent | 00176d7fd3e25fcdb3ce61f313b384d4c2508788 (diff) |
WinGui: (WPF) Continued work on the options window. Save Settings, Various functions and place holders for TODO's
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4328 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 740 |
1 files changed, 475 insertions, 265 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index f27d71b59..68a4ecf5d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -9,12 +9,16 @@ namespace HandBrakeWPF.ViewModels
{
+ using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Composition;
+ using System.Diagnostics;
using System.Globalization;
using System.IO;
+ using System.Linq;
+ using System.Windows;
using Caliburn.Micro;
@@ -24,6 +28,8 @@ namespace HandBrakeWPF.ViewModels using HandBrakeWPF.ViewModels.Interfaces;
+ using Ookii.Dialogs.Wpf;
+
/// <summary>
/// The Options View Model
/// </summary>
@@ -38,11 +44,6 @@ namespace HandBrakeWPF.ViewModels private readonly IUserSettingService userSettingService;
/// <summary>
- /// A Property to block Saving while the screen is loading.
- /// </summary>
- private bool isLoading = true;
-
- /// <summary>
/// The add audio mode options.
/// </summary>
private BindingList<string> addAudioModeOptions = new BindingList<string>();
@@ -268,6 +269,12 @@ namespace HandBrakeWPF.ViewModels private string sendFileTo;
/// <summary>
+ /// The send file to Path.
+ /// </summary>
+ private string sendFileToPath;
+
+
+ /// <summary>
/// The show cli window.
/// </summary>
private bool showCliWindow;
@@ -316,615 +323,628 @@ namespace HandBrakeWPF.ViewModels #region Properties
+ #region General
+
/// <summary>
- /// Gets or sets AddAudioModeOptions.
+ /// Gets or sets a value indicating whether CheckForUpdates.
/// </summary>
- public BindingList<string> AddAudioModeOptions
+ public bool CheckForUpdates
{
get
{
- return this.addAudioModeOptions;
+ return this.checkForUpdates;
}
set
{
- this.addAudioModeOptions = value;
- this.NotifyOfPropertyChange("AddAudioModeOptions");
+ this.checkForUpdates = value;
+ this.NotifyOfPropertyChange("CheckForUpdates");
}
}
/// <summary>
- /// Gets or sets a value indicating whether AddClosedCaptions.
+ /// Gets or sets CheckForUpdatesFrequencies.
/// </summary>
- public bool AddClosedCaptions
+ public BindingList<string> CheckForUpdatesFrequencies
{
get
{
- return this.addClosedCaptions;
+ return this.checkForUpdatesFrequencies;
}
set
{
- this.addClosedCaptions = value;
- this.NotifyOfPropertyChange("AddClosedCaptions");
+ this.checkForUpdatesFrequencies = value;
+ this.NotifyOfPropertyChange("CheckForUpdatesFrequencies");
}
}
/// <summary>
- /// Gets or sets a value indicating whether AddOnlyOneAudioTrackPerLanguage.
+ /// Gets or sets a value indicating whether CheckForUpdatesFrequency.
/// </summary>
- public bool AddOnlyOneAudioTrackPerLanguage
+ public int CheckForUpdatesFrequency
{
get
{
- return this.addOnlyOneAudioTrackPerLanguage;
+ return this.checkForUpdatesFrequency;
}
set
{
- this.addOnlyOneAudioTrackPerLanguage = value;
- this.NotifyOfPropertyChange("AddOnlyOneAudioTrackPerLanguage");
+ this.checkForUpdatesFrequency = value;
+ this.NotifyOfPropertyChange("CheckForUpdatesFrequency");
}
}
/// <summary>
- /// Gets or sets AddSubtitleModeOptions.
+ /// Gets or sets Arguments.
/// </summary>
- public BindingList<string> AddSubtitleModeOptions
+ public string Arguments
{
get
{
- return this.addSubtitleModeOptions;
+ return this.arguments;
}
set
{
- this.addSubtitleModeOptions = value;
- this.NotifyOfPropertyChange("AddSubtitleModeOptions");
+ this.arguments = value;
+ this.NotifyOfPropertyChange("Arguments");
}
}
/// <summary>
- /// Gets or sets Arguments.
+ /// Gets or sets a value indicating whether GrowlAfterEncode.
/// </summary>
- public string Arguments
+ public bool GrowlAfterEncode
{
get
{
- return this.arguments;
+ return this.growlAfterEncode;
}
set
{
- this.arguments = value;
- this.NotifyOfPropertyChange("Arguments");
+ this.growlAfterEncode = value;
+ this.NotifyOfPropertyChange("GrowlAfterEncode");
}
}
/// <summary>
- /// Gets or sets AutoNameDefaultPath.
+ /// Gets or sets a value indicating whether GrowlAfterQueue.
/// </summary>
- public string AutoNameDefaultPath
+ public bool GrowlAfterQueue
{
get
{
- return this.autoNameDefaultPath;
+ return this.growlAfterQueue;
}
set
{
- this.autoNameDefaultPath = value;
- this.NotifyOfPropertyChange("AutoNameDefaultPath");
+ this.growlAfterQueue = value;
+ this.NotifyOfPropertyChange("GrowlAfterQueue");
}
}
/// <summary>
- /// Gets or sets a value indicating whether AutomaticallyNameFiles.
+ /// Gets or sets a value indicating whether SendFileAfterEncode.
/// </summary>
- public bool AutomaticallyNameFiles
+ public bool SendFileAfterEncode
{
get
{
- return this.automaticallyNameFiles;
+ return this.sendFileAfterEncode;
}
set
{
- this.automaticallyNameFiles = value;
- this.NotifyOfPropertyChange("AutomaticallyNameFiles");
+ this.sendFileAfterEncode = value;
+ this.NotifyOfPropertyChange("SendFileAfterEncode");
}
}
/// <summary>
- /// Gets or sets AutonameFormat.
+ /// Gets or sets SendFileTo.
/// </summary>
- public string AutonameFormat
+ public string SendFileTo
{
get
{
- return this.autonameFormat;
+ return this.sendFileTo;
}
set
{
- this.autonameFormat = value;
- this.NotifyOfPropertyChange("AutonameFormat");
+ this.sendFileTo = value;
+ this.NotifyOfPropertyChange("SendFileTo");
}
}
/// <summary>
- /// Gets or sets AvailableLanguages.
+ /// Gets or sets SendFileToPath.
/// </summary>
- public BindingList<string> AvailableLanguages
+ public string SendFileToPath
{
get
{
- return this.availableLanguages;
+ return this.sendFileToPath;
}
set
{
- this.availableLanguages = value;
- this.NotifyOfPropertyChange("AvailableLanguages");
+ this.sendFileToPath = value;
+ this.NotifyOfPropertyChange("SendFileToPath");
}
}
/// <summary>
- /// Gets or sets a value indicating whether ChangeToTitleCase.
+ /// Gets or sets a value indicating whether EnableGuiTooltips.
/// </summary>
- public bool ChangeToTitleCase
+ public bool EnableGuiTooltips
{
get
{
- return this.changeToTitleCase;
+ return this.enableGuiTooltips;
}
set
{
- this.changeToTitleCase = value;
- this.NotifyOfPropertyChange("ChangeToTitleCase");
+ this.enableGuiTooltips = value;
+ this.NotifyOfPropertyChange("EnableGuiTooltips");
}
}
/// <summary>
- /// Gets or sets a value indicating whether CheckForUpdates.
+ /// Gets or sets WhenDone.
/// </summary>
- public bool CheckForUpdates
+ public string WhenDone
{
get
{
- return this.checkForUpdates;
+ return this.whenDone;
}
set
{
- this.checkForUpdates = value;
- this.NotifyOfPropertyChange("CheckForUpdates");
+ this.whenDone = value;
+ this.NotifyOfPropertyChange("WhenDone");
}
}
/// <summary>
- /// Gets or sets CheckForUpdatesFrequencies.
+ /// Gets or sets WhenDoneOptions.
/// </summary>
- public BindingList<string> CheckForUpdatesFrequencies
+ public BindingList<string> WhenDoneOptions
{
get
{
- return this.checkForUpdatesFrequencies;
+ return this.whenDoneOptions;
}
set
{
- this.checkForUpdatesFrequencies = value;
- this.NotifyOfPropertyChange("CheckForUpdatesFrequencies");
+ this.whenDoneOptions = value;
+ this.NotifyOfPropertyChange("WhenDoneOptions");
}
}
+ #endregion
+
+ #region Output Files
/// <summary>
- /// Gets or sets a value indicating whether CheckForUpdatesFrequency.
+ /// Gets or sets AutoNameDefaultPath.
/// </summary>
- public int CheckForUpdatesFrequency
+ public string AutoNameDefaultPath
{
get
{
- return this.checkForUpdatesFrequency;
+ return this.autoNameDefaultPath;
}
set
{
- this.checkForUpdatesFrequency = value;
- this.NotifyOfPropertyChange("CheckForUpdatesFrequency");
+ this.autoNameDefaultPath = value;
+ this.NotifyOfPropertyChange("AutoNameDefaultPath");
}
}
/// <summary>
- /// Gets or sets a value indicating whether ClearOldOlgs.
+ /// Gets or sets a value indicating whether AutomaticallyNameFiles.
/// </summary>
- public bool ClearOldOlgs
+ public bool AutomaticallyNameFiles
{
get
{
- return this.clearOldOlgs;
+ return this.automaticallyNameFiles;
}
set
{
- this.clearOldOlgs = value;
- this.NotifyOfPropertyChange("ClearOldOlgs");
+ this.automaticallyNameFiles = value;
+ this.NotifyOfPropertyChange("AutomaticallyNameFiles");
}
}
/// <summary>
- /// Gets or sets ConstantQualityGranularity.
+ /// Gets or sets AutonameFormat.
/// </summary>
- public BindingList<string> ConstantQualityGranularity
+ public string AutonameFormat
{
get
{
- return this.constantQualityGranularity;
+ return this.autonameFormat;
}
set
{
- this.constantQualityGranularity = value;
- this.NotifyOfPropertyChange("ConstantQualityGranularity");
+ this.autonameFormat = value;
+ this.NotifyOfPropertyChange("AutonameFormat");
}
}
/// <summary>
- /// Gets or sets a value indicating whether CopyLogToEncodeDirectory.
+ /// Gets or sets a value indicating whether ChangeToTitleCase.
/// </summary>
- public bool CopyLogToEncodeDirectory
+ public bool ChangeToTitleCase
{
get
{
- return this.copyLogToEncodeDirectory;
+ return this.changeToTitleCase;
}
set
{
- this.copyLogToEncodeDirectory = value;
- this.NotifyOfPropertyChange("CopyLogToEncodeDirectory");
+ this.changeToTitleCase = value;
+ this.NotifyOfPropertyChange("ChangeToTitleCase");
}
}
/// <summary>
- /// Gets or sets a value indicating whether CopyLogToSepcficedLocation.
+ /// Gets or sets Mp4ExtensionOptions.
/// </summary>
- public bool CopyLogToSepcficedLocation
+ public BindingList<string> Mp4ExtensionOptions
{
get
{
- return this.copyLogToSepcficedLocation;
+ return this.mp4ExtensionOptions;
}
set
{
- this.copyLogToSepcficedLocation = value;
- this.NotifyOfPropertyChange("CopyLogToSepcficedLocation");
+ this.mp4ExtensionOptions = value;
+ this.NotifyOfPropertyChange("Mp4ExtensionOptions");
}
}
/// <summary>
- /// Gets or sets a value indicating whether DisableLibdvdNav.
+ /// Gets or sets a value indicating whether RemoveUnderscores.
/// </summary>
- public bool DisableLibdvdNav
+ public bool RemoveUnderscores
{
get
{
- return this.disableLibdvdNav;
+ return this.removeUnderscores;
}
set
{
- this.disableLibdvdNav = value;
- this.NotifyOfPropertyChange("DisableLibdvdNav");
+ this.removeUnderscores = value;
+ this.NotifyOfPropertyChange("RemoveUnderscores");
}
}
/// <summary>
- /// Gets or sets a value indicating whether disablePresetUpdateCheckNotification.
+ /// Gets or sets SelectedMp4Extension.
/// </summary>
- public bool DisablePresetUpdateCheckNotification
+ public int SelectedMp4Extension
{
get
{
- return this.disablePresetUpdateCheckNotification;
+ return this.selectedMp4Extension;
}
set
{
- this.disablePresetUpdateCheckNotification = value;
- this.NotifyOfPropertyChange("DisablePresetUpdateCheckNotification");
+ this.selectedMp4Extension = value;
+ this.NotifyOfPropertyChange("SelectedMp4Extension");
}
}
+ #endregion
+
+ #region Preview
/// <summary>
- /// Gets or sets a value indicating whether DisplayStatusMessagesTrayIcon.
+ /// Gets or sets VLCPath.
/// </summary>
- public bool DisplayStatusMessagesTrayIcon
+ public string VLCPath
{
get
{
- return this.displayStatusMessagesTrayIcon;
+ return this.vlcPath;
}
set
{
- this.displayStatusMessagesTrayIcon = value;
- this.NotifyOfPropertyChange("DisplayStatusMessagesTrayIcon");
+ this.vlcPath = value;
+ this.NotifyOfPropertyChange("VLCPath");
}
}
+ #endregion
+
+ #region Audio and Subtitles
/// <summary>
- /// Gets or sets a value indicating whether EnableGuiTooltips.
+ /// Gets or sets AvailableLanguages.
/// </summary>
- public bool EnableGuiTooltips
+ public BindingList<string> AvailableLanguages
{
get
{
- return this.enableGuiTooltips;
+ return this.availableLanguages;
}
set
{
- this.enableGuiTooltips = value;
- this.NotifyOfPropertyChange("EnableGuiTooltips");
+ this.availableLanguages = value;
+ this.NotifyOfPropertyChange("AvailableLanguages");
}
}
/// <summary>
- /// Gets or sets a value indicating whether EnableQueryEditor.
+ /// Gets or sets AddAudioModeOptions.
/// </summary>
- public bool EnableQueryEditor
+ public BindingList<string> AddAudioModeOptions
{
get
{
- return this.enableQueryEditor;
+ return this.addAudioModeOptions;
}
set
{
- this.enableQueryEditor = value;
- this.NotifyOfPropertyChange("EnableQueryEditor");
+ this.addAudioModeOptions = value;
+ this.NotifyOfPropertyChange("AddAudioModeOptions");
}
}
/// <summary>
- /// Gets or sets a value indicating whether GrowlAfterEncode.
+ /// Gets or sets a value indicating whether AddClosedCaptions.
/// </summary>
- public bool GrowlAfterEncode
+ public bool AddClosedCaptions
{
get
{
- return this.growlAfterEncode;
+ return this.addClosedCaptions;
}
set
{
- this.growlAfterEncode = value;
- this.NotifyOfPropertyChange("GrowlAfterEncode");
+ this.addClosedCaptions = value;
+ this.NotifyOfPropertyChange("AddClosedCaptions");
}
}
/// <summary>
- /// Gets or sets a value indicating whether GrowlAfterQueue.
+ /// Gets or sets a value indicating whether AddOnlyOneAudioTrackPerLanguage.
/// </summary>
- public bool GrowlAfterQueue
+ public bool AddOnlyOneAudioTrackPerLanguage
{
get
{
- return this.growlAfterQueue;
+ return this.addOnlyOneAudioTrackPerLanguage;
}
set
{
- this.growlAfterQueue = value;
- this.NotifyOfPropertyChange("GrowlAfterQueue");
+ this.addOnlyOneAudioTrackPerLanguage = value;
+ this.NotifyOfPropertyChange("AddOnlyOneAudioTrackPerLanguage");
}
}
/// <summary>
- /// Gets or sets LogDirectory.
+ /// Gets or sets AddSubtitleModeOptions.
/// </summary>
- public string LogDirectory
+ public BindingList<string> AddSubtitleModeOptions
{
get
{
- return this.logDirectory;
+ return this.addSubtitleModeOptions;
}
set
{
- this.logDirectory = value;
- this.NotifyOfPropertyChange("LogDirectory");
+ this.addSubtitleModeOptions = value;
+ this.NotifyOfPropertyChange("AddSubtitleModeOptions");
}
}
/// <summary>
- /// Gets or sets LogVerbosityOptions.
+ /// Gets or sets SelectedAddAudioMode.
/// </summary>
- public BindingList<int> LogVerbosityOptions
+ public int SelectedAddAudioMode
{
get
{
- return this.logVerbosityOptions;
+ return this.selectedAddAudioMode;
}
set
{
- this.logVerbosityOptions = value;
- this.NotifyOfPropertyChange("LogVerbosityOptions");
+ this.selectedAddAudioMode = value;
+ this.NotifyOfPropertyChange("SelectedAddAudioMode");
}
}
/// <summary>
- /// Gets or sets MinLength.
+ /// Gets or sets SelectedAddSubtitleMode.
/// </summary>
- public long MinLength
+ public int SelectedAddSubtitleMode
{
get
{
- return this.minLength;
+ return this.selectedAddSubtitleMode;
}
set
{
- this.minLength = value;
- this.NotifyOfPropertyChange("MinLength");
+ this.selectedAddSubtitleMode = value;
+ this.NotifyOfPropertyChange("SelectedAddSubtitleMode");
}
}
/// <summary>
- /// Gets or sets a value indicating whether MinimiseToTray.
+ /// Gets or sets preferredLanguages.
/// </summary>
- public bool MinimiseToTray
+ public BindingList<string> PreferredLanguages
{
get
{
- return this.minimiseToTray;
+ return this.preferredLanguages;
}
set
{
- this.minimiseToTray = value;
- this.NotifyOfPropertyChange("MinimiseToTray");
+ this.preferredLanguages = value;
+ this.NotifyOfPropertyChange("preferredLanguages");
}
}
/// <summary>
- /// Gets or sets Mp4ExtensionOptions.
+ /// Gets or sets SelectedLangauges.
/// </summary>
- public BindingList<string> Mp4ExtensionOptions
+ public BindingList<string> SelectedLangauges
{
get
{
- return this.mp4ExtensionOptions;
+ return this.selectedLangauges;
}
-
set
{
- this.mp4ExtensionOptions = value;
- this.NotifyOfPropertyChange("Mp4ExtensionOptions");
+ this.selectedLangauges = value;
+ this.NotifyOfPropertyChange("SelectedLangauges");
}
}
/// <summary>
- /// Gets or sets a value indicating whether PreventSleep.
+ /// Gets or sets SelectedPreferreedLangauge.
/// </summary>
- public bool PreventSleep
+ public string SelectedPreferredLangauge
{
get
{
- return this.preventSleep;
+ return this.selectedPreferredLangauge;
}
set
{
- this.preventSleep = value;
- this.NotifyOfPropertyChange("PreventSleep");
+ this.selectedPreferredLangauge = value;
+ this.NotifyOfPropertyChange("SelectedPreferreedLangauge");
}
}
+ #endregion
+
+ #region System and Logging
/// <summary>
- /// Gets or sets PreviewPicturesToScan.
+ /// Gets or sets a value indicating whether CopyLogToEncodeDirectory.
/// </summary>
- public BindingList<int> PreviewPicturesToScan
+ public bool CopyLogToEncodeDirectory
{
get
{
- return this.previewPicturesToScan;
+ return this.copyLogToEncodeDirectory;
}
set
{
- this.previewPicturesToScan = value;
- this.NotifyOfPropertyChange("PreviewPicturesToScan");
+ this.copyLogToEncodeDirectory = value;
+ this.NotifyOfPropertyChange("CopyLogToEncodeDirectory");
}
}
/// <summary>
- /// Gets or sets PriorityLevelOptions.
+ /// Gets or sets a value indicating whether CopyLogToSepcficedLocation.
/// </summary>
- public BindingList<string> PriorityLevelOptions
+ public bool CopyLogToSepcficedLocation
{
get
{
- return this.priorityLevelOptions;
+ return this.copyLogToSepcficedLocation;
}
set
{
- this.priorityLevelOptions = value;
- this.NotifyOfPropertyChange("PriorityLevelOptions");
+ this.copyLogToSepcficedLocation = value;
+ this.NotifyOfPropertyChange("CopyLogToSepcficedLocation");
}
}
/// <summary>
- /// Gets or sets a value indicating whether PromptOnDifferentQuery.
+ /// Gets or sets a value indicating whether ClearOldOlgs.
/// </summary>
- public bool PromptOnDifferentQuery
+ public bool ClearOldOlgs
{
get
{
- return this.promptOnDifferentQuery;
+ return this.clearOldOlgs;
}
set
{
- this.promptOnDifferentQuery = value;
- this.NotifyOfPropertyChange("PromptOnDifferentQuery");
+ this.clearOldOlgs = value;
+ this.NotifyOfPropertyChange("ClearOldOlgs");
}
}
/// <summary>
- /// Gets or sets a value indicating whether RemoveUnderscores.
+ /// Gets or sets LogDirectory.
/// </summary>
- public bool RemoveUnderscores
+ public string LogDirectory
{
get
{
- return this.removeUnderscores;
+ return this.logDirectory;
}
set
{
- this.removeUnderscores = value;
- this.NotifyOfPropertyChange("RemoveUnderscores");
+ this.logDirectory = value;
+ this.NotifyOfPropertyChange("LogDirectory");
}
}
/// <summary>
- /// Gets or sets SelectedAddAudioMode.
+ /// Gets or sets a value indicating whether PreventSleep.
/// </summary>
- public int SelectedAddAudioMode
+ public bool PreventSleep
{
get
{
- return this.selectedAddAudioMode;
+ return this.preventSleep;
}
set
{
- this.selectedAddAudioMode = value;
- this.NotifyOfPropertyChange("SelectedAddAudioMode");
+ this.preventSleep = value;
+ this.NotifyOfPropertyChange("PreventSleep");
}
}
/// <summary>
- /// Gets or sets SelectedAddSubtitleMode.
+ /// Gets or sets PriorityLevelOptions.
/// </summary>
- public int SelectedAddSubtitleMode
+ public BindingList<string> PriorityLevelOptions
{
get
{
- return this.selectedAddSubtitleMode;
+ return this.priorityLevelOptions;
}
set
{
- this.selectedAddSubtitleMode = value;
- this.NotifyOfPropertyChange("SelectedAddSubtitleMode");
+ this.priorityLevelOptions = value;
+ this.NotifyOfPropertyChange("PriorityLevelOptions");
}
}
@@ -946,225 +966,247 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
- /// Gets or sets SelectedMp4Extension.
+ /// Gets or sets SelectedPriority.
/// </summary>
- public int SelectedMp4Extension
+ public string SelectedPriority
{
get
{
- return this.selectedMp4Extension;
+ return this.selectedPriority;
}
set
{
- this.selectedMp4Extension = value;
- this.NotifyOfPropertyChange("SelectedMp4Extension");
+ this.selectedPriority = value;
+ this.NotifyOfPropertyChange("SelectedPriority");
}
}
+ #endregion
+
+ #region Advanced
/// <summary>
- /// Gets or sets preferredLanguages.
+ /// Gets or sets a value indicating whether EnableQueryEditor.
/// </summary>
- public BindingList<string> PreferredLanguages
+ public bool EnableQueryEditor
{
get
{
- return this.preferredLanguages;
+ return this.enableQueryEditor;
}
set
{
- this.preferredLanguages = value;
- this.NotifyOfPropertyChange("preferredLanguages");
+ this.enableQueryEditor = value;
+ this.NotifyOfPropertyChange("EnableQueryEditor");
}
}
/// <summary>
- /// Gets or sets SelectedPreferreedLangauge.
+ /// Gets or sets a value indicating whether PromptOnDifferentQuery.
/// </summary>
- public string SelectedPreferredLangauge
+ public bool PromptOnDifferentQuery
{
get
{
- return this.selectedPreferredLangauge;
+ return this.promptOnDifferentQuery;
}
set
{
- this.selectedPreferredLangauge = value;
- this.NotifyOfPropertyChange("SelectedPreferreedLangauge");
+ this.promptOnDifferentQuery = value;
+ this.NotifyOfPropertyChange("PromptOnDifferentQuery");
}
}
/// <summary>
- /// Gets or sets SelectedPreviewCount.
+ /// Gets or sets ConstantQualityGranularity.
/// </summary>
- public int SelectedPreviewCount
+ public BindingList<string> ConstantQualityGranularity
{
get
{
- return this.selectedPreviewCount;
+ return this.constantQualityGranularity;
}
set
{
- this.selectedPreviewCount = value;
- this.NotifyOfPropertyChange("SelectedPreviewCount");
+ this.constantQualityGranularity = value;
+ this.NotifyOfPropertyChange("ConstantQualityGranularity");
}
}
/// <summary>
- /// Gets or sets SelectedPriority.
+ /// Gets or sets a value indicating whether DisableLibdvdNav.
/// </summary>
- public string SelectedPriority
+ public bool DisableLibdvdNav
{
get
{
- return this.selectedPriority;
+ return this.disableLibdvdNav;
}
set
{
- this.selectedPriority = value;
- this.NotifyOfPropertyChange("SelectedPriority");
+ this.disableLibdvdNav = value;
+ this.NotifyOfPropertyChange("DisableLibdvdNav");
}
}
/// <summary>
- /// Gets or sets SelectedVerbosity.
+ /// Gets or sets a value indicating whether disablePresetUpdateCheckNotification.
/// </summary>
- public int SelectedVerbosity
+ public bool DisablePresetUpdateCheckNotification
{
get
{
- return this.selectedVerbosity;
+ return this.disablePresetUpdateCheckNotification;
}
set
{
- this.selectedVerbosity = value;
- this.NotifyOfPropertyChange("SelectedVerbosity");
+ this.disablePresetUpdateCheckNotification = value;
+ this.NotifyOfPropertyChange("DisablePresetUpdateCheckNotification");
}
}
/// <summary>
- /// Gets or sets a value indicating whether SendFileAfterEncode.
+ /// Gets or sets a value indicating whether DisplayStatusMessagesTrayIcon.
/// </summary>
- public bool SendFileAfterEncode
+ public bool DisplayStatusMessagesTrayIcon
{
get
{
- return this.sendFileAfterEncode;
+ return this.displayStatusMessagesTrayIcon;
}
set
{
- this.sendFileAfterEncode = value;
- this.NotifyOfPropertyChange("SendFileAfterEncode");
+ this.displayStatusMessagesTrayIcon = value;
+ this.NotifyOfPropertyChange("DisplayStatusMessagesTrayIcon");
}
}
/// <summary>
- /// Gets or sets SendFileTo.
+ /// Gets or sets LogVerbosityOptions.
/// </summary>
- public string SendFileTo
+ public BindingList<int> LogVerbosityOptions
{
get
{
- return this.sendFileTo;
+ return this.logVerbosityOptions;
}
set
{
- this.sendFileTo = value;
- this.NotifyOfPropertyChange("SendFileTo");
+ this.logVerbosityOptions = value;
+ this.NotifyOfPropertyChange("LogVerbosityOptions");
}
}
/// <summary>
- /// Gets or sets a value indicating whether ShowCliWindow.
+ /// Gets or sets MinLength.
/// </summary>
- public bool ShowCliWindow
+ public long MinLength
{
get
{
- return this.showCliWindow;
+ return this.minLength;
}
set
{
- this.showCliWindow = value;
- this.NotifyOfPropertyChange("ShowCliWindow");
+ this.minLength = value;
+ this.NotifyOfPropertyChange("MinLength");
}
}
/// <summary>
- /// Gets or sets SelectedLangauges.
+ /// Gets or sets a value indicating whether MinimiseToTray.
/// </summary>
- public BindingList<string> SelectedLangauges
+ public bool MinimiseToTray
{
get
{
- return this.selectedLangauges;
+ return this.minimiseToTray;
}
+
set
{
- this.selectedLangauges = value;
- this.NotifyOfPropertyChange("SelectedLangauges");
+ this.minimiseToTray = value;
+ this.NotifyOfPropertyChange("MinimiseToTray");
}
}
/// <summary>
- /// Gets or sets VLCPath.
+ /// Gets or sets PreviewPicturesToScan.
/// </summary>
- public string VLCPath
+ public BindingList<int> PreviewPicturesToScan
{
get
{
- return this.vlcPath;
+ return this.previewPicturesToScan;
}
set
{
- this.vlcPath = value;
- this.NotifyOfPropertyChange("VLCPath");
+ this.previewPicturesToScan = value;
+ this.NotifyOfPropertyChange("PreviewPicturesToScan");
}
}
/// <summary>
- /// Gets or sets WhenDone.
+ /// Gets or sets SelectedPreviewCount.
/// </summary>
- public string WhenDone
+ public int SelectedPreviewCount
{
get
{
- return this.whenDone;
+ return this.selectedPreviewCount;
}
set
{
- this.whenDone = value;
- this.NotifyOfPropertyChange("WhenDone");
+ this.selectedPreviewCount = value;
+ this.NotifyOfPropertyChange("SelectedPreviewCount");
}
}
/// <summary>
- /// Gets or sets WhenDoneOptions.
+ /// Gets or sets SelectedVerbosity.
/// </summary>
- public BindingList<string> WhenDoneOptions
+ public int SelectedVerbosity
{
get
{
- return this.whenDoneOptions;
+ return this.selectedVerbosity;
}
set
{
- this.whenDoneOptions = value;
- this.NotifyOfPropertyChange("WhenDoneOptions");
+ this.selectedVerbosity = value;
+ this.NotifyOfPropertyChange("SelectedVerbosity");
}
}
+ /// <summary>
+ /// Gets or sets a value indicating whether ShowCliWindow.
+ /// </summary>
+ public bool ShowCliWindow
+ {
+ get
+ {
+ return this.showCliWindow;
+ }
+
+ set
+ {
+ this.showCliWindow = value;
+ this.NotifyOfPropertyChange("ShowCliWindow");
+ }
+ }
+ #endregion
+
#endregion
#region Public Methods
@@ -1212,27 +1254,25 @@ namespace HandBrakeWPF.ViewModels this.growlAfterEncode = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.GrowlEncode);
this.growlAfterQueue = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.GrowlQueue);
- this.SendFileAfterEncode = this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.SendFile);
- this.sendFileTo = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileTo));
- this.arguments = this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileToArgs);
+ this.sendFileAfterEncode = this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.SendFile);
+ this.sendFileTo = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileTo)) ?? string.Empty;
+ this.sendFileToPath = this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileTo) ?? string.Empty;
+ this.arguments = this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileToArgs) ?? string.Empty;
// #############################
// Output Settings
// #############################
// Enable auto naming feature.)
- if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming))
- {
- this.automaticallyNameFiles = true;
- }
+ this.automaticallyNameFiles = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming);
// Store the auto name path
- this.autoNameDefaultPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath);
+ this.autoNameDefaultPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath) ?? string.Empty;
if (string.IsNullOrEmpty(this.autoNameDefaultPath))
this.autoNameDefaultPath = "Click 'Browse' to set the default location";
// Store auto name format
- this.autonameFormat = this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat);
+ this.autonameFormat = this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat) ?? string.Empty;
// Use iPod/iTunes friendly .m4v extension for MP4 files.
this.mp4ExtensionOptions.Add("Automatic");
@@ -1251,7 +1291,7 @@ namespace HandBrakeWPF.ViewModels // #############################
// VLC Path
- this.vlcPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.VLC_Path);
+ this.vlcPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.VLC_Path) ?? string.Empty;
// #############################
// Audio and Subtitles Tab
@@ -1279,7 +1319,7 @@ namespace HandBrakeWPF.ViewModels }
}
- this.selectedPreferredLangauge = this.userSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage);
+ this.selectedPreferredLangauge = this.userSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage) ?? string.Empty;
this.AddAudioModeOptions.Add("None");
this.AddAudioModeOptions.Add("All Remaining Tracks");
@@ -1324,7 +1364,7 @@ namespace HandBrakeWPF.ViewModels this.copyLogToSepcficedLocation = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.SaveLogToCopyDirectory);
// The saved log path
- this.logDirectory = userSettingService.GetUserSetting<string>(ASUserSettingConstants.SaveLogCopyDirectory);
+ this.logDirectory = userSettingService.GetUserSetting<string>(ASUserSettingConstants.SaveLogCopyDirectory) ?? string.Empty;
this.clearOldOlgs = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearOldLogs);
@@ -1360,8 +1400,6 @@ namespace HandBrakeWPF.ViewModels // Use Experimental dvdnav
this.disableLibdvdNav = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav);
-
- this.isLoading = false;
}
/// <summary>
@@ -1369,9 +1407,181 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void Close()
{
+ this.Save();
this.TryClose();
}
+ /// <summary>
+ /// Browse - Send File To
+ /// </summary>
+ public void BrowseSendFileTo()
+ {
+ VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "All files (*.*)|*.*" };
+ dialog.ShowDialog();
+ this.SendFileTo = Path.GetFileNameWithoutExtension(dialog.FileName);
+ this.sendFileToPath = dialog.FileName;
+ }
+
+ /// <summary>
+ /// Browse Auto Name Path
+ /// </summary>
+ public void BrowseAutoNamePath()
+ {
+ VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true };
+ dialog.ShowDialog();
+ this.AutoNameDefaultPath = dialog.SelectedPath;
+ }
+
+ /// <summary>
+ /// Browse VLC Path
+ /// </summary>
+ public void BrowseVlcPath()
+ {
+ VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "All files (*.exe)|*.exe" };
+ dialog.ShowDialog();
+ this.VLCPath = dialog.FileName;
+ }
+
+ /// <summary>
+ /// Audio List Move Left
+ /// </summary>
+ public void LanguageMoveLeft()
+ {
+ // TODO
+ }
+
+ /// <summary>
+ /// Audio List Move Right
+ /// </summary>
+ public void LanguageMoveRight()
+ {
+ // TODO
+ }
+
+ /// <summary>
+ /// Audio List Clear all selected languages
+ /// </summary>
+ public void LanguageClearAll()
+ {
+ this.SelectedLangauges.Clear();
+ }
+
+ /// <summary>
+ /// Audio List Language Move UP
+ /// </summary>
+ public void LanguageMoveUp()
+ {
+ // TODO
+ }
+
+ /// <summary>
+ /// Audio List Language Move Down
+ /// </summary>
+ public void LanguageMoveDown()
+ {
+ // TODO
+ }
+
+ /// <summary>
+ /// Browse - Log Path
+ /// </summary>
+ public void BrowseLogPath()
+ {
+ VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true };
+ dialog.ShowDialog();
+ this.LogDirectory = dialog.SelectedPath;
+ }
+
+ /// <summary>
+ /// View the Default Log Directory for HandBrake
+ /// </summary>
+ public void ViewLogDirectory()
+ {
+ string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
+ string windir = Environment.GetEnvironmentVariable("WINDIR");
+ Process prc = new Process { StartInfo = { FileName = windir + @"\explorer.exe", Arguments = logDir } };
+ prc.Start();
+ }
+
+ /// <summary>
+ /// Clear HandBrakes log directory.
+ /// </summary>
+ public void ClearLogHistory()
+ {
+ MessageBoxResult result = MessageBox.Show("Are you sure you wish to clear the log file directory?", "Clear Logs",
+ MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
+ if (result == MessageBoxResult.Yes)
+ {
+ GeneralUtilities.ClearLogFiles(0);
+ MessageBox.Show("HandBrake's Log file directory has been cleared!", "Notice", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
#endregion
+
+ /// <summary>
+ /// Save the settings selected
+ /// </summary>
+ private void Save()
+ {
+ /* General */
+ this.userSettingService.SetUserSetting(UserSettingConstants.UpdateStatus, this.CheckForUpdates);
+ this.userSettingService.SetUserSetting(UserSettingConstants.DaysBetweenUpdateCheck, this.CheckForUpdatesFrequency);
+ this.userSettingService.SetUserSetting(UserSettingConstants.TooltipEnable, this.EnableGuiTooltips);
+ this.userSettingService.SetUserSetting(ASUserSettingConstants.WhenCompleteAction, this.WhenDone);
+ this.userSettingService.SetUserSetting(ASUserSettingConstants.GrowlQueue, this.GrowlAfterQueue);
+ this.userSettingService.SetUserSetting(ASUserSettingConstants.GrowlEncode, this.GrowlAfterEncode);
+ this.userSettingService.SetUserSetting(ASUserSettingConstants.SendFileTo, this.SendFileToPath);
+ this.userSettingService.SetUserSetting(ASUserSettingConstants.SendFile, this.SendFileAfterEncode);
+ this.userSettingService.SetUserSetting(ASUserSettingConstants.SendFileToArgs, this.Arguments);
+
+ /* Output Files */
+ this.userSettingService.SetUserSetting(UserSettingConstants.AutoNaming, this.AutomaticallyNameFiles);
+ this.userSettingService.SetUserSetting(UserSettingConstants.AutoNameFormat, this.AutonameFormat);
+ this.userSettingService.SetUserSetting(UserSettingConstants.AutoNamePath, this.AutoNameDefaultPath);
+ this.userSettingService.SetUserSetting(UserSettingConstants.UseM4v, this.SelectedMp4Extension);
+ this.userSettingService.SetUserSetting(UserSettingConstants.AutoNameRemoveUnderscore, this.RemoveUnderscores);
+ this.userSettingService.SetUserSetting(UserSettingConstants.AutoNameTitleCase, this.ChangeToTitleCase);
+
+ /* Previews */
+ this.userSettingService.SetUserSetting(UserSettingConstants.VLC_Path, this.VLCPath);
+
+ /* Audio and Subtitles */
+ this.userSettingService.SetUserSetting(UserSettingConstants.NativeLanguage, this.SelectedPreferredLangauge);
+ StringCollection collection = new StringCollection();
+ collection.AddRange(this.SelectedLangauges.ToArray());
+ this.userSettingService.SetUserSetting(UserSettingConstants.SelectedLanguages, collection);
+ this.userSettingService.SetUserSetting(UserSettingConstants.AddOnlyOneAudioPerLanguage, this.AddOnlyOneAudioTrackPerLanguage);
+ this.userSettingService.SetUserSetting(UserSettingConstants.UseClosedCaption, this.AddClosedCaptions);
+ this.userSettingService.SetUserSetting(UserSettingConstants.DubModeAudio, this.SelectedAddAudioMode);
+ this.userSettingService.SetUserSetting(UserSettingConstants.DubModeSubtitle, this.SelectedAddSubtitleMode);
+
+ /* System and Logging */
+ userSettingService.SetUserSetting(ASUserSettingConstants.ProcessPriority, this.SelectedPriority);
+ userSettingService.SetUserSetting(ASUserSettingConstants.PreventSleep, this.PreventSleep);
+ userSettingService.SetUserSetting(ASUserSettingConstants.Verbosity, this.SelectedVerbosity);
+ userSettingService.SetUserSetting(ASUserSettingConstants.SaveLogWithVideo, this.CopyLogToEncodeDirectory);
+ userSettingService.SetUserSetting(ASUserSettingConstants.SaveLogToCopyDirectory, this.CopyLogToSepcficedLocation);
+ userSettingService.SetUserSetting(ASUserSettingConstants.SaveLogCopyDirectory, this.LogDirectory);
+ userSettingService.SetUserSetting(UserSettingConstants.ClearOldLogs, this.ClearOldOlgs);
+
+ /* Advanced */
+ userSettingService.SetUserSetting(UserSettingConstants.MainWindowMinimize, this.MinimiseToTray);
+ userSettingService.SetUserSetting(UserSettingConstants.TrayIconAlerts, this.DisplayStatusMessagesTrayIcon);
+ userSettingService.SetUserSetting(UserSettingConstants.QueryEditorTab, this.EnableQueryEditor);
+ userSettingService.SetUserSetting(UserSettingConstants.PromptOnUnmatchingQueries, this.PromptOnDifferentQuery);
+ userSettingService.SetUserSetting(UserSettingConstants.PresetNotification, this.DisablePresetUpdateCheckNotification);
+ userSettingService.SetUserSetting(ASUserSettingConstants.ShowCLI, this.ShowCliWindow);
+ userSettingService.SetUserSetting(UserSettingConstants.PreviewScanCount, this.SelectedPreviewCount);
+ userSettingService.SetUserSetting(ASUserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty));
+
+ int value;
+ if (int.TryParse(this.MinLength.ToString(), out value))
+ {
+ this.userSettingService.SetUserSetting(ASUserSettingConstants.MinScanDuration, value);
+ }
+
+ userSettingService.SetUserSetting(ASUserSettingConstants.DisableLibDvdNav, this.DisableLibdvdNav);
+ }
}
}
\ No newline at end of file |