[Greater-commits] r3611 - trunk/GREAT-ER/Greater/UI

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Jul 18 15:09:23 CEST 2011


Author: aheinecke
Date: 2011-07-18 15:09:22 +0200 (Mon, 18 Jul 2011)
New Revision: 3611

Modified:
   trunk/GREAT-ER/Greater/UI/mainwindow.py
Log:
Fix Menubar activations


Modified: trunk/GREAT-ER/Greater/UI/mainwindow.py
===================================================================
--- trunk/GREAT-ER/Greater/UI/mainwindow.py	2011-07-18 09:40:18 UTC (rev 3610)
+++ trunk/GREAT-ER/Greater/UI/mainwindow.py	2011-07-18 13:09:22 UTC (rev 3611)
@@ -75,8 +75,7 @@
     def OnIdle(self, event):
         """Handle disabling and enabling menu entries on demand.
 
-        The first and the last menu ('File' and 'Help') are always enabled.
-        'Simulation' is now always enabled, too.
+        The 'Help', 'File' and 'Simulation' Entries are always enabled.
         Other menus are only enabled, if there is an open session.
         """
         # FIXME: Shouldn't the menu better (de)acticated automatically
@@ -90,11 +89,11 @@
             self.prev_session_open = session_open
             self.prev_results_exist = results_exist_or_catchment
             menubar = self.GetMenuBar()
-            for idx in range(1, menubar.GetMenuCount() - 1):
+            for idx in range(0, menubar.GetMenuCount()):
                 label = menubar.GetLabelTop(idx).replace('&', '')
                 if label == 'Analysis':
                     menubar.EnableTop(idx, results_exist_or_catchment)
-                elif label != 'Simulation':
+                elif label not in ['Simulation', 'Help', 'File']:
                     menubar.EnableTop(idx, session_open)
 
         # call Skip to make sure any other idle processing is actually



More information about the Greater-commits mailing list