summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-12-26 17:02:32 +0000
committersr55 <[email protected]>2013-12-26 17:02:32 +0000
commit840cb1e3448867a3d56bafc980dce39189d4814f (patch)
tree2d96e373fa47eddcdce08283f0fffd19c3c1dd30 /win/CS/HandBrakeWPF/ViewModels
parent9c2f166bc71277e98ced2d39eb56aa88ff5452af (diff)
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
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs148
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs27
2 files changed, 37 insertions, 138 deletions
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
@@ -159,11 +159,6 @@ namespace HandBrakeWPF.ViewModels
private EncodeTask queueEditTask;
/// <summary>
- /// The Source Menu Backing Field
- /// </summary>
- private BindingList<SourceMenuItem> sourceMenu;
-
- /// <summary>
/// The last percentage complete value.
/// </summary>
private int lastEncodePercentage;
@@ -353,22 +348,6 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Gets or sets the source menu.
- /// </summary>
- public BindingList<SourceMenuItem> SourceMenu
- {
- get
- {
- return this.sourceMenu;
- }
- set
- {
- this.sourceMenu = value;
- this.NotifyOfPropertyChange(() => SourceMenu);
- }
- }
-
- /// <summary>
/// Gets or sets Presets.
/// </summary>
public IEnumerable<Preset> Presets { get; set; }
@@ -434,6 +413,11 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
+ /// Gets or sets the title specific scan.
+ /// </summary>
+ public int TitleSpecificScan { get; set; }
+
+ /// <summary>
/// Gets or sets the Source Label
/// This indicates the status of scans.
/// </summary>
@@ -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<SourceMenuItem>(this.GenerateSourceMenu());
- }
-
// Log Cleaning
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearOldLogs))
{
@@ -1249,7 +1230,7 @@ namespace HandBrakeWPF.ViewModels
ShowSourceSelection = false;
- this.StartScan(dialog.SelectedPath, 0);
+ this.StartScan(dialog.SelectedPath, this.TitleSpecificScan);
}
/// <summary>
@@ -1262,51 +1243,7 @@ namespace HandBrakeWPF.ViewModels
ShowSourceSelection = false;
- this.StartScan(dialog.FileName, 0);
- }
-
- /// <summary>
- /// Folder Scan
- /// </summary>
- 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<ITitleSpecificViewModel>();
- this.WindowManager.ShowDialog(titleSpecificView);
-
- if (titleSpecificView.SelectedTitle.HasValue)
- {
- this.StartScan(dialog.SelectedPath, titleSpecificView.SelectedTitle.Value);
- }
- }
-
- /// <summary>
- /// File Scan
- /// </summary>
- public void FileScanTitleSpecific()
- {
- OpenFileDialog dialog = new OpenFileDialog { Filter = "All files (*.*)|*.*" };
- dialog.ShowDialog();
-
- if (string.IsNullOrEmpty(dialog.FileName))
- {
- return;
- }
-
- ITitleSpecificViewModel titleSpecificView = IoC.Get<ITitleSpecificViewModel>();
- this.WindowManager.ShowDialog(titleSpecificView);
-
- if (titleSpecificView.SelectedTitle.HasValue)
- {
- this.StartScan(dialog.FileName, titleSpecificView.SelectedTitle.Value);
- }
+ this.StartScan(dialog.FileName, this.TitleSpecificScan);
}
/// <summary>
@@ -2103,71 +2040,6 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// The generate source menu.
- /// </summary>
- /// <returns>
- /// The System.Collections.Generic.IEnumerable`1[T -&gt; HandBrakeWPF.Model.SourceMenuItem].
- /// </returns>
- private IList<SourceMenuItem> GenerateSourceMenu()
- {
- List<SourceMenuItem> menuItems = new List<SourceMenuItem>();
-
- 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;
- }
-
- /// <summary>
/// Allows the main window to respond to setting changes.
/// </summary>
/// <param name="sender">
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
/// </summary>
private bool addForeignAudioScanTrack;
+ /// <summary>
+ /// The is cl scaling.
+ /// </summary>
+ 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<VideoScaler>(EnumHelper<VideoScaler>.GetEnumList().ToList());
}
}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether is cl scaling.
+ /// </summary>
+ public bool IsClScaling
+ {
+ get
+ {
+ return this.isClScaling;
+ }
+ set
+ {
+ if (value.Equals(this.isClScaling))
+ {
+ return;
+ }
+ this.isClScaling = value;
+ this.NotifyOfPropertyChange(() => this.IsClScaling);
+ }
+ }
+
#endregion
#endregion