From: <ve...@us...> - 2008-03-16 21:48:30
|
Revision: 792 http://luma.svn.sourceforge.net/luma/?rev=792&view=rev Author: vegarwe Date: 2008-03-16 14:48:23 -0700 (Sun, 16 Mar 2008) Log Message: ----------- Only write plugin-config if and reload when, changes to plugin seclection has been made Modified Paths: -------------- trunk/luma/lib/luma/base/gui/MainWin.py trunk/luma/lib/luma/base/gui/PluginLoaderGui.py Modified: trunk/luma/lib/luma/base/gui/MainWin.py =================================================================== --- trunk/luma/lib/luma/base/gui/MainWin.py 2008-03-16 21:46:17 UTC (rev 791) +++ trunk/luma/lib/luma/base/gui/MainWin.py 2008-03-16 21:48:23 UTC (rev 792) @@ -267,6 +267,8 @@ dialog = PluginLoaderGui(PluginLoader('ALL').PLUGINS, self) dialog.exec_() + if (dialog.wasUpdated): + self.reloadPlugins() ############################################################################### Modified: trunk/luma/lib/luma/base/gui/PluginLoaderGui.py =================================================================== --- trunk/luma/lib/luma/base/gui/PluginLoaderGui.py 2008-03-16 21:46:17 UTC (rev 791) +++ trunk/luma/lib/luma/base/gui/PluginLoaderGui.py 2008-03-16 21:48:23 UTC (rev 792) @@ -36,6 +36,8 @@ self.checkerList = [] self.PLUGINS = tmpPlugins + + self.wasUpdated = False for x in self.PLUGINS.keys(): tmpObject = self.PLUGINS[x] @@ -97,9 +99,15 @@ tmpVal = 0 if x.checkState() == QtCore.Qt.Checked: tmpVal = 1 + + if configParser.has_option(pluginName, "load"): + oldVal = configParser.getint(pluginName, "load") + if tmpVal == oldVal: + continue configParser.set(pluginName, "load", tmpVal) configParser.write(open(self.defaultsHome, 'w')) + self.wasUpdated = True except IOError, errorData: print "Could not save to file for plugin defaults :(" print "Reason: ", errorData This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |