summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-03-01 18:10:34 +0000
committersr55 <[email protected]>2015-03-01 18:10:34 +0000
commitc8e25b9e67daf7c6902428a442ac19bf4306d5c3 (patch)
treecfaf3560a29050b09fd8934ec6d3ca81abf14984 /win/CS/HandBrakeWPF
parent29c62be71227ae33e382199f323890ae3bfffa69 (diff)
WinGui: Dropping more legacy code and moving some more UI only code up to the UI level.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6960 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs1
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj2
-rw-r--r--win/CS/HandBrakeWPF/Helpers/AppStyleHelper.cs2
-rw-r--r--win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs1
-rw-r--r--win/CS/HandBrakeWPF/Model/DriveInformation.cs48
-rw-r--r--win/CS/HandBrakeWPF/Services/NotificationService.cs1
-rw-r--r--win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs53
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs4
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs1
11 files changed, 105 insertions, 15 deletions
diff --git a/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs b/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs
index 32a53277b..adc18ff2d 100644
--- a/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs
+++ b/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs
@@ -12,7 +12,6 @@ namespace HandBrakeWPF.Commands
using System;
using System.Windows.Input;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.EventArgs;
using HandBrake.ApplicationServices.Services.Scan.Interfaces;
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index e44fd25d7..166d6782a 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -146,6 +146,7 @@
<Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="Model\Audio\AudioBehaviourModes.cs" />
<Compile Include="Model\Audio\AudioBehaviours.cs" />
+ <Compile Include="Model\DriveInformation.cs" />
<Compile Include="Model\Picture\PresetPictureSettingsMode.cs" />
<Compile Include="Model\Subtitles\SubtitleBehaviourModes.cs" />
<Compile Include="Model\Subtitles\SubtitleBehaviours.cs" />
@@ -164,6 +165,7 @@
<Compile Include="Utilities\AppcastReader.cs" />
<Compile Include="Utilities\DelayedActionProcessor.cs" />
<Compile Include="Utilities\DPIAwareness.cs" />
+ <Compile Include="Utilities\DriveUtilities.cs" />
<Compile Include="Utilities\HandBrakeApp.cs" />
<Compile Include="Services\Presets\Factories\PlistFactory.cs" />
<Compile Include="Utilities\PList.cs" />
diff --git a/win/CS/HandBrakeWPF/Helpers/AppStyleHelper.cs b/win/CS/HandBrakeWPF/Helpers/AppStyleHelper.cs
index 556cf53b4..ece44cfec 100644
--- a/win/CS/HandBrakeWPF/Helpers/AppStyleHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/AppStyleHelper.cs
@@ -13,8 +13,6 @@ namespace HandBrakeWPF.Helpers
using Caliburn.Micro;
- using HandBrake.ApplicationServices.Services.Interfaces;
-
using HandBrakeWPF.Services.Interfaces;
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
index ceb8943b8..e73251b07 100644
--- a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
@@ -19,7 +19,6 @@ namespace HandBrakeWPF.Helpers
using System.Xml.Serialization;
using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
using HandBrakeWPF.Services.Interfaces;
diff --git a/win/CS/HandBrakeWPF/Model/DriveInformation.cs b/win/CS/HandBrakeWPF/Model/DriveInformation.cs
new file mode 100644
index 000000000..f7e966b5c
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Model/DriveInformation.cs
@@ -0,0 +1,48 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="DriveInformation.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Information about a DVD drive
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model
+{
+ /// <summary>
+ /// Information about a DVD drive
+ /// </summary>
+ public class DriveInformation
+ {
+ /// <summary>
+ /// Gets or sets A Unique ID That represemts this model.
+ /// </summary>
+ public int Id { get; set; }
+
+ /// <summary>
+ /// Gets or sets The Drive Volume Name
+ /// </summary>
+ public string VolumeLabel { get; set; }
+
+ /// <summary>
+ /// Gets or sets The Root Directory
+ /// </summary>
+ public string RootDirectory { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this is a BluRay Drive.
+ /// </summary>
+ public bool IsBluRay { get; set; }
+
+ /// <summary>
+ /// Returns "Drive" + Id (e.g Drive2)
+ /// </summary>
+ /// <returns>
+ /// A String that contrains "Drive" and it's ID
+ /// </returns>
+ public override string ToString()
+ {
+ return "Drive" + this.Id;
+ }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Services/NotificationService.cs b/win/CS/HandBrakeWPF/Services/NotificationService.cs
index 0f387fec3..d85a63d42 100644
--- a/win/CS/HandBrakeWPF/Services/NotificationService.cs
+++ b/win/CS/HandBrakeWPF/Services/NotificationService.cs
@@ -11,7 +11,6 @@ namespace HandBrakeWPF.Services
{
using HandBrake.ApplicationServices.Services.Encode.EventArgs;
using HandBrake.ApplicationServices.Services.Encode.Interfaces;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrakeWPF.Services.Interfaces;
diff --git a/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs b/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs
new file mode 100644
index 000000000..d07056ef8
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs
@@ -0,0 +1,53 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="DriveUtilities.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The drive utilities.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Utilities
+{
+ using System.Collections.Generic;
+ using System.IO;
+
+ using HandBrakeWPF.Model;
+
+ /// <summary>
+ /// The drive utilities.
+ /// </summary>
+ public class DriveUtilities
+ {
+ /// <summary>
+ /// Get a list of available DVD drives which are ready and contain DVD content.
+ /// </summary>
+ /// <returns>A List of Drives with their details</returns>
+ public static List<DriveInformation> GetDrives()
+ {
+ var drives = new List<DriveInformation>();
+ DriveInfo[] theCollectionOfDrives = DriveInfo.GetDrives();
+ int id = 0;
+ foreach (DriveInfo curDrive in theCollectionOfDrives)
+ {
+ if (curDrive.DriveType == DriveType.CDRom && curDrive.IsReady)
+ {
+ if (Directory.Exists(curDrive.RootDirectory + "VIDEO_TS") ||
+ Directory.Exists(curDrive.RootDirectory + "BDMV"))
+ {
+ drives.Add(
+ new DriveInformation
+ {
+ Id = id,
+ VolumeLabel = curDrive.VolumeLabel,
+ RootDirectory = curDrive.RootDirectory.ToString()
+ });
+ id++;
+ }
+ }
+ }
+
+ return drives;
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
index 65464f3f9..189472949 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
@@ -12,10 +12,7 @@ namespace HandBrakeWPF.ViewModels
using System.Collections.Generic;
using System.Windows;
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Encode.Model;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.Model;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
@@ -23,7 +20,6 @@ namespace HandBrakeWPF.ViewModels
using HandBrakeWPF.Model.Audio;
using HandBrakeWPF.Model.Subtitles;
using HandBrakeWPF.Properties;
- using HandBrakeWPF.Services;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Presets;
using HandBrakeWPF.Services.Presets.Interfaces;
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 08662882c..9c46008f8 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -26,7 +26,6 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.EventArgs;
using HandBrake.ApplicationServices.Services.Scan.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.Model;
@@ -499,7 +498,7 @@ namespace HandBrakeWPF.ViewModels
// Check if we have a Folder, if so, check if it's a DVD / Bluray drive and get the label.
if (ScannedSource.ScanPath.EndsWith("\\"))
{
- foreach (DriveInformation item in GeneralUtilities.GetDrives())
+ foreach (DriveInformation item in DriveUtilities.GetDrives())
{
if (item.RootDirectory.Contains(this.ScannedSource.ScanPath.Replace("\\\\", "\\")))
{
@@ -1000,7 +999,7 @@ namespace HandBrakeWPF.ViewModels
if (this.showSourceSelection)
{
this.Drives.Clear();
- foreach (SourceMenuItem menuItem in from item in GeneralUtilities.GetDrives()
+ foreach (SourceMenuItem menuItem in from item in DriveUtilities.GetDrives()
let driveInformation = item
select new SourceMenuItem
{
diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
index 6d4fcc84a..c85c707bd 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
@@ -13,8 +13,6 @@ namespace HandBrakeWPF.ViewModels
using Caliburn.Micro;
- using HandBrake.ApplicationServices.Services.Interfaces;
-
using HandBrakeWPF.Model;
using HandBrakeWPF.Properties;
using HandBrakeWPF.Services.Interfaces;
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
index ff1b1a0c9..012a4c15b 100644
--- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
@@ -24,7 +24,6 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.Model;
using HandBrake.ApplicationServices.Interop.Model.Encoding;