summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoaquim Rocha <jrocha@igalia.com>2010-05-24 17:23:49 +0200
committerEitan Isaacson <eitan@monotonous.org>2010-06-10 08:47:39 -0700
commit1118b03af69071d74c5e6cd05c9dde108c15313b (patch)
tree407aaaa9da6a3edb1e9019e0287e4d5a8f8e20d4
parent752685ebdf772c479c34ab3917fa91643138919d (diff)
downloadcaribou-1118b03af69071d74c5e6cd05c9dde108c15313b.tar.gz
Add keyboard model retrieval from GConf
-rw-r--r--caribou/window.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/caribou/window.py b/caribou/window.py
index bed83c4..0d4109e 100644
--- a/caribou/window.py
+++ b/caribou/window.py
@@ -23,6 +23,10 @@ import gconf
import gtk
import gtk.gdk as gdk
import opacity
+import os
+
+CARIBOU_GCONF_LAYOUT_KEY = '/apps/caribou/osk/layout'
+CARIBOU_LAYOUT_DIR = 'caribou/keyboards'
class CaribouWindow(gtk.Window):
__gtype_name__ = "CaribouWindow"
@@ -43,7 +47,11 @@ class CaribouWindow(gtk.Window):
self._entry_location = gdk.Rectangle()
self._default_placement = default_placement or \
CaribouWindowPlacement()
-
+
+ conf_file_path = self._get_keyboard_conf()
+ if conf_file_path:
+ text_entry_mech.load_kb(conf_file_path)
+
def set_cursor_location(self, cursor_location):
self._cursor_location = cursor_location
self._update_position()
@@ -123,6 +131,14 @@ class CaribouWindow(gtk.Window):
return offset
+ def _get_keyboard_conf(self):
+ layout = self._gconf_client.get_string(CARIBOU_GCONF_LAYOUT_KEY)
+ conf_file_path = os.path.join(os.curdir,
+ CARIBOU_LAYOUT_DIR,
+ layout)
+ print conf_file_path
+ if os.path.exists(conf_file_path):
+ return conf_file_path
class CaribouWindowDocked(CaribouWindow,
animation.AnimatedWindowBase,