summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/App.xaml.cs4
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs18
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx6
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs28
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs16
5 files changed, 53 insertions, 19 deletions
diff --git a/win/CS/HandBrakeWPF/App.xaml.cs b/win/CS/HandBrakeWPF/App.xaml.cs
index a3809bea7..60b1bf10e 100644
--- a/win/CS/HandBrakeWPF/App.xaml.cs
+++ b/win/CS/HandBrakeWPF/App.xaml.cs
@@ -19,6 +19,7 @@ namespace HandBrakeWPF
using Caliburn.Micro;
using HandBrakeWPF.Helpers;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Startup;
using HandBrakeWPF.Utilities;
using HandBrakeWPF.ViewModels;
@@ -175,9 +176,10 @@ namespace HandBrakeWPF
try
{
IWindowManager windowManager = IoC.Get<IWindowManager>();
+ IErrorService errorService = IoC.Get<IErrorService>();
if (windowManager != null)
{
- ErrorViewModel errorView = new ErrorViewModel();
+ ErrorViewModel errorView = new ErrorViewModel(errorService);
GeneralApplicationException applicationException = null;
if (exception.GetType() == typeof(GeneralApplicationException))
{
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index a22cf482b..bbe866be0 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -576,6 +576,24 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to The system clipboard is currently unavailable..
+ /// </summary>
+ public static string Clipboard_Unavailable {
+ get {
+ return ResourceManager.GetString("Clipboard_Unavailable", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to This may be due to another application monitoring or locking the clipboard for its own use. You will not be able to use the clipboard until it is unlocked..
+ /// </summary>
+ public static string Clipboard_Unavailable_Solution {
+ get {
+ return ResourceManager.GetString("Clipboard_Unavailable_Solution", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Confirm.
/// </summary>
public static string Confirm {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index 84d46f2b9..21bed46f7 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -885,4 +885,10 @@ Time Remaining: {5}, Elapsed: {6:d\:hh\:mm\:ss}</value>
<value>The file '{0}' already exists!
Would you like to overwrite it?</value>
</data>
+ <data name="Clipboard_Unavailable" xml:space="preserve">
+ <value>The system clipboard is currently unavailable.</value>
+ </data>
+ <data name="Clipboard_Unavailable_Solution" xml:space="preserve">
+ <value>This may be due to another application monitoring or locking the clipboard for its own use. You will not be able to use the clipboard until it is unlocked.</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs
index be57cd804..ddea7a5e5 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs
@@ -13,6 +13,7 @@ namespace HandBrakeWPF.ViewModels
using System.Windows;
using HandBrakeWPF.Properties;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -20,32 +21,20 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public class ErrorViewModel : ViewModelBase, IErrorViewModel
{
- #region Constants and Fields
+ private readonly IErrorService errorService;
- /// <summary>
- /// The details.
- /// </summary>
private string details;
-
- /// <summary>
- /// The error message.
- /// </summary>
private string errorMessage;
-
- /// <summary>
- /// The solution.
- /// </summary>
private string solution;
- #endregion
-
#region Constructors and Destructors
/// <summary>
/// Initializes a new instance of the <see cref="ErrorViewModel"/> class.
/// </summary>
- public ErrorViewModel()
+ public ErrorViewModel(IErrorService errorService)
{
+ this.errorService = errorService;
this.Title = Resources.Error;
this.ErrorMessage = Resources.ErrorViewModel_UnknownError;
this.Details = Resources.ErrorViewModel_NoFurtherInformation;
@@ -128,7 +117,14 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void Copy()
{
- Clipboard.SetDataObject(this.ErrorMessage + Environment.NewLine + this.Details, true);
+ try
+ {
+ Clipboard.SetDataObject(this.ErrorMessage + Environment.NewLine + this.Details, true);
+ }
+ catch (Exception exc)
+ {
+ this.errorService.ShowError(Resources.Clipboard_Unavailable, Resources.Clipboard_Unavailable_Solution, exc);
+ }
}
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
index 6573b1f5a..d1ed6654d 100644
--- a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
@@ -16,6 +16,8 @@ namespace HandBrakeWPF.ViewModels
using Caliburn.Micro;
+ using HandBrakeWPF.Properties;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Utilities;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -29,6 +31,8 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public class LogViewModel : ViewModelBase, ILogViewModel
{
+ private readonly IErrorService errorService;
+
#region Private Fields
private readonly ILog logService;
@@ -40,8 +44,9 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Initializes a new instance of the <see cref="LogViewModel"/> class.
/// </summary>
- public LogViewModel()
+ public LogViewModel(IErrorService errorService)
{
+ this.errorService = errorService;
this.logService = LogService.GetLogger();
this.Title = "Log Viewer";
}
@@ -78,7 +83,14 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void CopyLog()
{
- Clipboard.SetDataObject(this.ActivityLog, true);
+ try
+ {
+ Clipboard.SetDataObject(this.ActivityLog, true);
+ }
+ catch (Exception exc)
+ {
+ this.errorService.ShowError(Resources.Clipboard_Unavailable, Resources.Clipboard_Unavailable_Solution, exc);
+ }
}
/// <summary>