aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-03-31 05:38:41 +0800
committerChris Toshok <toshok@src.gnome.org>2004-03-31 05:38:41 +0800
commit2a82a4b527aef8b7257cb72ea2aae05c4aee8163 (patch)
treed99140ea444917d7f12926b9463f70ebfe133ab2 /addressbook/gui
parentb3520a456f3ed8936ec9e9989047ef6662db7eaa (diff)
downloadgsoc2013-evolution-2a82a4b527aef8b7257cb72ea2aae05c4aee8163.tar
gsoc2013-evolution-2a82a4b527aef8b7257cb72ea2aae05c4aee8163.tar.gz
gsoc2013-evolution-2a82a4b527aef8b7257cb72ea2aae05c4aee8163.tar.bz2
gsoc2013-evolution-2a82a4b527aef8b7257cb72ea2aae05c4aee8163.tar.lz
gsoc2013-evolution-2a82a4b527aef8b7257cb72ea2aae05c4aee8163.tar.xz
gsoc2013-evolution-2a82a4b527aef8b7257cb72ea2aae05c4aee8163.tar.zst
gsoc2013-evolution-2a82a4b527aef8b7257cb72ea2aae05c4aee8163.zip
[ fixes bug #53634 ]
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. svn path=/trunk/; revision=25247
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/addressbook.c3
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c24
2 files changed, 18 insertions, 9 deletions
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