diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2002-08-16 20:56:14 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2002-08-16 20:56:14 +0800 |
commit | f245eb32c54f5f98e79643338f192abea871f2cf (patch) | |
tree | a9017040ec0bb4aff911c53780d824b30f9cc24d /calendar/gui/gnome-cal.c | |
parent | 83c35905a8146b88be28545604ec96c4358270d2 (diff) | |
download | gsoc2013-evolution-f245eb32c54f5f98e79643338f192abea871f2cf.tar.gz gsoc2013-evolution-f245eb32c54f5f98e79643338f192abea871f2cf.tar.zst gsoc2013-evolution-f245eb32c54f5f98e79643338f192abea871f2cf.zip |
added internal EComponentListener object, to listen for the activated Cal.
2002-08-16 Rodrigo Moya <rodrigo@ximian.com>
* cal-client/cal-client.[ch]: added internal EComponentListener
object, to listen for the activated Cal.
(cal_client_class_init): added "backend_died" signal.
(cal_client_destroy): clean up component listener.
(backend_died_cb): new callback for getting signals from the
EComponentListener.
(cal_opened_cb): setup component listener.
* cal-client/Makefile.am: added libetuil to needed LIBS.
* gui/gnome-cal.c (backend_died_cb): new callback.
(gnome_calendar_construct): connect to "backend_died" signal
on all CalClient's we create.
svn path=/trunk/; revision=17787
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index d26ad60e56..939b4c6d5c 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1717,6 +1717,34 @@ client_categories_changed_cb (CalClient *client, GPtrArray *categories, gpointer free_categories (merged); } +/* Callback when the backend dies */ +static void +backend_died_cb (CalClient *client, gpointer data) +{ + GnomeCalendar *gcal; + GnomeCalendarPrivate *priv; + char *message; + + gcal = GNOME_CALENDAR (data); + priv = gcal->priv; + + if (client == priv->client) { + message = g_strdup_printf (_("The calendar backend for\n%s\n has crashed. " + "You will have to restart Evolution in order " + "to use it again"), + cal_client_get_uri (priv->client)); + } else if (client == priv->task_pad_client) { + message = g_strdup_printf (_("The task backend for\n%s\n has crashed. " + "You will have to restart Evolution in order " + "to use it again"), + cal_client_get_uri (priv->task_pad_client)); + } else + g_assert_not_reached (); + + gnome_error_dialog_parented (message, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal)))); + g_free (message); +} + GtkWidget * gnome_calendar_construct (GnomeCalendar *gcal) { @@ -1740,6 +1768,8 @@ gnome_calendar_construct (GnomeCalendar *gcal) GTK_SIGNAL_FUNC (client_cal_opened_cb), gcal); gtk_signal_connect (GTK_OBJECT (priv->client), "categories_changed", GTK_SIGNAL_FUNC (client_categories_changed_cb), gcal); + gtk_signal_connect (GTK_OBJECT (priv->client), "backend_died", + GTK_SIGNAL_FUNC (backend_died_cb), gcal); e_day_view_set_cal_client (E_DAY_VIEW (priv->day_view), priv->client); @@ -1761,6 +1791,8 @@ gnome_calendar_construct (GnomeCalendar *gcal) GTK_SIGNAL_FUNC (client_cal_opened_cb), gcal); gtk_signal_connect (GTK_OBJECT (priv->task_pad_client), "categories_changed", GTK_SIGNAL_FUNC (client_categories_changed_cb), gcal); + gtk_signal_connect (GTK_OBJECT (priv->task_pad_client), "backend_died", + GTK_SIGNAL_FUNC (backend_died_cb), gcal); model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)); g_assert (model != NULL); |