summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKang Kai <kai.kang@windriver.com>2012-06-19 17:39:18 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-21 13:21:23 +0100
commitdee397af9064a54f6e14d64a839571e47f9fdfcd (patch)
tree3744d2066f804d154f00dd39bfbca13c8c2c3c2b
parentdf0059b465a07e7d01642b7a4e240fd40e916fe0 (diff)
downloadpoky-dee397af9064a54f6e14d64a839571e47f9fdfcd.tar.gz
bitbake: ui/depexp.py: use the new progressbar in Hob
[Yocto 2149] Use the new progressbar in Hob, so that we can reduce the maintenance burden of the multiple GUIs. (Bitbake rev: 6c0da26adbdcaa0c56737bacddb61678a9095e32) Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/ui/depexp.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py
index b62adbf851..425302e320 100644
--- a/bitbake/lib/bb/ui/depexp.py
+++ b/bitbake/lib/bb/ui/depexp.py
@@ -24,7 +24,7 @@ import threading
24import xmlrpclib 24import xmlrpclib
25import bb 25import bb
26import bb.event 26import bb.event
27from bb.ui.crumbs.progress import ProgressBar 27from bb.ui.crumbs.progressbar import HobProgressBar
28 28
29# Package Model 29# Package Model
30(COL_PKG_NAME) = (0) 30(COL_PKG_NAME) = (0)
@@ -220,8 +220,12 @@ def main(server, eventHandler):
220 220
221 gtk.gdk.threads_enter() 221 gtk.gdk.threads_enter()
222 dep = DepExplorer() 222 dep = DepExplorer()
223 pbar = ProgressBar(dep) 223 bardialog = gtk.Dialog(parent=dep)
224 pbar.connect("delete-event", gtk.main_quit) 224 bardialog.set_default_size(400, 50)
225 pbar = HobProgressBar()
226 bardialog.vbox.pack_start(pbar)
227 bardialog.show_all()
228 bardialog.connect("delete-event", gtk.main_quit)
225 gtk.gdk.threads_leave() 229 gtk.gdk.threads_leave()
226 230
227 progress_total = 0 231 progress_total = 0
@@ -238,19 +242,20 @@ def main(server, eventHandler):
238 if isinstance(event, bb.event.CacheLoadStarted): 242 if isinstance(event, bb.event.CacheLoadStarted):
239 progress_total = event.total 243 progress_total = event.total
240 gtk.gdk.threads_enter() 244 gtk.gdk.threads_enter()
241 pbar.set_title("Loading Cache") 245 bardialog.set_title("Loading Cache")
242 pbar.update(0, progress_total) 246 pbar.update(0)
243 gtk.gdk.threads_leave() 247 gtk.gdk.threads_leave()
244 248
245 if isinstance(event, bb.event.CacheLoadProgress): 249 if isinstance(event, bb.event.CacheLoadProgress):
246 x = event.current 250 x = event.current
247 gtk.gdk.threads_enter() 251 gtk.gdk.threads_enter()
248 pbar.update(x, progress_total) 252 pbar.update(x * 1.0 / progress_total)
253 pbar.set_title('')
249 gtk.gdk.threads_leave() 254 gtk.gdk.threads_leave()
250 continue 255 continue
251 256
252 if isinstance(event, bb.event.CacheLoadCompleted): 257 if isinstance(event, bb.event.CacheLoadCompleted):
253 pbar.hide() 258 bardialog.hide()
254 continue 259 continue
255 260
256 if isinstance(event, bb.event.ParseStarted): 261 if isinstance(event, bb.event.ParseStarted):
@@ -258,19 +263,21 @@ def main(server, eventHandler):
258 if progress_total == 0: 263 if progress_total == 0:
259 continue 264 continue
260 gtk.gdk.threads_enter() 265 gtk.gdk.threads_enter()
261 pbar.set_title("Processing recipes") 266 pbar.update(0)
262 pbar.update(0, progress_total) 267 bardialog.set_title("Processing recipes")
268
263 gtk.gdk.threads_leave() 269 gtk.gdk.threads_leave()
264 270
265 if isinstance(event, bb.event.ParseProgress): 271 if isinstance(event, bb.event.ParseProgress):
266 x = event.current 272 x = event.current
267 gtk.gdk.threads_enter() 273 gtk.gdk.threads_enter()
268 pbar.update(x, progress_total) 274 pbar.update(x * 1.0 / progress_total)
275 pbar.set_title('')
269 gtk.gdk.threads_leave() 276 gtk.gdk.threads_leave()
270 continue 277 continue
271 278
272 if isinstance(event, bb.event.ParseCompleted): 279 if isinstance(event, bb.event.ParseCompleted):
273 pbar.hide() 280 bardialog.hide()
274 continue 281 continue
275 282
276 if isinstance(event, bb.event.DepTreeGenerated): 283 if isinstance(event, bb.event.DepTreeGenerated):