aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-08-20 10:00:45 +0800
committerChris Toshok <toshok@src.gnome.org>2002-08-20 10:00:45 +0800
commitf64bfabfa514536408915328c490748f7273b9cc (patch)
tree5b2c87b09afbc255997b23073db0e85ee637b041 /addressbook/gui/component
parent5c2c86cd7ab91e4e88f16c37cea2ffeaffa702d0 (diff)
downloadgsoc2013-evolution-f64bfabfa514536408915328c490748f7273b9cc.tar.gz
gsoc2013-evolution-f64bfabfa514536408915328c490748f7273b9cc.tar.zst
gsoc2013-evolution-f64bfabfa514536408915328c490748f7273b9cc.zip
take and pass the CallStatus to our listener.
2002-08-19 Chris Toshok <toshok@ximian.com> * backend/pas/pas-book-view.c (pas_book_view_notify_complete): take and pass the CallStatus to our listener. * backend/pas/pas-book-view.h: change the prototype for notify_complete to include the CallStatus. * gui/component/select-names/e-select-names-completion.c (e_select_names_completion_seq_complete_cb): add the status arg. * gui/widgets/e-addressbook-view.c (e_addressbook_view_class_init): init the search_result signal. (e_addressbook_view_init): connect to the model's search_result signal. (emit_search_result): emit our search_result signal. (search_result): call emit_search_result. * gui/widgets/e-addressbook-view.h (struct _EAddressbookViewClass): add the search_result signal. * gui/widgets/e-addressbook-model.c (sequence_complete): emit both a "search_result" as well as the "stop_state_changed" signal. (e_addressbook_model_class_init): init the search_result signal. * gui/widgets/e-addressbook-model.h: add search_result signal. * gui/component/addressbook.c (search_result): pop up a dialog telling the user why the search failed or was truncated. (addressbook_factory_new_control): connect to the "search_result" signal on the view. * conduit/address-conduit.c (sequence_complete): add the status parameter to sequence_complete. * backend/idl/addressbook.idl: add BookViewListener_CallStatus, and change notifySequenceComplete to take a CallStatus. * backend/pas/pas-backend-ldap.c (create_card_handler): pass status back in the notify_complete call. (remove_card_handler): same. (modify_card_modify_handler): same (ldap_search_handler): same, and parse out the ldap return code so we can report limits being properly. * backend/pas/pas-backend-file.c (do_summary_query): pass status back in the notify_complete call. (pas_backend_file_search): same, and get rid of the status_message, as the status is passed back properly. (pas_backend_file_search): pass status back in the notify_complete call. (pas_backend_file_changes): same. (pas_backend_file_process_create_card): same. (pas_backend_file_process_remove_card): same. (pas_backend_file_process_modify_card): same. * backend/ebook/e-book-util.c (simple_query_sequence_complete_cb): add status parameter. * backend/ebook/e-book-view-listener.c (e_book_view_listener_queue_status_event): change name from _queue_empty_event, and take a status arg. (e_book_view_listener_queue_id_event): init resp->status (to SUCCESS). (e_book_view_listener_queue_sequence_event): same. (e_book_view_listener_queue_message_event): same. (impl_BookViewListener_notify_sequence_complete): call queue_status_event, and convert the corba status to EBookViewStatus. (e_book_view_listener_convert_status): new function, conver the corba status to EBookViewStatus. * backend/ebook/e-book-view-listener.h: add a "status" slot to EBookViewListenerResponse. * backend/ebook/e-book-view.h: change prototype for sequence_complete signal. * backend/ebook/e-book-view.c (e_book_view_do_complete_event): sequence_complete takes a parameter now (EBookViewStatus). (e_book_view_class_init): add the enum arg to the signal. * backend/ebook/e-book-types.h: add EBookViewStatus enum. svn path=/trunk/; revision=17814
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r--addressbook/gui/component/addressbook.c38
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c4
2 files changed, 40 insertions, 2 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index bf4de3db4d..025ac334db 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -906,6 +906,39 @@ set_status_message (EAddressbookView *eav, const char *message, AddressbookView
}
static void
+search_result (EAddressbookView *eav, EBookViewStatus status, AddressbookView *view)
+{
+ char *str = NULL;
+
+ switch (status) {
+ case E_BOOK_VIEW_STATUS_SUCCESS:
+ return;
+ case E_BOOK_VIEW_STATUS_SIZE_LIMIT_EXCEEDED:
+ str = _("More cards matched this query than either the server is \n"
+ "configured to return or Evolution is configured to display.\n"
+ "Please make your search more specific or raise the result limit in\n"
+ "the directory server preferences for this addressbook.");
+ break;
+ case E_BOOK_VIEW_STATUS_TIME_LIMIT_EXCEEDED:
+ str = _("The time to execute this query exceeded the server limit or the limit\n"
+ "you have configured for this addressbook. Please make your search\n"
+ "more specific or raise the time limit in the directory server\n"
+ "preferences for this addressbook.");
+ break;
+ case E_BOOK_VIEW_STATUS_INVALID_QUERY:
+ str = _("The backend for this addressbook was unable to parse this query.");
+ break;
+ case E_BOOK_VIEW_STATUS_OTHER_ERROR:
+ case E_BOOK_VIEW_STATUS_UNKNOWN:
+ str = _("This query did not complete successfully.");
+ break;
+ }
+
+ if (str)
+ gnome_warning_dialog (str);
+}
+
+static void
set_folder_bar_label (EAddressbookView *eav, const char *message, AddressbookView *view)
{
CORBA_Environment ev;
@@ -1065,6 +1098,11 @@ addressbook_factory_new_control (void)
view);
gtk_signal_connect (GTK_OBJECT (view->view),
+ "search_result",
+ GTK_SIGNAL_FUNC(search_result),
+ view);
+
+ gtk_signal_connect (GTK_OBJECT (view->view),
"folder_bar_message",
GTK_SIGNAL_FUNC(set_folder_bar_label),
view);
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c
index 42b62c1832..c2ff6f9640 100644
--- a/addressbook/gui/component/select-names/e-select-names-completion.c
+++ b/addressbook/gui/component/select-names/e-select-names-completion.c
@@ -81,7 +81,7 @@ static void e_select_names_completion_destroy (GtkObject *object);
static void e_select_names_completion_got_book_view_cb (EBook *book, EBookStatus status, EBookView *view, gpointer user_data);
static void e_select_names_completion_card_added_cb (EBookView *, const GList *cards, gpointer user_data);
-static void e_select_names_completion_seq_complete_cb (EBookView *, gpointer user_data);
+static void e_select_names_completion_seq_complete_cb (EBookView *, EBookViewStatus status, gpointer user_data);
static void e_select_names_completion_do_query (ESelectNamesCompletion *, const gchar *query_text, gint pos, gint limit);
@@ -884,7 +884,7 @@ e_select_names_completion_card_added_cb (EBookView *book_view, const GList *card
}
static void
-e_select_names_completion_seq_complete_cb (EBookView *book_view, gpointer user_data)
+e_select_names_completion_seq_complete_cb (EBookView *book_view, EBookViewStatus status, gpointer user_data)
{
ESelectNamesCompletionBookData *book_data = user_data;
ESelectNamesCompletion *comp = E_SELECT_NAMES_COMPLETION(book_data->comp);