[PATCH] Allow a couple more keyboard shortcuts on the custom part spoke.
Martin Kolman
mkolman at redhat.com
Fri May 30 13:53:03 UTC 2014
----- Original Message -----
> From: "Chris Lumens" <clumens at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Thursday, May 29, 2014 10:31:49 PM
> Subject: [PATCH] Allow a couple more keyboard shortcuts on the custom part spoke.
>
> (1) '-' should do the same thing as delete.
> (2) '+' should bring up the add dialog.
> ---
> pyanaconda/ui/gui/spokes/custom.py | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/pyanaconda/ui/gui/spokes/custom.py
> b/pyanaconda/ui/gui/spokes/custom.py
> index 328cf61..d04eda9 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -1422,17 +1422,20 @@ class CustomPartitioningSpoke(NormalSpoke,
> StorageChecker):
> ###
>
> def on_key_pressed(self, window, event, *args):
> - # Handle any keyboard events. Right now this is just delete for
> - # removing an existing mountpoint, but it could include more later.
> if not event or event and event.type != Gdk.EventType.KEY_RELEASE:
> return
>
> - if event.keyval == Gdk.KEY_Delete:
> + if event.keyval in [Gdk.KEY_Delete, Gdk.KEY_minus]:
> # 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")
> + elif event.keyval == Gdk.KEY_plus:
> + # And we only want '+' to work if you don't have a text entry
> focused, since
> + # the user might be entering some free-form text that can
> include a plus.
> + if not isinstance(window.get_focus(), Gtk.Entry):
> + self._addButton.emit("clicked")
>
> def _do_check(self):
> self.clear_errors()
> --
> 1.9.0
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
Nice idea, ACK! :)
More information about the anaconda-patches
mailing list