crumbs: add back progress implementation for depexp

The commit which introduced the new hob UI also deleted this class
which is used by depexp.

(Bitbake rev: d54dbe54cde8e0086bf1fb4926468e212660db53)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Lock 2012-02-24 21:52:58 -08:00 committed by Richard Purdie
parent c9e95d3363
commit 2ff96d664e
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import gtk
class ProgressBar(gtk.Dialog):
def __init__(self, parent):
gtk.Dialog.__init__(self, flags=(gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT))
self.set_title("Parsing metadata, please wait...")
self.set_default_size(500, 0)
self.set_transient_for(parent)
self.progress = gtk.ProgressBar()
self.vbox.pack_start(self.progress)
self.show_all()
def update(self, x, y):
self.progress.set_fraction(float(x)/float(y))
self.progress.set_text("%2d %%" % (x*100/y))
def pulse(self):
self.progress.set_text("Loading...")
self.progress.pulse()