3 from dialog
import Dialog
5 class CheckingBox(Dialog
):
9 def __init__(self
, root
):
11 self
.prog_name
= root
.get_name()
12 self
.set_title("Checking for updates")
13 self
.label
= gtk
.Label("Checking for updates to '%s'..." % self
.prog_name
)
14 self
.label
.set_padding(10, 10)
15 self
.vbox
.pack_start(self
.label
, True, True, 0)
18 self
.progress
= gtk
.ProgressBar()
19 self
.vbox
.pack_start(self
.progress
, False, True, 0)
22 self
.add_mixed_button('Details...', gtk
.STOCK_ZOOM_IN
, gtk
.RESPONSE_OK
)
24 if r
== gtk
.RESPONSE_OK
:
25 self
.show_details
= True
27 self
.connect('response', response
)
30 hint
= gtk
.Label("(if you want to skip this, click on\n"
31 "Details, and then on Execute)")
32 hint
.set_justify(gtk
.JUSTIFY_CENTER
)
33 self
.vbox
.pack_start(hint
, False, True, 0)
35 self
.hint_timeout
= None
37 self
.hint_timeout
= self
.hint_timeout
= gobject
.timeout_add(8000, show_hint
)
39 if self
.hint_timeout
is not None:
40 gobject
.source_remove(self
.hint_timeout
)
41 self
.hint_timeout
= None
42 self
.connect('destroy', destroy
)
44 def updates_done(self
, changes
):
45 """Close the dialog after a short delay"""
47 self
.label
.set_text("Updates found for '%s'" % self
.prog_name
)
49 self
.label
.set_text("No updates for '%s'" % self
.prog_name
)
50 self
.progress
.set_fraction(1)
51 self
.set_response_sensitive(gtk
.RESPONSE_OK
, False)
52 gobject
.timeout_add(1000, self
.destroy
)