[PATCH] Hook up the delete key on the resize dialog.
Vratislav Podzimek
vpodzime at redhat.com
Tue Jun 4 08:18:30 UTC 2013
On Fri, 2013-05-31 at 15:55 -0400, Chris Lumens wrote:
> ---
> pyanaconda/ui/gui/spokes/lib/resize.glade | 2 ++
> pyanaconda/ui/gui/spokes/lib/resize.py | 12 +++++++++++-
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/pyanaconda/ui/gui/spokes/lib/resize.glade b/pyanaconda/ui/gui/spokes/lib/resize.glade
> index ff8943d..3a4c5eb 100644
> --- a/pyanaconda/ui/gui/spokes/lib/resize.glade
> +++ b/pyanaconda/ui/gui/spokes/lib/resize.glade
> @@ -31,11 +31,13 @@
> <object class="GtkDialog" id="resizeDialog">
> <property name="height_request">550</property>
> <property name="can_focus">False</property>
> + <property name="events">GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
> <property name="border_width">5</property>
> <property name="resizable">False</property>
> <property name="modal">True</property>
> <property name="type_hint">dialog</property>
> <property name="decorated">False</property>
> + <signal name="key-release-event" handler="on_key_pressed" swapped="no"/>
> <child internal-child="vbox">
> <object class="GtkBox" id="dialog-vbox1">
> <property name="can_focus">False</property>
> diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py
> index 109ec65..30518aa 100644
> --- a/pyanaconda/ui/gui/spokes/lib/resize.py
> +++ b/pyanaconda/ui/gui/spokes/lib/resize.py
> @@ -21,7 +21,8 @@
>
> from __future__ import division
>
> -from gi.repository import Gtk
> +# pylint: disable-msg=E0611
> +from gi.repository import Gdk, Gtk
>
> from pyanaconda.i18n import _, N_, P_
> from pyanaconda.ui.lib.disks import size_str
> @@ -290,6 +291,15 @@ class ResizeDialog(GUIObject):
> return rc
>
> # Signal handlers.
> + 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 and self._deleteButton.get_sensitive():
> + self._deleteButton.emit("clicked")
> +
> def _sumReclaimableSpace(self, model, path, itr, *args):
> (editable, action, ident, targetSize) = model.get(itr, EDITABLE_COL, ACTION_COL, DEVICE_ID_COL, RESIZE_TARGET_COL)
>
ACK.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list