Example #1
0
    def _check_prefs(self, prefs):
        """
        Check if preferences are set properly. Set new ones if required.
        Return the new version.
        """
        if prefs is None:
            prefs = Preferences()
        else:
            try:
                bg = prefs.GetValue('M_BG_COLOUR')
                fg = prefs.GetValue('M_FG_COLOUR')
                font = prefs.GetValue('M_FONT')
            except Exception:
                self._prefsIO.SetTheme(sppasTheme())

        try:
            mult = prefs.GetValue('F_CCB_MULTIPLE')
        except Exception:
            prefs.SetValue(
                'F_CCB_MULTIPLE',
                t='bool',
                v=True,
                text=
                'Allow to check/uncheck multiple files in the file manager.')

        try:
            space = prefs.GetValue('F_SPACING')
        except Exception:
            prefs.SetValue('F_SPACING',
                           t='int',
                           v=2,
                           text='Space before each item of the file manager.')

        return prefs
    def _check_prefs(self, prefs):
        """
        Check if preferences are set properly. Set new ones if required.
        Return the new version.
        """
        if prefs is None:
            prefs = Preferences(sppasTheme())
        else:
            try:
                prefs.GetValue('M_BG_COLOUR')
                prefs.GetValue('M_FG_COLOUR')
                prefs.GetValue('M_FONT')
                prefs.GetValue('M_ICON_THEME')
            except Exception:
                self._prefsIO.SetTheme(sppasTheme())
                prefs = self._prefsIO

        prefs.SetValue('SND_INFO',       'bool', True)
        prefs.SetValue('SND_PLAY',       'bool', True)
        prefs.SetValue('SND_AUTOREPLAY', 'bool', False)
        prefs.SetValue('SND_PAUSE',      'bool', True)
        prefs.SetValue('SND_STOP',       'bool', False)
        prefs.SetValue('SND_NEXT',       'bool', False)
        prefs.SetValue('SND_REWIND',     'bool', False)
        prefs.SetValue('SND_EJECT',      'bool', False)

        return prefs