def __new__(cls, clear_cache = False):
     if not cls._instance:
         cls._instance = super(Settings, cls).__new__(cls)
         cls._instance.signals = Settings.signals()
         QSettings.setDefaultFormat(QSettings.IniFormat)
         log.DEBUG("saving settings in file %s" %(QSettings().fileName()));
         cls._instance._settings = QSettings()
         cls._defaults = {
              Settings.DOTA_PATH_KEY: dota_path_default,
              Settings.STEAM_PATH_KEY: steam_path_default,
          }
     if clear_cache:
         cls._instance._cache = {}
     return cls._instance
Beispiel #2
0
 def __new__(cls, clear_cache = False):
     if not cls._instance:
         cls._instance = super(Settings, cls).__new__(cls)
         cls._instance.signals = Settings.signals()
         QSettings.setDefaultFormat(QSettings.IniFormat)
         log.DEBUG("saving settings in file %s" %(QSettings().fileName()));
         cls._instance._settings = QSettings()
         cls._defaults = {
              Settings.DOTA_PATH_KEY: dota_path_default,
              Settings.STEAM_PATH_KEY: steam_path_default,
          }
     if clear_cache:
         cls._instance._cache = {}
     return cls._instance
Beispiel #3
0
    # This option is no longer used. It remains for compatibility with upgrades
    # so the value can be migrated
    c.add_opt('tag_browser_hidden_categories', default=set(),
            help=_('tag browser categories not to display'))

    c.add_opt
    return ConfigProxy(c)

config = _config()
# }}}

QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, config_dir)
QSettings.setPath(QSettings.IniFormat, QSettings.SystemScope,
        config_dir)
QSettings.setDefaultFormat(QSettings.IniFormat)

# Turn off DeprecationWarnings in windows GUI
if iswindows:
    import warnings
    warnings.simplefilter('ignore', DeprecationWarning)

def available_heights():
    desktop  = QCoreApplication.instance().desktop()
    return map(lambda x: x.height(), map(desktop.availableGeometry, range(desktop.numScreens())))

def available_height():
    desktop  = QCoreApplication.instance().desktop()
    return desktop.availableGeometry().height()

def max_available_height():
Beispiel #4
0
    # This option is no longer used. It remains for compatibility with upgrades
    # so the value can be migrated
    c.add_opt('tag_browser_hidden_categories',
              default=set(),
              help=_('tag browser categories not to display'))

    c.add_opt
    return ConfigProxy(c)


config = _config()
# }}}

QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, config_dir)
QSettings.setPath(QSettings.IniFormat, QSettings.SystemScope, config_dir)
QSettings.setDefaultFormat(QSettings.IniFormat)

# Turn off DeprecationWarnings in windows GUI
if iswindows:
    import warnings
    warnings.simplefilter('ignore', DeprecationWarning)


def available_heights():
    desktop = QCoreApplication.instance().desktop()
    return map(lambda x: x.height(),
               map(desktop.availableGeometry, range(desktop.numScreens())))


def available_height():
    desktop = QCoreApplication.instance().desktop()