def set_off_the_record_mode(self, mode, update_dconf=True):
'''Sets the “Off the record” mode
:param mode: Whether to prevent saving input to the
user database or not
: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_off_the_record_mode(%s, update_dconf = %s)\n"
%(mode, update_dconf))
if mode == self._off_the_record:
return
self._off_the_record = mode
self._init_or_update_property_menu(
self.off_the_record_mode_menu, mode)
self._update_ui() # because of the indicator in the auxiliary text
if update_dconf:
self._config.set_value(
self._config_section,
'offtherecord',
GLib.Variant.new_boolean(mode))
评论列表
文章目录