[PATCH] Verify user ready to proceed with installation in TUI. (#975793)

Samantha N. Bueno sbueno+anaconda at redhat.com
Mon Jul 22 12:32:11 UTC 2013


Another for rhel7-branch as well.

I feel like a better-worded message could be shown to users, so please
feel free to offer suggestions.

====

Show a message and prompt user with yes/no dialog to verify they
are ready to proceed before beginning installation.

This also alters the YesNoDialog so that it doesn't always center text.

Resolves: rhbz#975793
---
 pyanaconda/ui/tui/hubs/__init__.py | 8 +++++++-
 pyanaconda/ui/tui/tuiobject.py     | 3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py
index 14e6957..e05020e 100644
--- a/pyanaconda/ui/tui/hubs/__init__.py
+++ b/pyanaconda/ui/tui/hubs/__init__.py
@@ -19,7 +19,7 @@
 # Red Hat Author(s): Martin Sivak <msivak at redhat.com>
 #
 from .. import simpleline as tui
-from pyanaconda.ui.tui.tuiobject import TUIObject
+from pyanaconda.ui.tui.tuiobject import TUIObject, YesNoDialog
 from pyanaconda.ui.tui.spokes import collect_spokes
 from pyanaconda.ui import common
 
@@ -110,4 +110,10 @@ class TUIHub(TUIObject, common.Hub):
                     if not spoke.completed and spoke.mandatory:
                         print(_("Please complete all spokes before continuing"))
                         return False
+                    else:
+                        msg = _("Proceeding will begin installation.\nReady to continue?")
+                        question = YesNoDialog(self._app, msg)
+                        self._app.switch_screen_modal(question)
+                        if not question.answer:
+                            return None
             return key
diff --git a/pyanaconda/ui/tui/tuiobject.py b/pyanaconda/ui/tui/tuiobject.py
index e2c96f7..f68887f 100644
--- a/pyanaconda/ui/tui/tuiobject.py
+++ b/pyanaconda/ui/tui/tuiobject.py
@@ -73,7 +73,8 @@ class YesNoDialog(tui.UIScreen):
     def refresh(self, args = None):
         tui.UIScreen.refresh(self, args)
         text = tui.TextWidget(self._message)
-        self._window.append(tui.CenterWidget(text))
+#        self._window.append(tui.CenterWidget(text))
+        self._window.append(text)
         self._window.append(u"")
         return True
 
-- 
1.8.3.1



More information about the anaconda-patches mailing list