[PATCH 2/5] Allow passing an optional button list to showDetailedError.
Vratislav Podzimek
vpodzime at redhat.com
Wed Jul 8 06:23:16 UTC 2015
On Tue, 2015-07-07 at 17:32 -0500, David Lehman wrote:
> The button list will be unconditionally ignored by the TUI.
>
> (cherry picked from commit 9f6e21284c5a368497d46c08c37e2bee06385993)
>
> Related: rhbz#1236995
> Related: rhbz#1198367
> ---
> pyanaconda/ui/__init__.py | 3 +++
> pyanaconda/ui/gui/__init__.py | 7 ++++---
> pyanaconda/ui/tui/__init__.py | 2 +-
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/pyanaconda/ui/__init__.py b/pyanaconda/ui/__init__.py
> index 2686ded..3802bea 100644
> --- a/pyanaconda/ui/__init__.py
> +++ b/pyanaconda/ui/__init__.py
> @@ -122,6 +122,9 @@ class UserInterface(object):
> """
> raise NotImplementedError
>
> + def showDetailedError(self, message, details, buttons=None):
> + raise NotImplementedError
> +
> def showYesNoQuestion(self, message):
> """Display a dialog with the given message that presents the user a yes
> or no choice. This method returns True if the yes choice is selected,
> diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
> index 42b28fb..9251949 100644
> --- a/pyanaconda/ui/gui/__init__.py
> +++ b/pyanaconda/ui/gui/__init__.py
> @@ -722,15 +722,16 @@ class GraphicalUserInterface(UserInterface):
> sys.exit(1)
>
> @gtk_action_wait
> - def showDetailedError(self, message, details):
> + def showDetailedError(self, message, details, buttons=None):
> from pyanaconda.ui.gui.spokes.lib.detailederror import DetailedErrorDialog
> - dlg = DetailedErrorDialog(None, buttons=[_("_Quit")],
> - label=message)
> + buttons = buttons or [_("_Quit")]
> + dlg = DetailedErrorDialog(None, buttons=buttons, label=message)
>
> with self.mainWindow.enlightbox(dlg.window):
> dlg.refresh(details)
> rc = dlg.run()
> dlg.window.destroy()
> + return rc
>
> @gtk_action_wait
> def showYesNoQuestion(self, message):
> diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
> index 655913a..a45e5f7 100644
> --- a/pyanaconda/ui/tui/__init__.py
> +++ b/pyanaconda/ui/tui/__init__.py
> @@ -262,7 +262,7 @@ class TextUserInterface(ui.UserInterface):
> error_window = ErrorDialog(self._app, message)
> self._app.switch_screen_modal(error_window)
>
> - def showDetailedError(self, message, details):
> + def showDetailedError(self, message, details, buttons=None):
pylint's probably going to be a bit nervous about this, but I'm not sure
if we care.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list