summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/progress.py
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2010-11-25 15:15:10 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-12-07 12:50:55 +0000
commit1307d64286802dbaa1d58260cc50200d5f49f92c (patch)
tree333e6c8d85154bdf1fc9b7aff86a8c8b5dd3b2bf /bitbake/lib/bb/ui/crumbs/progress.py
parent8cbaa9f0d98caf82a4e698abf24edc1c1a3122b2 (diff)
downloadpoky-1307d64286802dbaa1d58260cc50200d5f49f92c.tar.gz
bitbake/depexp: Factor ProgressBar into a separate class in crumbs/
ProgressBar will be useful in other UI elements so make it it's own class. Make ProgressBar a subclass of gtk.Dialog, rather than gtk.Window, so that we can suggest the window manager parent the ProgressBar to the widget passed at as parent. Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/progress.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/progress.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/progress.py b/bitbake/lib/bb/ui/crumbs/progress.py
new file mode 100644
index 0000000000..8bd87108e6
--- /dev/null
+++ b/bitbake/lib/bb/ui/crumbs/progress.py
@@ -0,0 +1,17 @@
1import gtk
2
3class ProgressBar(gtk.Dialog):
4 def __init__(self, parent):
5
6 gtk.Dialog.__init__(self)
7 self.set_title("Parsing metadata, please wait...")
8 self.set_default_size(500, 0)
9 self.set_transient_for(parent)
10 self.set_destroy_with_parent(True)
11 self.progress = gtk.ProgressBar()
12 self.vbox.pack_start(self.progress)
13 self.show_all()
14
15 def update(self, x, y):
16 self.progress.set_fraction(float(x)/float(y))
17 self.progress.set_text("%d/%d (%2d %%)" % (x, y, x*100/y))