本文整理汇总了Python中gi.repository.Gio.Settings.set_boolean方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.set_boolean方法的具体用法?Python Settings.set_boolean怎么用?Python Settings.set_boolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Gio.Settings
的用法示例。
在下文中一共展示了Settings.set_boolean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enableA11y
# 需要导入模块: from gi.repository.Gio import Settings [as 别名]
# 或者: from gi.repository.Gio.Settings import set_boolean [as 别名]
def enableA11y(enable=True):
"""
Enables accessibility via DConf.
"""
from gi.repository.Gio import Settings
InterfaceSettings = Settings(schema=a11yDConfKey)
InterfaceSettings.set_boolean('toolkit-accessibility', enable)
示例2: __init__
# 需要导入模块: from gi.repository.Gio import Settings [as 别名]
# 或者: from gi.repository.Gio.Settings import set_boolean [as 别名]
class Zoomer:
def __init__(self):
self.incr = 0.1
self._refreshSettings()
def _refreshSettings(self):
self.a11yAppPrefs = Settings('org.gnome.desktop.a11y.applications')
self.magPrefs = Settings('org.gnome.desktop.a11y.magnifier')
def zoomIn(self):
mag_factor = self.magPrefs.get_double('mag-factor')
self.magPrefs.set_double('mag-factor', mag_factor + self.incr)
self.zoomOn()
def zoomOut(self):
mag_factor = self.magPrefs.get_double('mag-factor')
self.magPrefs.set_double('mag-factor', mag_factor - self.incr)
self.zoomOn()
def zoomOff(self):
self.a11yAppPrefs.set_boolean('screen-magnifier-enabled', False)
def zoomOn(self):
self.a11yAppPrefs.set_boolean('screen-magnifier-enabled', True)
def isActive(self):
return self.a11yAppPrefs.get_boolean('screen-magnifier-enabled')
示例3: setSingleMode
# 需要导入模块: from gi.repository.Gio import Settings [as 别名]
# 或者: from gi.repository.Gio.Settings import set_boolean [as 别名]
def setSingleMode(self, single):
'''
Toggle single mode on or off.
@param single: True if we want single mode.
@type single: boolean
'''
if isinstance(self._view_model, SingleViewModel) == single:
return
gsettings = GSettings(schema=PLUGVIEWS_GSCHEMA)
gsettings.set_boolean('layout-single', single)
plugins = self._view_model.getViewedPlugins()
self._view_model.close()
del self._view_model
for plugin in plugins:
if plugin.get_parent():
plugin.get_parent().remove(plugin)
self._initViewModel(single)
for plugin in plugins:
self._view_model.addElement(plugin)