Bugs when expanded and collapsing plugin tree and location tree fixed
authorlaurent
Tue, 06 Oct 2009 11:55:32 +0200
changeset 405 7bbbcddb72db
parent 404 dbe88e319bdf
child 406 18811cff50e6
Bugs when expanded and collapsing plugin tree and location tree fixed
Beremiz.py
--- a/Beremiz.py	Tue Oct 06 11:13:13 2009 +0200
+++ b/Beremiz.py	Tue Oct 06 11:55:32 2009 +0200
@@ -713,22 +713,20 @@
         for child in self.PluginInfos[plugin]["children"]:
             self.PluginInfos[child]["left"].Hide()
             self.PluginInfos[child]["right"].Hide()
-            if force or self.PluginInfos[child]["expanded"]:
-                self.CollapsePlugin(child, force)
-                if force:
-                    self.PluginInfos[child]["expanded"] = False
+            self.CollapsePlugin(child, force)
+            if force:
+                self.PluginInfos[child]["expanded"] = False
         locations_infos = self.PluginInfos[plugin].get("locations_infos", None)
         if locations_infos is not None:
-            if force or not locations_infos["root"]["expanded"]:
-                self.CollapseLocation(locations_infos, "root", force)
-                if force:
-                    locations_infos["root"]["expanded"] = False
+            self.CollapseLocation(locations_infos, "root", force)
+            if force:
+                locations_infos["root"]["expanded"] = False
 
     def ExpandLocation(self, locations_infos, group, force = False):
         for child in locations_infos[group]["children"]:
             locations_infos[child]["left"].Show()
             locations_infos[child]["right"].Show()
-            if force or not locations_infos[child]["expanded"]:
+            if force or locations_infos[child]["expanded"]:
                 self.ExpandLocation(locations_infos, child, force)
                 if force:
                     locations_infos[child]["expanded"] = True
@@ -737,10 +735,9 @@
         for child in locations_infos[group]["children"]:
             locations_infos[child]["left"].Hide()
             locations_infos[child]["right"].Hide()
-            if force or locations_infos[child]["expanded"]:
-                self.CollapseLocation(locations_infos, child, force)
-                if force:
-                    locations_infos[child]["expanded"] = False
+            self.CollapseLocation(locations_infos, child, force)
+            if force:
+                locations_infos[child]["expanded"] = False
 
     def GenerateTreeBranch(self, plugin):
         leftwindow = wx.Panel(self.PLCConfig, -1, size=wx.Size(-1, -1))