PATCH 1/2 removes useless piece of code. PATCH 2/2 adds a double-click functionality to the AddLayout dialog.
Vratislav Podzimek (2): Remove useless handler of Cancel button (AddLayout dialog) Close AddLayout dialog on double-click
pyanaconda/ui/gui/spokes/keyboard.glade | 3 ++- pyanaconda/ui/gui/spokes/keyboard.py | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-)
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ui/gui/spokes/keyboard.glade | 1 - pyanaconda/ui/gui/spokes/keyboard.py | 3 --- 2 files changed, 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/keyboard.glade b/pyanaconda/ui/gui/spokes/keyboard.glade index a4cd335..b0408e7 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.glade +++ b/pyanaconda/ui/gui/spokes/keyboard.glade @@ -31,7 +31,6 @@ <property name="receives_default">True</property> <property name="use_action_appearance">False</property> <property name="use_stock">True</property> - <signal name="clicked" handler="on_cancel_clicked" swapped="no"/> </object> <packing> <property name="expand">False</property> diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py index 899fc96..9e25040 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.py +++ b/pyanaconda/ui/gui/spokes/keyboard.py @@ -134,9 +134,6 @@ class AddLayoutDialog(GUIObject): selected = selection.count_selected_rows() self._confirmAddButton.set_sensitive(selected)
- def on_cancel_clicked(self, *args): - print "CANCELING" - def on_entry_changed(self, *args): self._treeModelFilter.refilter()
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ui/gui/spokes/keyboard.glade | 2 ++ pyanaconda/ui/gui/spokes/keyboard.py | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/keyboard.glade b/pyanaconda/ui/gui/spokes/keyboard.glade index b0408e7..1919a14 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.glade +++ b/pyanaconda/ui/gui/spokes/keyboard.glade @@ -108,9 +108,11 @@ <object class="GtkTreeView" id="newLayoutView"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="events">GDK_BUTTON_PRESS_MASK | GDK_STRUCTURE_MASK</property> <property name="model">newLayoutStoreSort</property> <property name="headers_visible">False</property> <property name="headers_clickable">False</property> + <signal name="button-press-event" handler="on_layout_view_button_press" swapped="no"/> <child internal-child="selection"> <object class="GtkTreeSelection" id="newLayoutSelection"> <property name="mode">multiple</property> diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py index 9e25040..dc1271f 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.py +++ b/pyanaconda/ui/gui/spokes/keyboard.py @@ -24,7 +24,8 @@ import gettext _ = lambda x: gettext.ldgettext("anaconda", x) N_ = lambda x: x
-from gi.repository import GLib, Gkbd, Gtk +# pylint: disable-msg=E0611 +from gi.repository import GLib, Gkbd, Gtk, Gdk
from pyanaconda.ui.gui import GUIObject from pyanaconda.ui.gui.spokes import NormalSpoke @@ -140,6 +141,16 @@ class AddLayoutDialog(GUIObject): def on_entry_icon_clicked(self, *args): self._entry.set_text("")
+ def on_layout_view_button_press(self, widget, event, *args): + # BUG: Gdk.EventType.2BUTTON_PRESS results in syntax error + if event.type == getattr(Gdk.EventType, "2BUTTON_PRESS"): + # double-click should close the dialog + button = self.builder.get_object("confirmAddButton") + button.emit("clicked") + + # let the other actions happen as well + return False + def _addLayout(self, store, name): store.append([name])
anaconda-patches@lists.fedorahosted.org