# HG changeset patch
# User lbessard
# Date 1220200867 -7200
# Node ID fdd05081c966aec9c5db02695ffc0027e2ee3805
# Parent  05f6e0d7710ce3485dc3821c3af23b648f40d2e8
Bug when reopen files on Windows fixed

diff -r 05f6e0d7710c -r fdd05081c966 PLCOpenEditor.py
--- a/PLCOpenEditor.py	Thu Aug 28 14:32:42 2008 +0200
+++ b/PLCOpenEditor.py	Sun Aug 31 18:41:07 2008 +0200
@@ -1684,11 +1684,13 @@
     def RefreshLibraryTree(self):
         to_delete = []
         blocktypes = self.Controler.GetBlockTypes()
-        if wx.Platform == '__WXMSW__':
-            root = self.LibraryTree.AddRoot("Block Types")
-            self.LibraryTree.SetPyData(root, {"type" : CATEGORY})
-        else:
-            root = self.LibraryTree.AddRoot("")
+        root = self.LibraryTree.GetRootItem()
+        if not root.IsOk():
+            if wx.Platform == '__WXMSW__':
+                root = self.LibraryTree.AddRoot("Block Types")
+                self.LibraryTree.SetPyData(root, {"type" : CATEGORY})
+            else:
+                root = self.LibraryTree.AddRoot("")
         if wx.VERSION >= (2, 6, 0):
             category_item, root_cookie = self.LibraryTree.GetFirstChild(root)
         else: