search dialogue
authorThomas Thurman <tthurman@gnome.org>
Fri, 28 Aug 2009 21:26:16 +0000 (17:26 -0400)
committerThomas Thurman <tthurman@gnome.org>
Fri, 28 Aug 2009 21:26:16 +0000 (17:26 -0400)
belltower.c

index 35031ef..ba1a88f 100644 (file)
@@ -596,10 +596,12 @@ show_towers_from_list (GSList *list)
   if (!list->next)
     {
       /* only one; don't bother showing the list */
+      FoundTower* found = (FoundTower*) list->data;
+
       hildon_banner_show_information(window,
                                     NULL,
                                     "One tower found.");
-      show_tower (list->data);
+      show_tower (found->primarykey);
 
       /* FIXME: and free the list */
       return;
@@ -761,6 +763,25 @@ show_bookmarks (void)
 static void
 tower_search (void)
 {
+  GtkWidget *terms = gtk_dialog_new_with_buttons ("What are you looking for?",
+                                                 GTK_WINDOW (window),
+                                                 GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
+                                                 "Search",
+                                                 GTK_RESPONSE_OK,
+                                                 NULL);
+  GtkWidget *entry = gtk_entry_new ();
+
+  gtk_box_pack_end (GTK_BOX (GTK_DIALOG (terms)->vbox),
+                   entry, TRUE, TRUE, 0);
+
+  gtk_widget_show_all (GTK_WIDGET (terms));
+
+  if (gtk_dialog_run (GTK_DIALOG (terms))==GTK_RESPONSE_OK)
+    {
+      show_message (gtk_entry_get_text (GTK_ENTRY (entry)));
+    }
+
+  gtk_widget_destroy (GTK_WIDGET (terms));
 }
 
 static void