Patchwork [bitbake-devel,11/32] Hob: make the image configuration page not to flash the progress bar

login
register
mail settings
Submitter Shane Wang
Date Feb. 29, 2012, 2:15 p.m.
Message ID <01a2bab8db48a197f25682f9a5673a399e20be7d.1330523904.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/22441/
State New
Headers show

Comments

Shane Wang - Feb. 29, 2012, 2:15 p.m.
Sometimes the image configuration page flashes the progress bar, that is because we show_all() and then hide() the progress bar. For this case, the patch doesn't add the progress bar onto the gtable. Then, it will not be flashed any more.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   30 +++++++++----------
 1 files changed, 14 insertions(+), 16 deletions(-)
Joshua Lock - Feb. 29, 2012, 9:29 p.m.
On 29/02/12 06:15, Shane Wang wrote:
> Sometimes the image configuration page flashes the progress bar, that is because we show_all() and then hide() the progress bar. For this case, the patch doesn't add the progress bar onto the gtable. Then, it will not be flashed any more.
>
> Signed-off-by: Shane Wang<shane.wang@intel.com>

I'm not a fan of show_all() but this looks fine:

Signed-off-by: Joshua Lock <josh@linux.intel.com>

> ---
>   bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   30 +++++++++----------
>   1 files changed, 14 insertions(+), 16 deletions(-)
>
> diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
> index cd86606..db54d79 100644
> --- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
> +++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
> @@ -84,21 +84,20 @@ class ImageConfigurationPage (HobPage):
>           for child in children:
>               self.remove(child)
>
> -    def _pack_components(self):
> +    def _pack_components(self, pack_config_build_button = False):
>           self._remove_all_widget()
>           self.pack_start(self.config_top_button, expand=False, fill=False)
>           self.pack_start(self.group_align, expand=True, fill=True)
>
>           self.box_group_area.pack_start(self.gtable, expand=True, fill=True)
> -        self.box_group_area.pack_end(self.config_build_button, expand=False, fill=False)
> +        if pack_config_build_button == True:
> +            self.box_group_area.pack_end(self.config_build_button, expand=False, fill=False)
>
>       def show_machine(self):
> -        self._pack_components()
> -        self.set_config_machine_layout()
> -        self.show_all()
>           self.progress_bar.reset()
> -        self.progress_bar.hide()
> -        self.config_build_button.hide_all()
> +        self._pack_components(pack_config_build_button = False)
> +        self.set_config_machine_layout(show_progress_bar = False)
> +        self.show_all()
>
>       def update_progress_bar(self, title, fraction, status=True):
>           self.progress_bar.update(fraction)
> @@ -106,18 +105,16 @@ class ImageConfigurationPage (HobPage):
>           self.progress_bar.set_rcstyle(status)
>
>       def show_info_populating(self):
> -        self._pack_components()
> -        self.set_config_machine_layout()
> +        self._pack_components(pack_config_build_button = False)
> +        self.set_config_machine_layout(show_progress_bar = True)
>           self.show_all()
> -        self.config_build_button.hide_all()
>
>       def show_info_populated(self):
> -        self._pack_components()
> -        self.set_config_machine_layout()
> +        self.progress_bar.reset()
> +        self._pack_components(pack_config_build_button = True)
> +        self.set_config_machine_layout(show_progress_bar = False)
>           self.set_config_baseimg_layout()
>           self.show_all()
> -        self.progress_bar.reset()
> -        self.progress_bar.hide()
>
>       def create_config_machine(self):
>           self.machine_title = gtk.Label()
> @@ -154,13 +151,14 @@ class ImageConfigurationPage (HobPage):
>           self.progress_bar = HobProgressBar()
>           self.machine_separator = gtk.HSeparator()
>
> -    def set_config_machine_layout(self):
> +    def set_config_machine_layout(self, show_progress_bar = False):
>           self.gtable.attach(self.machine_title, 0, 40, 0, 4)
>           self.gtable.attach(self.machine_title_desc, 0, 40, 4, 6)
>           self.gtable.attach(self.machine_combo, 0, 12, 6, 9)
>           self.gtable.attach(self.layer_button, 12, 36, 6, 10)
>           self.gtable.attach(self.layer_info_icon, 36, 40, 6, 9)
> -        self.gtable.attach(self.progress_bar, 0, 40, 13, 17)
> +        if show_progress_bar == True:
> +            self.gtable.attach(self.progress_bar, 0, 40, 13, 17)
>           self.gtable.attach(self.machine_separator, 0, 40, 12, 13)
>
>       def create_config_baseimg(self):

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index cd86606..db54d79 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -84,21 +84,20 @@  class ImageConfigurationPage (HobPage):
         for child in children:
             self.remove(child)
 
-    def _pack_components(self):
+    def _pack_components(self, pack_config_build_button = False):
         self._remove_all_widget()
         self.pack_start(self.config_top_button, expand=False, fill=False)
         self.pack_start(self.group_align, expand=True, fill=True)
 
         self.box_group_area.pack_start(self.gtable, expand=True, fill=True)
-        self.box_group_area.pack_end(self.config_build_button, expand=False, fill=False)
+        if pack_config_build_button == True:
+            self.box_group_area.pack_end(self.config_build_button, expand=False, fill=False)
 
     def show_machine(self):
-        self._pack_components()
-        self.set_config_machine_layout()
-        self.show_all()
         self.progress_bar.reset()
-        self.progress_bar.hide()
-        self.config_build_button.hide_all()
+        self._pack_components(pack_config_build_button = False)
+        self.set_config_machine_layout(show_progress_bar = False)
+        self.show_all()
 
     def update_progress_bar(self, title, fraction, status=True):
         self.progress_bar.update(fraction)
@@ -106,18 +105,16 @@  class ImageConfigurationPage (HobPage):
         self.progress_bar.set_rcstyle(status)
 
     def show_info_populating(self):
-        self._pack_components()
-        self.set_config_machine_layout()
+        self._pack_components(pack_config_build_button = False)
+        self.set_config_machine_layout(show_progress_bar = True)
         self.show_all()
-        self.config_build_button.hide_all()
 
     def show_info_populated(self):
-        self._pack_components()
-        self.set_config_machine_layout()
+        self.progress_bar.reset()
+        self._pack_components(pack_config_build_button = True)
+        self.set_config_machine_layout(show_progress_bar = False)
         self.set_config_baseimg_layout()
         self.show_all()
-        self.progress_bar.reset()
-        self.progress_bar.hide()
 
     def create_config_machine(self):
         self.machine_title = gtk.Label()
@@ -154,13 +151,14 @@  class ImageConfigurationPage (HobPage):
         self.progress_bar = HobProgressBar()
         self.machine_separator = gtk.HSeparator()
 
-    def set_config_machine_layout(self):
+    def set_config_machine_layout(self, show_progress_bar = False):
         self.gtable.attach(self.machine_title, 0, 40, 0, 4)
         self.gtable.attach(self.machine_title_desc, 0, 40, 4, 6)
         self.gtable.attach(self.machine_combo, 0, 12, 6, 9)
         self.gtable.attach(self.layer_button, 12, 36, 6, 10)
         self.gtable.attach(self.layer_info_icon, 36, 40, 6, 9)
-        self.gtable.attach(self.progress_bar, 0, 40, 13, 17)
+        if show_progress_bar == True:
+            self.gtable.attach(self.progress_bar, 0, 40, 13, 17)
         self.gtable.attach(self.machine_separator, 0, 40, 12, 13)
 
     def create_config_baseimg(self):