[PATCH 11/12] Allow password spoke to be exited without password (#1004931)

David Shea dshea at redhat.com
Fri Oct 4 18:28:17 UTC 2013


This makes the behavior of the root password spoke similar to that of
the user spoke, in that you can enter it, do nothing, and hit "Done" to
return to the progress hub.
---
 pyanaconda/ui/gui/spokes/password.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py
index 57f2649..58e6719 100644
--- a/pyanaconda/ui/gui/spokes/password.py
+++ b/pyanaconda/ui/gui/spokes/password.py
@@ -98,6 +98,10 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
         self.pw_bar.add_offset_value("high", 4)
 
     def refresh(self):
+        # Enable the input checks in case they were disabled on the last exit
+        for check in self.checks:
+            check.enable()
+
         self.pw.grab_focus()
         self.pw.emit("changed")
 
@@ -117,7 +121,7 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
 
     def apply(self):
         pw = self.pw.get_text()
-        if (not pw) and (self._kickstarted):
+        if not pw:
             return
 
         self.data.rootpw.password = cryptPassword(pw)
@@ -249,4 +253,9 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
         self._waivePasswordClicks += 1
         self._pwStrengthCheck.update_check_status()
 
+        # If neither the password nor the confirm field are set, skip the checks
+        if (not self.pw.get_text()) and (not self.confirm.get_text()):
+            for check in self.checks:
+                check.disable()
+
         NormalSpoke.on_back_clicked(self, button)
-- 
1.8.3.1



More information about the anaconda-patches mailing list