# HG changeset patch # User laurent # Date 1260373882 -3600 # Node ID 898648a09e13beb28438d0ac39f5e9aa1c723a89 # Parent e3adb9f63171fcc6f09382fd1ff2adfba94ac293 One issue on SetDataProducer not handled fixed diff -r e3adb9f63171 -r 898648a09e13 Beremiz.py --- a/Beremiz.py Wed Dec 09 16:46:59 2009 +0100 +++ b/Beremiz.py Wed Dec 09 16:51:22 2009 +0100 @@ -409,7 +409,6 @@ self.Controler = self.PluginRoot result = self.PluginRoot.LoadProject(projectOpen, buildpath) if not result: - self.DebugVariablePanel.SetDataProducer(self.PluginRoot) self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE) self.RefreshAll() else: @@ -421,6 +420,9 @@ if plugin_root is not None: self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE) self.RefreshAll() + if self.EnableDebug: + self.DebugVariablePanel.SetDataProducer(self.PluginRoot) + # Add beremiz's icon in top left corner of the frame self.SetIcon(wx.Icon(Bpath( "images", "brz.ico"), wx.BITMAP_TYPE_ICO)) @@ -516,8 +518,8 @@ def OnCloseFrame(self, event): if self.PluginRoot is None or self.CheckSaveBeforeClosing(_("Close Application")): + self.PluginRoot.KillDebugThread() self.KillLocalRuntime() - self.PluginRoot.KillDebugThread() event.Skip() else: event.Veto() @@ -1321,7 +1323,8 @@ self.PluginRoot.CloseProject() self.PluginRoot = None self.Log.flush() - self.DebugVariablePanel.SetDataProducer(None) + if self.EnableDebug: + self.DebugVariablePanel.SetDataProducer(None) def OnNewProjectMenu(self, event): if self.PluginRoot is not None and not self.CheckSaveBeforeClosing(): @@ -1343,7 +1346,8 @@ self.Controler = self.PluginRoot result = self.PluginRoot.NewProject(projectpath) if not result: - self.DebugVariablePanel.SetDataProducer(self.PluginRoot) + if self.EnableDebug: + self.DebugVariablePanel.SetDataProducer(self.PluginRoot) self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE) self.RefreshAll() else: @@ -1371,7 +1375,8 @@ self.Controler = self.PluginRoot result = self.PluginRoot.LoadProject(projectpath) if not result: - self.DebugVariablePanel.SetDataProducer(self.PluginRoot) + if self.EnableDebug: + self.DebugVariablePanel.SetDataProducer(self.PluginRoot) self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE) self.RefreshAll() else: