diff options
author | sr55 <[email protected]> | 2015-04-20 18:46:33 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-04-20 18:46:33 +0000 |
commit | 69a4cf5c8b880bd69be890a043dd3abae31b07bf (patch) | |
tree | 05fdc33bc0e7d92e8a2c7b73f9532a953dbe3009 /win/CS/HandBrakeWPF/ViewModels | |
parent | e1bd5f45bef2c38582d5e4e5e162e12c9e671dbd (diff) |
WinGui: Restore the "No Titles Found" dialog from previous versions of HandBrake.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7108 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 115 |
1 files changed, 108 insertions, 7 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 652068444..c521ee235 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -199,6 +199,12 @@ namespace HandBrakeWPF.ViewModels /// </summary>
private bool canPause;
+ private bool showAlertWindow;
+
+ private string alertWindowHeader;
+
+ private string alertWindowText;
+
#endregion
/// <summary>
@@ -1058,6 +1064,77 @@ namespace HandBrakeWPF.ViewModels }
}
+ /// <summary>
+ /// Gets or sets a value indicating whether show alert window.
+ /// </summary>
+ public bool ShowAlertWindow
+ {
+ get
+ {
+ return this.showAlertWindow;
+ }
+ set
+ {
+ if (value.Equals(this.showAlertWindow))
+ {
+ return;
+ }
+ this.showAlertWindow = value;
+ this.NotifyOfPropertyChange(() => this.ShowAlertWindow);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether alert window header.
+ /// </summary>
+ public string AlertWindowHeader
+ {
+ get
+ {
+ return this.alertWindowHeader;
+ }
+ set
+ {
+ if (value == this.alertWindowHeader)
+ {
+ return;
+ }
+ this.alertWindowHeader = value;
+ this.NotifyOfPropertyChange(() => this.AlertWindowHeader);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether alert window text.
+ /// </summary>
+ public string AlertWindowText
+ {
+ get
+ {
+ return this.alertWindowText;
+ }
+ set
+ {
+ if (value == this.alertWindowText)
+ {
+ return;
+ }
+ this.alertWindowText = value;
+ this.NotifyOfPropertyChange(() => this.AlertWindowText);
+ }
+ }
+
+ /// <summary>
+ /// Gets the alert window close.
+ /// </summary>
+ public Action AlertWindowClose
+ {
+ get
+ {
+ return this.CloseAlertWindow;
+ }
+ }
+
#endregion
#region Load and Shutdown Handling
@@ -1486,6 +1563,16 @@ namespace HandBrakeWPF.ViewModels this.ShowSourceSelection = false;
}
+ /// <summary>
+ /// The close alert window.
+ /// </summary>
+ public void CloseAlertWindow()
+ {
+ this.ShowAlertWindow = false;
+ this.AlertWindowText = string.Empty;
+ this.AlertWindowHeader = string.Empty;
+ }
+
#endregion
#region Main Window Public Methods
@@ -1999,6 +2086,22 @@ namespace HandBrakeWPF.ViewModels }
}
+ /// <summary>
+ /// The open alert window.
+ /// </summary>
+ /// <param name="header">
+ /// The header.
+ /// </param>
+ /// <param name="message">
+ /// The message.
+ /// </param>
+ private void OpenAlertWindow(string header, string message)
+ {
+ this.ShowAlertWindow = true;
+ this.AlertWindowHeader = header;
+ this.AlertWindowText = message;
+ }
+
#endregion
#region Event Handlers
@@ -2043,8 +2146,11 @@ namespace HandBrakeWPF.ViewModels {
this.NotifyOfPropertyChange(() => this.ScannedSource);
this.NotifyOfPropertyChange(() => this.ScannedSource.Titles);
- this.SelectedTitle = this.ScannedSource.Titles.FirstOrDefault(t => t.MainTitle)
- ?? this.ScannedSource.Titles.FirstOrDefault();
+ this.SelectedTitle = this.ScannedSource.Titles.FirstOrDefault(t => t.MainTitle) ?? this.ScannedSource.Titles.FirstOrDefault();
+ }
+ else
+ {
+ this.OpenAlertWindow(Resources.Main_ScanNoTitlesFound, Resources.Main_ScanNoTitlesFoundMessage);
}
this.ShowStatusWindow = false;
@@ -2058,11 +2164,6 @@ namespace HandBrakeWPF.ViewModels this.SourceLabel = Resources.Main_ScanCancelled;
this.StatusLabel = Resources.Main_ScanCancelled;
}
- else if (e.Exception == null && e.ErrorInformation != null)
- {
- this.SourceLabel = Resources.Main_ScanFailed_NoReason + e.ErrorInformation;
- this.StatusLabel = Resources.Main_ScanFailed_NoReason + e.ErrorInformation;
- }
else
{
this.SourceLabel = Resources.Main_ScanFailled_CheckLog;
|