def set_page_size(self, page_size, update_dconf=True):
'''Sets the page size of the lookup table
:param page_size: The page size of the lookup table
:type mode: integer >= 1 and <= 9
: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_page_size(%s, update_dconf = %s)\n"
%(page_size, update_dconf))
if page_size == self._page_size:
return
if page_size >= 1 and page_size <= 9:
self._page_size = page_size
self._lookup_table.set_page_size(self._page_size)
self.reset()
if update_dconf:
self._config.set_value(
self._config_section,
'pagesize',
GLib.Variant.new_int32(page_size))
评论列表
文章目录