From 20992d6bbad05b17bf0b4895c702d61256a8c3b7 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 9 Mar 2019 21:17:50 -0800 Subject: [PATCH] closes #370 - error modal configuration --- README.md | 1 + gooey/gui/containers/application.py | 3 ++- gooey/python_bindings/config_generator.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cadae1a..d742126 100644 --- a/README.md +++ b/README.md @@ -279,6 +279,7 @@ Just about everything in Gooey's overall look and feel can be customized by pass | show_stop_warning | Displays a warning modal before allowing the user to force termination of your program | | force_stop_is_error | Toggles whether an early termination by the shows the success or error screen | | show_success_modal | Toggles whether or not to show a summary modal after a successful run | +| show_failure_modal | Toggles whether or not to show a summary modal on failure | | show_restart_button | Toggles whether or not to show the restart button at the end of execution | | run_validators | Controls whether or not to have Gooey perform validation before calling your program | | poll_external_updates | (Experimental!) When True, Gooey will call your code with a `gooey-seed-ui` CLI argument and use the response to fill out dynamic values in the UI (See: [Using Dynamic Values](#using-dynamic-values))| diff --git a/gooey/gui/containers/application.py b/gooey/gui/containers/application.py index 4401cc0..49fac7d 100644 --- a/gooey/gui/containers/application.py +++ b/gooey/gui/containers/application.py @@ -136,7 +136,8 @@ class GooeyApplication(wx.Frame): self.showForceStopped() else: self.showError() - wx.CallAfter(modals.showFailure) + if self.buildSpec.get('show_failure_modal'): + wx.CallAfter(modals.showFailure) def onStopExecution(self): diff --git a/gooey/python_bindings/config_generator.py b/gooey/python_bindings/config_generator.py index bdecfa5..01b47db 100644 --- a/gooey/python_bindings/config_generator.py +++ b/gooey/python_bindings/config_generator.py @@ -44,6 +44,7 @@ def create_from_parser(parser, source_path, **kwargs): 'encoding': kwargs.get('encoding', 'utf-8'), 'show_stop_warning': kwargs.get('show_stop_warning', True), 'show_success_modal': kwargs.get('show_success_modal', True), + 'show_failure_modal': kwargs.get('show_failure_modal', True), 'force_stop_is_error': kwargs.get('force_stop_is_error', True), 'poll_external_updates':kwargs.get('poll_external_updates', False), 'return_to_config': kwargs.get('return_to_config', False),