(self, cell, path)
A plugin has been enabled or disabled
A plugin has been enabled or disabled
A plugin has been enabled or disabled
def on_plugin_toggled(self, cell, path):
        """A plugin has been enabled or disabled"""
        treeview = self.builder.get_object('pluginlist')
        model = treeview.get_model()
        plugin = model[path][0]

        if not self.plugins[plugin]:
            # Plugin is currently disabled, load it
            self.registry.enable(plugin)
        else:
            # Plugin is currently enabled, unload it
            self.registry.disable(plugin)

        self.plugins[plugin] = not self.plugins[plugin]
        # Update the treeview
        model[path][1] = self.plugins[plugin]

        enabled_plugins = [x for x in self.plugins if self.plugins[x] == True]
        self.config['enabled_plugins'] = enabled_plugins
        self.config.save()
def on_plugin_toggled ( self , cell , path ) : treeview = self . builder . get_object ( 'pluginlist' ) model = treeview . get_model ( ) plugin = model [ path ] [ 0 ] if not self . plugins [ plugin ] : # Plugin is currently disabled, load it self . registry . enable ( plugin ) else : # Plugin is currently enabled, unload it self . registry . disable ( plugin ) self . plugins [ plugin ] = not self . plugins [ plugin ] # Update the treeview model [ path ] [ 1 ] = self . plugins [ plugin ] enabled_plugins = [ x for x in self . plugins if self . plugins [ x ] == True ] self . config [ 'enabled_plugins' ] = enabled_plugins self . config . save ( )