From 840cb1e3448867a3d56bafc980dce39189d4814f Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 26 Dec 2013 17:02:32 +0000 Subject: WinGui: Some more minor tweaks to the new source menu and tidyup on the options screen. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5941 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 148 ++------------------- win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 27 ++++ 2 files changed, 37 insertions(+), 138 deletions(-) (limited to 'win/CS/HandBrakeWPF/ViewModels') diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 632de39ba..355aad73d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -158,11 +158,6 @@ namespace HandBrakeWPF.ViewModels /// private EncodeTask queueEditTask; - /// - /// The Source Menu Backing Field - /// - private BindingList sourceMenu; - /// /// The last percentage complete value. /// @@ -352,22 +347,6 @@ namespace HandBrakeWPF.ViewModels } } - /// - /// Gets or sets the source menu. - /// - public BindingList SourceMenu - { - get - { - return this.sourceMenu; - } - set - { - this.sourceMenu = value; - this.NotifyOfPropertyChange(() => SourceMenu); - } - } - /// /// Gets or sets Presets. /// @@ -433,6 +412,11 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets the title specific scan. + /// + public int TitleSpecificScan { get; set; } + /// /// Gets or sets the Source Label /// This indicates the status of scans. @@ -956,6 +940,9 @@ namespace HandBrakeWPF.ViewModels { this.Drives.Add(menuItem); } + + this.TitleSpecificScan = 0; + this.NotifyOfPropertyChange(() => this.TitleSpecificScan); } } } @@ -1014,12 +1001,6 @@ namespace HandBrakeWPF.ViewModels this.SelectedPreset = this.presetService.DefaultPreset; - // Populate the Source menu with drives. - if (!AppArguments.IsInstantHandBrake) - { - this.SourceMenu = new BindingList(this.GenerateSourceMenu()); - } - // Log Cleaning if (userSettingService.GetUserSetting(UserSettingConstants.ClearOldLogs)) { @@ -1249,7 +1230,7 @@ namespace HandBrakeWPF.ViewModels ShowSourceSelection = false; - this.StartScan(dialog.SelectedPath, 0); + this.StartScan(dialog.SelectedPath, this.TitleSpecificScan); } /// @@ -1262,51 +1243,7 @@ namespace HandBrakeWPF.ViewModels ShowSourceSelection = false; - this.StartScan(dialog.FileName, 0); - } - - /// - /// Folder Scan - /// - public void FolderScanTitleSpecific() - { - VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true }; - dialog.ShowDialog(); - - if (string.IsNullOrEmpty(dialog.SelectedPath)) - { - return; - } - - ITitleSpecificViewModel titleSpecificView = IoC.Get(); - this.WindowManager.ShowDialog(titleSpecificView); - - if (titleSpecificView.SelectedTitle.HasValue) - { - this.StartScan(dialog.SelectedPath, titleSpecificView.SelectedTitle.Value); - } - } - - /// - /// File Scan - /// - public void FileScanTitleSpecific() - { - OpenFileDialog dialog = new OpenFileDialog { Filter = "All files (*.*)|*.*" }; - dialog.ShowDialog(); - - if (string.IsNullOrEmpty(dialog.FileName)) - { - return; - } - - ITitleSpecificViewModel titleSpecificView = IoC.Get(); - this.WindowManager.ShowDialog(titleSpecificView); - - if (titleSpecificView.SelectedTitle.HasValue) - { - this.StartScan(dialog.FileName, titleSpecificView.SelectedTitle.Value); - } + this.StartScan(dialog.FileName, this.TitleSpecificScan); } /// @@ -2102,71 +2039,6 @@ namespace HandBrakeWPF.ViewModels } } - /// - /// The generate source menu. - /// - /// - /// The System.Collections.Generic.IEnumerable`1[T -> HandBrakeWPF.Model.SourceMenuItem]. - /// - private IList GenerateSourceMenu() - { - List menuItems = new List(); - - SourceMenuItem folderScan = new SourceMenuItem - { - IsOpenFolder = true, - Text = "Open Folder", - Command = new SourceMenuCommand(this.FolderScan), - IsDrive = false, - InputGestureText = "Ctrl + R" - }; - SourceMenuItem fileScan = new SourceMenuItem - { - IsOpenFolder = false, - Text = "Open File", - Command = new SourceMenuCommand(this.FileScan), - IsDrive = false, - InputGestureText = "Ctrl + F" - }; - - SourceMenuItem titleSpecific = new SourceMenuItem { Text = "Title Specific Scan" }; - SourceMenuItem folderScanTitle = new SourceMenuItem - { - IsOpenFolder = true, - Text = "Open Folder", - Command = new SourceMenuCommand(this.FolderScanTitleSpecific), - IsDrive = false - }; - SourceMenuItem fileScanTitle = new SourceMenuItem - { - IsOpenFolder = false, - Text = "Open File", - Command = new SourceMenuCommand(this.FileScanTitleSpecific), - IsDrive = false - }; - titleSpecific.Children.Add(folderScanTitle); - titleSpecific.Children.Add(fileScanTitle); - - menuItems.Add(folderScan); - menuItems.Add(fileScan); - menuItems.Add(titleSpecific); - - // Drives - menuItems.AddRange( - from item in GeneralUtilities.GetDrives() - let driveInformation = item - select - new SourceMenuItem - { - Text = string.Format("{0} ({1})", item.RootDirectory, item.VolumeLabel), - Command = new SourceMenuCommand(() => this.ProcessDrive(driveInformation)), - Tag = item, - IsDrive = true - }); - - return menuItems; - } - /// /// Allows the main window to respond to setting changes. /// diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index e0fdee4e2..7e717c20e 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -379,6 +379,11 @@ namespace HandBrakeWPF.ViewModels /// private bool addForeignAudioScanTrack; + /// + /// The is cl scaling. + /// + private bool isClScaling; + #endregion #region Constructors and Destructors @@ -1485,6 +1490,7 @@ namespace HandBrakeWPF.ViewModels set { this.selectedScalingMode = value; + this.IsClScaling = value == VideoScaler.BicubicCl; } } @@ -1509,6 +1515,27 @@ namespace HandBrakeWPF.ViewModels return new BindingList(EnumHelper.GetEnumList().ToList()); } } + + /// + /// Gets or sets a value indicating whether is cl scaling. + /// + public bool IsClScaling + { + get + { + return this.isClScaling; + } + set + { + if (value.Equals(this.isClScaling)) + { + return; + } + this.isClScaling = value; + this.NotifyOfPropertyChange(() => this.IsClScaling); + } + } + #endregion #endregion -- cgit v1.2.3