Bug on file loading from shell command fixed
authorlbessard
Fri, 29 Jun 2007 16:24:56 +0200
changeset 232 e435bbec1759
parent 231 4fd03ee0c30e
child 233 6f2936f7fb3f
Bug on file loading from shell command fixed
objdictgen/objdictedit.py
--- a/objdictgen/objdictedit.py	Thu Jun 28 16:29:41 2007 +0200
+++ b/objdictgen/objdictedit.py	Fri Jun 29 16:24:56 2007 +0200
@@ -341,10 +341,15 @@
         
         self.Manager = NodeManager(ScriptDirectory)
         for filepath in filesOpen:
-            self.Manager.OpenFileInCurrent(filepath)
-            new_editingpanel = EditingPanel(self, self.Manager)
-            self.FileOpened.AddPage(new_editingpanel, "")
-            self.FileOpened.SetSelection(self.Manager.GetCurrentNodeIndex())
+            result = self.Manager.OpenFileInCurrent(filepath)
+            if type(result) == IntType:
+                new_editingpanel = EditingPanel(self, self.Manager)
+                new_editingpanel.SetIndex(result)
+                self.FileOpened.AddPage(new_editingpanel, "")
+            window = self.FileOpened.GetPage(0)
+            if window:
+                self.Manager.ChangeCurrentNode(window.GetIndex())
+                self.FileOpened.SetSelection(0)
         if self.Manager.CurrentDS302Defined(): 
             self.EditMenu.Enable(wxID_OBJDICTEDITEDITMENUITEMS8, True)
         else: