Esempio n. 1
0
    def _save_config(self):
        autostart = self._switch_daemon_enabled.get_active()
        self._cfg.set('core', 'autostart', int(autostart))

        self._accountman.save_to_cfg(self._cfg)

        enabled_plugins = ''
        for row in self._liststore_plugins:
            plugin = row[0]
            modname = plugin.get_modname()

            if row[1] == True:
                if len(enabled_plugins) > 0:
                    enabled_plugins += ', '
                enabled_plugins += modname

            config = plugin.get_config()
            if len(config) > 0:
                if not self._cfg.has_section(modname):
                    self._cfg.add_section(modname)
                for k, v in config.iteritems():
                    self._cfg.set(modname, k, v)

        self._cfg.set('core', 'enabled_plugins', enabled_plugins)

        write_cfg(self._cfg)

        if autostart: self._create_autostart()
        else: self._delete_autostart()
Esempio n. 2
0
	def _save_config(self):
		autostart = self._switch_daemon_enabled.get_active()
		self._cfg.set('core', 'autostart', int(autostart))

		self._accountman.save_to_cfg(self._cfg)
		
		enabled_plugins = ''
		for row in self._liststore_plugins:
			plugin = row[0]
			modname = plugin.get_modname()
			
			if row[1] == True:
				if len(enabled_plugins) > 0:
					enabled_plugins += ', '
				enabled_plugins += modname
			
			config = plugin.get_config()
			if len(config) > 0:
				if not self._cfg.has_section(modname):
					self._cfg.add_section(modname)
				for k, v in config.iteritems():
					self._cfg.set(modname, k, v)
		
		self._cfg.set('core', 'enabled_plugins', enabled_plugins)
		
		write_cfg(self._cfg)

		if autostart: self._create_autostart()
		else: self._delete_autostart()