summaryrefslogtreecommitdiff
path: root/caribou/ui/keyboard.py
diff options
context:
space:
mode:
Diffstat (limited to 'caribou/ui/keyboard.py')
-rw-r--r--caribou/ui/keyboard.py31
1 files changed, 21 insertions, 10 deletions
diff --git a/caribou/ui/keyboard.py b/caribou/ui/keyboard.py
index ec1aac4..ace93b0 100644
--- a/caribou/ui/keyboard.py
+++ b/caribou/ui/keyboard.py
@@ -415,18 +415,24 @@ class CaribouKeyboard(gtk.Notebook):
self.key_size = 30
self.current_mask = 0
self.current_page = 0
+ self._gconf_connections = []
self.client = gconf.client_get_default()
- self.client.notify_add(const.CARIBOU_GCONF + "/normal_color",
- self._colors_changed)
- self.client.notify_add(const.CARIBOU_GCONF + "/mouse_over_color",
- self._colors_changed)
- self.client.notify_add(const.CARIBOU_GCONF + "/default_colors",
- self._colors_changed)
- self.client.notify_add(const.CARIBOU_GCONF + "/default_font",
- self._key_font_changed)
- self.client.notify_add(const.CARIBOU_GCONF + "/key_font",
- self._key_font_changed)
+ self._gconf_connections.append(self.client.notify_add(
+ const.CARIBOU_GCONF + "/normal_color",
+ self._colors_changed))
+ self._gconf_connections.append(self.client.notify_add(
+ const.CARIBOU_GCONF + "/mouse_over_color",
+ self._colors_changed))
+ self._gconf_connections.append(self.client.notify_add(
+ const.CARIBOU_GCONF + "/default_colors",
+ self._colors_changed))
+ self._gconf_connections.append(self.client.notify_add(
+ const.CARIBOU_GCONF + "/default_font",
+ self._key_font_changed))
+ self._gconf_connections.append(self.client.notify_add(
+ const.CARIBOU_GCONF + "/key_font",
+ self._key_font_changed))
self.connect('size-allocate', self._on_size_allocate)
@@ -548,6 +554,11 @@ class CaribouKeyboard(gtk.Notebook):
def _pressed_preferences_key(self, key):
self.keyboard_preferences.window.show_all()
+ def destroy(self):
+ for id in self._gconf_connections:
+ self.client.notify_remove(id)
+ super(gtk.Notebook, self).destroy()
+
def _switch_to_layout(self, name):
n_pages = self.get_n_pages()
for i in range(n_pages):