add banner on loading closes #266

oops quotes

main_window is public

fix banner arguments

remove gtk.run

try help banner

remove help()

test progress indicator

progress + banner

test fixing timeout
This commit is contained in:
Juke 2011-03-22 00:48:35 +01:00
commit 9a9b07257c

View file

@ -77,7 +77,7 @@ class MasstransitHildon():
pass pass
horizontal_box = gtk.HBox() horizontal_box = gtk.HBox()
main_window = toolkit.Window() self.main_window = toolkit.Window()
try : try :
self.refresh_button = toolkit.Button( self.refresh_button = toolkit.Button(
gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT, gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT,
@ -114,13 +114,12 @@ class MasstransitHildon():
self.refresh_button = gtk.Button("Actualiser") self.refresh_button = gtk.Button("Actualiser")
self.retour_button = gtk.Button("Retour") self.retour_button = gtk.Button("Retour")
self.combo_source = gtk.combo_box_entry_new_text() self.combo_source = gtk.combo_box_entry_new_text()
help(self.combo_source)
self.combo_dest = gtk.combo_box_entry_new_text() self.combo_dest = gtk.combo_box_entry_new_text()
horizontal_box.pack_start(self.combo_source) horizontal_box.pack_start(self.combo_source)
horizontal_box.pack_start(self.combo_dest) horizontal_box.pack_start(self.combo_dest)
main_window.set_title("Horaires des Prochains Trains") self.main_window.set_title("Horaires des Prochains Trains")
main_window.connect("destroy", self.on_main_window_destroy) self.main_window.connect("destroy", self.on_main_window_destroy)
self.refresh_button.connect("clicked", self.on_refresh_button_clicked) self.refresh_button.connect("clicked", self.on_refresh_button_clicked)
@ -172,8 +171,8 @@ class MasstransitHildon():
vertical_box.pack_start(treeview) vertical_box.pack_start(treeview)
vertical_box.pack_start(self.refresh_button) vertical_box.pack_start(self.refresh_button)
main_window.add(vertical_box) self.main_window.add(vertical_box)
main_window.show_all() self.main_window.show_all()
self.fill_touch_selector_entry() self.fill_touch_selector_entry()
if toolkit != gtk: if toolkit != gtk:
@ -246,6 +245,9 @@ class MasstransitHildon():
def refresh(self): def refresh(self):
"update departures" "update departures"
banner = hildon.hildon_banner_show_information(self.main_window, "", "Chargement en cours")
banner.set_timeout(10000)
hildon.hildon_gtk_window_set_progress_indicator(self.main_window, 1)
self.treestore.clear() self.treestore.clear()
try : try :
source_text = self.combo_source.get_current_text() source_text = self.combo_source.get_current_text()
@ -267,6 +269,8 @@ class MasstransitHildon():
departure.information]) departure.information])
self.refresh_in_progress = False self.refresh_in_progress = False
banner.set_timeout(1)
hildon.hildon_gtk_window_set_progress_indicator(self.main_window, 0)
class Masstransit(BaseApplication): class Masstransit(BaseApplication):