Label no_lifts;
GConf.Client gconf;
bool preload = false;
+ string url;
+
+ Gtk.Button goto_website;
public LiftListWindow (AdacMitfahrclub _adac) {
adac = _adac;
construct {
set_title ("Beifahrer");
+ var menu = new AppMenu ();
+ goto_website = new Gtk.Button.with_label (_("Show website"));
+ menu.append (goto_website);
+ set_main_menu (menu);
+
gconf = GConf.Client.get_default ();
store = new ListStore (6, typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (Lift));
tree.row_activated.connect (this.on_row_activated);
Gdk.Screen.get_default ().size_changed.connect (this.on_orientation_changed);
+ goto_website.clicked.connect (on_goto_website_clicked);
}
public async void find_lifts (string city_from, int radius_from, string city_to, int radius_to, Date date, int tolerance = 0) {
set_title ("%s - %s".printf (city_from, city_to));
Hildon.gtk_window_set_progress_indicator (this, 1);
+ url = adac.get_lift_list_url (city_from, radius_from, city_to, radius_to, date, tolerance);
+ if (url == null)
+ return;
+ goto_website.show ();
var lift_list = yield adac.get_lift_list (city_from, radius_from, city_to, radius_to, date, tolerance);
foreach (Lift lift in lift_list) {
string icon_name = null;
Hildon.gtk_window_set_progress_indicator (this, 0);
}
+ void on_goto_website_clicked () {
+ BeifahrerProgram.open_browser (this, url);
+ }
+
private void on_row_activated (TreeView tree, TreePath /*_*/path, TreeViewColumn column) {
TreeModel model = tree.model;
TreeIter iter;