From 9a9b07257cca5f96b9e62183bc1be5d1f64568d0 Mon Sep 17 00:00:00 2001 From: Juke Date: Tue, 22 Mar 2011 00:48:35 +0100 Subject: [PATCH] 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 --- weboob/applications/masstransit/masstransit.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/weboob/applications/masstransit/masstransit.py b/weboob/applications/masstransit/masstransit.py index 5fc09960..59866f90 100644 --- a/weboob/applications/masstransit/masstransit.py +++ b/weboob/applications/masstransit/masstransit.py @@ -77,7 +77,7 @@ class MasstransitHildon(): pass horizontal_box = gtk.HBox() - main_window = toolkit.Window() + self.main_window = toolkit.Window() try : self.refresh_button = toolkit.Button( gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT, @@ -114,13 +114,12 @@ class MasstransitHildon(): self.refresh_button = gtk.Button("Actualiser") self.retour_button = gtk.Button("Retour") self.combo_source = gtk.combo_box_entry_new_text() - help(self.combo_source) self.combo_dest = gtk.combo_box_entry_new_text() horizontal_box.pack_start(self.combo_source) horizontal_box.pack_start(self.combo_dest) - main_window.set_title("Horaires des Prochains Trains") - main_window.connect("destroy", self.on_main_window_destroy) + self.main_window.set_title("Horaires des Prochains Trains") + self.main_window.connect("destroy", self.on_main_window_destroy) 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(self.refresh_button) - main_window.add(vertical_box) - main_window.show_all() + self.main_window.add(vertical_box) + self.main_window.show_all() self.fill_touch_selector_entry() if toolkit != gtk: @@ -246,6 +245,9 @@ class MasstransitHildon(): def refresh(self): "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() try : source_text = self.combo_source.get_current_text() @@ -267,6 +269,8 @@ class MasstransitHildon(): departure.information]) self.refresh_in_progress = False + banner.set_timeout(1) + hildon.hildon_gtk_window_set_progress_indicator(self.main_window, 0) class Masstransit(BaseApplication):