Put all of the menu handling code in View.
authorMatthijs Kooijman <matthijs@stdin.nl>
Tue, 3 Nov 2009 08:41:57 +0000 (09:41 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Tue, 3 Nov 2009 08:41:57 +0000 (09:41 +0100)
This leaves the keybinding code alone, for now.

src/gui/gui.py

index ea288a3d7ef8b876798824aaae955e6c5d78c053..bbb5f0a8bf6609160f74ad52e28ee261712b6845 100644 (file)
@@ -143,7 +143,7 @@ class View(object):
         Update the gui after a change in model or some user interaction.
         Should be filled by subclasses.
         """
-        pass
+        appuifw.app.menu=self.get_menu_entries()
 
     def get_menu_entries(self):
         """ Returns a list of menu entries to display. Will be
@@ -183,9 +183,6 @@ class ListView(View):
             index = 0
         self.set_bindings_for_selection(index)
 
-    def refresh(self):
-        appuifw.app.menu=self.get_menu_entries()
-
     def set_index(self,index):
         if index > len(self.widgets):
             index = len(self.widgets)