From 2a82a4b527aef8b7257cb72ea2aae05c4aee8163 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Tue, 30 Mar 2004 21:38:41 +0000 Subject: [ fixes bug #53634 ] 2004-03-30 Chris Toshok [ fixes bug #53634 ] * gui/widgets/e-addressbook-view.c (eab_view_new): call e_search_bar_set_menu to add the Advanced... menu item to the search menu, and connect to "menu_activated". (search_menu_activated): new function, pop up the advanced dialog if id == ESB_ADVANCED. (query_changed): use e_search_bar_get_item_id instead of g_object_get. * gui/component/addressbook.c (verbs): remove ToolSearch. (pixmaps): remove the ToolSearch pixmap. svn path=/trunk/; revision=25247 --- addressbook/gui/widgets/e-addressbook-view.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'addressbook/gui/widgets/e-addressbook-view.c') diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 963f1389b1..0297268f5b 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -110,6 +110,7 @@ static void invisible_destroyed (gpointer data, GObject *where_object_was); static void make_suboptions (EABView *view); static void query_changed (ESearchBar *esb, EABView *view); static void search_activated (ESearchBar *esb, EABView *view); +static void search_menu_activated (ESearchBar *esb, int id, EABView *view); static void connect_master_list_changed (EABView *view); static ECategoriesMasterList *get_master_list (void); @@ -165,6 +166,11 @@ static ESearchBarItem addressbook_search_option_items[] = { { NULL, -1, NULL } }; +static ESearchBarItem addressbook_search_items[] = { + { N_("Advanced..."), ESB_ADVANCED, NULL }, + { NULL, -1, NULL }, +}; + GType eab_view_get_type (void) { @@ -429,12 +435,15 @@ eab_view_new (void) /* create our search bar */ eav->search = E_SEARCH_BAR (e_search_bar_new (NULL, addressbook_search_option_items)); + e_search_bar_set_menu (eav->search, addressbook_search_items); make_suboptions (eav); connect_master_list_changed (eav); g_signal_connect (eav->search, "query_changed", G_CALLBACK (query_changed), eav); g_signal_connect (eav->search, "search_activated", G_CALLBACK (search_activated), eav); + g_signal_connect (eav->search, "menu_activated", + G_CALLBACK (search_menu_activated), eav); gtk_box_pack_start (GTK_BOX (eav), GTK_WIDGET (eav->search), FALSE, FALSE, 0); gtk_widget_show (GTK_WIDGET (eav->search)); gtk_widget_set_sensitive (GTK_WIDGET (eav->search), FALSE); @@ -1572,18 +1581,21 @@ search_activated (ESearchBar *esb, EABView *v) g_free (search_word); } +static void +search_menu_activated (ESearchBar *esb, int id, EABView *view) +{ + if (id == ESB_ADVANCED) + gtk_widget_show(eab_search_dialog_new(view)); +} + static void query_changed (ESearchBar *esb, EABView *view) { int search_type; - g_object_get(esb, - "item_id", &search_type, - NULL); - - if (search_type == ESB_ADVANCED) { + search_type = e_search_bar_get_item_id(esb); + if (search_type == ESB_ADVANCED) gtk_widget_show(eab_search_dialog_new(view)); - } } static int -- cgit v1.2.3