mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
8cbaa9f0d9
commit
1307d64286
@@ -0,0 +1,17 @@
|
||||
import gtk
|
||||
|
||||
class ProgressBar(gtk.Dialog):
|
||||
def __init__(self, parent):
|
||||
|
||||
gtk.Dialog.__init__(self)
|
||||
self.set_title("Parsing metadata, please wait...")
|
||||
self.set_default_size(500, 0)
|
||||
self.set_transient_for(parent)
|
||||
self.set_destroy_with_parent(True)
|
||||
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("%d/%d (%2d %%)" % (x, y, x*100/y))
|
||||
Reference in New Issue
Block a user