# HG changeset patch # User lbessard # Date 1214829341 -7200 # Node ID ddb5b2e499e2b02b25d984a31a9b1d061717a64b # Parent 93af9ac5aeaf7c1f4bce285157492ec7928992f9 Remove useless tests on refreshing edit and file menus diff -r 93af9ac5aeaf -r ddb5b2e499e2 PLCOpenEditor.py --- a/PLCOpenEditor.py Mon Jun 30 14:35:06 2008 +0200 +++ b/PLCOpenEditor.py Mon Jun 30 14:35:41 2008 +0200 @@ -667,7 +667,7 @@ #------------------------------------------------------------------------------- def RefreshFileMenu(self): - if self.FileMenu: + if self.ModeSolo: if self.Controler.HasOpenedProject(): selected = self.GetPageSelection() if selected >= 0: @@ -897,31 +897,30 @@ #------------------------------------------------------------------------------- def RefreshEditMenu(self): - if self.EditMenu: - if self.Controler.HasOpenedProject(): - undo, redo = self.Controler.GetBufferState() - self.EditMenu.Enable(wx.ID_UNDO, undo) - self.EditMenu.Enable(wx.ID_REDO, redo) - else: - self.EditMenu.Enable(wx.ID_UNDO, False) - self.EditMenu.Enable(wx.ID_REDO, False) - if self.Controler.HasOpenedProject(): - if self.GetPageCount() > 0: - self.EditMenu.Enable(wx.ID_REFRESH, True) - else: - self.EditMenu.Enable(wx.ID_REFRESH, False) - self.EditMenu.Enable(wx.ID_ADD, True) - self.EditMenu.Enable(wx.ID_DELETE, True) + if self.Controler.HasOpenedProject(): + undo, redo = self.Controler.GetBufferState() + self.EditMenu.Enable(wx.ID_UNDO, undo) + self.EditMenu.Enable(wx.ID_REDO, redo) + else: + self.EditMenu.Enable(wx.ID_UNDO, False) + self.EditMenu.Enable(wx.ID_REDO, False) + if self.Controler.HasOpenedProject(): + if self.GetPageCount() > 0: + self.EditMenu.Enable(wx.ID_REFRESH, True) else: self.EditMenu.Enable(wx.ID_REFRESH, False) - self.EditMenu.Enable(wx.ID_ADD, False) - self.EditMenu.Enable(wx.ID_DELETE, False) - self.EditMenu.Enable(wx.ID_CUT, True) - self.EditMenu.Enable(wx.ID_COPY, True) - if self.CopyBuffer is not None: - self.EditMenu.Enable(wx.ID_PASTE, True) - else: - self.EditMenu.Enable(wx.ID_PASTE, False) + self.EditMenu.Enable(wx.ID_ADD, True) + self.EditMenu.Enable(wx.ID_DELETE, True) + else: + self.EditMenu.Enable(wx.ID_REFRESH, False) + self.EditMenu.Enable(wx.ID_ADD, False) + self.EditMenu.Enable(wx.ID_DELETE, False) + self.EditMenu.Enable(wx.ID_CUT, True) + self.EditMenu.Enable(wx.ID_COPY, True) + if self.CopyBuffer is not None: + self.EditMenu.Enable(wx.ID_PASTE, True) + else: + self.EditMenu.Enable(wx.ID_PASTE, False) def OnRefreshMenu(self, event): selected = self.GetPageSelection()