diff options
author | sr55 <[email protected]> | 2011-12-27 22:52:43 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-12-27 22:52:43 +0000 |
commit | 5b745b8f17f8acc6d3799eb3cb86e09c7ca99017 (patch) | |
tree | 5a97790d448b6ac3b85b46f1803df00c34a39820 /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | |
parent | 20fd52b888f111ac2d7670fa3c41e495661cdebd (diff) |
WinGui: (WPF) Initial work to hookup the log viewer + some additional helper classes ported over form the WinForms version.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4390 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 5a8ecd233..1e6034cf9 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -83,6 +83,11 @@ namespace HandBrakeWPF.ViewModels /// </summary>
private string sourceLabel;
+ public string sourcePath;
+ private string dvdDrivePath;
+ private string dvdDriveLabel;
+ private List<DriveInformation> drives;
+
/// <summary>
/// The Toolbar Status Label
/// </summary>
@@ -278,6 +283,43 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
+ /// Gets SourceName.
+ /// </summary>
+ public string SourceName
+ {
+ get
+ {
+ if (this.selectedSourceType == SourceType.DvdDrive)
+ {
+ return this.dvdDriveLabel;
+ }
+
+ if (selectedTitle != null && !string.IsNullOrEmpty(selectedTitle.SourceName))
+ {
+ return Path.GetFileName(selectedTitle.SourceName);
+ }
+
+ // We have a drive, selected as a folder.
+ if (this.sourcePath.EndsWith("\\"))
+ {
+ drives = GeneralUtilities.GetDrives();
+ foreach (DriveInformation item in drives)
+ {
+ if (item.RootDirectory.Contains(this.sourcePath))
+ {
+ return item.VolumeLabel;
+ }
+ }
+ }
+
+ if (Path.GetFileNameWithoutExtension(this.sourcePath) != "VIDEO_TS")
+ return Path.GetFileNameWithoutExtension(this.sourcePath);
+
+ return Path.GetFileNameWithoutExtension(Path.GetDirectoryName(this.sourcePath));
+ }
+ }
+
+ /// <summary>
/// Gets RangeMode.
/// </summary>
public IEnumerable<PointToPointMode> RangeMode
@@ -832,6 +874,7 @@ namespace HandBrakeWPF.ViewModels {
// TODO
// 1. Disable GUI.
+ this.sourcePath = filename;
this.scanService.Scan(filename, title, this.userSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount));
}
|