Reworked actions api and actions objects:
[debian/gnuradio] / grc / gui / Bars.py
index 697d48a3ced7c3bea8a578c4ae10d0db8f47b1b8..fff5ebc08d1b51f55ed2beab5c55b4cc609da328 100644 (file)
@@ -104,9 +104,8 @@ class Toolbar(gtk.Toolbar):
                """
                gtk.Toolbar.__init__(self)
                self.set_style(gtk.TOOLBAR_ICONS)
-               for action_name in TOOLBAR_LIST:
-                       if action_name: #add a tool item
-                               action = Actions.get_action_from_name(action_name)
+               for action in TOOLBAR_LIST:
+                       if action: #add a tool item
                                self.add(action.create_tool_item())
                                #this reset of the tooltip property is required (after creating the tool item) for the tooltip to show
                                action.set_property('tooltip', action.get_property('tooltip'))
@@ -123,16 +122,15 @@ class MenuBar(gtk.MenuBar):
                Add the submenu to the menu bar.
                """
                gtk.MenuBar.__init__(self)
-               for main_action,action_names in MENU_BAR_LIST:
+               for main_action, actions in MENU_BAR_LIST:
                        #create the main menu item
                        main_menu_item = main_action.create_menu_item()
                        self.append(main_menu_item)
                        #create the menu
                        main_menu = gtk.Menu()
                        main_menu_item.set_submenu(main_menu)
-                       for action_name in action_names:
-                               if action_name: #append a menu item
-                                       action = Actions.get_action_from_name(action_name)
+                       for action in actions:
+                               if action: #append a menu item
                                        main_menu.append(action.create_menu_item())
                                else: main_menu.append(gtk.SeparatorMenuItem())
                        main_menu.show_all() #this show all is required for the separators to show