From 0ec1895bf3f7b64938df35de8266b6fc3d9f60d9 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 29 Aug 2002 09:48:02 +0000 Subject: [ fixes #20347 ] hook up the backend_died signal. (backend_died): new 2002-08-29 Chris Toshok [ 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 --- addressbook/gui/widgets/e-addressbook-view.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'addressbook/gui/widgets/e-addressbook-view.c') diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index c8052b4216..f12a324953 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -83,6 +83,7 @@ static void search_result (GtkObject *object, EBookViewStatus status, EAddr static void folder_bar_message (GtkObject *object, const gchar *status, EAddressbookView *eav); static void stop_state_changed (GtkObject *object, EAddressbookView *eav); static void writable_status (GtkObject *object, gboolean writable, EAddressbookView *eav); +static void backend_died (GtkObject *object, EAddressbookView *eav); static void command_state_change (EAddressbookView *eav); static void alphabet_state_change (EAddressbookView *eav, gunichar letter); @@ -252,6 +253,11 @@ e_addressbook_view_init (EAddressbookView *eav) GTK_SIGNAL_FUNC (writable_status), eav); + gtk_signal_connect (GTK_OBJECT(eav->model), + "backend_died", + GTK_SIGNAL_FUNC (backend_died), + eav); + eav->editable = FALSE; eav->book = NULL; eav->query = g_strdup (SHOW_ALL_SEARCH); @@ -1360,6 +1366,17 @@ alphabet_state_change (EAddressbookView *eav, gunichar letter) gtk_signal_emit (GTK_OBJECT (eav), e_addressbook_view_signals [ALPHABET_STATE_CHANGE], letter); } +static void +backend_died (GtkObject *object, EAddressbookView *eav) +{ + char *message = g_strdup_printf (_("The addressbook backend for\n%s\nhas crashed. " + "You will have to restart Evolution in order " + "to use it again"), + e_book_get_uri (eav->book)); + gnome_error_dialog_parented (message, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (eav)))); + g_free (message); +} + static void create_table_view (EAddressbookView *view) { -- cgit v1.2.3