[PATCH 1/2] Confirm before resetting custom partitioning selections (#970093).

Vratislav Podzimek vpodzime at redhat.com
Thu Mar 13 20:17:30 UTC 2014


On Thu, 2014-03-13 at 16:07 -0400, Chris Lumens wrote:
> ---
>  pyanaconda/ui/gui/spokes/custom.py | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
> index 45ec28e..7cc1a48 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -2921,7 +2921,23 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
>      # This callback is for the button that just resets the UI to anaconda's
>      # current understanding of the disk layout.
>      def on_reset_clicked(self, *args):
> -        self.refresh()
> +        msg = _("Continuing with this action will reset all your partitioning selections "
> +                "to their current on-disk state.")
> +
> +        dlg = Gtk.MessageDialog(flags=Gtk.DialogFlags.MODAL,
> +                                message_type=Gtk.MessageType.WARNING,
> +                                buttons=Gtk.ButtonsType.NONE,
> +                                message_format=msg)
> +        dlg.set_decorated(False)
> +        dlg.add_buttons(_("_Reset selections"), 0, _("_Preserve current selections"), 1)
> +        dlg.set_default_response(1)
Does that mean that when user hits ESC, the response will be 1 and
refresh will be skipped? If not, we should either ignore escape or
change the if below to "if rc == 0".

> +
> +        with enlightbox(self.window, dlg):
> +            rc = dlg.run()
> +            dlg.destroy()
> +
> +        if not rc:
> +            self.refresh()
>  
>      # This callback is for the button that has anaconda go back and rescan the
>      # disks to pick up whatever changes the user made outside our control.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list