diff options
author | Seth Alves <alves@src.gnome.org> | 2000-04-10 02:46:25 +0800 |
---|---|---|
committer | Seth Alves <alves@src.gnome.org> | 2000-04-10 02:46:25 +0800 |
commit | 9496367085a9e45cf4d918987aab2244e3c7ece1 (patch) | |
tree | cec62e9ba647d28172ef834c6f59150589d557d1 /calendar/gui/gnome-cal.c | |
parent | 99612fe24cfc0dcb5bc8f020fe759ccb3cfc1416 (diff) | |
download | gsoc2013-evolution-9496367085a9e45cf4d918987aab2244e3c7ece1.tar.gz gsoc2013-evolution-9496367085a9e45cf4d918987aab2244e3c7ece1.tar.zst gsoc2013-evolution-9496367085a9e45cf4d918987aab2244e3c7ece1.zip |
catch cal_loaded signal on the cal client. (gnome_calendar_load_cb):
* gui/gnome-cal.c (gnome_calendar_load): catch cal_loaded signal
on the cal client.
(gnome_calendar_load_cb): callback for cal_loaded signal. moved
gnome_calendar_update_all from gnome_calendar_load to here.
* gui/calendar-commands.c: minor cleanups
* pcs/cal-backend.c (save_to_vcal): copied code from gnome-pim
to write vcal to a file
(save): filled it with more gnome-pim code
(add_object): call save () after changing
(remove_object): same
(cal_backend_create): same
(cal_backend_remove_object): same
svn path=/trunk/; revision=2352
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 86655f15e5..5b449c79d3 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -256,12 +256,25 @@ gnome_calendar_new (char *title) 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); + 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_load_cb (GtkWidget *cal_client, + gpointer something, + GnomeCalendar *gcal) +{ + gnome_calendar_update_all (gcal, NULL, 0); +} + + + int gnome_calendar_load (GnomeCalendar *gcal, char *file) { @@ -269,16 +282,14 @@ gnome_calendar_load (GnomeCalendar *gcal, char *file) g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), 0); g_return_val_if_fail (file != NULL, 0); - /* FIXME: connect to the cal_loaded signal fo the CalClient and get the - * asynchronous notification properly! - */ + gtk_signal_connect (GTK_OBJECT (gcal->client), "cal_loaded", + gnome_calendar_load_cb, gcal); - /* if ((r = calendar_load (gcal->cal, file)) != NULL){ DELETE */ if (cal_client_load_calendar (gcal->client, file) == FALSE){ printf ("Error loading calendar: %s\n", file); return 0; } - gnome_calendar_update_all (gcal, NULL, 0); + return 1; } |