diff options
author | Cristiana Voicu <cristiana.voicu@intel.com> | 2012-11-26 09:42:36 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-11-26 20:57:30 +0000 |
commit | 73b9f64357f03da95c5d4b4d0d56ff1bb1e3ff0d (patch) | |
tree | 80e061dda4e56d54a6774182d14237f53b4a8f80 /bitbake/lib/bb/ui/crumbs/hig.py | |
parent | c6dc0b976776b94ba92a7be6d69ac3fe605eff2a (diff) | |
download | poky-73b9f64357f03da95c5d4b4d0d56ff1bb1e3ff0d.tar.gz |
bitbake: hob: make some layers non removable
- there are some layers which cannot be removed; so ,I have used
a new variable called BBLAYERS_NON_REMOVABLE located in bblayers.conf,
which contains those layers which cannot be deleted
- "meta-hob" layer is added to this variable in hob code, like it's
added to BBLAYERS var
[YOCTO #3176]
(Bitbake rev: 05da1621eed4c6201cd65372d229f63ea8a44b6e)
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hig.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py index d973086102..e56cf2a759 100644 --- a/bitbake/lib/bb/ui/crumbs/hig.py +++ b/bitbake/lib/bb/ui/crumbs/hig.py | |||
@@ -1665,11 +1665,12 @@ class LayerSelectionDialog (CrumbsDialog): | |||
1665 | def add_leave_cb(self, button, event): | 1665 | def add_leave_cb(self, button, event): |
1666 | self.im.set_from_file(hic.ICON_INDI_ADD_FILE) | 1666 | self.im.set_from_file(hic.ICON_INDI_ADD_FILE) |
1667 | 1667 | ||
1668 | def __init__(self, title, layers, all_layers, parent, flags, buttons=None): | 1668 | def __init__(self, title, layers, layers_non_removable, all_layers, parent, flags, buttons=None): |
1669 | super(LayerSelectionDialog, self).__init__(title, parent, flags, buttons) | 1669 | super(LayerSelectionDialog, self).__init__(title, parent, flags, buttons) |
1670 | 1670 | ||
1671 | # class members from other objects | 1671 | # class members from other objects |
1672 | self.layers = layers | 1672 | self.layers = layers |
1673 | self.layers_non_removable = layers_non_removable | ||
1673 | self.all_layers = all_layers | 1674 | self.all_layers = all_layers |
1674 | self.layers_changed = False | 1675 | self.layers_changed = False |
1675 | 1676 | ||
@@ -1709,10 +1710,7 @@ class LayerSelectionDialog (CrumbsDialog): | |||
1709 | """ | 1710 | """ |
1710 | def draw_delete_button_cb(self, col, cell, model, it, tv): | 1711 | def draw_delete_button_cb(self, col, cell, model, it, tv): |
1711 | path = model.get_value(it, 0) | 1712 | path = model.get_value(it, 0) |
1712 | # Trailing slashes are uncommon in bblayers.conf but confuse os.path.basename | 1713 | if path in self.layers_non_removable: |
1713 | path.rstrip('/') | ||
1714 | name = os.path.basename(path) | ||
1715 | if name == "meta" or name == "meta-hob": | ||
1716 | cell.set_sensitive(False) | 1714 | cell.set_sensitive(False) |
1717 | cell.set_property('pixbuf', None) | 1715 | cell.set_property('pixbuf', None) |
1718 | cell.set_property('mode', gtk.CELL_RENDERER_MODE_INERT) | 1716 | cell.set_property('mode', gtk.CELL_RENDERER_MODE_INERT) |
@@ -1730,11 +1728,8 @@ class LayerSelectionDialog (CrumbsDialog): | |||
1730 | """ | 1728 | """ |
1731 | def draw_layer_path_cb(self, col, cell, model, it): | 1729 | def draw_layer_path_cb(self, col, cell, model, it): |
1732 | path = model.get_value(it, 0) | 1730 | path = model.get_value(it, 0) |
1733 | name = os.path.basename(path) | 1731 | if path in self.layers_non_removable: |
1734 | if name == "meta": | 1732 | cell.set_property('markup', "<b>It cannot be removed</b>\n%s" % path) |
1735 | cell.set_property('markup', "<b>Core layer for images: it cannot be removed</b>\n%s" % path) | ||
1736 | elif name == "meta-hob": | ||
1737 | cell.set_property('markup', "<b>Core layer for Hob: it cannot be removed</b>\n%s" % path) | ||
1738 | else: | 1733 | else: |
1739 | cell.set_property('text', path) | 1734 | cell.set_property('text', path) |
1740 | 1735 | ||