3 from dialog
import Dialog
5 class CheckingBox(Dialog
):
6 def __init__(self
, root
):
8 self
.set_title("Checking for updates")
9 self
.label
= gtk
.Label("Checking for updates to '%s'..." % root
.get_name())
10 self
.label
.set_padding(10, 10)
11 self
.vbox
.pack_start(self
.label
, True, True, 0)
14 self
.progress
= gtk
.ProgressBar()
15 self
.vbox
.pack_start(self
.progress
, False, True, 0)
18 self
.add_mixed_button('Details...', gtk
.STOCK_ZOOM_IN
, gtk
.RESPONSE_OK
)
19 self
.connect('response', lambda w
, r
: self
.destroy())
21 def updates_done(self
, changes
):
22 """Close the dialog after a short delay"""
24 self
.label
.set_text('Updates found')
26 self
.label
.set_text('No changes')
27 self
.progress
.set_fraction(1)
28 self
.set_response_sensitive(gtk
.RESPONSE_OK
, False)
29 gobject
.timeout_add(1000, self
.destroy
)