second half of the few/many change
authorThomas Thurman <tthurman@gnome.org>
Sun, 30 Aug 2009 21:18:34 +0000 (17:18 -0400)
committerThomas Thurman <tthurman@gnome.org>
Sun, 30 Aug 2009 21:18:34 +0000 (17:18 -0400)
TODO
belltower.c

diff --git a/TODO b/TODO
index eb775a9..fd8e0d7 100644 (file)
--- 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)
index 6787255..920e5e8 100644 (file)
@@ -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);
     }