diff options
author | Seth Alves <alves@src.gnome.org> | 2000-04-21 10:26:55 +0800 |
---|---|---|
committer | Seth Alves <alves@src.gnome.org> | 2000-04-21 10:26:55 +0800 |
commit | 0ebe18356658bb57a0c69f872a38ceb58259bfe1 (patch) | |
tree | 2fec11f7f6af06642ba02799e798f778ad3fa7ad /calendar/gui/gnome-cal.c | |
parent | 3d9a80f3a8c2efc7cb2857a50a42805775fccbf6 (diff) | |
download | gsoc2013-evolution-0ebe18356658bb57a0c69f872a38ceb58259bfe1.tar gsoc2013-evolution-0ebe18356658bb57a0c69f872a38ceb58259bfe1.tar.gz gsoc2013-evolution-0ebe18356658bb57a0c69f872a38ceb58259bfe1.tar.bz2 gsoc2013-evolution-0ebe18356658bb57a0c69f872a38ceb58259bfe1.tar.lz gsoc2013-evolution-0ebe18356658bb57a0c69f872a38ceb58259bfe1.tar.xz gsoc2013-evolution-0ebe18356658bb57a0c69f872a38ceb58259bfe1.tar.zst gsoc2013-evolution-0ebe18356658bb57a0c69f872a38ceb58259bfe1.zip |
callback for obj_updated or obj_removed. (gnome_calendar_new): hook up
* 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.
svn path=/trunk/; revision=2538
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 40 |
1 files changed, 27 insertions, 13 deletions
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) { |