summaryrefslogtreecommitdiffstats
path: root/setup/shortcuteditor.py
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2018-03-13 13:41:32 +0800
committerPeng Wu <alexepico@gmail.com>2018-03-13 13:41:32 +0800
commit490ad011a162e4867a6ba044f07e7cace7207ae1 (patch)
tree8c1d0e314acd021603804576bf361420b04c1dfb /setup/shortcuteditor.py
parent84c420e0ec0f2f4a16f0a4e99be3a68114b9ebc5 (diff)
downloadibus-libpinyin-490ad011a162e4867a6ba044f07e7cace7207ae1.tar.gz
ibus-libpinyin-490ad011a162e4867a6ba044f07e7cace7207ae1.tar.xz
ibus-libpinyin-490ad011a162e4867a6ba044f07e7cace7207ae1.zip
use GSettings in setup dialog
Diffstat (limited to 'setup/shortcuteditor.py')
-rw-r--r--setup/shortcuteditor.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/setup/shortcuteditor.py b/setup/shortcuteditor.py
index ab94f38..a1b61af 100644
--- a/setup/shortcuteditor.py
+++ b/setup/shortcuteditor.py
@@ -43,10 +43,10 @@ COLUMN_ACCELERATOR,
# The default shortcut value is stored here.
accelerators = \
(
- (_("Switch Chinese/English"), "main_switch" , "<Shift>"),
- (_("Full/Half Width Letter"), "letter_switch", ""),
- (_("Full/Half Width Punct"), "punct_switch", "<Control>period"),
- (_("Switch Traditional/Simplfied Chinese"), "trad_switch", "<Control><Shift>f")
+ (_("Switch Chinese/English"), "main-switch" , "<Shift>"),
+ (_("Full/Half Width Letter"), "letter-switch", ""),
+ (_("Full/Half Width Punct"), "punct-switch", "<Control>period"),
+ (_("Switch Traditional/Simplfied Chinese"), "trad-switch", "<Control><Shift>f")
)
class ShortcutTreeView(Gtk.TreeView):
@@ -211,12 +211,12 @@ class ShortcutEditor(Gtk.Box):
def emit_shortcut_changed(self, key, value):
self.emit("shortcut-changed", key, value)
- def update_shortcuts(self, values):
+ def update_shortcuts(self, config):
for label, keyname, defvalue in accelerators:
- value = values[keyname] if keyname in values else defvalue
+ value = config.get_value(keyname).get_string()
self.__shortcut_treeview.set_shortcut_value(keyname, value)
# store the default value
- self.emit_shortcut_changed(keyname, value)
+ # self.emit_shortcut_changed(keyname, value)
class ShortcutEditorDialog(Gtk.Dialog):
def __init__(self, title = None, transient_for = None, flags = 0):