[rhel7-branch 26/29] custom: Clearing errors should also clear Done clicked state (#1158609)
bcl
installerbot-noreply at redhat.com
Tue Jun 2 00:31:27 UTC 2015
From: "Brian C. Lane" <bcl at redhat.com>
When there is an error we tell the user to click done again to exit. If
they do anything else the state needs to be cleared. We already call
clear_errors from all these places in order to reset the error bar, so
add clearing of the done clicked state.
Since do_check also clears errors, set the state to True *after* an
error has been found.
Resolves: rhbz#1158609
(cherry picked from commit 60e66d8754a2e35cec718ed31ff7c2dbf28316cf)
Related: rhbz#1196721
---
pyanaconda/ui/gui/spokes/custom.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 1a98764..0365c7b 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1512,6 +1512,9 @@ def _do_check(self):
return self._error == ""
def on_back_clicked(self, button):
+ # Preserve back_clicked across save_right_side/clear_errors calls
+ back_already_clicked = self._back_already_clicked
+
# Clear any existing errors
self.clear_errors()
@@ -1526,8 +1529,7 @@ def on_back_clicked(self, button):
# If back has been clicked on once already and no other changes made on the screen,
# run the storage check now. This handles displaying any errors in the info bar.
- if not self._back_already_clicked:
- self._back_already_clicked = True
+ if not back_already_clicked:
# If we hit any errors while saving things above, stop and let the
# user think about what they have done
@@ -1552,6 +1554,7 @@ def on_back_clicked(self, button):
luks.format.passphrase = self.passphrase
if not self._do_check():
+ self._back_already_clicked = True
return
if len(self._storage_playground.devicetree.findActions()) > 0:
@@ -2464,6 +2467,7 @@ def on_device_type_changed(self, combo):
def clear_errors(self):
self._error = None
self.clear_info()
+ self._back_already_clicked = False
# This callback is for the button that just resets the UI to anaconda's
# current understanding of the disk layout.
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/e7296b18bf4b7b0d6d7206c36b148366841d9954
More information about the anaconda-patches
mailing list