summaryrefslogtreecommitdiff
path: root/setup/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup/main.py')
-rw-r--r--setup/main.py40
1 files changed, 22 insertions, 18 deletions
diff --git a/setup/main.py b/setup/main.py
index a604782..9313bb9 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -392,27 +392,33 @@ class AnthySetup(object):
for key in prefs.keys(section):
key = prefs.str(key)
value = prefs.get_value(section, key)
+ ch = prefs.typing_from_config_key(key)
+ if ch == '':
+ continue
# config.set_value(key, None) is not supported.
if value != None and len(value) == 3 and \
((value[0] != None and value[0] != '') or \
(value[1] != None and value[1] != '') or \
(value[2] != None and value[2] != '')):
- rule[key] = {}
- rule[key][0] = prefs.str(value[0])
- rule[key][1] = prefs.str(value[1])
- rule[key][2] = prefs.str(value[2])
+ rule[ch] = {}
+ rule[ch][0] = prefs.str(value[0])
+ rule[ch][1] = prefs.str(value[1])
+ rule[ch][2] = prefs.str(value[2])
for key in prefs.get_value(section_base, 'newkeys'):
key = prefs.str(key)
value = self.prefs.get_value_direct(section, key)
+ ch = prefs.typing_from_config_key(key)
+ if ch == '':
+ continue
# config.set_value(key, None) is not supported.
if value != None and len(value) == 3 and \
((value[0] != None and value[0] != '') or \
(value[1] != None and value[1] != '') or \
(value[2] != None and value[2] != '')):
- rule[key] = {}
- rule[key][0] = prefs.str(value[0])
- rule[key][1] = prefs.str(value[1])
- rule[key][2] = prefs.str(value[2])
+ rule[ch] = {}
+ rule[ch][0] = prefs.str(value[0])
+ rule[ch][1] = prefs.str(value[1])
+ rule[ch][2] = prefs.str(value[2])
for key, value in sorted(rule.items(), \
cmp = self.__japanese_thumb_sort):
ls.append(['thumb', key, value[0], value[2], value[1]])
@@ -1203,11 +1209,10 @@ class AnthySetup(object):
if section_base == None:
self.__run_message_dialog(_("Your custom key is not assigned in any sections. Maybe a bug."))
return
- if type == 'kana' or type == 'romaji':
- gkey = prefs.typing_to_config_key(key)
- if gkey == '':
- return
- key = gkey
+ gkey = prefs.typing_to_config_key(key)
+ if gkey == '':
+ return
+ key = gkey
section = section_base + '/' + method
if key not in prefs.keys(section):
# ibus does not support gconf_client_all_entries().
@@ -1250,11 +1255,10 @@ class AnthySetup(object):
return
section = section_base + '/' + method
newkeys = prefs.get_value(section_base, 'newkeys')
- if type == 'kana' or type == 'romaji':
- gkey = prefs.typing_to_config_key(key)
- if gkey == '':
- return
- key = gkey
+ gkey = prefs.typing_to_config_key(key)
+ if gkey == '':
+ return
+ key = gkey
if key in newkeys:
newkeys.remove(key)
prefs.set_value(section_base, 'newkeys', newkeys)