diff options
author | sr55 <[email protected]> | 2018-12-14 20:57:01 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2018-12-14 20:57:01 +0000 |
commit | 591fa3ab6b24409c2a515a7a8dc28ed071deefac (patch) | |
tree | 4fccbba887ae5cd986f1965e01ad218c94185185 /win/CS | |
parent | c69dfd82e7c3e720245d77410cfaa87a7a502b35 (diff) |
WinGui: Don't allow multiple preview windows to be opened.
Diffstat (limited to 'win/CS')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 9c0788bf6..a64e0cb39 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1457,7 +1457,7 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void OpenPreviewWindow()
{
- if (!string.IsNullOrEmpty(this.CurrentTask.Source))
+ if (!string.IsNullOrEmpty(this.CurrentTask.Source) && !this.StaticPreviewViewModel.IsOpen)
{
this.StaticPreviewViewModel.IsOpen = true;
this.StaticPreviewViewModel.UpdatePreviewFrame(this.CurrentTask, this.ScannedSource);
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index 7989cd85a..d8ad6e9b9 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -525,7 +525,7 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void Close()
{
- this.TryClose();
+ this.IsOpen = false;
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml b/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml index 48323b259..6f1b54694 100644 --- a/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml +++ b/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml @@ -9,6 +9,7 @@ mc:Ignorable="d" SizeToContent="WidthAndHeight"
TextOptions.TextFormattingMode="Display"
WindowStartupLocation="CenterScreen"
+ cal:Message.Attach="[Event Closing] = [Action Close]"
Title="{Binding Title}">
<Window.Resources>
|