summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/ui/hob.py30
1 files changed, 24 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index 72786432bc..c2acadac91 100644
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -469,12 +469,21 @@ class MainWindow (gtk.Window):
469 else: 469 else:
470 self.handler.build_packages(self.model.get_selected_pn()) 470 self.handler.build_packages(self.model.get_selected_pn())
471 471
472 # Disable parts of the menu which shouldn't be used whilst building
473 self.set_menus_sensitive(False)
472 self.nb.set_current_page(1) 474 self.nb.set_current_page(1)
473 475
476 def set_menus_sensitive(self, sensitive):
477 self.add_layers_action.set_sensitive(sensitive)
478 self.layers_action.set_sensitive(sensitive)
479 self.prefs_action.set_sensitive(sensitive)
480 self.open_action.set_sensitive(sensitive)
481
474 def back_button_clicked_cb(self, button): 482 def back_button_clicked_cb(self, button):
475 self.toggle_createview() 483 self.toggle_createview()
476 484
477 def toggle_createview(self): 485 def toggle_createview(self):
486 self.set_menus_sensitive(True)
478 self.build.model.clear() 487 self.build.model.clear()
479 self.nb.set_current_page(0) 488 self.nb.set_current_page(0)
480 489
@@ -816,18 +825,27 @@ class MainWindow (gtk.Window):
816 825
817 actions = gtk.ActionGroup('ImageCreator') 826 actions = gtk.ActionGroup('ImageCreator')
818 self.actions = actions 827 self.actions = actions
819 actions.add_actions([('Quit', gtk.STOCK_QUIT, None, None, 828 actions.add_actions([('Quit', gtk.STOCK_QUIT, None, None, None, self.menu_quit,),
820 None, self.menu_quit,),
821 ('File', None, '_File'), 829 ('File', None, '_File'),
822 ('Save', gtk.STOCK_SAVE, None, None, None, self.save_cb), 830 ('Save', gtk.STOCK_SAVE, None, None, None, self.save_cb),
823 ('Save As', gtk.STOCK_SAVE_AS, None, None, None, self.save_as_cb), 831 ('Save As', gtk.STOCK_SAVE_AS, None, None, None, self.save_as_cb),
824 ('Open', gtk.STOCK_OPEN, None, None, None, self.open_cb),
825 ('AddLayer', None, 'Add Layer', None, None, self.add_layer_cb),
826 ('Edit', None, '_Edit'), 832 ('Edit', None, '_Edit'),
827 ('Help', None, '_Help'), 833 ('Help', None, '_Help'),
828 ('Layers', None, 'Layers', None, None, self.layers_cb),
829 ('Preferences', gtk.STOCK_PREFERENCES, None, None, None, self.preferences_cb),
830 ('About', gtk.STOCK_ABOUT, None, None, None, self.about_cb)]) 834 ('About', gtk.STOCK_ABOUT, None, None, None, self.about_cb)])
835
836 self.add_layers_action = gtk.Action('AddLayer', 'Add Layer', None, None)
837 self.add_layers_action.connect("activate", self.add_layer_cb)
838 self.actions.add_action(self.add_layers_action)
839 self.layers_action = gtk.Action('Layers', 'Layers', None, None)
840 self.layers_action.connect("activate", self.layers_cb)
841 self.actions.add_action(self.layers_action)
842 self.prefs_action = gtk.Action('Preferences', 'Preferences', None, None)
843 self.prefs_action.connect("activate", self.preferences_cb)
844 self.actions.add_action(self.prefs_action)
845 self.open_action = gtk.Action('Open', 'Open', None, None)
846 self.open_action.connect("activate", self.open_cb)
847 self.actions.add_action(self.open_action)
848
831 uimanager.insert_action_group(actions, 0) 849 uimanager.insert_action_group(actions, 0)
832 uimanager.add_ui_from_string(menu_items) 850 uimanager.add_ui_from_string(menu_items)
833 851