What about closing dialog by hitting Escape? I think the best
pattern
for those cases is "if rc == OK_CODE, do else do nothing".
Well, it's a little more complicated because there's also the
possibility of rc being 2 (see return_to_hub_link_clicked in
lib/refresh.py). But, how does this look instead:
if rc == 1:
# User hit OK on the dialog, indicating they stayed on the dialog
# until rescanning completed and now needs to go back to the
# main storage spoke.
self.skipTo = "StorageSpoke"
elif rc != 2:
# User either hit cancel on the dialog or closed it via escape, so
# there was no rescanning done.
return
> diff --git a/pyanaconda/ui/gui/spokes/lib/refresh.py
b/pyanaconda/ui/gui/spokes/lib/refresh.py
> index 83d2efb..3fc9b57 100644
> --- a/pyanaconda/ui/gui/spokes/lib/refresh.py
> +++ b/pyanaconda/ui/gui/spokes/lib/refresh.py
> @@ -19,10 +19,13 @@
> # Red Hat Author(s): Chris Lumens <clumens(a)redhat.com>
> #
>
> -from gi.repository import Gtk
> +from gi.repository import GLib, Gtk
Please add "# pylint: disable-msg=E0611" before this import.
Done.
- Chris