diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-09-22 21:14:10 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-09-22 21:14:10 +0800 |
commit | 97502c28df8b4a419b7230c19338b087b161f423 (patch) | |
tree | b1c0e3eaa854990ed0f06f78ecd61d9ec8bd892a /addressbook/backend/ebook | |
parent | 2a20e41b574fa96a513a0a8faa4544cbef895146 (diff) | |
download | gsoc2013-evolution-97502c28df8b4a419b7230c19338b087b161f423.tar.gz gsoc2013-evolution-97502c28df8b4a419b7230c19338b087b161f423.tar.zst gsoc2013-evolution-97502c28df8b4a419b7230c19338b087b161f423.zip |
Added a function to set the status message associated with a given view.
2000-09-22 Christopher James Lahey <clahey@helixcode.com>
* backend/ebook/e-book-view-listener.c,
backend/ebook/e-book-view-listener.h, backend/ebook/e-book-view.c,
backend/ebook/e-book-view.h, backend/idl/addressbook.idl,
backend/pas/pas-book-view.c, backend/pas/pas-book-view.h: Added a
function to set the status message associated with a given view.
This is not yet implemented in the gui.
svn path=/trunk/; revision=5549
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r-- | addressbook/backend/ebook/e-book-view-listener.c | 46 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book-view-listener.h | 4 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book-view.c | 28 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-book-view.h | 1 |
4 files changed, 73 insertions, 6 deletions
diff --git a/addressbook/backend/ebook/e-book-view-listener.c b/addressbook/backend/ebook/e-book-view-listener.c index be871d65d7..cd1bdc6000 100644 --- a/addressbook/backend/ebook/e-book-view-listener.c +++ b/addressbook/backend/ebook/e-book-view-listener.c @@ -72,6 +72,7 @@ e_book_view_listener_queue_empty_event (EBookViewListener *listener, resp->op = op; resp->id = NULL; resp->cards = NULL; + resp->message = NULL; e_book_view_listener_queue_response (listener, resp); } @@ -89,6 +90,7 @@ e_book_view_listener_queue_id_event (EBookViewListener *listener, resp->op = op; resp->id = g_strdup (id); resp->cards = NULL; + resp->message = NULL; e_book_view_listener_queue_response (listener, resp); } @@ -107,6 +109,7 @@ e_book_view_listener_queue_sequence_event (EBookViewListener *listener, resp->op = op; resp->id = NULL; resp->cards = NULL; + resp->message = NULL; for ( i = 0; i < cards->_length; i++ ) { resp->cards = g_list_append(resp->cards, e_card_new(cards->_buffer[i])); @@ -115,6 +118,24 @@ e_book_view_listener_queue_sequence_event (EBookViewListener *listener, e_book_view_listener_queue_response (listener, resp); } +/* Status Message */ +static void +e_book_view_listener_queue_message_event (EBookViewListener *listener, + EBookViewListenerOperation op, + const char *message) +{ + EBookViewListenerResponse *resp; + + resp = g_new0 (EBookViewListenerResponse, 1); + + resp->op = op; + resp->id = NULL; + resp->cards = NULL; + resp->message = g_strdup(message); + + e_book_view_listener_queue_response (listener, resp); +} + static void impl_BookViewListener_signal_card_added (PortableServer_Servant servant, const Evolution_VCardList *cards, @@ -157,6 +178,16 @@ impl_BookViewListener_signal_sequence_complete (PortableServer_Servant servant, e_book_view_listener_queue_empty_event (listener, SequenceCompleteEvent); } +static void +impl_BookViewListener_signal_status_message (PortableServer_Servant servant, + const char *message, + CORBA_Environment *ev) +{ + EBookViewListener *listener = E_BOOK_VIEW_LISTENER (bonobo_object_from_servant (servant)); + + e_book_view_listener_queue_message_event (listener, StatusMessageEvent, message); +} + /** * e_book_view_listener_check_pending: * @listener: the #EBookViewListener @@ -288,12 +319,14 @@ e_book_view_listener_destroy (GtkObject *object) for (l = listener->priv->response_queue; l != NULL; l = l->next) { EBookViewListenerResponse *resp = l->data; - if (resp->id) - g_free(resp->id); - if (resp->cards) { - g_list_foreach(resp->cards, (GFunc) gtk_object_unref, NULL); - g_list_free(resp->cards); - } + + g_free(resp->id); + + g_list_foreach(resp->cards, (GFunc) gtk_object_unref, NULL); + g_list_free(resp->cards); + + g_free (resp->message); + g_free (resp); } g_list_free (listener->priv->response_queue); @@ -314,6 +347,7 @@ e_book_view_listener_get_epv (void) 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; + epv->signal_status_message = impl_BookViewListener_signal_status_message; return epv; } diff --git a/addressbook/backend/ebook/e-book-view-listener.h b/addressbook/backend/ebook/e-book-view-listener.h index 65e5f8eb5b..5a535a209a 100644 --- a/addressbook/backend/ebook/e-book-view-listener.h +++ b/addressbook/backend/ebook/e-book-view-listener.h @@ -42,6 +42,7 @@ typedef enum { CardRemovedEvent, CardModifiedEvent, SequenceCompleteEvent, + StatusMessageEvent, } EBookViewListenerOperation; typedef struct { @@ -52,6 +53,9 @@ typedef struct { /* For Card[Added|Modified]Event */ GList *cards; /* Of type ECard. */ + + /* For StatusMessageEvent */ + char *message; } EBookViewListenerResponse; diff --git a/addressbook/backend/ebook/e-book-view.c b/addressbook/backend/ebook/e-book-view.c index f00a2efb08..6e0379f2cc 100644 --- a/addressbook/backend/ebook/e-book-view.c +++ b/addressbook/backend/ebook/e-book-view.c @@ -32,6 +32,7 @@ enum { CARD_REMOVED, CARD_ADDED, SEQUENCE_COMPLETE, + STATUS_MESSAGE, LAST_SIGNAL }; @@ -76,6 +77,15 @@ e_book_view_do_complete_event (EBookView *book_view, gtk_signal_emit (GTK_OBJECT (book_view), e_book_view_signals [SEQUENCE_COMPLETE]); } +static void +e_book_view_do_status_message_event (EBookView *book_view, + EBookViewListenerResponse *resp) +{ + gtk_signal_emit (GTK_OBJECT (book_view), e_book_view_signals [STATUS_MESSAGE], + resp->message); + g_free(resp->message); +} + /* * Reading notices out of the EBookViewListener's queue. @@ -103,6 +113,9 @@ e_book_view_check_listener_queue (EBookViewListener *listener, EBookView *book_v case SequenceCompleteEvent: e_book_view_do_complete_event (book_view, resp); break; + case StatusMessageEvent: + e_book_view_do_status_message_event (book_view, resp); + break; default: g_error ("EBookView: Unknown operation %d in listener queue!\n", resp->op); @@ -267,9 +280,24 @@ e_book_view_class_init (EBookViewClass *klass) gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); + e_book_view_signals [STATUS_MESSAGE] = + gtk_signal_new ("status_message", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (EBookViewClass, status_message), + gtk_marshal_NONE__STRING, + GTK_TYPE_NONE, 1, + GTK_TYPE_STRING); + gtk_object_class_add_signals (object_class, e_book_view_signals, LAST_SIGNAL); + klass->card_changed = NULL; + klass->card_added = NULL; + klass->card_removed = NULL; + klass->sequence_complete = NULL; + klass->status_message = NULL; + object_class->destroy = e_book_view_destroy; } diff --git a/addressbook/backend/ebook/e-book-view.h b/addressbook/backend/ebook/e-book-view.h index b8edc68018..bd64c9dbc7 100644 --- a/addressbook/backend/ebook/e-book-view.h +++ b/addressbook/backend/ebook/e-book-view.h @@ -37,6 +37,7 @@ struct _EBookViewClass { 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 (* status_message) (EBookView *book_view, const char *message); }; /* Creating a new addressbook. */ |