[PATCH] Handle next button naming also if there is only one module (#1107887)

Martin Kolman mkolman at redhat.com
Mon Sep 29 15:14:36 UTC 2014

Due to how multi-page modules work (they return FAILURE on apply() to
prevent Firstboot from switching to the next module) the code that
changes the next button label will be never called if there is only
a single multi-page module in Firstboot.

So check if the label change is needed even if the module returns

Related: rhbz#1107887
Signed-off-by: Martin Kolman <mkolman at redhat.com>
 firstboot/interface.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/firstboot/interface.py b/firstboot/interface.py
index 60d4800..800c8bd 100644
--- a/firstboot/interface.py
+++ b/firstboot/interface.py
@@ -150,8 +150,14 @@ class Interface(object):
         # interface which will know the proper way to handle it.
         result = module.apply(self, self.testing)
-        # If something went wrong in the module, don't advance.
+        # If something went wrong in the module, don't advance,
+        # but check if the next button should be renamed as
+        # returning failure seems to be an indication of switching
+        # to next page in multi-page modules
         if result == RESULT_FAILURE:
+            if len(self._controlStack) == 1:
+                if self._control.currentPage == len(self.moduleList) - 1:
+                    self.nextButton.set_label(_("_Done"))
         # If the apply action from the current page jumped us to another page,

More information about the anaconda-patches mailing list