aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-addressbook-model.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2001-01-10 07:08:08 +0800
committerChris Toshok <toshok@src.gnome.org>2001-01-10 07:08:08 +0800
commit289cbd41bc8c3bdfe417f3c78e5061bbed07dcfb (patch)
treee08629bc6de08c1bb1411e65963c757338aafd0d /addressbook/gui/widgets/e-addressbook-model.c
parent70fe2fd985176bdcf7c8fcc433f0b640f2b52432 (diff)
downloadgsoc2013-evolution-289cbd41bc8c3bdfe417f3c78e5061bbed07dcfb.tar.gz
gsoc2013-evolution-289cbd41bc8c3bdfe417f3c78e5061bbed07dcfb.tar.zst
gsoc2013-evolution-289cbd41bc8c3bdfe417f3c78e5061bbed07dcfb.zip
register our status_message signal. (status_message): new function, emit
2001-01-09 Chris Toshok <toshok@helixcode.com> * gui/widgets/e-minicard-view-widget.c (e_minicard_view_widget_class_init): register our status_message signal. (status_message): new function, emit our status_message signal. (e_minicard_view_widget_realize): connect to the EMinicardView's status_message signal. * gui/widgets/e-minicard-view-widget.h: add status_message signal. * gui/widgets/e-minicard-view.c (e_minicard_view_class_init): register our status_message signal. (e_minicard_view_init): init status_message_id. (status_message): new function, emit our status_message signal. (book_view_loaded): connect to the EBookView's status_message signal. (disconnect_signals): disconnect status_message_id. * gui/widgets/e-minicard-view.h: add status_mesage_id, and status_message signal. * gui/widgets/e-addressbook-model.c (status_message): new function, emit our status_message. (e_addressbook_model_class_init): register our "status_message" signal. (book_view_loaded): connect to the EBookView's status_message signal, so we can chain it to our parent. (e_addressbook_model_init): init status_message_id. (remove_book_view): disconnect status_message_id. * gui/widgets/e-addressbook-model.h: add status_message_id, and status_message signal. * backend/pas/pas-backend-ldap.c change the objectclass we create objects with to "inetOrgPerson" as it encompasses the fields we use. (create_dn_from_ecard): remove the mail/org handling from here. we just prepend cn=$cn onto the base dn. (create_card_handler): remove the NULL that build_mods_from_ecards adds at the end, and insert our objectClass. (modify_card_handler): call search_for_dn to get the ECardSimple of the old card, since it might (and does in the current code) doing a brute force search. (search_for_dn): new function, to search for an entry by its dn. right now we brute force (objectclass=*) under the base dn and compare dn's. going to add a first pass that explodes the dn and searches that way, using (objectclass=*) as a last resort. also, here's where we'd put the extensibleMatch code if we want to go that route. * backend/ebook/e-card.c (e_card_set_arg): if we're setting the full name regenerate ecard->name. svn path=/trunk/; revision=7345
Diffstat (limited to 'addressbook/gui/widgets/e-addressbook-model.c')
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index 35c8dda745..c40c21f3bb 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -32,6 +32,13 @@ enum {
ARG_EDITABLE,
};
+enum {
+ STATUS_MESSAGE,
+ LAST_SIGNAL
+};
+
+static guint e_addressbook_model_signals [LAST_SIGNAL] = {0, };
+
static void
remove_book_view(EAddressbookModel *model)
{
@@ -44,10 +51,14 @@ remove_book_view(EAddressbookModel *model)
if (model->book_view && model->modify_card_id)
gtk_signal_disconnect(GTK_OBJECT (model->book_view),
model->modify_card_id);
+ if (model->book_view && model->status_message_id)
+ gtk_signal_disconnect(GTK_OBJECT (model->book_view),
+ model->status_message_id);
model->create_card_id = 0;
model->remove_card_id = 0;
model->modify_card_id = 0;
+ model->status_message_id = 0;
if (model->book_view)
gtk_object_unref(GTK_OBJECT(model->book_view));
@@ -236,6 +247,16 @@ modify_card(EBookView *book_view,
}
static void
+status_message (EBookView *book_view,
+ char* status,
+ EAddressbookModel *model)
+{
+ gtk_signal_emit (GTK_OBJECT (model),
+ e_addressbook_model_signals [STATUS_MESSAGE],
+ status);
+}
+
+static void
e_addressbook_model_class_init (GtkObjectClass *object_class)
{
ETableModelClass *model_class = (ETableModelClass *) object_class;
@@ -252,6 +273,16 @@ e_addressbook_model_class_init (GtkObjectClass *object_class)
GTK_ARG_READWRITE, ARG_QUERY);
gtk_object_add_arg_type ("EAddressbookModel::editable", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_EDITABLE);
+
+ e_addressbook_model_signals [STATUS_MESSAGE] =
+ gtk_signal_new ("status_message",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EAddressbookModelClass, status_message),
+ gtk_marshal_NONE__POINTER,
+ GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
+
+ gtk_object_class_add_signals (object_class, e_addressbook_model_signals, LAST_SIGNAL);
model_class->column_count = addressbook_col_count;
model_class->row_count = addressbook_row_count;
@@ -277,6 +308,7 @@ e_addressbook_model_init (GtkObject *object)
model->create_card_id = 0;
model->remove_card_id = 0;
model->modify_card_id = 0;
+ model->status_message_id = 0;
model->data = NULL;
model->data_count = 0;
model->editable = TRUE;
@@ -304,6 +336,10 @@ book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, gpointe
"card_changed",
GTK_SIGNAL_FUNC(modify_card),
model);
+ model->status_message_id = gtk_signal_connect(GTK_OBJECT(model->book_view),
+ "status_message",
+ GTK_SIGNAL_FUNC(status_message),
+ model);
for ( i = 0; i < model->data_count; i++ ) {
gtk_object_unref(GTK_OBJECT(model->data[i]));