From bafc982da4a7398d7aab35362076b8c3c9722057 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Mon, 25 Feb 2002 11:01:20 +0000 Subject: only handle the ESB_ADVANCED case here now. the actual query work is done 2002-02-24 Chris Toshok * gui/component/addressbook.c (addressbook_query_changed): only handle the ESB_ADVANCED case here now. the actual query work is done in addressbook_search_activated. (addressbook_search_activated): split out all the searching functionality here. (addressbook_factory_new_control): hook up "search_activated" to addressbook_search_activated. svn path=/trunk/; revision=15828 --- addressbook/ChangeLog | 10 ++++++++++ addressbook/gui/component/addressbook.c | 21 +++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index d3170c12cd..ca2944e2fb 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,13 @@ +2002-02-24 Chris Toshok + + * gui/component/addressbook.c (addressbook_query_changed): only + handle the ESB_ADVANCED case here now. the actual query work is + done in addressbook_search_activated. + (addressbook_search_activated): split out all the searching + functionality here. + (addressbook_factory_new_control): hook up "search_activated" to + addressbook_search_activated. + 2002-02-24 Chris Toshok * gui/component/addressbook-config.c diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index 3e3a854dbe..73cb71abff 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -869,7 +869,7 @@ addressbook_menu_activated (ESearchBar *esb, int id, AddressbookView *view) } static void -addressbook_query_changed (ESearchBar *esb, AddressbookView *view) +addressbook_search_activated (ESearchBar *esb, AddressbookView *view) { ECategoriesMasterList *master_list; char *search_word, *search_query; @@ -931,7 +931,22 @@ addressbook_query_changed (ESearchBar *esb, AddressbookView *view) NULL); g_free (search_query); - g_free (search_word); + } + + g_free (search_word); +} + +static void +addressbook_query_changed (ESearchBar *esb, AddressbookView *view) +{ + int search_type; + + gtk_object_get(GTK_OBJECT(esb), + "item_id", &search_type, + NULL); + + if (search_type == ESB_ADVANCED) { + gtk_widget_show(e_addressbook_search_dialog_new(view->view)); } } @@ -1127,6 +1142,8 @@ addressbook_factory_new_control (void) FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (view->search), "query_changed", GTK_SIGNAL_FUNC (addressbook_query_changed), view); + gtk_signal_connect (GTK_OBJECT (view->search), "search_activated", + GTK_SIGNAL_FUNC (addressbook_search_activated), view); gtk_signal_connect (GTK_OBJECT (view->search), "menu_activated", GTK_SIGNAL_FUNC (addressbook_menu_activated), view); -- cgit v1.2.3