summaryrefslogtreecommitdiff
path: root/caribou
diff options
context:
space:
mode:
authorEitan Isaacson <eitan@monotonous.org>2011-05-31 13:11:43 -0700
committerEitan Isaacson <eitan@monotonous.org>2011-06-01 12:47:01 -0700
commit0b377562a5d294f974883104133c39f14b147211 (patch)
tree720b49fd1e2fa4eb54f6cb3423f245226cf231a2 /caribou
parent8c68108c6c03de869ffe712bf8d898ced88b6553 (diff)
downloadcaribou-0b377562a5d294f974883104133c39f14b147211.tar.gz
Aggregate button activation signals.
Diffstat (limited to 'caribou')
-rw-r--r--caribou/antler/keyboard_view.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/caribou/antler/keyboard_view.py b/caribou/antler/keyboard_view.py
index ff77b75..49a32f0 100644
--- a/caribou/antler/keyboard_view.py
+++ b/caribou/antler/keyboard_view.py
@@ -37,8 +37,6 @@ class AntlerKey(Gtk.Button):
ctx = self.get_style_context()
ctx.add_class("antler-keyboard-button")
- if key.props.name == "Caribou_Prefs":
- key.connect("key-clicked", self._on_prefs_clicked)
if key.get_extended_keys ():
self._sublevel = AntlerSubLevel(self)
@@ -61,13 +59,6 @@ class AntlerKey(Gtk.Button):
else:
self.unset_state_flags(Gtk.StateFlags.INCONSISTENT)
- def _on_prefs_clicked(self, key):
- p = PreferencesDialog(AntlerSettings())
- p.populate_settings(CaribouSettings())
- p.show_all()
- p.run()
- p.destroy()
-
def _get_key_label(self):
label = self.caribou_key.props.name
if PRETTY_LABELS.has_key(self.caribou_key.props.name):
@@ -233,6 +224,7 @@ class AntlerKeyboardView(Gtk.Notebook):
self.scanner = Caribou.Scanner()
self.scanner.set_keyboard(self.keyboard_model)
self.keyboard_model.connect("notify::active-group", self._on_group_changed)
+ self.keyboard_model.connect("key-activated", self._on_key_activated)
self.layers = {}
@@ -268,6 +260,14 @@ class AntlerKeyboardView(Gtk.Notebook):
self._set_to_active_layer()
+ def _on_key_activated(self, model, key):
+ if key.props.name == "Caribou_Prefs":
+ p = PreferencesDialog(AntlerSettings())
+ p.populate_settings(CaribouSettings())
+ p.show_all()
+ p.run()
+ p.destroy()
+
def _on_use_system_theme_changed(self, setting, value):
if value:
Gtk.StyleContext.remove_provider_for_screen(