[PATCH] The delete key shouldn't always delete a mountpoint (#969197, #970185).

Vratislav Podzimek vpodzime at redhat.com
Mon Jun 17 08:18:14 UTC 2013


On Fri, 2013-06-14 at 17:55 -0400, Chris Lumens wrote:
> We should only delete the mountpoint if a MountpointSelector is focused.
> ---
>  pyanaconda/ui/gui/spokes/custom.py | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
> index 63ee476..da2808c 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -78,6 +78,7 @@ from pyanaconda.ui.lib.disks import size_str
>  
>  # pylint: disable-msg=E0611
>  from gi.repository import Gdk, Gtk
> +from gi.repository.AnacondaWidgets import MountpointSelector
>  
>  import logging
>  log = logging.getLogger("anaconda")
> @@ -1836,7 +1837,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
>              return
>  
>          if event.keyval == Gdk.KEY_Delete:
> -            self._removeButton.emit("clicked")
> +            # But we only want delete to work if you have focused a MountpointSelector,
> +            # and not just any random widget.  For those, it's likely the user wants
> +            # to delete a character.
> +            if isinstance(window.get_focus(), MountpointSelector):
> +                self._removeButton.emit("clicked")
>  
>      def on_back_clicked(self, button):
>          # First, save anything from the currently displayed mountpoint.
ACK.

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list