[rhel7/master/f21 v2] custom: Clearing errors should also clear Done clicked state (#1158609)
Samantha N. Bueno
sbueno+anaconda at redhat.com
Fri Oct 31 19:18:03 UTC 2014
On Fri, Oct 31, 2014 at 09:15:00AM -0700, Brian C. Lane wrote:
> 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.
Ack.
>
> Resolves: rhbz#1158609
>
> NOTE: Previous version broke double done click because save_right_side calls clear_errors
> ---
> pyanaconda/ui/gui/spokes/custom.py | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
> index 9daf9d1..1985c91 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -2176,6 +2176,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
> return bool(self._error == "")
>
> def on_back_clicked(self, button):
> + # Preserve back_clicked across save_right_side since it calls clear_errors
> + back_already_clicked = self._back_already_clicked
> # First, save anything from the currently displayed mountpoint.
> self._save_right_side(self._current_selector)
>
> @@ -2187,8 +2189,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
>
> # 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:
>
> new_luks = [d for d in self.__storage.devices
> if d.format.type == "luks" and not d.format.exists]
> @@ -2208,6 +2209,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
> luks.format.passphrase = self.passphrase
>
> if not self._do_check():
> + self._back_already_clicked = True
> return
>
> if len(self.__storage.devicetree.findActions()) > 0:
> @@ -3109,6 +3111,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
> 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.
> --
> 1.9.3
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
More information about the anaconda-patches
mailing list