Exemple #1
0
    def on_default_toolbar_style_changed(self, client, *args, **kwargs):
        """
        Update the toolbar style, if the user has not selected a style
        specifically for NoStaples.
        
        Note: This method circumvents proper MVC separations in order to avoid
        recursion and should probably be revisited at some point.
        """
        preferences_model = self.application.get_preferences_model()
        preferences_view = self.application.get_preferences_view()
        
        if preferences_model.toolbar_style != 'System Default':
            return

        style = client.get_string('/desktop/gnome/interface/toolbar_style')
        
        try:
            preferences_model.toolbar_style = \
                constants.SYSTEM_TOOLBAR_STYLES[style]
        except KeyError:
            preferences_model.toolbar_style = 'Icons Only'
        
        # Reset so that future system-wide changes will be handled.
        # This must be back-ended to prevent an infinite recusion
        if preferences_model.toolbar_style != 'System Default':
            preferences_model._prop_toolbar_style = 'System Default'
            write_combobox(
                preferences_view['toolbar_style_combobox'], 
                'System Default')
Exemple #2
0
 def property_toolbar_style_value_change(self, model, old_value, new_value):
     """Select the active toolbar style in the combobox."""
     preferences_view = self.application.get_preferences_view()
     
     write_combobox(preferences_view['toolbar_style_combobox'], new_value)
     
     # If user sets to system default, need to force update from GConf
     if new_value == 'System Default':
         self.on_default_toolbar_style_changed(self.gconf_client)
Exemple #3
0
 def property_thumbnail_size_value_change(self, model, old_value, new_value):
     """Select the active thumbnail size in the combobox."""
     preferences_view = self.application.get_preferences_view()
     
     write_combobox(preferences_view['thumbnail_size_combobox'], new_value)
Exemple #4
0
 def property_preview_mode_value_change(self, model, old_value, new_value):
     """Select the active preview mode in the combobox."""
     preferences_view = self.application.get_preferences_view()
     
     write_combobox(preferences_view['preview_mode_combobox'], new_value)