[PATCH 2/2] Select all disks when Ctrl+A is pressed (#864707)

Vratislav Podzimek vpodzime at redhat.com
Fri Apr 19 11:40:40 UTC 2013


On Fri, 2013-04-19 at 13:30 +0200, Vratislav Podzimek wrote:
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
>  pyanaconda/ui/gui/spokes/storage.glade |  2 ++
>  pyanaconda/ui/gui/spokes/storage.py    | 13 +++++++++++--
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/storage.glade b/pyanaconda/ui/gui/spokes/storage.glade
> index 0d042c3..832a11a 100644
> --- a/pyanaconda/ui/gui/spokes/storage.glade
> +++ b/pyanaconda/ui/gui/spokes/storage.glade
> @@ -868,10 +868,12 @@
>                            <object class="GtkBox" id="local_disks_box">
>                              <property name="visible">True</property>
>                              <property name="can_focus">False</property>
> +                            <property name="events">GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
>                              <property name="margin_left">6</property>
>                              <property name="margin_right">6</property>
>                              <property name="hexpand">True</property>
>                              <property name="spacing">30</property>
> +                            <signal name="key-release-event" handler="on_disks_key_released" swapped="no"/>
>                              <child>
>                                <placeholder/>
>                              </child>
> diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
> index 17634d7..92ce296 100644
> --- a/pyanaconda/ui/gui/spokes/storage.py
> +++ b/pyanaconda/ui/gui/spokes/storage.py
> @@ -38,8 +38,9 @@
>  
>  """
>  
> -from gi.repository import Gdk, GLib, Gtk
> -from gi.repository import AnacondaWidgets
> +# pylint: disable-msg=E0611
> +from gi.repository import Gdk, GLib, Gtk, AnacondaWidgets
> +
>  from pyanaconda.ui.communication import hubQ
>  from pyanaconda.ui.lib.disks import getDisks, isLocalDisk, size_str
>  from pyanaconda.ui.gui import GUIObject
> @@ -857,3 +858,11 @@ class StorageSpoke(NormalSpoke, StorageChecker):
>                  rc = dialog.run()
>  
>              dialog.window.destroy()
> +
> +    def on_disks_key_released(self, box, event):
> +        # if Ctrl-A was pressed, select all disks
> +        if bool(event.state & Gdk.ModifierType.CONTROL_MASK) and \
> +                (event.keyval in (Gdk.KEY_a, Gdk.KEY_A)):
> +            for overview in box.get_children():
> +                overview.set_chosen(True)
> +
This needs to call 'self._update_disk_list()'. Fixed locally.

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list