aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog5
-rw-r--r--calendar/gui/gnome-cal.c40
2 files changed, 32 insertions, 13 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 1e1028b2a5..b128d4e0a7 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,10 @@
2000-04-20 Seth Alves <alves@hungry.com>
+ * gui/gnome-cal.c (gnome_calendar_changed_cb): callback for
+ obj_updated or obj_removed.
+ (gnome_calendar_new): hook up gnome_calendar_changed_cb so if
+ evolution is running twice, they will both see changes right away.
+
* gui/gncal-full-day.c (child_realize): create fullday's gcs
even if pixmap_bell has already been created. this was
causing crashes if the calendar was run twice.
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index bb50e1c1c4..ad4c95168d 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -225,6 +225,28 @@ gnome_calendar_set_view (GnomeCalendar *gcal, char *page_name)
}
+static void
+gnome_calendar_update_all (GnomeCalendar *cal, iCalObject *object, int flags)
+{
+ gncal_day_panel_update (GNCAL_DAY_PANEL (cal->day_view),
+ object, flags);
+ gncal_week_view_update (GNCAL_WEEK_VIEW (cal->week_view),
+ object, flags);
+ month_view_update (MONTH_VIEW (cal->month_view), object, flags);
+ year_view_update (YEAR_VIEW (cal->year_view), object, flags);
+}
+
+
+static void
+gnome_calendar_changed_cb (GtkWidget *cal_client,
+ const char *uid,
+ GnomeCalendar *gcal)
+{
+ printf ("gnome-cal: got changed_cb, uid='%s'\n", uid?uid:"<NULL>");
+ gnome_calendar_update_all (gcal, NULL, CHANGE_ALL);
+}
+
+
GtkWidget *
gnome_calendar_new (char *title)
{
@@ -239,21 +261,14 @@ gnome_calendar_new (char *title)
setup_widgets (gcal);
- return retval;
-}
+ gtk_signal_connect (GTK_OBJECT (gcal->client), "obj_updated",
+ gnome_calendar_changed_cb, gcal);
+ gtk_signal_connect (GTK_OBJECT (gcal->client), "obj_removed",
+ gnome_calendar_changed_cb, gcal);
-static void
-gnome_calendar_update_all (GnomeCalendar *cal, iCalObject *object, int flags)
-{
- gncal_day_panel_update (GNCAL_DAY_PANEL (cal->day_view),
- object, flags);
- gncal_week_view_update (GNCAL_WEEK_VIEW (cal->week_view),
- object, flags);
- month_view_update (MONTH_VIEW (cal->month_view), object, flags);
- year_view_update (YEAR_VIEW (cal->year_view), object, flags);
+ return retval;
}
-
typedef struct
{
GnomeCalendar *gcal;
@@ -265,7 +280,6 @@ typedef struct
static void
gnome_calendar_load_cb (GtkWidget *cal_client,
- /*gpointer something,*/
CalClientLoadStatus success,
load_or_create_data *locd)
{