From 33579a01fd419d4ff99901d4ccd0897c1a057e55 Mon Sep 17 00:00:00 2001 From: Thomas Thurman Date: Fri, 28 Aug 2009 17:26:16 -0400 Subject: [PATCH] search dialogue --- belltower.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/belltower.c b/belltower.c index 35031ef..ba1a88f 100644 --- a/belltower.c +++ b/belltower.c @@ -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 -- 1.7.9.5