diff options
author | sr55 <[email protected]> | 2010-06-11 18:57:37 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-06-11 18:57:37 +0000 |
commit | 4ecb7b2c297ba7e87c0a9ab8e0768d45fc4f0810 (patch) | |
tree | 0bcc32549872c771f0cf21c71a7b1da31513f153 /win/C#/HandBrake.ApplicationServices/Services/Queue.cs | |
parent | 20c52cb94e7cb9db92a58a8aca3f92715d073f98 (diff) |
WinGui:
- Improvements to the IQueue and IEncode interface. This allows for some cleanup of code in frmMain and frmPreview
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3376 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/HandBrake.ApplicationServices/Services/Queue.cs')
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Services/Queue.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs index 226ea68b1..0a1eb3c3d 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs @@ -8,6 +8,7 @@ namespace HandBrake.ApplicationServices.Services using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
@@ -16,6 +17,7 @@ namespace HandBrake.ApplicationServices.Services using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Properties;
using HandBrake.ApplicationServices.Services.Interfaces;
/// <summary>
@@ -38,6 +40,7 @@ namespace HandBrake.ApplicationServices.Services /// </summary>
private int nextJobId;
+ #region Events
/// <summary>
/// Fires when the Queue has started
/// </summary>
@@ -58,6 +61,7 @@ namespace HandBrake.ApplicationServices.Services /// Fires when the entire encode queue has completed.
/// </summary>
public event EventHandler QueueCompleted;
+ #endregion
#region Properties
/// <summary>
@@ -406,6 +410,41 @@ namespace HandBrake.ApplicationServices.Services Finish();
}
+ /// <summary>
+ /// Perform an action after an encode. e.g a shutdown, standby, restart etc.
+ /// </summary>
+ private void Finish()
+ {
+ // Growl
+ if (Settings.Default.growlQueue)
+ GrowlCommunicator.Notify("Queue Completed", "Put down that cocktail...\nyour Handbrake queue is done.");
+
+ // Do something whent he encode ends.
+ switch (Settings.Default.CompletionOption)
+ {
+ case "Shutdown":
+ Process.Start("Shutdown", "-s -t 60");
+ break;
+ case "Log Off":
+ Win32.ExitWindowsEx(0, 0);
+ break;
+ case "Suspend":
+ Application.SetSuspendState(PowerState.Suspend, true, true);
+ break;
+ case "Hibernate":
+ Application.SetSuspendState(PowerState.Hibernate, true, true);
+ break;
+ case "Lock System":
+ Win32.LockWorkStation();
+ break;
+ case "Quit HandBrake":
+ Application.Exit();
+ break;
+ default:
+ break;
+ }
+ }
+
#endregion
}
}
\ No newline at end of file |