diff options
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r-- | addressbook/backend/ebook/e-book-view-listener.c | 28 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book-view-listener.h | 3 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book-view.c | 19 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book-view.h | 7 |
4 files changed, 52 insertions, 5 deletions
diff --git a/addressbook/backend/ebook/e-book-view-listener.c b/addressbook/backend/ebook/e-book-view-listener.c index c84bf160c5..71f942798a 100644 --- a/addressbook/backend/ebook/e-book-view-listener.c +++ b/addressbook/backend/ebook/e-book-view-listener.c @@ -48,7 +48,7 @@ e_book_view_listener_check_queue (EBookViewListener *listener) static void e_book_view_listener_queue_response (EBookViewListener *listener, - EBookViewListenerResponse *response) + EBookViewListenerResponse *response) { listener->priv->response_queue = g_list_append (listener->priv->response_queue, @@ -62,6 +62,22 @@ e_book_view_listener_queue_response (EBookViewListener *listener, /* Add, Remove, Modify */ static void +e_book_view_listener_queue_empty_event (EBookViewListener *listener, + EBookViewListenerOperation op) +{ + EBookViewListenerResponse *resp; + + resp = g_new0 (EBookViewListenerResponse, 1); + + resp->op = op; + resp->id = NULL; + resp->cards = NULL; + + e_book_view_listener_queue_response (listener, resp); +} + +/* Add, Remove, Modify */ +static void e_book_view_listener_queue_id_event (EBookViewListener *listener, EBookViewListenerOperation op, const char *id) @@ -132,6 +148,15 @@ impl_BookViewListener_signal_card_changed (PortableServer_Servant servant, listener, CardModifiedEvent, cards); } +static void +impl_BookViewListener_signal_sequence_complete (PortableServer_Servant servant, + 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_check_pending: * @listener: the #EBookViewListener @@ -285,6 +310,7 @@ e_book_view_listener_get_epv (void) epv->signal_card_changed = impl_BookViewListener_signal_card_changed; epv->signal_card_removed = impl_BookViewListener_signal_card_removed; epv->signal_card_added = impl_BookViewListener_signal_card_added; + epv->signal_sequence_complete = impl_BookViewListener_signal_sequence_complete; return epv; } diff --git a/addressbook/backend/ebook/e-book-view-listener.h b/addressbook/backend/ebook/e-book-view-listener.h index e479ffd99b..65e5f8eb5b 100644 --- a/addressbook/backend/ebook/e-book-view-listener.h +++ b/addressbook/backend/ebook/e-book-view-listener.h @@ -40,7 +40,8 @@ typedef enum { /* Async events */ CardAddedEvent, CardRemovedEvent, - CardModifiedEvent + CardModifiedEvent, + SequenceCompleteEvent, } EBookViewListenerOperation; typedef struct { diff --git a/addressbook/backend/ebook/e-book-view.c b/addressbook/backend/ebook/e-book-view.c index 65a90b8ede..f00a2efb08 100644 --- a/addressbook/backend/ebook/e-book-view.c +++ b/addressbook/backend/ebook/e-book-view.c @@ -31,6 +31,7 @@ enum { CARD_CHANGED, CARD_REMOVED, CARD_ADDED, + SEQUENCE_COMPLETE, LAST_SIGNAL }; @@ -68,6 +69,13 @@ e_book_view_do_removed_event (EBookView *book_view, g_free(resp->id); } +static void +e_book_view_do_complete_event (EBookView *book_view, + EBookViewListenerResponse *resp) +{ + gtk_signal_emit (GTK_OBJECT (book_view), e_book_view_signals [SEQUENCE_COMPLETE]); +} + /* * Reading notices out of the EBookViewListener's queue. @@ -92,6 +100,9 @@ e_book_view_check_listener_queue (EBookViewListener *listener, EBookView *book_v case CardRemovedEvent: e_book_view_do_removed_event (book_view, resp); break; + case SequenceCompleteEvent: + e_book_view_do_complete_event (book_view, resp); + break; default: g_error ("EBookView: Unknown operation %d in listener queue!\n", resp->op); @@ -248,6 +259,14 @@ e_book_view_class_init (EBookViewClass *klass) GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + e_book_view_signals [SEQUENCE_COMPLETE] = + gtk_signal_new ("sequence_complete", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (EBookViewClass, sequence_complete), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + gtk_object_class_add_signals (object_class, e_book_view_signals, LAST_SIGNAL); diff --git a/addressbook/backend/ebook/e-book-view.h b/addressbook/backend/ebook/e-book-view.h index 92fde1e37f..b8edc68018 100644 --- a/addressbook/backend/ebook/e-book-view.h +++ b/addressbook/backend/ebook/e-book-view.h @@ -33,9 +33,10 @@ struct _EBookViewClass { /* * Signals. */ - 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 (* 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); }; /* Creating a new addressbook. */ |