예제 #1
0
    def apply_theme(self):
        theme_filename = self.theme_filename
        _logger.info(_("Loading theme from '{}'").format(theme_filename))

        theme = Theme.load(theme_filename)
        if not theme:
            _logger.error(_("Unable to read theme '{}'").format(theme_filename))
        else:
            # Save to gsettings
            # Make sure gsettings is in sync with onboard (LP: 877601)
            self.theme = theme_filename
            theme.apply()

            # Fix theme not saved to gesettings when switching
            # system contrast themes.
            # Possible gsettings bug in Precise (wasn't in Oneiric).
            self.settings.apply()
예제 #2
0
 def cb_theme_changed(self, theme_filename):
     # load and apply the theme
     theme = Theme.load(theme_filename)
     if theme:
         theme.apply()