[master/rhel7] tui ErrorDialog needs to be modal (#983316)
Vratislav Podzimek
vpodzime at redhat.com
Fri Sep 20 18:16:29 UTC 2013
On Fri, 2013-09-20 at 08:58 -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
>
> The dialog waits for any key to be hit, and it needs to be displayed
> immediately so use a modal screen.
> ---
> pyanaconda/packaging/yumpayload.py | 3 ++-
> pyanaconda/ui/tui/__init__.py | 2 +-
> pyanaconda/ui/tui/tuiobject.py | 2 ++
> 3 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
> index 5c9bbc1..d9630f9 100644
> --- a/pyanaconda/packaging/yumpayload.py
> +++ b/pyanaconda/packaging/yumpayload.py
> @@ -1525,7 +1525,8 @@ reposdir=%s
> except DependencyError as e:
> if errorHandler.cb(e) == ERROR_RAISE:
> progressQ.send_quit(1)
> - sys.exit(1)
> + while True:
> + time.sleep(100000)
>
> # doPreInstall
> # create mountpoints for protected device mountpoints (?)
> diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
> index cb3e511..c3e8471 100644
> --- a/pyanaconda/ui/tui/__init__.py
> +++ b/pyanaconda/ui/tui/__init__.py
> @@ -258,7 +258,7 @@ class TextUserInterface(ui.UserInterface):
> """Internal helper function that MUST BE CALLED FROM THE MAIN THREAD"""
>
> error_window = ErrorDialog(self._app, message)
> - self._app.switch_screen(error_window)
> + self._app.switch_screen_modal(error_window)
>
> def showDetailedError(self, message, details):
> return self._show_message_in_main_thread(self._showDetailedError, (message, details))
> diff --git a/pyanaconda/ui/tui/tuiobject.py b/pyanaconda/ui/tui/tuiobject.py
> index e2c96f7..da82909 100644
> --- a/pyanaconda/ui/tui/tuiobject.py
> +++ b/pyanaconda/ui/tui/tuiobject.py
> @@ -44,6 +44,7 @@ class ErrorDialog(tui.UIScreen):
> tui.UIScreen.refresh(self, args)
> text = tui.TextWidget(self._message)
> self._window.append(tui.CenterWidget(text))
> + return True
>
> def prompt(self, args = None):
> return _("Press enter to exit.")
> @@ -51,6 +52,7 @@ class ErrorDialog(tui.UIScreen):
> def input(self, args, key):
> """This dialog is closed by any input."""
> self.close()
> + return None
This should be INPUT_PROCESSED from pyanaconda/constants_text.py.
Otherwise this looks good to me.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list