summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs46
1 files changed, 40 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs
index 759be462d..d6e5d5598 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs
@@ -1,7 +1,11 @@
-/* AboutViewModel.cs $
- This file is part of the HandBrake source code.
- Homepage: <http://handbrake.fr>.
- It may be used under the terms of the GNU General Public License. */
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AboutViewModel.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 About View Model
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
namespace HandBrakeWPF.ViewModels
{
@@ -9,6 +13,9 @@ namespace HandBrakeWPF.ViewModels
using Caliburn.Micro;
+ using HandBrake.ApplicationServices;
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -18,20 +25,47 @@ namespace HandBrakeWPF.ViewModels
public class AboutViewModel : ViewModelBase, IAboutViewModel
{
/// <summary>
+ /// Backing Field for the User setting service.
+ /// </summary>
+ private readonly IUserSettingService userSettingService;
+
+ /// <summary>
/// Initializes a new instance of the <see cref="AboutViewModel"/> class.
/// </summary>
/// <param name="windowManager">
/// The window manager.
/// </param>
- public AboutViewModel(IWindowManager windowManager) : base(windowManager)
+ /// <param name="userSettingService">
+ /// The user Setting Service.
+ /// </param>
+ public AboutViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ : base(windowManager)
{
+ this.userSettingService = userSettingService;
+ }
+
+ /// <summary>
+ /// Gets Version.
+ /// </summary>
+ public string Version
+ {
+ get
+ {
+ string nightly = userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion).Contains("svn") ? " (SVN / Nightly Build)" : string.Empty;
+ return string.Format(
+ "{0} ({1}) {2}",
+ userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),
+ userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild),
+ nightly);
+ }
}
/// <summary>
/// Close this window.
/// </summary>
public void Close()
- {
+ {
+ this.TryClose();
}
}
}