plugger.py
changeset 62 ddf0cdd71558
parent 57 3b53f9a509d9
child 64 531e6a834d7e
--- a/plugger.py	Fri Oct 05 17:51:55 2007 +0200
+++ b/plugger.py	Fri Oct 05 17:55:49 2007 +0200
@@ -665,10 +665,13 @@
     
     # Update PLCOpenEditor Plugin Block types from loaded plugins
     def RefreshPluginsBlockLists(self):
-        ClearPluginTypes()
-        AddPluginBlockList(self.BlockTypesFactory())
-        for child in self.IterChilds():
-            AddPluginBlockList(child.BlockTypesFactory())
+        if getattr(self, "PluggedChilds", None) is not None:
+            ClearPluginTypes()
+            AddPluginBlockList(self.BlockTypesFactory())
+            for child in self.IterChilds():
+                AddPluginBlockList(child.BlockTypesFactory())
+        if self.PLCEditor is not None:
+            self.PLCEditor.RefreshEditor()
     
     def PlugPath(self, PlugName=None):
         return self.ProjectPath
@@ -871,7 +874,7 @@
         new_dialog.Show()
 
     def _EditPLC(self, logger):
-        if not self.PLCEditor:
+        if self.PLCEditor is None:
             self.RefreshPluginsBlockLists()
             def _onclose():
                 self.PLCEditor = None