From 1c40ac1cb21723bdd70b357994808e8f5883e04d Mon Sep 17 00:00:00 2001 From: Thomas Thurman Date: Sun, 30 Aug 2009 17:18:34 -0400 Subject: [PATCH] second half of the few/many change --- TODO | 1 + belltower.c | 25 +++++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index eb775a9..fd8e0d7 100644 --- a/TODO +++ b/TODO @@ -4,3 +4,4 @@ * Add my name to the credits list * Switch names in the buttons in the credits list around ("view..." should be subtext) * Download Dove automatically +* parse_dove should have an option to call show_towers_by_list automagically (maybe if you include a title) diff --git a/belltower.c b/belltower.c index 6787255..920e5e8 100644 --- a/belltower.c +++ b/belltower.c @@ -973,7 +973,7 @@ towers_by_subarea (gchar *area) if (gtk_dialog_run (GTK_DIALOG (dialog))==GTK_RESPONSE_OK) { GSList *matches = NULL; - cac.county = strdup (hildon_touch_selector_get_current_text (HILDON_TOUCH_SELECTOR (selector))); + cac.county = g_strdup (hildon_touch_selector_get_current_text (HILDON_TOUCH_SELECTOR (selector))); parse_dove (get_towers_by_county_cb, &matches, @@ -1084,10 +1084,27 @@ towers_by_area_with_many (gboolean countries_with_many) if (result) { - if (strcmp (result, COUNTRIES_WITH_FEW)==0) - towers_by_area_with_many (FALSE); + if (countries_with_many) + { + /* these countries have many towers, so + * show the sub-areas + */ + if (strcmp (result, COUNTRIES_WITH_FEW)==0) + towers_by_area_with_many (FALSE); + else + towers_by_subarea (result); + } else - towers_by_subarea (result); + { + country_and_county cac = { result, NULL }; + GSList *matches = NULL; + + parse_dove (get_towers_by_county_cb, + &matches, + &cac); + + show_towers_from_list (matches); + } g_free (result); } -- 1.7.9.5