diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /bitbake/lib/bb/ui/crumbs/progress.py | |
download | poky-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/progress.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/progress.py | 23 |
1 files changed, 23 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..1d28a111b3 --- /dev/null +++ b/bitbake/lib/bb/ui/crumbs/progress.py | |||
@@ -0,0 +1,23 @@ | |||
1 | import gtk | ||
2 | |||
3 | class ProgressBar(gtk.Dialog): | ||
4 | def __init__(self, parent): | ||
5 | |||
6 | gtk.Dialog.__init__(self, flags=(gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)) | ||
7 | self.set_title("Parsing metadata, please wait...") | ||
8 | self.set_default_size(500, 0) | ||
9 | self.set_transient_for(parent) | ||
10 | self.progress = gtk.ProgressBar() | ||
11 | self.vbox.pack_start(self.progress) | ||
12 | self.show_all() | ||
13 | |||
14 | def set_text(self, msg): | ||
15 | self.progress.set_text(msg) | ||
16 | |||
17 | def update(self, x, y): | ||
18 | self.progress.set_fraction(float(x)/float(y)) | ||
19 | self.progress.set_text("%2d %%" % (x*100/y)) | ||
20 | |||
21 | def pulse(self): | ||
22 | self.progress.set_text("Loading...") | ||
23 | self.progress.pulse() | ||