diff options
author | Joshua Lock <josh@linux.intel.com> | 2011-08-23 16:35:05 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-24 19:49:33 -0700 |
commit | d1b1109e82e85f585154bdf54a36fc788c27f75d (patch) | |
tree | ae99ab3672bd5169c2212232147ffce42392e14d /bitbake/lib/bb/ui/hob.py | |
parent | 39e90c81d73ac06c7b3472d8894f3d194f9d67c8 (diff) | |
download | poky-d1b1109e82e85f585154bdf54a36fc788c27f75d.tar.gz |
hob: disable some menu entries whilst build is in progress
It doesn't make sense to be able to modify the preferences and add/remove
layers whilst a build is in progress - disable the relevant menu items once
the build has started and re-enable them once the user has returned to the
creation view.
(Bitbake rev: 0423587db09f6f28cf9d801f5657a84157f42dbe)
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/hob.py')
-rw-r--r-- | bitbake/lib/bb/ui/hob.py | 30 |
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 | ||