当前位置: 首页>>代码示例>>Python>>正文


Python Settings.get_boolean方法代码示例

本文整理汇总了Python中gi.repository.Gio.Settings.get_boolean方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.get_boolean方法的具体用法?Python Settings.get_boolean怎么用?Python Settings.get_boolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gi.repository.Gio.Settings的用法示例。


在下文中一共展示了Settings.get_boolean方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from gi.repository.Gio import Settings [as 别名]
# 或者: from gi.repository.Gio.Settings import get_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')
开发者ID:timthelion,项目名称:gnome-shell-zoom-control-window,代码行数:29,代码来源:GnomeZoomSettings.py

示例2: isA11yEnabled

# 需要导入模块: from gi.repository.Gio import Settings [as 别名]
# 或者: from gi.repository.Gio.Settings import get_boolean [as 别名]
def isA11yEnabled():
    """
    Checks if accessibility is enabled via DConf.
    """
    from gi.repository.Gio import Settings
    InterfaceSettings = Settings(schema=a11yDConfKey)
    dconfEnabled = InterfaceSettings.get_boolean('toolkit-accessibility')
    if os.environ.get('GTK_MODULES', '').find('gail:atk-bridge') == -1:
        envEnabled = False
    else:
        envEnabled = True  # pragma: no cover
    return (dconfEnabled or envEnabled)
开发者ID:wangweiqing,项目名称:dogtail,代码行数:14,代码来源:utils.py

示例3: __init__

# 需要导入模块: from gi.repository.Gio import Settings [as 别名]
# 或者: from gi.repository.Gio.Settings import get_boolean [as 别名]
 def __init__(self, *perm_views):
   '''
   Initialize view manager.
   
   @param perm_views: List of permanent views, at least one is required.
   @type perm_views: list of {PluginView}
   '''
   self._perm_views = perm_views
   gsettings = GSettings(schema=PLUGVIEWS_GSCHEMA)
   single = gsettings.get_boolean('layout-single')
   self._initViewModel(single)
   self._setupActions()
开发者ID:javihernandez,项目名称:accerciser,代码行数:14,代码来源:view.py

示例4: isA11yEnabled

# 需要导入模块: from gi.repository.Gio import Settings [as 别名]
# 或者: from gi.repository.Gio.Settings import get_boolean [as 别名]
def isA11yEnabled():
    """
    Checks if accessibility is enabled via DConf.
    """
    from gi.repository.Gio import Settings
    try:
        InterfaceSettings = Settings(schema_id=a11yDConfKey)
    except TypeError: # if we have older glib that has deprecated param name
        InterfaceSettings = Settings(schema=a11yDConfKey)
    dconfEnabled = InterfaceSettings.get_boolean('toolkit-accessibility')
    if os.environ.get('GTK_MODULES', '').find('gail:atk-bridge') == -1:
        envEnabled = False
    else:
        envEnabled = True  # pragma: no cover
    return (dconfEnabled or envEnabled)
开发者ID:martiinsiimon,项目名称:dogtail,代码行数:17,代码来源:utils.py


注:本文中的gi.repository.Gio.Settings.get_boolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。