def set_show_number_of_candidates(self, mode, update_dconf=True):
'''Sets the “Show number of candidates” mode
:param mode: Whether to show the number of candidates
in the auxiliary text
: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_show_number_of_candidates(%s, update_dconf = %s)\n"
%(mode, update_dconf))
if mode == self._show_number_of_candidates:
return
self._show_number_of_candidates = mode
self.reset()
if update_dconf:
self._config.set_value(
self._config_section,
'shownumberofcandidates',
GLib.Variant.new_boolean(mode))
评论列表
文章目录