def set_arrow_keys_reopen_preedit(self, mode, update_dconf=True):
'''Sets whether the arrow keys are allowed to reopen a preëdit
:param mode: Whether arrow keys can reopen a preëdit
:type mode: boolean
:param update_dconf: Whether to write the change to dconf.
Set this to False if this method is
called because the dconf key changed
to avoid endless loops when the dconf
key is changed twice in a short time.
:type update_dconf: boolean
'''
if DEBUG_LEVEL > 1:
sys.stderr.write(
"set_arrow_keys_reopen_preedit(%s, update_dconf = %s)\n"
%(mode, update_dconf))
if mode == self._arrow_keys_reopen_preedit:
return
self._arrow_keys_reopen_preedit = mode
if update_dconf:
self._config.set_value(
self._config_section,
'arrowkeysreopenpreedit',
GLib.Variant.new_boolean(mode))
评论列表
文章目录