All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Hob: Adjust the progress bar not to show 100% when things are not finished
@ 2012-05-23 15:18 Shane Wang
  2012-05-23 15:19 ` [PATCH 1/1] Hob: Adjust the progress bar and set 100% only when all is done Shane Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Shane Wang @ 2012-05-23 15:18 UTC (permalink / raw)
  To: bitbake-devel

On build appliance, because the packages are prebuilt, Hob spends much time getting the package
list, it is very strange that things are not finsihed but the progress bar shows 100% and wait
there. This patch is to fix that and ensure the bar to show 100% if and only if all things are done.

The following changes since commit 39a9267dee0a0ee4d87ed51d4a0272549c462b02:

  Hob: add '--select a machine--' and '--select a base image--' to GUI (2012-05-22 14:56:17 +0100)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib shane/newproxy
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=shane/newproxy

Shane Wang (1):
  Hob: Adjust the progress bar and set 100% only when all is done.

 bitbake/lib/bb/ui/crumbs/builder.py         |   12 ++++++++++--
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    8 ++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

-- 
1.7.6




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] Hob: Adjust the progress bar and set 100% only when all is done.
  2012-05-23 15:18 [PATCH 0/1] Hob: Adjust the progress bar not to show 100% when things are not finished Shane Wang
@ 2012-05-23 15:19 ` Shane Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Shane Wang @ 2012-05-23 15:19 UTC (permalink / raw)
  To: bitbake-devel

After parsing recipes, Hob will populate recipes and packages, which is probably
time exhaused. So, this patch is to adjust the progress bar and ensure 100% is
set if and only if all populations are done.

The patch also fixes "weird 18 second delay when parsing recipes" on build appliance.
Because Hob is doing something, but the progress bar shows 100% and wait there.

[Yocto #2341]

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py         |   12 ++++++++++--
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    8 ++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 44d626c..c77272e 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -424,6 +424,8 @@ class Builder(gtk.Window):
         self.handler.connect("data-generated",           self.handler_data_generated_cb)
         self.handler.connect("command-succeeded",        self.handler_command_succeeded_cb)
         self.handler.connect("command-failed",           self.handler_command_failed_cb)
+        self.handler.connect("recipe-populated",         self.handler_recipe_populated_cb)
+        self.handler.connect("package-populated",        self.handler_package_populated_cb)
 
         self.handler.set_config_filter(hob_conf_filter)
 
@@ -773,6 +775,12 @@ class Builder(gtk.Window):
     def packagelist_changed_cb(self, package_model):
         self.package_details_page.refresh_selection()
 
+    def handler_recipe_populated_cb(self, handler):
+        self.image_configuration_page.update_progress_bar("Populated recipes", 0.99)
+
+    def handler_package_populated_cb(self, handler):
+        self.image_configuration_page.update_progress_bar("Populated packages", 1.0)
+
     def handler_parsing_started_cb(self, handler, message):
         if self.current_step != self.RCPPKGINFO_POPULATING:
             return
@@ -792,7 +800,7 @@ class Builder(gtk.Window):
 
         fraction = message["current"] * 1.0/message["total"]
         if message["eventname"] == "TreeDataPreparationProgress":
-            fraction = 0.6 + 0.4 * fraction
+            fraction = 0.6 + 0.38 * fraction
         else:
             fraction = 0.6 * fraction
         self.image_configuration_page.update_progress_bar(message["title"], fraction)
@@ -802,7 +810,7 @@ class Builder(gtk.Window):
             return
 
         if message["eventname"] == "TreeDataPreparationCompleted":
-            fraction = 1.0
+            fraction = 0.98
         else:
             fraction = 0.6
         self.image_configuration_page.update_progress_bar(message["title"], fraction)
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 7303ff8..b34bdbe 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -57,6 +57,12 @@ class HobHandler(gobject.GObject):
          "parsing-completed"       : (gobject.SIGNAL_RUN_LAST,
                                       gobject.TYPE_NONE,
                                      (gobject.TYPE_PYOBJECT,)),
+         "recipe-populated"        : (gobject.SIGNAL_RUN_LAST,
+                                      gobject.TYPE_NONE,
+                                     ()),
+         "package-populated"       : (gobject.SIGNAL_RUN_LAST,
+                                      gobject.TYPE_NONE,
+                                     ()),
     }
 
     (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO, SANITY_CHECK) = range(6)
@@ -158,6 +164,7 @@ class HobHandler(gobject.GObject):
 
         if isinstance(event, bb.event.PackageInfo):
             self.package_model.populate(event._pkginfolist)
+            self.emit("package-populated")
             self.run_next_command()
 
         elif isinstance(event, bb.event.SanityCheckPassed):
@@ -171,6 +178,7 @@ class HobHandler(gobject.GObject):
             self.current_phase = "data generation"
             if event._model:
                 self.recipe_model.populate(event._model)
+                self.emit("recipe-populated")
         elif isinstance(event, bb.event.ConfigFilesFound):
             self.current_phase = "configuration lookup"
             var = event._variable
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-23 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-23 15:18 [PATCH 0/1] Hob: Adjust the progress bar not to show 100% when things are not finished Shane Wang
2012-05-23 15:19 ` [PATCH 1/1] Hob: Adjust the progress bar and set 100% only when all is done Shane Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.