[PATCH] The delete key shouldn't always delete a mountpoint (#969197, #970185).
Chris Lumens
clumens at redhat.com
Fri Jun 14 21:55:41 UTC 2013
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.
--
1.8.1.2
More information about the anaconda-patches
mailing list