summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs9
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs26
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs19
3 files changed, 24 insertions, 30 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index fd465d480..bbcd093c5 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -205,10 +205,15 @@ namespace HandBrakeWPF.ViewModels
/// </param>
/// <param name="notificationService">
/// The notification Service.
- /// *** Leave in Constructor. *** TODO find out why?
+ /// *** Leave in Constructor. ***
+ /// </param>
+ /// <param name="whenDoneService">
+ /// The when Done Service.
+ /// *** Leave in Constructor. ***
/// </param>
public MainViewModel(IUserSettingService userSettingService, IScanServiceWrapper scanService, IEncodeServiceWrapper encodeService, IPresetService presetService,
- IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, IDriveDetectService driveDetectService, INotificationService notificationService)
+ IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, IDriveDetectService driveDetectService, INotificationService notificationService,
+ IPrePostActionService whenDoneService)
{
this.scanService = scanService;
this.encodeService = encodeService;
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index bde7bc38c..4b61c4192 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -19,6 +19,8 @@ namespace HandBrakeWPF.ViewModels
using System.Linq;
using System.Windows;
+ using Caliburn.Micro;
+
using HandBrake.ApplicationServices;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
@@ -1482,15 +1484,15 @@ namespace HandBrakeWPF.ViewModels
this.whenDoneOptions.Add("Hibernate");
this.whenDoneOptions.Add("Lock System");
this.whenDoneOptions.Add("Log off");
- // this.whenDoneOptions.Add("Quit HandBrake");
+ this.whenDoneOptions.Add("Quit HandBrake");
this.WhenDone = userSettingService.GetUserSetting<string>("WhenCompleteAction");
this.GrowlAfterEncode = userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlEncode);
this.GrowlAfterQueue = userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlQueue);
- 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;
+ this.SendFileAfterEncode = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.SendFile);
+ this.SendFileTo = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo)) ?? string.Empty;
+ this.SendFileToPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo) ?? string.Empty;
+ this.Arguments = this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileToArgs) ?? string.Empty;
// #############################
// Output Settings
@@ -1597,7 +1599,7 @@ namespace HandBrakeWPF.ViewModels
this.priorityLevelOptions.Add("Low");
this.SelectedPriority = userSettingService.GetUserSetting<string>(ASUserSettingConstants.ProcessPriority);
- this.PreventSleep = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.PreventSleep);
+ this.PreventSleep = userSettingService.GetUserSetting<bool>(UserSettingConstants.PreventSleep);
// Log Verbosity Level
this.logVerbosityOptions.Clear();
@@ -1820,12 +1822,12 @@ namespace HandBrakeWPF.ViewModels
/* General */
this.userSettingService.SetUserSetting(UserSettingConstants.UpdateStatus, this.CheckForUpdates);
this.userSettingService.SetUserSetting(UserSettingConstants.DaysBetweenUpdateCheck, this.CheckForUpdatesFrequency);
- this.userSettingService.SetUserSetting(ASUserSettingConstants.WhenCompleteAction, this.WhenDone);
+ this.userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, this.WhenDone);
this.userSettingService.SetUserSetting(UserSettingConstants.GrowlQueue, this.GrowlAfterQueue);
this.userSettingService.SetUserSetting(UserSettingConstants.GrowlEncode, this.GrowlAfterEncode);
- this.userSettingService.SetUserSetting(ASUserSettingConstants.SendFileTo, this.SendFileToPath);
- this.userSettingService.SetUserSetting(ASUserSettingConstants.SendFile, this.SendFileAfterEncode);
- this.userSettingService.SetUserSetting(ASUserSettingConstants.SendFileToArgs, this.Arguments);
+ this.userSettingService.SetUserSetting(UserSettingConstants.SendFileTo, this.SendFileToPath);
+ this.userSettingService.SetUserSetting(UserSettingConstants.SendFile, this.SendFileAfterEncode);
+ this.userSettingService.SetUserSetting(UserSettingConstants.SendFileToArgs, this.Arguments);
/* Output Files */
this.userSettingService.SetUserSetting(UserSettingConstants.AutoNaming, this.AutomaticallyNameFiles);
@@ -1852,7 +1854,7 @@ namespace HandBrakeWPF.ViewModels
/* System and Logging */
userSettingService.SetUserSetting(ASUserSettingConstants.ProcessPriority, this.SelectedPriority);
- userSettingService.SetUserSetting(ASUserSettingConstants.PreventSleep, this.PreventSleep);
+ userSettingService.SetUserSetting(UserSettingConstants.PreventSleep, this.PreventSleep);
userSettingService.SetUserSetting(ASUserSettingConstants.Verbosity, this.SelectedVerbosity);
userSettingService.SetUserSetting(ASUserSettingConstants.SaveLogWithVideo, this.CopyLogToEncodeDirectory);
userSettingService.SetUserSetting(ASUserSettingConstants.SaveLogToCopyDirectory, this.CopyLogToSepcficedLocation);
@@ -1935,7 +1937,7 @@ namespace HandBrakeWPF.ViewModels
this.UpdateMessage = info.WasSuccessful ? "Update Downloaded" : "Update Failed. You can try downloading the update from http://handbrake.fr";
Process.Start(Path.Combine(Path.GetTempPath(), "handbrake-setup.exe"));
- Application.Current.Shutdown();
+ Execute.OnUIThread(() => Application.Current.Shutdown());
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index 3b5bf33e8..bf7d46b3d 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -10,13 +10,11 @@
namespace HandBrakeWPF.ViewModels
{
using System;
- using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows;
using Caliburn.Micro;
- using HandBrake.ApplicationServices;
using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Interfaces;
@@ -31,13 +29,6 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public class QueueViewModel : ViewModelBase, IQueueViewModel
{
- /*
-
- * TODO FIX THE DRAP/DROP ADORNER!
- */
-
-
-
#region Constants and Fields
/// <summary>
@@ -82,9 +73,6 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Initializes a new instance of the <see cref="QueueViewModel"/> class.
/// </summary>
- /// <param name="windowManager">
- /// The window manager.
- /// </param>
/// <param name="userSettingService">
/// The user Setting Service.
/// </param>
@@ -94,7 +82,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="errorService">
/// The Error Service
/// </param>
- public QueueViewModel(IWindowManager windowManager, IUserSettingService userSettingService, IQueueProcessor queueProcessor, IErrorService errorService)
+ public QueueViewModel(IUserSettingService userSettingService, IQueueProcessor queueProcessor, IErrorService errorService)
{
this.userSettingService = userSettingService;
this.queueProcessor = queueProcessor;
@@ -199,7 +187,7 @@ namespace HandBrakeWPF.ViewModels
public void WhenDone(string action)
{
this.WhenDoneAction = action;
- this.userSettingService.SetUserSetting(ASUserSettingConstants.WhenCompleteAction, action);
+ this.userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, action);
}
/// <summary>
@@ -374,7 +362,7 @@ namespace HandBrakeWPF.ViewModels
{
this.Load();
- this.WhenDoneAction = this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.WhenCompleteAction);
+ this.WhenDoneAction = this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction);
this.queueProcessor.JobProcessingStarted += this.queueProcessor_JobProcessingStarted;
this.queueProcessor.QueueCompleted += this.queueProcessor_QueueCompleted;
@@ -429,7 +417,6 @@ namespace HandBrakeWPF.ViewModels
e.EstimatedTimeLeft,
e.ElapsedTime);
}
-
});
}