diff options
author | sr55 <[email protected]> | 2013-01-17 22:29:37 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-01-17 22:29:37 +0000 |
commit | 7dd8b460af31e84d3b1cb82b63f03464dbadf3ee (patch) | |
tree | 83399a9a0e8a942831a2fb6d7a4d849100b6ad7b /win/CS/HandBrake.ApplicationServices | |
parent | 6f7272a5caf858b0dd461eee74654c1e4d54500b (diff) |
WinGui: UI Tweaks.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5180 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
5 files changed, 101 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/EventArgs/SettingChangedEventArgs.cs b/win/CS/HandBrake.ApplicationServices/EventArgs/SettingChangedEventArgs.cs new file mode 100644 index 000000000..2687508b2 --- /dev/null +++ b/win/CS/HandBrake.ApplicationServices/EventArgs/SettingChangedEventArgs.cs @@ -0,0 +1,27 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SettingChangedEventArgs.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 setting changed event args.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.EventArgs
+{
+ /// <summary>
+ /// The setting changed event args.
+ /// </summary>
+ public class SettingChangedEventArgs
+ {
+ /// <summary>
+ /// Gets or sets the key.
+ /// </summary>
+ public string Key { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value.
+ /// </summary>
+ public object Value { get; set; }
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index 6730e2d66..efeeffb47 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -83,6 +83,7 @@ <ItemGroup>
<Compile Include="Collections\SerializableDictionary.cs" />
<Compile Include="Converters\EnumToDescConverter.cs" />
+ <Compile Include="EventArgs\SettingChangedEventArgs.cs" />
<Compile Include="Exceptions\GeneralApplicationException.cs" />
<Compile Include="EventArgs\EncodeCompletedEventArgs.cs" />
<Compile Include="EventArgs\EncodeProgressEventArgs.cs" />
diff --git a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs index 554f78c35..6fcf10b57 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs @@ -12,6 +12,8 @@ namespace HandBrake.ApplicationServices.Model using System.Collections.ObjectModel;
using System.Linq;
+ using Caliburn.Micro;
+
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.Interop.Model;
using HandBrake.Interop.Model.Encoding;
@@ -22,8 +24,17 @@ namespace HandBrake.ApplicationServices.Model /// <summary>
/// An Encode Task
/// </summary>
- public class EncodeTask
+ public class EncodeTask : PropertyChangedBase
{
+ #region Private Fields
+
+ /// <summary>
+ /// The advanced panel enabled.
+ /// </summary>
+ private bool showAdvancedTab;
+
+ #endregion
+
/// <summary>
/// Initializes a new instance of the <see cref="EncodeTask"/> class.
/// </summary>
@@ -424,7 +435,7 @@ namespace HandBrake.ApplicationServices.Model public bool FastDecode { get; set; }
/// <summary>
- /// Extra Advanced Arguments for the Video Tab.
+ /// Gets or sets Extra Advanced Arguments for the Video Tab.
/// </summary>
public string ExtraAdvancedArguments { get; set; }
@@ -481,6 +492,25 @@ namespace HandBrake.ApplicationServices.Model /// Gets or sets PreviewEncodeStartAt.
/// </summary>
public string PreviewEncodeStartAt { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether advanced panel enabled.
+ /// </summary>
+ public bool ShowAdvancedTab
+ {
+ get
+ {
+ return this.showAdvancedTab;
+ }
+ set
+ {
+ if (!object.Equals(value, this.showAdvancedTab))
+ {
+ this.showAdvancedTab = value;
+ this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);
+ }
+ }
+ }
#endregion
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs index d7bba9550..bf6cb9c91 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs @@ -9,12 +9,30 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
{
+ using HandBrake.ApplicationServices.EventArgs;
+
+ /// <summary>
+ /// The setting event handler.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ public delegate void SettingEventHandler(object sender, SettingChangedEventArgs e);
+
/// <summary>
/// The User Setting Service Interace.
/// </summary>
public interface IUserSettingService
{
/// <summary>
+ /// The setting changed.
+ /// </summary>
+ event SettingEventHandler SettingChanged;
+
+ /// <summary>
/// Set the specified user setting.
/// </summary>
/// <param name="name">
diff --git a/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs b/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs index ab77ce800..db7389637 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs @@ -16,6 +16,7 @@ namespace HandBrake.ApplicationServices.Services using System.Xml.Serialization;
using HandBrake.ApplicationServices.Collections;
+ using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Services.Interfaces;
@@ -48,6 +49,11 @@ namespace HandBrake.ApplicationServices.Services }
/// <summary>
+ /// The setting changed.
+ /// </summary>
+ public event SettingEventHandler SettingChanged;
+
+ /// <summary>
/// Set the specified user setting.
/// </summary>
/// <param name="name">
@@ -60,6 +66,8 @@ namespace HandBrake.ApplicationServices.Services {
this.userSettings[name] = value;
this.Save();
+
+ this.OnSettingChanged(new SettingChangedEventArgs {Key = name, Value = value});
}
/// <summary>
@@ -99,6 +107,21 @@ namespace HandBrake.ApplicationServices.Services }
/// <summary>
+ /// The on setting changed.
+ /// </summary>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ protected virtual void OnSettingChanged(SettingChangedEventArgs e)
+ {
+ SettingEventHandler handler = this.SettingChanged;
+ if (handler != null)
+ {
+ handler(this, e);
+ }
+ }
+
+ /// <summary>
/// Save the User Settings
/// </summary>
private void Save()
|