aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--addressbook/ChangeLog84
-rw-r--r--addressbook/backend/ebook/e-book-types.h9
-rw-r--r--addressbook/backend/ebook/e-book-util.c2
-rw-r--r--addressbook/backend/ebook/e-book-view-listener.c37
-rw-r--r--addressbook/backend/ebook/e-book-view-listener.h4
-rw-r--r--addressbook/backend/ebook/e-book-view.c9
-rw-r--r--addressbook/backend/ebook/e-book-view.h2
-rw-r--r--addressbook/backend/idl/addressbook.idl13
-rw-r--r--addressbook/backend/pas/pas-backend-file.c16
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c21
-rw-r--r--addressbook/backend/pas/pas-book-view.c5
-rw-r--r--addressbook/backend/pas/pas-book-view.h3
-rw-r--r--addressbook/conduit/address-conduit.c2
-rw-r--r--addressbook/gui/component/addressbook.c38
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c4
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c13
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.h1
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c29
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.h1
19 files changed, 262 insertions, 31 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 0a8ddeacc9..add7889c61 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,89 @@
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.
+
+2002-08-19 Chris Toshok <toshok@ximian.com>
+
* backend/pas/pas-backend-file.c
(pas_backend_file_get_static_capabilities): add
"cache-completions" here, since file completion results are
diff --git a/addressbook/backend/ebook/e-book-types.h b/addressbook/backend/ebook/e-book-types.h
index ac8350b878..59459a0979 100644
--- a/addressbook/backend/ebook/e-book-types.h
+++ b/addressbook/backend/ebook/e-book-types.h
@@ -33,6 +33,15 @@ typedef enum {
} EBookStatus;
typedef enum {
+ E_BOOK_VIEW_STATUS_SUCCESS,
+ E_BOOK_VIEW_STATUS_TIME_LIMIT_EXCEEDED,
+ E_BOOK_VIEW_STATUS_SIZE_LIMIT_EXCEEDED,
+ E_BOOK_VIEW_STATUS_INVALID_QUERY,
+ E_BOOK_VIEW_STATUS_OTHER_ERROR,
+ E_BOOK_VIEW_STATUS_UNKNOWN
+} EBookViewStatus;
+
+typedef enum {
E_BOOK_SIMPLE_QUERY_STATUS_SUCCESS,
E_BOOK_SIMPLE_QUERY_STATUS_CANCELLED,
E_BOOK_SIMPLE_QUERY_STATUS_OTHER_ERROR
diff --git a/addressbook/backend/ebook/e-book-util.c b/addressbook/backend/ebook/e-book-util.c
index e113e8c607..06e2787f3e 100644
--- a/addressbook/backend/ebook/e-book-util.c
+++ b/addressbook/backend/ebook/e-book-util.c
@@ -422,7 +422,7 @@ simple_query_card_added_cb (EBookView *view, const GList *cards, gpointer closur
}
static void
-simple_query_sequence_complete_cb (EBookView *view, gpointer closure)
+simple_query_sequence_complete_cb (EBookView *view, EBookViewStatus status, gpointer closure)
{
SimpleQueryInfo *sq = closure;
diff --git a/addressbook/backend/ebook/e-book-view-listener.c b/addressbook/backend/ebook/e-book-view-listener.c
index 9981375631..cbb548892f 100644
--- a/addressbook/backend/ebook/e-book-view-listener.c
+++ b/addressbook/backend/ebook/e-book-view-listener.c
@@ -15,6 +15,8 @@
#include "e-book-view.h"
#include "e-card.h"
+static EBookViewStatus e_book_view_listener_convert_status (GNOME_Evolution_Addressbook_BookViewListener_CallStatus status);
+
enum {
RESPONSES_QUEUED,
LAST_SIGNAL
@@ -109,8 +111,9 @@ e_book_view_listener_queue_response (EBookViewListener *listener,
/* Add, Remove, Modify */
static void
-e_book_view_listener_queue_empty_event (EBookViewListener *listener,
- EBookViewListenerOperation op)
+e_book_view_listener_queue_status_event (EBookViewListener *listener,
+ EBookViewListenerOperation op,
+ EBookViewStatus status)
{
EBookViewListenerResponse *resp;
@@ -120,6 +123,7 @@ e_book_view_listener_queue_empty_event (EBookViewListener *listener,
resp = g_new0 (EBookViewListenerResponse, 1);
resp->op = op;
+ resp->status = status;
resp->id = NULL;
resp->cards = NULL;
resp->message = NULL;
@@ -141,6 +145,7 @@ e_book_view_listener_queue_id_event (EBookViewListener *listener,
resp = g_new0 (EBookViewListenerResponse, 1);
resp->op = op;
+ resp->status = E_BOOK_VIEW_STATUS_SUCCESS;
resp->id = g_strdup (id);
resp->cards = NULL;
resp->message = NULL;
@@ -163,6 +168,7 @@ e_book_view_listener_queue_sequence_event (EBookViewListener *listener,
resp = g_new0 (EBookViewListenerResponse, 1);
resp->op = op;
+ resp->status = E_BOOK_VIEW_STATUS_SUCCESS;
resp->id = NULL;
resp->cards = NULL;
resp->message = NULL;
@@ -188,6 +194,7 @@ e_book_view_listener_queue_message_event (EBookViewListener *listener,
resp = g_new0 (EBookViewListenerResponse, 1);
resp->op = op;
+ resp->status = E_BOOK_VIEW_STATUS_SUCCESS;
resp->id = NULL;
resp->cards = NULL;
resp->message = g_strdup(message);
@@ -230,11 +237,13 @@ impl_BookViewListener_notify_card_changed (PortableServer_Servant servant,
static void
impl_BookViewListener_notify_sequence_complete (PortableServer_Servant servant,
+ const GNOME_Evolution_Addressbook_BookViewListener_CallStatus status,
CORBA_Environment *ev)
{
EBookViewListener *listener = E_BOOK_VIEW_LISTENER (bonobo_object_from_servant (servant));
- e_book_view_listener_queue_empty_event (listener, SequenceCompleteEvent);
+ e_book_view_listener_queue_status_event (listener, SequenceCompleteEvent,
+ e_book_view_listener_convert_status (status));
}
static void
@@ -294,6 +303,28 @@ e_book_view_listener_pop_response (EBookViewListener *listener)
return resp;
}
+static EBookViewStatus
+e_book_view_listener_convert_status (const GNOME_Evolution_Addressbook_BookViewListener_CallStatus status)
+{
+ switch (status) {
+ case GNOME_Evolution_Addressbook_BookViewListener_Success:
+ return E_BOOK_VIEW_STATUS_SUCCESS;
+ case GNOME_Evolution_Addressbook_BookViewListener_SearchTimeLimitExceeded:
+ return E_BOOK_VIEW_STATUS_TIME_LIMIT_EXCEEDED;
+ case GNOME_Evolution_Addressbook_BookViewListener_SearchSizeLimitExceeded:
+ return E_BOOK_VIEW_STATUS_SIZE_LIMIT_EXCEEDED;
+ case GNOME_Evolution_Addressbook_BookViewListener_InvalidQuery:
+ return E_BOOK_VIEW_STATUS_INVALID_QUERY;
+ case GNOME_Evolution_Addressbook_BookViewListener_OtherError:
+ return E_BOOK_VIEW_STATUS_OTHER_ERROR;
+ default:
+ g_warning ("e_book_view_listener_convert_status: Unknown status "
+ "from card server: %d\n", (int) status);
+ return E_BOOK_VIEW_STATUS_UNKNOWN;
+
+ }
+}
+
static EBookViewListener *
e_book_view_listener_construct (EBookViewListener *listener)
{
diff --git a/addressbook/backend/ebook/e-book-view-listener.h b/addressbook/backend/ebook/e-book-view-listener.h
index 2eca095dc0..284c880ed1 100644
--- a/addressbook/backend/ebook/e-book-view-listener.h
+++ b/addressbook/backend/ebook/e-book-view-listener.h
@@ -14,6 +14,7 @@
#include <libgnome/gnome-defs.h>
#include <bonobo/bonobo-object.h>
+#include <ebook/e-book-types.h>
#include <ebook/addressbook.h>
BEGIN_GNOME_DECLS
@@ -48,6 +49,9 @@ typedef enum {
typedef struct {
EBookViewListenerOperation op;
+ /* For SequenceComplete */
+ EBookViewStatus status;
+
/* For CardRemovedEvent */
char *id;
diff --git a/addressbook/backend/ebook/e-book-view.c b/addressbook/backend/ebook/e-book-view.c
index 1af893bcd6..3dd5f4c703 100644
--- a/addressbook/backend/ebook/e-book-view.c
+++ b/addressbook/backend/ebook/e-book-view.c
@@ -90,9 +90,9 @@ e_book_view_do_removed_event (EBookView *book_view,
static void
e_book_view_do_complete_event (EBookView *book_view,
- EBookViewListenerResponse *resp)
+ EBookViewListenerResponse *resp)
{
- gtk_signal_emit (GTK_OBJECT (book_view), e_book_view_signals [SEQUENCE_COMPLETE]);
+ gtk_signal_emit (GTK_OBJECT (book_view), e_book_view_signals [SEQUENCE_COMPLETE], resp->status);
}
static void
@@ -300,8 +300,9 @@ e_book_view_class_init (EBookViewClass *klass)
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (EBookViewClass, sequence_complete),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
+ gtk_marshal_NONE__ENUM,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_ENUM);
e_book_view_signals [STATUS_MESSAGE] =
gtk_signal_new ("status_message",
diff --git a/addressbook/backend/ebook/e-book-view.h b/addressbook/backend/ebook/e-book-view.h
index e1dc211c91..2e055ddec9 100644
--- a/addressbook/backend/ebook/e-book-view.h
+++ b/addressbook/backend/ebook/e-book-view.h
@@ -38,7 +38,7 @@ struct _EBookViewClass {
void (* card_changed) (EBookView *book_view, const GList *cards);
void (* card_removed) (EBookView *book_view, const char *id);
void (* card_added) (EBookView *book_view, const GList *cards);
- void (* sequence_complete) (EBookView *book_view);
+ void (* sequence_complete) (EBookView *book_view, EBookViewStatus status);
void (* status_message) (EBookView *book_view, const char *message);
};
diff --git a/addressbook/backend/idl/addressbook.idl b/addressbook/backend/idl/addressbook.idl
index 9e1ee8766f..8872c07c94 100644
--- a/addressbook/backend/idl/addressbook.idl
+++ b/addressbook/backend/idl/addressbook.idl
@@ -31,10 +31,21 @@ module Addressbook {
* changes (if it affects the set of viewed cards.)
*/
interface BookViewListener : Bonobo::Unknown {
+ enum CallStatus {
+ Success,
+ /* These are still successful searches, but
+ the result set was truncated */
+ SearchSizeLimitExceeded,
+ SearchTimeLimitExceeded,
+
+ /* These are failures */
+ InvalidQuery,
+ OtherError
+ };
void notifyCardAdded (in VCardList cards);
void notifyCardRemoved (in CardId id);
void notifyCardChanged (in VCardList cards);
- void notifySequenceComplete ();
+ void notifySequenceComplete (in CallStatus status);
void notifyStatusMessage (in string message);
};
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index fe14be3f07..542ab47c0b 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -190,7 +190,7 @@ do_summary_query (PASBackendFile *bf,
if (card_count)
pas_book_view_notify_add (view->book_view, cards);
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
g_list_foreach (cards, (GFunc)g_free, NULL);
g_list_free (cards);
@@ -377,9 +377,7 @@ pas_backend_file_search (PASBackendFile *bf,
view->card_sexp = pas_backend_card_sexp_new (view->search);
if (!view->card_sexp) {
- /* need a different error message here. */
- pas_book_view_notify_status_message (view->book_view, _("Error in search expression."));
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_InvalidQuery);
return;
}
@@ -436,7 +434,7 @@ pas_backend_file_search (PASBackendFile *bf,
if (card_count)
pas_book_view_notify_add (view->book_view, cards);
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
/*
** It's fine to do this now since the data has been handed off.
@@ -561,7 +559,7 @@ pas_backend_file_changes (PASBackendFile *bf,
pas_book_view_notify_remove (view->book_view, id);
}
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
}
/* Update the hash */
@@ -658,7 +656,7 @@ pas_backend_file_process_create_card (PASBackend *backend,
if (vcard_matches_search (view, vcard)) {
bonobo_object_ref (BONOBO_OBJECT (view->book_view));
pas_book_view_notify_add_1 (view->book_view, vcard);
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
bonobo_object_unref (BONOBO_OBJECT (view->book_view));
}
}
@@ -728,7 +726,7 @@ pas_backend_file_process_remove_card (PASBackend *backend,
if (vcard_matches_search (view, vcard_string)) {
bonobo_object_ref (BONOBO_OBJECT (view->book_view));
pas_book_view_notify_remove (view->book_view, req->id);
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
bonobo_object_unref (BONOBO_OBJECT (view->book_view));
}
}
@@ -809,7 +807,7 @@ pas_backend_file_process_modify_card (PASBackend *backend,
else /* if (old_match) */
pas_book_view_notify_remove (view->book_view, id);
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c
index 296bb8797a..2d30ef508c 100644
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ b/addressbook/backend/pas/pas-backend-ldap.c
@@ -1059,7 +1059,7 @@ create_card_handler (LDAPOp *op, LDAPMessage *res)
pas_book_view_notify_add_1 (view->book_view,
new_vcard);
}
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
g_free (new_vcard);
@@ -1071,7 +1071,7 @@ create_card_handler (LDAPOp *op, LDAPMessage *res)
}
if (op->view)
- pas_book_view_notify_complete (op->view);
+ pas_book_view_notify_complete (op->view, GNOME_Evolution_Addressbook_BookViewListener_Success);
/* and lastly respond */
response = ldap_error_to_response (ldap_error);
@@ -1259,7 +1259,7 @@ remove_card_handler (LDAPOp *op, LDAPMessage *res)
ldap_error_to_response (ldap_error));
if (op->view)
- pas_book_view_notify_complete (op->view);
+ pas_book_view_notify_complete (op->view, GNOME_Evolution_Addressbook_BookViewListener_Success);
}
static void
@@ -1371,7 +1371,7 @@ modify_card_modify_handler (LDAPOp *op, LDAPMessage *res)
pas_book_view_notify_add_1 (view->book_view, modify_op->vcard);
else /* if (old_match) */
pas_book_view_notify_remove (view->book_view, e_card_simple_get_id (modify_op->card));
- pas_book_view_notify_complete (view->book_view);
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
}
@@ -2771,14 +2771,23 @@ ldap_search_handler (LDAPOp *op, LDAPMessage *res)
/* the entry that marks the end of our search */
if (search_op->num_pending_adds)
send_pending_adds (search_op);
- pas_book_view_notify_complete (search_op->op.view);
+
+ if (ldap_error == LDAP_TIMELIMIT_EXCEEDED)
+ pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_SearchTimeLimitExceeded);
+ else if (ldap_error == LDAP_SIZELIMIT_EXCEEDED)
+ pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_SearchSizeLimitExceeded);
+ else if (ldap_error == LDAP_SUCCESS)
+ pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_Success);
+ else
+ pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_OtherError);
+
ldap_op_finished (op);
}
else {
g_warning ("unhandled search result type %d returned", msg_type);
if (search_op->num_pending_adds)
send_pending_adds (search_op);
- pas_book_view_notify_complete (search_op->op.view);
+ pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_OtherError);
ldap_op_finished (op);
}
}
diff --git a/addressbook/backend/pas/pas-book-view.c b/addressbook/backend/pas/pas-book-view.c
index b5266a6b35..27d0f3ae06 100644
--- a/addressbook/backend/pas/pas-book-view.c
+++ b/addressbook/backend/pas/pas-book-view.c
@@ -126,14 +126,15 @@ pas_book_view_notify_add_1 (PASBookView *book_view,
}
void
-pas_book_view_notify_complete (PASBookView *book_view)
+pas_book_view_notify_complete (PASBookView *book_view,
+ GNOME_Evolution_Addressbook_BookViewListener_CallStatus status)
{
CORBA_Environment ev;
CORBA_exception_init (&ev);
GNOME_Evolution_Addressbook_BookViewListener_notifySequenceComplete (
- book_view->priv->listener, &ev);
+ book_view->priv->listener, status, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_warning ("pas_book_view_notify_complete: Exception signaling BookViewListener!\n");
diff --git a/addressbook/backend/pas/pas-book-view.h b/addressbook/backend/pas/pas-book-view.h
index 26bf360f17..712f3c3b96 100644
--- a/addressbook/backend/pas/pas-book-view.h
+++ b/addressbook/backend/pas/pas-book-view.h
@@ -40,7 +40,8 @@ void pas_book_view_notify_add (PASBookView *b
const GList *cards);
void pas_book_view_notify_add_1 (PASBookView *book_view,
const char *card);
-void pas_book_view_notify_complete (PASBookView *book_view);
+void pas_book_view_notify_complete (PASBookView *book_view,
+ GNOME_Evolution_Addressbook_BookViewListener_CallStatus);
void pas_book_view_notify_status_message (PASBookView *book_view,
const char *message);
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c
index 48f3fa03d8..b87226864c 100644
--- a/addressbook/conduit/address-conduit.c
+++ b/addressbook/conduit/address-conduit.c
@@ -1302,7 +1302,7 @@ card_removed (EBookView *book_view, const char *id, EAddrConduitContext *ctxt)
}
static void
-sequence_complete (EBookView *book_view, EAddrConduitContext *ctxt)
+sequence_complete (EBookView *book_view, EBookViewStatus status, EAddrConduitContext *ctxt)
{
gtk_signal_disconnect_by_data (GTK_OBJECT (book_view), ctxt);
gtk_object_unref (GTK_OBJECT (book_view));
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);
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index aadd5f049f..80ff8debf1 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -37,6 +37,7 @@ enum {
enum {
WRITABLE_STATUS,
STATUS_MESSAGE,
+ SEARCH_RESULT,
FOLDER_BAR_MESSAGE,
CARD_ADDED,
CARD_REMOVED,
@@ -231,11 +232,15 @@ status_message (EBookView *book_view,
static void
sequence_complete (EBookView *book_view,
+ EBookViewStatus status,
EAddressbookModel *model)
{
model->search_in_progress = FALSE;
status_message (book_view, NULL, model);
gtk_signal_emit (GTK_OBJECT (model),
+ e_addressbook_model_signals [SEARCH_RESULT],
+ status);
+ gtk_signal_emit (GTK_OBJECT (model),
e_addressbook_model_signals [STOP_STATE_CHANGED]);
}
@@ -285,6 +290,14 @@ e_addressbook_model_class_init (GtkObjectClass *object_class)
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
+ e_addressbook_model_signals [SEARCH_RESULT] =
+ gtk_signal_new ("search_result",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EAddressbookModelClass, search_result),
+ gtk_marshal_NONE__ENUM,
+ GTK_TYPE_NONE, 1, GTK_TYPE_ENUM);
+
e_addressbook_model_signals [FOLDER_BAR_MESSAGE] =
gtk_signal_new ("folder_bar_message",
GTK_RUN_LAST,
diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h
index 5e018388b8..57644dbca6 100644
--- a/addressbook/gui/widgets/e-addressbook-model.h
+++ b/addressbook/gui/widgets/e-addressbook-model.h
@@ -45,6 +45,7 @@ struct _EAddressbookModelClass {
* Signals
*/
void (*writable_status) (EAddressbookModel *model, gboolean writable);
+ void (*search_result) (EAddressbookModel *model, EBookViewStatus status);
void (*status_message) (EAddressbookModel *model, const gchar *message);
void (*folder_bar_message) (EAddressbookModel *model, const gchar *message);
void (*card_added) (EAddressbookModel *model, gint index, gint count);
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 229e8675c2..c8052b4216 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -79,6 +79,7 @@ static void e_addressbook_view_destroy (GtkObject *object);
static void change_view_type (EAddressbookView *view, EAddressbookViewType view_type);
static void status_message (GtkObject *object, const gchar *status, EAddressbookView *eav);
+static void search_result (GtkObject *object, EBookViewStatus status, EAddressbookView *eav);
static void folder_bar_message (GtkObject *object, const gchar *status, EAddressbookView *eav);
static void stop_state_changed (GtkObject *object, EAddressbookView *eav);
static void writable_status (GtkObject *object, gboolean writable, EAddressbookView *eav);
@@ -105,6 +106,7 @@ enum {
enum {
STATUS_MESSAGE,
+ SEARCH_RESULT,
FOLDER_BAR_MESSAGE,
COMMAND_STATE_CHANGE,
ALPHABET_STATE_CHANGE,
@@ -180,6 +182,14 @@ e_addressbook_view_class_init (EAddressbookViewClass *klass)
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
+ e_addressbook_view_signals [SEARCH_RESULT] =
+ gtk_signal_new ("search_result",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EAddressbookViewClass, search_result),
+ gtk_marshal_NONE__ENUM,
+ GTK_TYPE_NONE, 1, GTK_TYPE_ENUM);
+
e_addressbook_view_signals [FOLDER_BAR_MESSAGE] =
gtk_signal_new ("folder_bar_message",
GTK_RUN_LAST,
@@ -223,6 +233,11 @@ e_addressbook_view_init (EAddressbookView *eav)
eav);
gtk_signal_connect (GTK_OBJECT(eav->model),
+ "search_result",
+ GTK_SIGNAL_FUNC (search_result),
+ eav);
+
+ gtk_signal_connect (GTK_OBJECT(eav->model),
"folder_bar_message",
GTK_SIGNAL_FUNC (folder_bar_message),
eav);
@@ -1293,6 +1308,14 @@ emit_status_message (EAddressbookView *eav, const gchar *status)
}
static void
+emit_search_result (EAddressbookView *eav, EBookViewStatus status)
+{
+ gtk_signal_emit (GTK_OBJECT (eav),
+ e_addressbook_view_signals [SEARCH_RESULT],
+ status);
+}
+
+static void
emit_folder_bar_message (EAddressbookView *eav, const gchar *message)
{
gtk_signal_emit (GTK_OBJECT (eav),
@@ -1307,6 +1330,12 @@ status_message (GtkObject *object, const gchar *status, EAddressbookView *eav)
}
static void
+search_result (GtkObject *object, EBookViewStatus status, EAddressbookView *eav)
+{
+ emit_search_result (eav, status);
+}
+
+static void
folder_bar_message (GtkObject *object, const gchar *status, EAddressbookView *eav)
{
emit_folder_bar_message (eav, status);
diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h
index 58511845bd..897c37d420 100644
--- a/addressbook/gui/widgets/e-addressbook-view.h
+++ b/addressbook/gui/widgets/e-addressbook-view.h
@@ -94,6 +94,7 @@ struct _EAddressbookViewClass
* Signals
*/
void (*status_message) (EAddressbookView *view, const gchar *message);
+ void (*search_result) (EAddressbookView *view, EBookViewStatus status);
void (*folder_bar_message) (EAddressbookView *view, const gchar *message);
void (*command_state_change) (EAddressbookView *view);
void (*alphabet_state_change) (EAddressbookView *view, gunichar letter);