aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog15
-rw-r--r--addressbook/gui/component/addressbook.c3
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c24
3 files changed, 33 insertions, 9 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index db0fcd13a2..07c1f90d18 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,20 @@
2004-03-30 Chris Toshok <toshok@ximian.com>
+ [ 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.
+
+2004-03-30 Chris Toshok <toshok@ximian.com>
+
[ gui part of the fix required for #48665 ]
* gui/widgets/e-addressbook-model.c (get_view): pass the source's
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 293f8664fe..a698094a94 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -397,7 +397,6 @@ static BonoboUIVerb verbs [] = {
BONOBO_UI_UNSAFE_VERB ("ContactsPrintPreview", print_preview_cb),
BONOBO_UI_UNSAFE_VERB ("ContactsSaveAsVCard", save_contact_cb),
BONOBO_UI_UNSAFE_VERB ("ContactsView", view_contact_cb),
- BONOBO_UI_UNSAFE_VERB ("ToolSearch", search_cb),
BONOBO_UI_UNSAFE_VERB ("ContactDelete", delete_contact_cb),
BONOBO_UI_UNSAFE_VERB ("ContactStop", stop_loading_cb),
@@ -427,8 +426,6 @@ static EPixmap pixmaps [] = {
E_PIXMAP ("/menu/EditPlaceholder/Edit/ContactsPaste", "16_paste.png"),
E_PIXMAP ("/menu/EditPlaceholder/Edit/ContactDelete", "evolution-trash-mini.png"),
- E_PIXMAP ("/menu/Tools/ComponentPlaceholder/ToolSearch", "search-16.png"),
-
E_PIXMAP ("/Toolbar/ContactsPrint", "buttons/print.png"),
E_PIXMAP ("/Toolbar/ContactDelete", "buttons/delete-message.png"),
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);
@@ -1573,17 +1582,20 @@ search_activated (ESearchBar *esb, EABView *v)
}
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