summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVratislav Podzimek <vpodzime@redhat.com>2012-09-24 20:13:20 +0200
committerVratislav Podzimek <vpodzime@redhat.com>2012-09-26 11:00:00 +0200
commit05a20f70a74ec71d80fc1c2ea163713b33897b2b (patch)
tree986b8eff93d99be9b5bb63e8d7418d69caaa6e45
parent12376658ce63c00cc8f73c2f99d80eb3b3c32089 (diff)
downloadanaconda-05a20f70a74ec71d80fc1c2ea163713b33897b2b.tar.gz
anaconda-05a20f70a74ec71d80fc1c2ea163713b33897b2b.tar.xz
anaconda-05a20f70a74ec71d80fc1c2ea163713b33897b2b.zip
Close AddLayout dialog on double-click
-rw-r--r--pyanaconda/ui/gui/spokes/keyboard.glade2
-rw-r--r--pyanaconda/ui/gui/spokes/keyboard.py13
2 files changed, 14 insertions, 1 deletions
diff --git a/pyanaconda/ui/gui/spokes/keyboard.glade b/pyanaconda/ui/gui/spokes/keyboard.glade
index b0408e796..1919a14b8 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 9e250408e..dc1271f5c 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])