aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend/ebook')
-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
6 files changed, 54 insertions, 9 deletions
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);
};