aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog31
-rw-r--r--calendar/cal-client/cal-client.h5
-rw-r--r--calendar/gui/eventedit.c1
-rw-r--r--calendar/gui/gncal-day-panel.c1
-rw-r--r--calendar/gui/gncal-day-panel.h1
-rw-r--r--calendar/gui/gncal-day-view.c3
-rw-r--r--calendar/gui/gncal-full-day.c7
-rw-r--r--calendar/gui/gncal-todo.c7
-rw-r--r--calendar/gui/gnome-cal.c28
-rw-r--r--calendar/gui/gnome-cal.h17
-rw-r--r--calendar/gui/main.c48
-rw-r--r--calendar/gui/main.h2
-rw-r--r--calendar/gui/mark.c3
-rw-r--r--calendar/gui/month-view.c2
-rw-r--r--calendar/gui/quick-view.c10
-rw-r--r--calendar/gui/year-view.c2
16 files changed, 85 insertions, 83 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 70630f92f8..01c67ce777 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,34 @@
+2000-03-12 Federico Mena Quintero <federico@helixcode.com>
+
+ * gui/main.c (gnome_calendar_locate): Removed function now that it
+ is no CORBA server in the GUI.
+ (save_default_calendar): Removed function. Now the personal
+ calendar server will take care of saving modified calendars when
+ appropriate.
+ (close_cmd): Do not call unregister_calendar_services().
+
+ * gui/eventedit.c (ee_ok): Do not save the calendar.
+
+ * gui/gncal-day-panel.c (day_view_range_activated): Likewise.
+
+ * gui/gncal-todo.c (ok_button): Likewise.
+ (delete_todo): Likewise.
+
+ * gui/gncal-full-day.c (delete_occurance): Likewise.
+ (delete_appointment): Likewise.
+ (unrecur_appointment): Likewise.
+ (child_focus_out): Likewise.
+ (update_from_drag_info): Likewise.
+
+ * gui/gnome-cal.c (gnome_calendar_new): Removed obsolete call to
+ create the CORBA server.
+
+ * gui/gnome-cal.h (GnomeCalendar): Renamed `calc' field to
+ `client'.
+
+ * cal-client/cal-client.h (CalClient): Removed filename and
+ corba_server fields.
+
2000-03-10 Federico Mena Quintero <federico@helixcode.com>
* gui/main.c (main): Do not pass the INIT_SERVER flag to
diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h
index 5738856c99..e03008ca67 100644
--- a/calendar/cal-client/cal-client.h
+++ b/calendar/cal-client/cal-client.h
@@ -24,7 +24,7 @@
#include <libgnome/gnome-defs.h>
#include <gtk/gtkobject.h>
-#include "cal-util/cal-util.h"
+#include <cal-util/cal-util.h>
BEGIN_GNOME_DECLS
@@ -51,9 +51,6 @@ struct _CalClient {
/* Private data */
gpointer priv;
-
- void *corba_server;
- gchar *filename;
};
struct _CalClientClass {
diff --git a/calendar/gui/eventedit.c b/calendar/gui/eventedit.c
index d3f44b702b..7f2c543f56 100644
--- a/calendar/gui/eventedit.c
+++ b/calendar/gui/eventedit.c
@@ -753,7 +753,6 @@ ee_ok (GtkWidget *widget, EventEditor *ee)
else
gnome_calendar_object_changed (ee->gnome_cal, ee->ical, CHANGE_ALL);
- save_default_calendar (ee->gnome_cal);
ee->ical->new = 0;
}
diff --git a/calendar/gui/gncal-day-panel.c b/calendar/gui/gncal-day-panel.c
index 8d21b6fabc..2a886d6a3b 100644
--- a/calendar/gui/gncal-day-panel.c
+++ b/calendar/gui/gncal-day-panel.c
@@ -46,7 +46,6 @@ day_view_range_activated (GncalFullDay *fullday, GncalDayPanel *dpanel)
gncal_full_day_selection_range (fullday, &ical->dtstart, &ical->dtend);
gnome_calendar_add_object (dpanel->calendar, ical);
- save_default_calendar (dpanel->calendar);
gncal_full_day_focus_child (fullday, ical);
}
diff --git a/calendar/gui/gncal-day-panel.h b/calendar/gui/gncal-day-panel.h
index 6bf8768d9c..cb1fba5a5a 100644
--- a/calendar/gui/gncal-day-panel.h
+++ b/calendar/gui/gncal-day-panel.h
@@ -8,6 +8,7 @@
#ifndef GNCAL_DAY_PANEL_H
#define GNCAL_DAY_PANEL_H
+#include <gtk/gtkcalendar.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkscrolledwindow.h>
#include <gtk/gtktable.h>
diff --git a/calendar/gui/gncal-day-view.c b/calendar/gui/gncal-day-view.c
index a93929e569..82175ba85c 100644
--- a/calendar/gui/gncal-day-view.c
+++ b/calendar/gui/gncal-day-view.c
@@ -366,7 +366,6 @@ gncal_day_view_update (GncalDayView *dview, iCalObject *ico, int flags)
g_return_if_fail (dview != NULL);
g_return_if_fail (GNCAL_IS_DAY_VIEW (dview));
- g_return_if_fail (dview->calendar->calc);
if (dview->day_str)
g_free (dview->day_str);
@@ -380,7 +379,7 @@ gncal_day_view_update (GncalDayView *dview, iCalObject *ico, int flags)
calendar_destroy_event_list (dview->events);
*/
- dview->events = calendar_get_events_in_range (dview->calendar->calc,
+ dview->events = calendar_get_events_in_range (dview->calendar->client,
dview->lower,
dview->upper);
diff --git a/calendar/gui/gncal-full-day.c b/calendar/gui/gncal-full-day.c
index f402707e73..05c863058d 100644
--- a/calendar/gui/gncal-full-day.c
+++ b/calendar/gui/gncal-full-day.c
@@ -439,7 +439,6 @@ delete_occurance (GtkWidget *widget, gpointer data)
*t = child->start;
ical->exdate = g_list_prepend(ical->exdate, t);
gnome_calendar_object_changed (gcal, child->ico, CHANGE_DATES);
- save_default_calendar (gcal);
}
@@ -454,7 +453,6 @@ delete_appointment (GtkWidget *widget, gpointer data)
fullday = GNCAL_FULL_DAY (child->widget->parent);
gnome_calendar_remove_object (fullday->calendar, child->ico);
- save_default_calendar (fullday->calendar);
}
static void
@@ -479,7 +477,6 @@ unrecur_appointment (GtkWidget *widget, gpointer data)
gnome_calendar_object_changed (fullday->calendar, child->ico, CHANGE_ALL);
gnome_calendar_add_object (fullday->calendar, new);
- save_default_calendar (fullday->calendar);
}
static void
@@ -634,7 +631,6 @@ child_focus_out (GtkWidget *widget, GdkEventFocus *event, gpointer data)
fullday = GNCAL_FULL_DAY (widget->parent);
gnome_calendar_object_changed (fullday->calendar, child->ico, CHANGE_SUMMARY);
- save_default_calendar (fullday->calendar);
return FALSE;
}
@@ -1846,7 +1842,6 @@ update_from_drag_info (GncalFullDay *fullday)
/* Notify calendar of change */
gnome_calendar_object_changed (fullday->calendar, di->child->ico, CHANGE_DATES);
- save_default_calendar (fullday->calendar);
}
static gint
@@ -2134,7 +2129,7 @@ gncal_full_day_update (GncalFullDay *fullday, iCalObject *ico, int flags)
g_return_if_fail (fullday != NULL);
g_return_if_fail (GNCAL_IS_FULL_DAY (fullday));
- if (!fullday->calendar->calc)
+ if (!fullday->calendar->client)
return;
/* Try to find child that changed */
diff --git a/calendar/gui/gncal-todo.c b/calendar/gui/gncal-todo.c
index 87fd1b68ba..e00b851df0 100644
--- a/calendar/gui/gncal-todo.c
+++ b/calendar/gui/gncal-todo.c
@@ -87,7 +87,6 @@ ok_button (GtkWidget *widget, GnomeDialog *dialog)
} else
gnome_calendar_object_changed (todo->calendar, ico, CHANGE_ALL); /* ok, summary only... */
- save_default_calendar (todo->calendar);
gtk_widget_destroy (GTK_WIDGET (dialog));
}
@@ -282,8 +281,6 @@ static void
delete_todo (GncalTodo *todo)
{
gnome_calendar_remove_object (todo->calendar, get_clist_selected_ico (todo->clist));
- save_default_calendar (todo->calendar);
-
}
static void
@@ -862,11 +859,11 @@ gncal_todo_update (GncalTodo *todo, iCalObject *ico, int flags)
*/
GList *l, *uids;
- uids = cal_client_get_uids (todo->calendar->calc,
+ uids = cal_client_get_uids (todo->calendar->client,
CALOBJ_TYPE_EVENT);
for (l = uids; l; l = l->next){
char *obj_string =
- cal_client_get_object (todo->calendar->calc,
+ cal_client_get_object (todo->calendar->client,
l->data);
iCalObject *obj = string_to_ical_object (obj_string);
insert_in_clist (todo, obj);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 408f6b5396..5abcb46b29 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -4,22 +4,25 @@
*
* Author: Miguel de Icaza (miguel@kernel.org)
*/
+
#include <config.h>
-#include <gnome.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include <fcntl.h>
+#include <gtk/gtkmain.h>
+#include <gtk/gtknotebook.h>
+#include <libgnomeui/gnome-messagebox.h>
+#include <cal-util/timeutil.h>
#include "alarm.h"
-/* #include "calendar.h" DELETE */
#include "gnome-cal.h"
#include "gncal-day-panel.h"
#include "gncal-week-view.h"
#include "month-view.h"
#include "year-view.h"
-#include "cal-util/timeutil.h"
#include "main.h"
-#include "corba-cal.h"
+
+
GnomeApp *parent_class;
@@ -229,9 +232,8 @@ gnome_calendar_new (char *title)
gcal->current_display = time_day_begin (time (NULL));
/*gcal->cal = calendar_new (title, CALENDAR_INIT_ALARMS); DELETE */
- gcal->calc = cal_client_new ();
+ gcal->client = cal_client_new ();
setup_widgets (gcal);
- gnome_calendar_create_corba_server (gcal);
return retval;
}
@@ -252,8 +254,12 @@ 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!
+ */
+
/* if ((r = calendar_load (gcal->cal, file)) != NULL){ DELETE */
- if (cal_client_load_calendar (gcal->calc, file) == FALSE){
+ if (cal_client_load_calendar (gcal->client, file) == FALSE){
printf ("Error loading calendar: %s\n", file);
return 0;
}
@@ -271,7 +277,7 @@ gnome_calendar_add_object (GnomeCalendar *gcal, iCalObject *obj)
/*calendar_add_object (gcal->cal, obj); DELETE */
obj_string = ical_object_to_string (obj);
- cal_client_update_object (gcal->calc, obj->uid, obj_string);
+ cal_client_update_object (gcal->client, obj->uid, obj_string);
g_free (obj_string);
gnome_calendar_update_all (gcal, obj, CHANGE_NEW);
}
@@ -286,7 +292,7 @@ gnome_calendar_remove_object (GnomeCalendar *gcal, iCalObject *obj)
g_return_if_fail (obj != NULL);
/* calendar_remove_object (gcal->cal, obj); DELETE */
- r = cal_client_remove_object (gcal->calc, obj->uid);
+ r = cal_client_remove_object (gcal->client, obj->uid);
gnome_calendar_update_all (gcal, obj, CHANGE_ALL);
}
@@ -297,7 +303,7 @@ gnome_calendar_object_changed (GnomeCalendar *gcal, iCalObject *obj, int flags)
g_return_if_fail (GNOME_IS_CALENDAR (gcal));
g_return_if_fail (obj != NULL);
- /* FIX ME -- i don't know what to do here */
+ /* FIXME -- i don't know what to do here */
/* gcal->cal->modified = TRUE; */
gnome_calendar_update_all (gcal, obj, flags);
@@ -621,5 +627,3 @@ gnome_calendar_todo_properties_changed (GnomeCalendar *gcal)
todo_style_changed = 1;
todo_list_properties_changed (GNCAL_DAY_PANEL (gcal->day_view));
}
-
-
diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h
index 6bdbf4ca1b..dbe2493a2f 100644
--- a/calendar/gui/gnome-cal.h
+++ b/calendar/gui/gnome-cal.h
@@ -2,26 +2,30 @@
* GnomeCalendar widget
* Copyright (C) 1998 the Free Software Foundation
*
- * Author: Miguel de Icaza (miguel@kernel.org)
+ * Authors: Miguel de Icaza (miguel@kernel.org)
+ * Federico Mena-Quintero <federico@helixcode.com>
*/
#ifndef GNOME_CALENDAR_APP_H
#define GNOME_CALENDAR_APP_H
-#include <gnome.h>
-
-/*#include "calendar.h"*/
-#include "cal-client/cal-client.h"
+#include <time.h>
+#include <libgnome/gnome-defs.h>
+#include <gtk/gtkcalendar.h>
+#include <libgnomeui/gnome-app.h>
+#include <cal-client/cal-client.h>
BEGIN_GNOME_DECLS
+
+
#define GNOME_CALENDAR(obj) GTK_CHECK_CAST(obj, gnome_calendar_get_type(), GnomeCalendar)
#define GNOME_CALENDAR_CLASS(class) GTK_CHECK_CAST_CLASS(class, gnome_calendar_get_type(), GnomeCalendarClass)
#define GNOME_IS_CALENDAR(obj) GTK_CHECK_TYPE(obj, gnome_calendar_get_type())
typedef struct {
GnomeApp gnome_app;
- CalClient *calc; /* was Calendar *cal; */
+ CalClient *client;
time_t current_display;
GtkWidget *notebook;
@@ -79,6 +83,7 @@ gnome_calendar_colors_changed (GnomeCalendar *gcal);
void
gnome_calendar_todo_properties_changed (GnomeCalendar *gcal);
+
END_GNOME_DECLS
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index 3d30c4d1c5..6aca7aa9b8 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -297,31 +297,13 @@ display_objedit_today (GtkWidget *widget, GnomeCalendar *gcal)
gtk_widget_show (ee);
}
-GnomeCalendar *
-gnome_calendar_locate (const char *pathname)
-{
- GList *l;
-
- if (pathname == NULL || pathname [0] == 0)
- pathname = user_calendar_file;
-
- for (l = all_calendars; l; l = l->next){
- GnomeCalendar *gcal = l->data;
-
- if (strcmp (gcal->calc->filename, pathname) == 0){
- return gcal;
- }
- }
- return NULL;
-}
-
static void
close_cmd (GtkWidget *widget, GnomeCalendar *gcal)
{
all_calendars = g_list_remove (all_calendars, gcal);
/* DELETE
- FIX ME -- what do i do here?
+ FIXME -- what do i do here?
if (gcal->cal->modified){
if (!gcal->cal->filename)
save_calendar_cmd (widget, gcal);
@@ -333,10 +315,8 @@ close_cmd (GtkWidget *widget, GnomeCalendar *gcal)
gtk_widget_destroy (GTK_WIDGET (gcal));
active_calendars--;
- if (active_calendars == 0){
- unregister_calendar_services ();
+ if (active_calendars == 0)
gtk_main_quit ();
- }
}
void
@@ -483,7 +463,7 @@ save_ok (GtkWidget *widget, GtkFileSelection *fs)
gtk_window_set_wmclass (GTK_WINDOW (gcal), "gnomecal", "gnomecal");
fname = g_strdup (gtk_file_selection_get_filename (fs));
- /* calendar_save (gcal->cal, fname); DELETE / FIX ME*/
+ /* calendar_save (gcal->cal, fname); DELETE / FIXME*/
g_free(fname);
gtk_main_quit ();
}
@@ -566,18 +546,6 @@ save_calendar_cmd (GtkWidget *widget, void *data)
}
#endif /* 0 */
-/*
- * Saves @gcal if it is the default calendar
- */
-void
-save_default_calendar (GnomeCalendar *gcal)
-{
- if (!gcal->calc->filename)
- return;
-
- /* save_calendar_cmd (NULL, gcal); FIX ME */
-}
-
static GnomeUIInfo gnome_cal_file_menu [] = {
GNOMEUIINFO_MENU_NEW_ITEM(N_("_New calendar"),
N_("Create a new calendar"),
@@ -585,7 +553,7 @@ static GnomeUIInfo gnome_cal_file_menu [] = {
GNOMEUIINFO_MENU_OPEN_ITEM(open_calendar_cmd, NULL),
- /* GNOMEUIINFO_MENU_SAVE_ITEM(save_calendar_cmd, NULL), FIX ME */
+ /* GNOMEUIINFO_MENU_SAVE_ITEM(save_calendar_cmd, NULL), FIXME */
GNOMEUIINFO_MENU_SAVE_AS_ITEM(save_as_calendar_cmd, NULL),
@@ -817,7 +785,7 @@ dump_events (void)
printf ("%s -- %s\n", start, end);
printf (" %s\n", co->ico->summary);
}
- /* calendar_destroy_event_list (l); DELETE / FIX ME */
+ /* calendar_destroy_event_list (l); DELETE / FIXME */
/* calendar_destroy (cal); DELETE */
exit (0);
}
@@ -980,7 +948,7 @@ session_save_state (GnomeClient *client, gint phase, GnomeRestartStyle save_styl
argv [i++] = "--view";
argv [i++] = gnome_calendar_get_current_view_name (gcal);
free_list = g_list_append (free_list, geometry);
- /* calendar_save (gcal->cal, gcal->cal->filename); FIX ME */
+ /* calendar_save (gcal->cal, gcal->cal->filename); FIXME */
}
argv [i] = NULL;
gnome_client_set_clone_command (client, i, argv);
@@ -1089,7 +1057,7 @@ main (int argc, char **argv)
-/* FIX ME -- where should this go? */
+/* FIXME -- where should this go? */
void
calendar_iterate (GnomeCalendar *cal,
time_t start, time_t end,
@@ -1122,7 +1090,7 @@ calendar_object_compare_by_start (gconstpointer a, gconstpointer b)
return (diff < 0) ? -1 : (diff > 0) ? 1 : 0;
}
-/* FIX ME -- where should this (and calendar_object_compare_by_start) go? */
+/* FIXME -- where should this (and calendar_object_compare_by_start) go? */
/* returns a list of events in the form of CalendarObject* */
GList *calendar_get_events_in_range (CalClient *calc,
time_t start, time_t end)
diff --git a/calendar/gui/main.h b/calendar/gui/main.h
index e05fd4367b..9c8ea083f5 100644
--- a/calendar/gui/main.h
+++ b/calendar/gui/main.h
@@ -88,8 +88,6 @@ void parse_color_spec (char *spec, int *r, int *g, int *b);
/* Calls build_color_spec() for the color in the specified property number */
char *color_spec_from_prop (ColorProp propnum);
-void save_default_calendar (GnomeCalendar *gcal);
-
GnomeCalendar *new_calendar (char *full_name, char *calendar_file,
char *geometry, char *page, gboolean hidden);
diff --git a/calendar/gui/mark.c b/calendar/gui/mark.c
index 660fdba6ab..b9c64bea52 100644
--- a/calendar/gui/mark.c
+++ b/calendar/gui/mark.c
@@ -114,8 +114,7 @@ mark_month_item (GnomeMonthItem *mitem, GnomeCalendar *cal)
month_begin = time_month_begin (time_from_day (mitem->year, mitem->month, 1));
month_end = time_month_end (month_begin);
- list =
- calendar_get_events_in_range (cal->calc, month_begin, month_end);
+ list = calendar_get_events_in_range (cal->client, month_begin, month_end);
for (l = list; l; l = l->next) {
co = l->data;
diff --git a/calendar/gui/month-view.c b/calendar/gui/month-view.c
index 7d2d6c29bb..518eecc1c8 100644
--- a/calendar/gui/month-view.c
+++ b/calendar/gui/month-view.c
@@ -83,7 +83,7 @@ do_quick_view_popup (MonthView *mv, GdkEventButton *event, int day)
day_begin_time = time_from_day (mv->year, mv->month, day);
day_end_time = time_day_end (day_begin_time);
- list = calendar_get_events_in_range (mv->calendar->calc,
+ list = calendar_get_events_in_range (mv->calendar->client,
day_begin_time, day_end_time);
strftime (date_str, sizeof (date_str), _("%a %b %d %Y"), localtime (&day_begin_time));
diff --git a/calendar/gui/quick-view.c b/calendar/gui/quick-view.c
index 42da747259..179f22b1e7 100644
--- a/calendar/gui/quick-view.c
+++ b/calendar/gui/quick-view.c
@@ -6,6 +6,16 @@
*/
#include <config.h>
+#include <gdk_imlib.h>
+#include <gtk/gtkalignment.h>
+#include <gtk/gtkframe.h>
+#include <gtk/gtkhseparator.h>
+#include <gtk/gtklabel.h>
+#include <gtk/gtkmain.h>
+#include <gtk/gtkvbox.h>
+#include <libgnomeui/gnome-canvas.h>
+#include <libgnomeui/gnome-canvas-text.h>
+#include <libgnomeui/gnome-uidefs.h>
#include "quick-view.h"
#include "main.h"
diff --git a/calendar/gui/year-view.c b/calendar/gui/year-view.c
index 42c85a0d32..18526c3b2e 100644
--- a/calendar/gui/year-view.c
+++ b/calendar/gui/year-view.c
@@ -307,7 +307,7 @@ do_quick_view_popup (YearView *yv, GdkEventButton *event, int year, int month, i
day_start = time_from_day (year, month, day);
day_end = time_day_end (day_start);
- list = calendar_get_events_in_range (yv->calendar->calc,
+ list = calendar_get_events_in_range (yv->calendar->client,
day_start, day_end);
strftime (date_str, sizeof (date_str), _("%a %b %d %Y"), localtime (&day_start));