From 661e986e850bd45b566759daf3b87d34d5caf3f7 Mon Sep 17 00:00:00 2001 From: morkt Date: Fri, 3 Feb 2017 18:04:35 +0400 Subject: [PATCH] (FileExistsDialog): new modal window. added FileErrorDialog logic to GarConvert. --- GUI/FileErrorDialog.xaml.cs | 16 +++++++ GUI/FileExistsDialog.xaml | 21 +++++++++ GUI/FileExistsDialog.xaml.cs | 72 +++++++++++++++++++++++++++++ GUI/GARbro.GUI.csproj | 7 +++ GUI/GarConvert.cs | 62 ++++++++++++------------- GUI/GarExtract.cs | 29 ++---------- GUI/MainWindow.xaml.cs | 37 ++++++++++++++- GUI/Strings/guiStrings.Designer.cs | 56 ++++++++++++++++++++++ GUI/Strings/guiStrings.ko-KR.resx | 26 +++++++++++ GUI/Strings/guiStrings.resx | 20 ++++++++ GUI/Strings/guiStrings.ru-RU.resx | 20 ++++++++ GUI/Strings/guiStrings.zh-Hans.resx | 26 +++++++++++ 12 files changed, 332 insertions(+), 60 deletions(-) create mode 100644 GUI/FileExistsDialog.xaml create mode 100644 GUI/FileExistsDialog.xaml.cs diff --git a/GUI/FileErrorDialog.xaml.cs b/GUI/FileErrorDialog.xaml.cs index 7fcb5725..420e9129 100644 --- a/GUI/FileErrorDialog.xaml.cs +++ b/GUI/FileErrorDialog.xaml.cs @@ -16,6 +16,16 @@ namespace GARbro.GUI this.DataContext = new ViewModel { Title = title, Text = error_text }; } + new public FileErrorDialogResult ShowDialog () + { + bool dialog_result = base.ShowDialog() ?? false; + return new FileErrorDialogResult + { + Continue = dialog_result, + IgnoreErrors = IgnoreErrors.IsChecked ?? false + }; + } + private void ContinueButton_Click (object sender, RoutedEventArgs e) { this.DialogResult = true; @@ -73,4 +83,10 @@ namespace GARbro.GUI public event EventHandler CanExecuteChanged; } } + + public struct FileErrorDialogResult + { + public bool Continue; + public bool IgnoreErrors; + } } diff --git a/GUI/FileExistsDialog.xaml b/GUI/FileExistsDialog.xaml new file mode 100644 index 00000000..bb1c2689 --- /dev/null +++ b/GUI/FileExistsDialog.xaml @@ -0,0 +1,21 @@ + + + + + + + +