aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-addressbook-model.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-08-29 17:48:02 +0800
committerChris Toshok <toshok@src.gnome.org>2002-08-29 17:48:02 +0800
commit0ec1895bf3f7b64938df35de8266b6fc3d9f60d9 (patch)
tree638cc671c66fc792b4c60e1ea86af16b6b91e118 /addressbook/gui/widgets/e-addressbook-model.c
parent7f3d3493a3bfb3cec85609d6951565fead6796bc (diff)
downloadgsoc2013-evolution-0ec1895bf3f7b64938df35de8266b6fc3d9f60d9.tar
gsoc2013-evolution-0ec1895bf3f7b64938df35de8266b6fc3d9f60d9.tar.gz
gsoc2013-evolution-0ec1895bf3f7b64938df35de8266b6fc3d9f60d9.tar.bz2
gsoc2013-evolution-0ec1895bf3f7b64938df35de8266b6fc3d9f60d9.tar.lz
gsoc2013-evolution-0ec1895bf3f7b64938df35de8266b6fc3d9f60d9.tar.xz
gsoc2013-evolution-0ec1895bf3f7b64938df35de8266b6fc3d9f60d9.tar.zst
gsoc2013-evolution-0ec1895bf3f7b64938df35de8266b6fc3d9f60d9.zip
[ fixes #20347 ] hook up the backend_died signal. (backend_died): new
2002-08-29 Chris Toshok <toshok@ximian.com> [ fixes #20347 ] * gui/widgets/e-addressbook-view.c (e_addressbook_view_init): hook up the backend_died signal. (backend_died): new function, pop up an error dialog saying the backend died. * gui/widgets/e-addressbook-model.c (backend_died): new function, emit the backend_died signal. (e_addressbook_model_class_init): create the backend_died signal. (e_addressbook_model_init): init backend_died_id (e_addressbook_model_set_arg): disconnect the backend_died signal from the old book and hook it up to the new book. * gui/widgets/e-addressbook-model.h: add the backend_died signal. * backend/ebook/e-book.c (backend_died_cb): new function, emit the backend_died signal. (e_book_do_response_open): create the component listener and hook up the backend_died signal. (e_book_destroy): disconnect the component listener and unref it. * backend/ebook/e-book.h: add backend_died signal. svn path=/trunk/; revision=17918
Diffstat (limited to 'addressbook/gui/widgets/e-addressbook-model.c')
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index 881a8e4eed..7f59c2313c 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -44,6 +44,7 @@ enum {
CARD_CHANGED,
MODEL_CHANGED,
STOP_STATE_CHANGED,
+ BACKEND_DIED,
LAST_SIGNAL
};
@@ -260,6 +261,14 @@ writable_status (EBook *book,
}
static void
+backend_died (EBook *book,
+ EAddressbookModel *model)
+{
+ gtk_signal_emit (GTK_OBJECT (model),
+ e_addressbook_model_signals [BACKEND_DIED]);
+}
+
+static void
e_addressbook_model_class_init (GtkObjectClass *object_class)
{
parent_class = gtk_type_class (PARENT_TYPE);
@@ -347,6 +356,14 @@ e_addressbook_model_class_init (GtkObjectClass *object_class)
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
+ e_addressbook_model_signals [BACKEND_DIED] =
+ gtk_signal_new ("backend_died",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EAddressbookModelClass, backend_died),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+
gtk_object_class_add_signals (object_class, e_addressbook_model_signals, LAST_SIGNAL);
}
@@ -363,6 +380,7 @@ e_addressbook_model_init (GtkObject *object)
model->modify_card_id = 0;
model->status_message_id = 0;
model->writable_status_id = 0;
+ model->backend_died_id = 0;
model->sequence_complete_id = 0;
model->data = NULL;
model->data_count = 0;
@@ -481,9 +499,13 @@ e_addressbook_model_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
if (model->writable_status_id)
gtk_signal_disconnect(GTK_OBJECT (model->book),
model->writable_status_id);
-
model->writable_status_id = 0;
+ if (model->backend_died_id)
+ gtk_signal_disconnect(GTK_OBJECT (model->book),
+ model->backend_died_id);
+ model->backend_died_id = 0;
+
gtk_object_unref(GTK_OBJECT(model->book));
}
model->book = E_BOOK(GTK_VALUE_OBJECT (*arg));
@@ -495,6 +517,9 @@ e_addressbook_model_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
gtk_signal_connect (GTK_OBJECT(model->book),
"writable_status",
writable_status, model);
+ gtk_signal_connect (GTK_OBJECT(model->book),
+ "backend_died",
+ backend_died, model);
}
break;
case ARG_QUERY: