diff options
author | Chris Toshok <toshok@ximian.com> | 2001-08-08 10:54:11 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-08-08 10:54:11 +0800 |
commit | 8db57316948801a0d0c91bf5487b9e22182a6d37 (patch) | |
tree | 7af7807340e101602d82890b355aab6d9d724aa8 /addressbook/gui/component | |
parent | 19f5c4472df77f2592abf7216f6350e3f6d55d3d (diff) | |
download | gsoc2013-evolution-8db57316948801a0d0c91bf5487b9e22182a6d37.tar gsoc2013-evolution-8db57316948801a0d0c91bf5487b9e22182a6d37.tar.gz gsoc2013-evolution-8db57316948801a0d0c91bf5487b9e22182a6d37.tar.bz2 gsoc2013-evolution-8db57316948801a0d0c91bf5487b9e22182a6d37.tar.lz gsoc2013-evolution-8db57316948801a0d0c91bf5487b9e22182a6d37.tar.xz gsoc2013-evolution-8db57316948801a0d0c91bf5487b9e22182a6d37.tar.zst gsoc2013-evolution-8db57316948801a0d0c91bf5487b9e22182a6d37.zip |
pass view->view instead of the EBook. (addressbook_search_menu_items):
2001-08-07 Chris Toshok <toshok@ximian.com>
* gui/component/addressbook.c (search_cb): pass view->view instead
of the EBook.
(addressbook_search_menu_items): remove E_FILTERBAR_ADVANCED.
(addressbook_menu_activated): remove E_FILTERBAR_ADVANCED.
(addressbook_search_option_items): add "Advanced..." here.
(addressbook_query_changed): add special handling for Advanced...
* gui/search/e-addressbook-search-dialog.h (struct
_EAddressbookSearchDialog): add EAddressbookView and remove the
model/adapter fields. Also fix prototype of
e_addressbook_search_dialog_new.
* gui/search/e-addressbook-search-dialog.c
(e_addressbook_search_dialog_class_init): get rid of
set_arg/get_arg.
(button_press): set the query on the EAddressbookView, and always
close the dialog.
(e_addressbook_search_dialog_init): get rid of the minicard view,
and pack the other widgets accordingly.
(e_addressbook_search_dialog_new): pass EAddressbookView instead
of EBook.
(e_addressbook_search_dialog_destroy): remove model/adapter stuff.
svn path=/trunk/; revision=11760
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r-- | addressbook/gui/component/addressbook.c | 86 |
1 files changed, 38 insertions, 48 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index f87d49d689..04abcd005f 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -98,15 +98,9 @@ config_cb (BonoboUIComponent *uih, void *user_data, const char *path) static void search_cb (BonoboUIComponent *uih, void *user_data, const char *path) { - EBook *book; AddressbookView *view = (AddressbookView *) user_data; - gtk_object_get(GTK_OBJECT(view->view), - "book", &book, - NULL); - g_assert (E_IS_BOOK (book)); - - gtk_widget_show(e_addressbook_search_dialog_new(book)); + gtk_widget_show(e_addressbook_search_dialog_new(view->view)); } static void @@ -245,7 +239,7 @@ change_view_type (AddressbookView *view, EAddressbookViewType view_type) gtk_object_set (GTK_OBJECT (view->view), "type", view_type, NULL); } -BonoboUIVerb verbs [] = { +static BonoboUIVerb verbs [] = { BONOBO_UI_UNSAFE_VERB ("ContactsPrint", print_cb), BONOBO_UI_UNSAFE_VERB ("ContactsSaveAsVCard", save_contact_cb), BONOBO_UI_UNSAFE_VERB ("ToolSearch", search_cb), @@ -559,27 +553,16 @@ set_prop (BonoboPropertyBag *bag, static ESearchBarItem addressbook_search_menu_items[] = { E_FILTERBAR_RESET, - { NULL, 0 }, - E_FILTERBAR_ADVANCED, - { NULL, -1 } + { NULL, -1 }, }; static void addressbook_menu_activated (ESearchBar *esb, int id, AddressbookView *view) { - EBook *book; switch (id) { case E_FILTERBAR_RESET_ID: e_addressbook_view_show_all(view->view); break; - case E_FILTERBAR_ADVANCED_ID: - gtk_object_get(GTK_OBJECT(view->view), - "book", &book, - NULL); - g_assert (E_IS_BOOK (book)); - - gtk_widget_show(e_addressbook_search_dialog_new(book)); - break; } } @@ -588,6 +571,7 @@ enum { ESB_FULL_NAME, ESB_EMAIL, ESB_CATEGORY, + ESB_ADVANCED }; static ESearchBarItem addressbook_search_option_items[] = { @@ -595,6 +579,7 @@ static ESearchBarItem addressbook_search_option_items[] = { { N_("Name contains"), ESB_FULL_NAME }, { N_("Email contains"), ESB_EMAIL }, { N_("Category contains"), ESB_CATEGORY }, + { N_("Advanced..."), ESB_ADVANCED }, { NULL, -1 } }; @@ -609,37 +594,42 @@ addressbook_query_changed (ESearchBar *esb, AddressbookView *view) "option_choice", &search_type, NULL); - if (search_word && strlen (search_word)) { - switch (search_type) { - case ESB_ANY: - search_query = g_strdup_printf ("(contains \"x-evolution-any-field\" \"%s\")", - search_word); - break; - case ESB_FULL_NAME: - search_query = g_strdup_printf ("(contains \"full_name\" \"%s\")", - search_word); - break; - case ESB_EMAIL: - search_query = g_strdup_printf ("(contains \"email\" \"%s\")", - search_word); - break; - case ESB_CATEGORY: - search_query = g_strdup_printf ("(contains \"category\" \"%s\")", - search_word); - break; - default: + if (search_type == ESB_ADVANCED) { + gtk_widget_show(e_addressbook_search_dialog_new(view->view)); + } + else { + if (search_word && strlen (search_word)) { + switch (search_type) { + case ESB_ANY: + search_query = g_strdup_printf ("(contains \"x-evolution-any-field\" \"%s\")", + search_word); + break; + case ESB_FULL_NAME: + search_query = g_strdup_printf ("(contains \"full_name\" \"%s\")", + search_word); + break; + case ESB_EMAIL: + search_query = g_strdup_printf ("(contains \"email\" \"%s\")", + search_word); + break; + case ESB_CATEGORY: + search_query = g_strdup_printf ("(contains \"category\" \"%s\")", + search_word); + break; + default: + search_query = g_strdup ("(contains \"full_name\" \"\")"); + break; + } + } else search_query = g_strdup ("(contains \"full_name\" \"\")"); - break; - } - } else - search_query = g_strdup ("(contains \"full_name\" \"\")"); - gtk_object_set (GTK_OBJECT(view->view), - "query", search_query, - NULL); + gtk_object_set (GTK_OBJECT(view->view), + "query", search_query, + NULL); - g_free (search_query); - g_free (search_word); + g_free (search_query); + g_free (search_word); + } } static GNOME_Evolution_ShellView |