aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorSeth Alves <alves@src.gnome.org>2000-04-10 02:46:25 +0800
committerSeth Alves <alves@src.gnome.org>2000-04-10 02:46:25 +0800
commit9496367085a9e45cf4d918987aab2244e3c7ece1 (patch)
treecec62e9ba647d28172ef834c6f59150589d557d1 /calendar/gui
parent99612fe24cfc0dcb5bc8f020fe759ccb3cfc1416 (diff)
downloadgsoc2013-evolution-9496367085a9e45cf4d918987aab2244e3c7ece1.tar
gsoc2013-evolution-9496367085a9e45cf4d918987aab2244e3c7ece1.tar.gz
gsoc2013-evolution-9496367085a9e45cf4d918987aab2244e3c7ece1.tar.bz2
gsoc2013-evolution-9496367085a9e45cf4d918987aab2244e3c7ece1.tar.lz
gsoc2013-evolution-9496367085a9e45cf4d918987aab2244e3c7ece1.tar.xz
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')
-rw-r--r--calendar/gui/calendar-commands.c17
-rw-r--r--calendar/gui/gnome-cal.c25
-rw-r--r--calendar/gui/gnome-cal.h2
3 files changed, 24 insertions, 20 deletions
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index 9b3fa91525..12b3c92774 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -566,6 +566,7 @@ calendar_close_event (GtkWidget *widget, GdkEvent *event, GnomeCalendar *gcal)
return TRUE;
}
+
GnomeCalendar *
new_calendar (char *full_name, char *calendar_file, char *geometry, char *page, gboolean hidden)
{
@@ -584,16 +585,7 @@ new_calendar (char *full_name, char *calendar_file, char *geometry, char *page,
if (gnome_parse_geometry (geometry, &xpos, &ypos, &width, &height)){
if (xpos != -1)
gtk_widget_set_uposition (toplevel, xpos, ypos);
- /*if (width != -1)
- gtk_widget_set_usize (toplevel, width, 600);*/
}
- /*gtk_widget_set_usize (toplevel, width, 600); */
-
- /*
- setup_appbar (toplevel);
- setup_menu (toplevel);
- */
-
if (page)
gnome_calendar_set_view (GNOME_CALENDAR (toplevel), page);
@@ -601,12 +593,13 @@ new_calendar (char *full_name, char *calendar_file, char *geometry, char *page,
printf ("calendar_file is '%s'\n", calendar_file?calendar_file:"NULL");
if (calendar_file && g_file_exists (calendar_file)) {
printf ("loading calendar\n");
- success = gnome_calendar_load (GNOME_CALENDAR (toplevel), calendar_file);
+ success = gnome_calendar_load (GNOME_CALENDAR (toplevel),
+ calendar_file);
}
else {
printf ("creating calendar\n");
- success = gnome_calendar_create (GNOME_CALENDAR (toplevel), calendar_file);
- /*GNOME_CALENDAR (toplevel)->client->filename = g_strdup (calendar_file);*/
+ success = gnome_calendar_create (GNOME_CALENDAR (toplevel),
+ calendar_file);
}
printf ("load or create returned %d\n", success);
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;
}
diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h
index 636696e9a0..fec7b95bb5 100644
--- a/calendar/gui/gnome-cal.h
+++ b/calendar/gui/gnome-cal.h
@@ -43,7 +43,7 @@ typedef struct {
guint gnome_calendar_get_type (void);
GtkWidget *gnome_calendar_new (char *title);
-int gnome_calendar_load (GnomeCalendar *gcal,
+int gnome_calendar_load (GnomeCalendar *gcal,
char *file);
int gnome_calendar_create (GnomeCalendar *gcal,
char *file);