Beremiz.py
changeset 678 92a1ec3c6fdd
parent 675 44b35c27e9ff
child 679 d72f3a42f440
equal deleted inserted replaced
677:607731b33026 678:92a1ec3c6fdd
   476         self.ScrollingEnabled = True
   476         self.ScrollingEnabled = True
   477         
   477         
   478         self.LastPanelSelected = None
   478         self.LastPanelSelected = None
   479         
   479         
   480         self.PluginInfos = {}
   480         self.PluginInfos = {}
       
   481         self.PluginRoot = None
   481         
   482         
   482         # Define Tree item icon list
   483         # Define Tree item icon list
   483         self.LocationImageList = wx.ImageList(16, 16)
   484         self.LocationImageList = wx.ImageList(16, 16)
   484         self.LocationImageDict = {}
   485         self.LocationImageDict = {}
   485         
   486         
   495         
   496         
   496         # Add beremiz's icon in top left corner of the frame
   497         # Add beremiz's icon in top left corner of the frame
   497         self.SetIcon(wx.Icon(Bpath( "images", "brz.ico"), wx.BITMAP_TYPE_ICO))
   498         self.SetIcon(wx.Icon(Bpath( "images", "brz.ico"), wx.BITMAP_TYPE_ICO))
   498         
   499         
   499         if projectOpen is not None and os.path.isdir(projectOpen):
   500         if projectOpen is not None and os.path.isdir(projectOpen):
   500             self.PluginRoot = PluginsRoot(self, self.Log)
   501             self.OpenProject(os.path.abspath(projectOpen))
   501             self.Controler = self.PluginRoot
       
   502             result = self.PluginRoot.LoadProject(projectOpen, buildpath)
       
   503             if not result:
       
   504                 self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE)
       
   505                 self.RefreshAll()
       
   506             else:
       
   507                 self.ResetView()
       
   508                 self.ShowErrorMessage(result)
       
   509         else:
   502         else:
   510             self.PluginRoot = plugin_root
   503             self.PluginRoot = plugin_root
   511             self.Controler = plugin_root
   504             self.Controler = plugin_root
   512             if plugin_root is not None:
   505             if plugin_root is not None:
   513                 self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE)
   506                 self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE)
   514                 self.RefreshAll()
   507                 self.RefreshAll()
       
   508             self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU)
   515         if self.EnableDebug:
   509         if self.EnableDebug:
   516             self.DebugVariablePanel.SetDataProducer(self.PluginRoot)
   510             self.DebugVariablePanel.SetDataProducer(self.PluginRoot)
   517         
   511         
   518         self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
   512         self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
   519         
   513         
   520         self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU)
       
   521         self.RefreshPluginMenu()
   514         self.RefreshPluginMenu()
   522         self.LogConsole.SetFocus()
   515         self.LogConsole.SetFocus()
   523 
   516 
   524     def RiseLogConsole(self):
   517     def RiseLogConsole(self):
   525         self.BottomNoteBook.SetSelection(self.BottomNoteBook.GetPageIndex(self.LogConsole))
   518         self.BottomNoteBook.SetSelection(self.BottomNoteBook.GetPageIndex(self.LogConsole))