# HG changeset patch # User laurent # Date 1318183836 -7200 # Node ID 31976c61c70176243f459b4169830516460b6f68 # Parent eb523c4fa2da5a21c90664f553a36edfe7d0763b Fix bug when opening another project while current edited project has at least one tab opened diff -r eb523c4fa2da -r 31976c61c701 PLCOpenEditor.py --- a/PLCOpenEditor.py Sun Oct 09 20:04:35 2011 +0200 +++ b/PLCOpenEditor.py Sun Oct 09 20:10:36 2011 +0200 @@ -1203,10 +1203,12 @@ if USE_AUI: for child in self.TabsOpened.GetChildren(): if isinstance(child, wx.aui.AuiTabCtrl): - window = child.GetWindowFromIdx(child.GetActivePage()) - window.RefreshView() - if not window.IsDebugging() and self.TabsOpened.GetPageIndex(window) == selected and variablepanel: - self.RefreshVariablePanel(window.GetTagName()) + active_page = child.GetActivePage() + if active_page >= 0: + window = child.GetWindowFromIdx(child.GetActivePage()) + window.RefreshView() + if not window.IsDebugging() and self.TabsOpened.GetPageIndex(window) == selected and variablepanel: + self.RefreshVariablePanel(window.GetTagName()) elif selected >= 0: window = self.TabsOpened.GetPage(idx) window.RefreshView()