From 94e331f09f82e76f15b838fd678f4cb7b0ee65e4 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Sat, 24 Apr 2010 20:36:23 +0200 Subject: [PATCH] Respect the date tolerance setting --- src/adac-mitfahrclub.vala | 4 +--- src/lift-list-window.vala | 4 ++-- src/query-window.vala | 4 +++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/adac-mitfahrclub.vala b/src/adac-mitfahrclub.vala index c3d585f..2d080e0 100644 --- a/src/adac-mitfahrclub.vala +++ b/src/adac-mitfahrclub.vala @@ -230,7 +230,7 @@ public class AdacMitfahrclub { return result; } - public List? get_lift_list (string city_from, string city_to, Date date) { + public List? get_lift_list (string city_from, string city_to, Date date, int tolerance = 0) { if (city_list == null) get_city_list (); @@ -256,8 +256,6 @@ public class AdacMitfahrclub { num_to ); - int tolerance = 0; - url += "&date=date&day=%d&month=%d&year=%d&tolerance=%d&smoking=&avg_speed=&".printf ( date.get_day (), date.get_month (), diff --git a/src/lift-list-window.vala b/src/lift-list-window.vala index ead447a..8ba1e6f 100644 --- a/src/lift-list-window.vala +++ b/src/lift-list-window.vala @@ -99,10 +99,10 @@ public class LiftListWindow : StackableWindow { BeifahrerProgram.orientation.changed.connect (this.on_orientation_changed); } - public void find_lifts (string city_from, string city_to, Date date) { + public void find_lifts (string city_from, string city_to, Date date, int tolerance = 0) { set_title ("%s - %s".printf (city_from, city_to)); - var lift_list = adac.get_lift_list (city_from, city_to, date); + var lift_list = adac.get_lift_list (city_from, city_to, date, tolerance); foreach (Lift lift in lift_list) { TreeIter iter; string icon_name = null; diff --git a/src/query-window.vala b/src/query-window.vala index b71acf1..ddb15c5 100644 --- a/src/query-window.vala +++ b/src/query-window.vala @@ -237,10 +237,12 @@ public class QueryWindow : StackableWindow { date.set_month ((DateMonth) (month + DateMonth.JANUARY)); date.set_year ((DateYear) year); + int tolerance = tolerance_selector.get_active (0); + Hildon.gtk_window_set_progress_indicator (this, 1); var window = new LiftListWindow (adac); window.show_all (); - window.find_lifts (city_from, city_to, date); + window.find_lifts (city_from, city_to, date, tolerance); Hildon.gtk_window_set_progress_indicator (this, 0); } -- 1.7.9.5