Quantcast

* Add checks for self.db.plugins[name].disabled

James Whitehead II [12-16-08 - 09:33]
* Add checks for self.db.plugins[name].disabled
Filename
NinjaPanel.lua
diff --git a/NinjaPanel.lua b/NinjaPanel.lua
index 186eb3d..b08eff2 100644
--- a/NinjaPanel.lua
+++ b/NinjaPanel.lua
@@ -125,12 +125,20 @@ function NinjaPanel:SpawnPlugin(name, object, type)
 	ldb.RegisterCallback(self, "LibDataBroker_AttributeChanged_" .. name, "UpdatePlugin")
 end

+function NinjaPanel:PluginIsDisabled(name)
+	if db.plugins[name] then
+		return db.plugins[name].disabled
+	else
+		return false
+	end
+end
+
 function NinjaPanel:ScanForPlugins()
 	self.warned = self.warned or {}

 	local changed = false
 	for name,dataobj in ldb:DataObjectIterator() do
-		if not self:HasPlugin(name) then
+		if not self:HasPlugin(name) and not self:PluginIsDisabled(name) then
 			if dataobj.type == "data source" or dataobj.text then
 				self:SpawnPlugin(name, dataobj, "data source")
 				changed = true