Remove useless tests on refreshing edit and file menus
authorlbessard
Mon, 30 Jun 2008 14:35:41 +0200
changeset 217 ddb5b2e499e2
parent 216 93af9ac5aeaf
child 218 1b8e9bb83f25
Remove useless tests on refreshing edit and file menus
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()