/// </summary>\r
public const string Verbosity = "Verbosity";\r
\r
- /// <summary>\r
- /// When Complete Action\r
- /// </summary>\r
- public const string WhenCompleteAction = "WhenCompleteAction";\r
-\r
/// <summary>\r
/// Process Priority\r
/// </summary>\r
public const string ProcessPriority = "ProcessPriority";\r
\r
- /// <summary>\r
- /// Prevent Sleep\r
- /// </summary>\r
- public const string PreventSleep = "PreventSleep";\r
-\r
/// <summary>\r
/// Save Log Directory\r
/// </summary>\r
/// </summary>\r
public const string DisableLibDvdNav = "DisableLibDvdNav";\r
\r
- /// <summary>\r
- /// Send file enabled.\r
- /// </summary>\r
- public const string SendFile = "SendFile";\r
-\r
- /// <summary>\r
- /// Send file to application path\r
- /// </summary>\r
- public const string SendFileTo = "SendFileTo";\r
-\r
- /// <summary>\r
- /// Send file to arguments\r
- /// </summary>\r
- public const string SendFileToArgs = "SendFileToArgs";\r
-\r
/// <summary>\r
/// Min Title Scan Duration\r
/// </summary>\r
using System;\r
using System.Runtime.Serialization;\r
\r
+ using HandBrake.ApplicationServices.Model;\r
+\r
/// <summary>\r
/// Encode Progress Event Args\r
/// </summary>\r
/// <param name="errorInformation">\r
/// The error information.\r
/// </param>\r
- public EncodeCompletedEventArgs(bool sucessful, Exception exception, string errorInformation)\r
+ /// <param name="filename">\r
+ /// The filename.\r
+ /// </param>\r
+ public EncodeCompletedEventArgs(bool sucessful, Exception exception, string errorInformation, string filename)\r
{\r
this.Successful = sucessful;\r
this.Exception = exception;\r
this.ErrorInformation = errorInformation;\r
+ this.FileName = filename;\r
}\r
\r
+ /// <summary>\r
+ /// Gets or sets the file name.\r
+ /// </summary>\r
+ [DataMember]\r
+ public string FileName { get; set; }\r
+\r
/// <summary>\r
/// Gets or sets a value indicating whether Successful.\r
/// </summary>\r
using System.IO;\r
using System.Windows.Forms;\r
\r
- using Caliburn.Micro;\r
-\r
using HandBrake.ApplicationServices.EventArgs;\r
+ using HandBrake.ApplicationServices.Exceptions;\r
using HandBrake.ApplicationServices.Model;\r
using HandBrake.ApplicationServices.Services.Base;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
{\r
if (this.IsEncoding)\r
{\r
- throw new Exception("HandBrake is already encodeing.");\r
+ throw new GeneralApplicationException("HandBrake is already encodeing.", "Please try again in a minute", null);\r
}\r
\r
this.IsEncoding = true;\r
-\r
this.currentTask = encodeQueueTask;\r
\r
if (enableLogging)\r
}\r
}\r
\r
- if (this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.PreventSleep))\r
- {\r
- Win32.PreventSleep();\r
- }\r
-\r
// Make sure the path exists, attempt to create it if it doesn't\r
this.VerifyEncodeDestinationPath(currentTask);\r
\r
catch (Exception exc)\r
{\r
encodeQueueTask.Status = QueueItemStatus.Error;\r
+ this.IsEncoding = false;\r
this.InvokeEncodeCompleted(\r
new EncodeCompletedEventArgs(\r
- false, null, "An Error occured when trying to encode this source. "));\r
+ false, exc, "An Error occured when trying to encode this source. ", this.currentTask.Task.Destination));\r
throw;\r
}\r
}\r
// This exception doesn't warrent user interaction, but it should be logged (TODO)\r
}\r
\r
- Execute.OnUIThread(() =>\r
- {\r
- if (this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.PreventSleep))\r
- {\r
- Win32.AllowSleep();\r
- }\r
- });\r
-\r
this.currentTask.Status = QueueItemStatus.Completed;\r
this.IsEncoding = false;\r
- this.InvokeEncodeCompleted(new EncodeCompletedEventArgs(true, null, string.Empty));\r
+ this.InvokeEncodeCompleted(new EncodeCompletedEventArgs(true, null, string.Empty, this.currentTask.Task.Destination));\r
}\r
\r
/// <summary>\r
{\r
using System;\r
using System.Diagnostics;\r
- using System.Globalization;\r
\r
using HandBrake.ApplicationServices.Model;\r
using HandBrake.ApplicationServices.Services.Base;\r
/// </summary>\r
private bool loggingEnabled;\r
\r
+ /// <summary>\r
+ /// The Current Task\r
+ /// </summary>\r
+ private QueueTask currentTask;\r
+\r
#endregion\r
\r
/// <summary>\r
{\r
this.startTime = DateTime.Now;\r
this.loggingEnabled = enableLogging;\r
+ this.currentTask = job;\r
\r
try\r
{\r
}\r
}\r
\r
- // Prvent the system from sleeping if the user asks\r
- if (this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.PreventSleep) )\r
- {\r
- Win32.PreventSleep();\r
- }\r
-\r
// Verify the Destination Path Exists, and if not, create it.\r
this.VerifyEncodeDestinationPath(job);\r
\r
}\r
catch (Exception exc)\r
{\r
- this.InvokeEncodeCompleted(new EncodeCompletedEventArgs(false, exc, "An Error has occured."));\r
+ this.InvokeEncodeCompleted(new EncodeCompletedEventArgs(false, exc, "An Error has occured.", this.currentTask.Task.Destination));\r
}\r
}\r
\r
\r
this.InvokeEncodeCompleted(\r
e.Error\r
- ? new EncodeCompletedEventArgs(false, null, string.Empty)\r
- : new EncodeCompletedEventArgs(true, null, string.Empty));\r
-\r
- if (this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.PreventSleep))\r
- {\r
- Win32.AllowSleep();\r
- }\r
+ ? new EncodeCompletedEventArgs(false, null, string.Empty, this.currentTask.Task.Destination)\r
+ : new EncodeCompletedEventArgs(true, null, string.Empty, this.currentTask.Task.Destination));\r
\r
this.ShutdownFileWriter();\r
}\r
using System;\r
using System.Collections.Generic;\r
using System.ComponentModel;\r
- using System.Diagnostics;\r
using System.IO;\r
using System.Linq;\r
- using System.Windows.Forms;\r
using System.Xml.Serialization;\r
\r
using Caliburn.Micro;\r
// Handling Log Data \r
this.EncodeService.ProcessLogs(this.LastProcessedJob.Task.Destination);\r
\r
- // Post-Processing\r
- if (e.Successful)\r
- {\r
- this.SendToApplication(this.LastProcessedJob.Task.Destination);\r
- }\r
-\r
// Move onto the next job.\r
if (this.IsProcessing)\r
{\r
}\r
}\r
\r
- /// <summary>\r
- /// Perform an action after an encode. e.g a shutdown, standby, restart etc.\r
- /// </summary>\r
- private void Finish()\r
- {\r
- // Do something whent he encode ends.\r
- switch (this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.WhenCompleteAction))\r
- {\r
- case "Shutdown":\r
- Process.Start("Shutdown", "-s -t 60");\r
- break;\r
- case "Log off":\r
- Win32.ExitWindowsEx(0, 0);\r
- break;\r
- case "Suspend":\r
- Application.SetSuspendState(PowerState.Suspend, true, true);\r
- break;\r
- case "Hibernate":\r
- Application.SetSuspendState(PowerState.Hibernate, true, true);\r
- break;\r
- case "Lock System":\r
- Win32.LockWorkStation();\r
- break;\r
- case "Quit HandBrake":\r
- Execute.OnUIThread(Application.Exit);\r
- break;\r
- }\r
- }\r
-\r
/// <summary>\r
/// Invoke the JobProcessingStarted event\r
/// </summary>\r
\r
// Fire the event to tell connected services.\r
this.InvokeQueueCompleted(EventArgs.Empty);\r
-\r
- // Run the After encode completeion work\r
- this.Finish();\r
- }\r
- }\r
-\r
- /// <summary>\r
- /// Send a file to a 3rd party application after encoding has completed.\r
- /// </summary>\r
- /// <param name="file">\r
- /// The file path\r
- /// </param>\r
- private void SendToApplication(string file)\r
- {\r
- if (this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.SendFile) &&\r
- !string.IsNullOrEmpty(this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileTo)))\r
- {\r
- string args = string.Format(\r
- "{0} \"{1}\"", \r
- this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileToArgs), \r
- file);\r
- var vlc =\r
- new ProcessStartInfo(\r
- this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileTo), args);\r
- Process.Start(vlc);\r
}\r
}\r
\r
namespace HandBrake.Server\r
{\r
- using System;\r
using System.Linq;\r
\r
using HandBrake.ApplicationServices.Services;\r
{\r
if (args.Count() != 1)\r
{\r
- //Console.WriteLine("Invalid Arguments");\r
- //Console.ReadLine();\r
-\r
IServerService server = new ServerService();\r
server.Start("8001");\r
}\r
<Compile Include="Model\DownloadStatus.cs" />\r
<Compile Include="Services\Interfaces\INotificationService.cs" />\r
<Compile Include="Services\Interfaces\IUpdateService.cs" />\r
+ <Compile Include="Services\Interfaces\IPrePostActionService.cs" />\r
<Compile Include="Services\NotificationService.cs" />\r
<Compile Include="Services\ScanServiceWrapper.cs" />\r
<Compile Include="Services\UpdateService.cs" />\r
+ <Compile Include="Services\PrePostActionService.cs" />\r
<Compile Include="ViewModels\AdvancedViewModel.cs" />\r
<Compile Include="ViewModels\EncoderOptionsViewModel.cs" />\r
<Compile Include="ViewModels\Interfaces\IEncoderOptionsViewModel.cs" />\r
-namespace HandBrakeWPF.Services.Interfaces\r
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="INotificationService.cs" company="HandBrake Project (http://handbrake.fr)">\r
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+// Defines the INotificationService type.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Services.Interfaces\r
{\r
+ /// <summary>\r
+ /// The NotificationService interface.\r
+ /// </summary>\r
public interface INotificationService\r
{\r
}\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="IPrePostActionService.cs" company="HandBrake Project (http://handbrake.fr)">\r
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+// Defines the IPrePostActionService type.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Services.Interfaces\r
+{\r
+ /// <summary>\r
+ /// The WhenDoneService interface.\r
+ /// </summary>\r
+ public interface IPrePostActionService\r
+ {\r
+ }\r
+}\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="WhenDoneService.cs" company="HandBrake Project (http://handbrake.fr)">\r
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+// Defines the WhenDoneService type.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Services\r
+{\r
+ using System.Diagnostics;\r
+ using System.Windows.Forms;\r
+\r
+ using Caliburn.Micro;\r
+\r
+ using HandBrake.ApplicationServices.Services.Interfaces;\r
+ using HandBrake.ApplicationServices.Utilities;\r
+\r
+ using HandBrakeWPF.Services.Interfaces;\r
+\r
+ using Application = System.Windows.Application;\r
+\r
+ /// <summary>\r
+ /// The when done service.\r
+ /// </summary>\r
+ public class PrePostActionService : IPrePostActionService\r
+ {\r
+ /// <summary>\r
+ /// The queue processor.\r
+ /// </summary>\r
+ private readonly IQueueProcessor queueProcessor;\r
+\r
+ /// <summary>\r
+ /// The user setting service.\r
+ /// </summary>\r
+ private readonly IUserSettingService userSettingService;\r
+\r
+ /// <summary>\r
+ /// Initializes a new instance of the <see cref="PrePostActionService"/> class.\r
+ /// </summary>\r
+ /// <param name="queueProcessor">\r
+ /// The queue processor.\r
+ /// </param>\r
+ /// <param name="userSettingService">\r
+ /// The user Setting Service.\r
+ /// </param>\r
+ public PrePostActionService(IQueueProcessor queueProcessor, IUserSettingService userSettingService)\r
+ {\r
+ this.queueProcessor = queueProcessor;\r
+ this.userSettingService = userSettingService;\r
+\r
+ this.queueProcessor.QueueCompleted += QueueProcessorQueueCompleted;\r
+ this.queueProcessor.EncodeService.EncodeCompleted += EncodeService_EncodeCompleted;\r
+ this.queueProcessor.EncodeService.EncodeStarted += EncodeService_EncodeStarted;\r
+ }\r
+\r
+ /// <summary>\r
+ /// The encode service_ encode started.\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void EncodeService_EncodeStarted(object sender, System.EventArgs e)\r
+ {\r
+ if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PreventSleep))\r
+ {\r
+ Win32.PreventSleep();\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// The encode service_ encode completed.\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The EncodeCompletedEventArgs.\r
+ /// </param>\r
+ private void EncodeService_EncodeCompleted(object sender, HandBrake.ApplicationServices.EventArgs.EncodeCompletedEventArgs e)\r
+ {\r
+ // Send the file to the users requested applicaiton\r
+ if (e.Successful)\r
+ {\r
+ this.SendToApplication(e.FileName);\r
+ }\r
+\r
+ // Allow the system to sleep again.\r
+ Execute.OnUIThread(() =>\r
+ {\r
+ if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PreventSleep))\r
+ {\r
+ Win32.AllowSleep();\r
+ }\r
+ });\r
+ }\r
+\r
+ /// <summary>\r
+ /// The queue processor queue completed event handler.\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void QueueProcessorQueueCompleted(object sender, System.EventArgs e)\r
+ {\r
+ // Do something whent he encode ends.\r
+ switch (this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction))\r
+ {\r
+ case "Shutdown":\r
+ Process.Start("Shutdown", "-s -t 60");\r
+ break;\r
+ case "Log off":\r
+ Win32.ExitWindowsEx(0, 0);\r
+ break;\r
+ case "Suspend":\r
+ System.Windows.Forms.Application.SetSuspendState(PowerState.Suspend, true, true);\r
+ break;\r
+ case "Hibernate":\r
+ System.Windows.Forms.Application.SetSuspendState(PowerState.Hibernate, true, true);\r
+ break;\r
+ case "Lock System":\r
+ Win32.LockWorkStation();\r
+ break;\r
+ case "Quit HandBrake":\r
+ Execute.OnUIThread(() => Application.Current.Shutdown());\r
+ break;\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Send a file to a 3rd party application after encoding has completed.\r
+ /// </summary>\r
+ /// <param name="file">\r
+ /// The file path\r
+ /// </param>\r
+ private void SendToApplication(string file)\r
+ {\r
+ if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.SendFile) &&\r
+ !string.IsNullOrEmpty(this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo)))\r
+ {\r
+ string args = string.Format(\r
+ "{0} \"{1}\"",\r
+ this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileToArgs),\r
+ file);\r
+ var vlc =\r
+ new ProcessStartInfo(\r
+ this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo), args);\r
+ Process.Start(vlc);\r
+ }\r
+ }\r
+ }\r
+}\r
this.windsorContainer.Register(Component.For<IScanServiceWrapper>().ImplementedBy<ScanServiceWrapper>().LifeStyle.Is(LifestyleType.Singleton));\r
this.windsorContainer.Register(Component.For<IEncodeServiceWrapper>().ImplementedBy<EncodeServiceWrapper>().LifeStyle.Is(LifestyleType.Singleton));\r
this.windsorContainer.Register(Component.For<INotificationService>().ImplementedBy<NotificationService>().LifeStyle.Is(LifestyleType.Singleton));\r
+ this.windsorContainer.Register(Component.For<IPrePostActionService>().ImplementedBy<PrePostActionService>().LifeStyle.Is(LifestyleType.Singleton));\r
\r
// Commands\r
this.windsorContainer.Register(Component.For<IAdvancedEncoderOptionsCommand>().ImplementedBy<AdvancedEncoderOptionsCommand>().LifeStyle.Is(LifestyleType.Singleton));\r
/// Disable LibHb Features\r
/// </summary>\r
public const string DisableLibHbFeatures = "DisableLibHbFeatures";\r
+ \r
+ /// <summary>\r
+ /// When Complete Action\r
+ /// </summary>\r
+ public const string WhenCompleteAction = "WhenCompleteAction";\r
+\r
+ /// <summary>\r
+ /// Send file enabled.\r
+ /// </summary>\r
+ public const string SendFile = "SendFile";\r
+\r
+ /// <summary>\r
+ /// Send file to application path\r
+ /// </summary>\r
+ public const string SendFileTo = "SendFileTo";\r
+\r
+ /// <summary>\r
+ /// Send file to arguments\r
+ /// </summary>\r
+ public const string SendFileToArgs = "SendFileToArgs";\r
+\r
+ /// <summary>\r
+ /// Prevent Sleep\r
+ /// </summary>\r
+ public const string PreventSleep = "PreventSleep";\r
\r
#endregion\r
}\r
/// </param>\r
/// <param name="notificationService">\r
/// The notification Service.\r
- /// *** Leave in Constructor. *** TODO find out why?\r
+ /// *** Leave in Constructor. *** \r
+ /// </param>\r
+ /// <param name="whenDoneService">\r
+ /// The when Done Service.\r
+ /// *** Leave in Constructor. *** \r
/// </param>\r
public MainViewModel(IUserSettingService userSettingService, IScanServiceWrapper scanService, IEncodeServiceWrapper encodeService, IPresetService presetService,\r
- IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, IDriveDetectService driveDetectService, INotificationService notificationService)\r
+ IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, IDriveDetectService driveDetectService, INotificationService notificationService,\r
+ IPrePostActionService whenDoneService)\r
{\r
this.scanService = scanService;\r
this.encodeService = encodeService;\r
using System.Linq;\r
using System.Windows;\r
\r
+ using Caliburn.Micro;\r
+\r
using HandBrake.ApplicationServices;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
using HandBrake.ApplicationServices.Utilities;\r
this.whenDoneOptions.Add("Hibernate");\r
this.whenDoneOptions.Add("Lock System");\r
this.whenDoneOptions.Add("Log off");\r
- // this.whenDoneOptions.Add("Quit HandBrake");\r
+ this.whenDoneOptions.Add("Quit HandBrake");\r
this.WhenDone = userSettingService.GetUserSetting<string>("WhenCompleteAction");\r
\r
this.GrowlAfterEncode = userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlEncode);\r
this.GrowlAfterQueue = userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlQueue);\r
- this.SendFileAfterEncode = this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.SendFile);\r
- this.SendFileTo = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileTo)) ?? string.Empty;\r
- this.SendFileToPath = this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileTo) ?? string.Empty;\r
- this.Arguments = this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SendFileToArgs) ?? string.Empty;\r
+ this.SendFileAfterEncode = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.SendFile);\r
+ this.SendFileTo = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo)) ?? string.Empty;\r
+ this.SendFileToPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo) ?? string.Empty;\r
+ this.Arguments = this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileToArgs) ?? string.Empty;\r
\r
// #############################\r
// Output Settings\r
this.priorityLevelOptions.Add("Low");\r
this.SelectedPriority = userSettingService.GetUserSetting<string>(ASUserSettingConstants.ProcessPriority);\r
\r
- this.PreventSleep = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.PreventSleep);\r
+ this.PreventSleep = userSettingService.GetUserSetting<bool>(UserSettingConstants.PreventSleep);\r
\r
// Log Verbosity Level\r
this.logVerbosityOptions.Clear();\r
/* General */\r
this.userSettingService.SetUserSetting(UserSettingConstants.UpdateStatus, this.CheckForUpdates);\r
this.userSettingService.SetUserSetting(UserSettingConstants.DaysBetweenUpdateCheck, this.CheckForUpdatesFrequency);\r
- this.userSettingService.SetUserSetting(ASUserSettingConstants.WhenCompleteAction, this.WhenDone);\r
+ this.userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, this.WhenDone);\r
this.userSettingService.SetUserSetting(UserSettingConstants.GrowlQueue, this.GrowlAfterQueue);\r
this.userSettingService.SetUserSetting(UserSettingConstants.GrowlEncode, this.GrowlAfterEncode);\r
- this.userSettingService.SetUserSetting(ASUserSettingConstants.SendFileTo, this.SendFileToPath);\r
- this.userSettingService.SetUserSetting(ASUserSettingConstants.SendFile, this.SendFileAfterEncode);\r
- this.userSettingService.SetUserSetting(ASUserSettingConstants.SendFileToArgs, this.Arguments);\r
+ this.userSettingService.SetUserSetting(UserSettingConstants.SendFileTo, this.SendFileToPath);\r
+ this.userSettingService.SetUserSetting(UserSettingConstants.SendFile, this.SendFileAfterEncode);\r
+ this.userSettingService.SetUserSetting(UserSettingConstants.SendFileToArgs, this.Arguments);\r
\r
/* Output Files */\r
this.userSettingService.SetUserSetting(UserSettingConstants.AutoNaming, this.AutomaticallyNameFiles);\r
\r
/* System and Logging */\r
userSettingService.SetUserSetting(ASUserSettingConstants.ProcessPriority, this.SelectedPriority);\r
- userSettingService.SetUserSetting(ASUserSettingConstants.PreventSleep, this.PreventSleep);\r
+ userSettingService.SetUserSetting(UserSettingConstants.PreventSleep, this.PreventSleep);\r
userSettingService.SetUserSetting(ASUserSettingConstants.Verbosity, this.SelectedVerbosity);\r
userSettingService.SetUserSetting(ASUserSettingConstants.SaveLogWithVideo, this.CopyLogToEncodeDirectory);\r
userSettingService.SetUserSetting(ASUserSettingConstants.SaveLogToCopyDirectory, this.CopyLogToSepcficedLocation);\r
this.UpdateMessage = info.WasSuccessful ? "Update Downloaded" : "Update Failed. You can try downloading the update from http://handbrake.fr";\r
\r
Process.Start(Path.Combine(Path.GetTempPath(), "handbrake-setup.exe"));\r
- Application.Current.Shutdown();\r
+ Execute.OnUIThread(() => Application.Current.Shutdown());\r
}\r
\r
/// <summary>\r
namespace HandBrakeWPF.ViewModels\r
{\r
using System;\r
- using System.Collections.ObjectModel;\r
using System.ComponentModel;\r
using System.Windows;\r
\r
using Caliburn.Micro;\r
\r
- using HandBrake.ApplicationServices;\r
using HandBrake.ApplicationServices.EventArgs;\r
using HandBrake.ApplicationServices.Model;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
/// </summary>\r
public class QueueViewModel : ViewModelBase, IQueueViewModel\r
{\r
- /*\r
- \r
- * TODO FIX THE DRAP/DROP ADORNER!\r
- */\r
-\r
-\r
-\r
#region Constants and Fields\r
\r
/// <summary>\r
/// <summary>\r
/// Initializes a new instance of the <see cref="QueueViewModel"/> class.\r
/// </summary>\r
- /// <param name="windowManager">\r
- /// The window manager.\r
- /// </param>\r
/// <param name="userSettingService">\r
/// The user Setting Service.\r
/// </param>\r
/// <param name="errorService">\r
/// The Error Service \r
/// </param>\r
- public QueueViewModel(IWindowManager windowManager, IUserSettingService userSettingService, IQueueProcessor queueProcessor, IErrorService errorService)\r
+ public QueueViewModel(IUserSettingService userSettingService, IQueueProcessor queueProcessor, IErrorService errorService)\r
{\r
this.userSettingService = userSettingService;\r
this.queueProcessor = queueProcessor;\r
public void WhenDone(string action)\r
{\r
this.WhenDoneAction = action;\r
- this.userSettingService.SetUserSetting(ASUserSettingConstants.WhenCompleteAction, action);\r
+ this.userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, action);\r
}\r
\r
/// <summary>\r
{\r
this.Load();\r
\r
- this.WhenDoneAction = this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.WhenCompleteAction);\r
+ this.WhenDoneAction = this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction);\r
\r
this.queueProcessor.JobProcessingStarted += this.queueProcessor_JobProcessingStarted;\r
this.queueProcessor.QueueCompleted += this.queueProcessor_QueueCompleted;\r
e.EstimatedTimeLeft,\r
e.ElapsedTime);\r
}\r
-\r
});\r
}\r
\r