diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2012-05-22 11:08:34 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-22 14:56:16 +0100 |
commit | 7690c45c711853c8df64b338847263488c56fcae (patch) | |
tree | 42ff4bcf38a9dfa36d7637fb1e59f814eb06d9a9 /bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | |
parent | e069e53536e4894507a72da79e7e8af55a0d31b1 (diff) | |
download | poky-7690c45c711853c8df64b338847263488c56fcae.tar.gz |
Hob: Add filter for images listed in image combo
Define BBUI_IMAGE_WHITE_PATTERN variable to indicate which image is
allowed to be displayed in image combobox.
Define BBUI_IMAGE_BLACK_PATTERN variable to indicate which image is NOT
allowed to be displayed in image combobox.
This fixes [YOCTO #1581]
(Bitbake rev: 960461bc12945675af3081eb469f932f4a6eb1cd)
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py index 95d48b9836..20a398cf50 100644 --- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | import gtk | 23 | import gtk |
24 | import glib | 24 | import glib |
25 | import re | ||
25 | from bb.ui.crumbs.progressbar import HobProgressBar | 26 | from bb.ui.crumbs.progressbar import HobProgressBar |
26 | from bb.ui.crumbs.hobcolor import HobColors | 27 | from bb.ui.crumbs.hobcolor import HobColors |
27 | from bb.ui.crumbs.hobwidget import hic, HobImageButton, HobInfoButton, HobAltButton, HobButton | 28 | from bb.ui.crumbs.hobwidget import hic, HobImageButton, HobInfoButton, HobAltButton, HobButton |
@@ -345,6 +346,16 @@ class ImageConfigurationPage (HobPage): | |||
345 | active = -1 | 346 | active = -1 |
346 | cnt = 0 | 347 | cnt = 0 |
347 | 348 | ||
349 | white_pattern = [] | ||
350 | if self.builder.parameters.image_white_pattern: | ||
351 | for i in self.builder.parameters.image_white_pattern.split(): | ||
352 | white_pattern.append(re.compile(i)) | ||
353 | |||
354 | black_pattern = [] | ||
355 | if self.builder.parameters.image_black_pattern: | ||
356 | for i in self.builder.parameters.image_black_pattern.split(): | ||
357 | black_pattern.append(re.compile(i)) | ||
358 | |||
348 | it = image_model.get_iter_first() | 359 | it = image_model.get_iter_first() |
349 | self._image_combo_disconnect_signal() | 360 | self._image_combo_disconnect_signal() |
350 | model = self.image_combo.get_model() | 361 | model = self.image_combo.get_model() |
@@ -356,10 +367,28 @@ class ImageConfigurationPage (HobPage): | |||
356 | image_name = image_model[path][recipe_model.COL_NAME] | 367 | image_name = image_model[path][recipe_model.COL_NAME] |
357 | if image_name == self.builder.recipe_model.__dummy_image__: | 368 | if image_name == self.builder.recipe_model.__dummy_image__: |
358 | continue | 369 | continue |
359 | self.image_combo.append_text(image_name) | 370 | |
360 | if image_name == selected_image: | 371 | if black_pattern: |
361 | active = cnt | 372 | allow = True |
362 | cnt = cnt + 1 | 373 | for pattern in black_pattern: |
374 | if pattern.search(image_name): | ||
375 | allow = False | ||
376 | break | ||
377 | elif white_pattern: | ||
378 | allow = False | ||
379 | for pattern in white_pattern: | ||
380 | if pattern.search(image_name): | ||
381 | allow = True | ||
382 | break | ||
383 | else: | ||
384 | allow = True | ||
385 | |||
386 | if allow: | ||
387 | self.image_combo.append_text(image_name) | ||
388 | if image_name == selected_image: | ||
389 | active = cnt | ||
390 | cnt = cnt + 1 | ||
391 | |||
363 | self.image_combo.append_text(self.builder.recipe_model.__dummy_image__) | 392 | self.image_combo.append_text(self.builder.recipe_model.__dummy_image__) |
364 | if selected_image == self.builder.recipe_model.__dummy_image__: | 393 | if selected_image == self.builder.recipe_model.__dummy_image__: |
365 | active = cnt | 394 | active = cnt |