aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/cal-util/calobj.c1
-rw-r--r--calendar/calendar.c6
-rw-r--r--calendar/calobj.c1
-rw-r--r--calendar/eventedit.c1
-rw-r--r--calendar/gncal-day-panel.c8
-rw-r--r--calendar/gncal-week-view.c38
-rw-r--r--calendar/gncal-week-view.h5
-rw-r--r--calendar/gui/calendar.c6
-rw-r--r--calendar/gui/eventedit.c1
-rw-r--r--calendar/gui/gncal-day-panel.c8
-rw-r--r--calendar/gui/gncal-week-view.c38
-rw-r--r--calendar/gui/gncal-week-view.h5
-rw-r--r--calendar/pcs/calobj.c1
14 files changed, 90 insertions, 38 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 6c62cf7a7f..e3adbf056f 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+1998-04-21 Miguel de Icaza <miguel@nuclecu.unam.mx>
+
+ * gncal-week-view.c (gncal_week_view_new): Make the week view
+ descend from VBox so that we can add a label to it.
+
+ Added a label that displays the week range.
+
1998-04-21 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gnome-cal.c: Made it use GncalDayPanel.
@@ -15,7 +22,7 @@
1998-04-20 Miguel de Icaza <miguel@nuclecu.unam.mx>
* eventedit.c (ee_ok): Mark the event as non-new after accepting changes.
-
+
1998-04-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gncal-full-day.c (gncal_full_day_get_day_start_yoffset): New
diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c
index b7578ca397..cb1bd8b560 100644
--- a/calendar/cal-util/calobj.c
+++ b/calendar/cal-util/calobj.c
@@ -1135,7 +1135,6 @@ duration_callback (iCalObject *ico, time_t start, time_t end, void *closure)
int *count = closure;
struct tm *tm;
- print_time_t (start);
tm = localtime (&start);
(*count)++;
diff --git a/calendar/calendar.c b/calendar/calendar.c
index 34020adf38..d564c81a9d 100644
--- a/calendar/calendar.c
+++ b/calendar/calendar.c
@@ -110,6 +110,12 @@ calendar_add_object (Calendar *cal, iCalObject *obj)
g_assert_not_reached ();
}
+ if (!obj->uid){
+ char buffer [80];
+
+ snprintf (buffer, sizeof (buffer), "GnomeCalendar-%ld\n", time (NULL));
+ }
+
cal->modified = TRUE;
/* FIXME: do we have to set the last_mod field in the object? */
diff --git a/calendar/calobj.c b/calendar/calobj.c
index b7578ca397..cb1bd8b560 100644
--- a/calendar/calobj.c
+++ b/calendar/calobj.c
@@ -1135,7 +1135,6 @@ duration_callback (iCalObject *ico, time_t start, time_t end, void *closure)
int *count = closure;
struct tm *tm;
- print_time_t (start);
tm = localtime (&start);
(*count)++;
diff --git a/calendar/eventedit.c b/calendar/eventedit.c
index 12d548d3b5..0158d29673 100644
--- a/calendar/eventedit.c
+++ b/calendar/eventedit.c
@@ -229,7 +229,6 @@ event_editor_setup_time_frame (EventEditor *ee)
ee->ical->dtend = time_add_minutes (ee->ical->dtstart, 30);
}
ee->start_time = start_time = gnome_date_edit_new (ee->ical->dtstart, TRUE);
- print_time_t (ee->ical->dtstart);
gnome_date_edit_set_popup_range ((GnomeDateEdit *) start_time, day_begin, day_end);
gtk_signal_connect (GTK_OBJECT (start_time), "date_changed",
GTK_SIGNAL_FUNC (check_dates), ee);
diff --git a/calendar/gncal-day-panel.c b/calendar/gncal-day-panel.c
index d546cda34f..099b02f384 100644
--- a/calendar/gncal-day-panel.c
+++ b/calendar/gncal-day-panel.c
@@ -96,7 +96,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
w = gtk_label_new ("");
dpanel->date_label = GTK_LABEL (w);
gtk_table_attach (GTK_TABLE (dpanel), w,
- 1, 2, 0, 1,
+ 0, 1, 0, 1,
GTK_FILL | GTK_SHRINK,
GTK_FILL | GTK_SHRINK,
0, 0);
@@ -110,7 +110,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_table_attach (GTK_TABLE (dpanel), w,
- 1, 2, 1, 3,
+ 0, 1, 1, 3,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
@@ -140,7 +140,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
(GtkSignalFunc) calendar_day_selected,
dpanel);
gtk_table_attach (GTK_TABLE (dpanel), w,
- 0, 1, 1, 2,
+ 1, 2, 1, 2,
GTK_FILL | GTK_SHRINK,
GTK_FILL | GTK_SHRINK,
0, 0);
@@ -151,7 +151,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
w = gtk_button_new_with_label ("TODO");
dpanel->todo_list = w;
gtk_table_attach (GTK_TABLE (dpanel), w,
- 0, 1, 2, 3,
+ 1, 2, 2, 3,
GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
diff --git a/calendar/gncal-week-view.c b/calendar/gncal-week-view.c
index e73c0ccf25..7de8899cb3 100644
--- a/calendar/gncal-week-view.c
+++ b/calendar/gncal-week-view.c
@@ -29,7 +29,7 @@ gncal_week_view_get_type (void)
(GtkArgGetFunc) NULL
};
- week_view_type = gtk_type_unique (gtk_table_get_type (), &week_view_info);
+ week_view_type = gtk_type_unique (gtk_vbox_get_type (), &week_view_info);
}
return week_view_type;
@@ -93,30 +93,33 @@ GtkWidget *
gncal_week_view_new (GnomeCalendar *calendar, time_t start_of_week)
{
GncalWeekView *wview;
+ GtkWidget *table;
int i;
g_return_val_if_fail (calendar != NULL, NULL);
wview = gtk_type_new (gncal_week_view_get_type ());
- gtk_table_set_homogeneous (GTK_TABLE (wview), TRUE);
-
+ table = gtk_table_new (0, 0, 0);
+ gtk_table_set_homogeneous (GTK_TABLE (table), TRUE);
+ wview->label = gtk_label_new ("");
+ gtk_box_pack_start (GTK_BOX (wview), wview->label, 0, 0, 0);
+ gtk_box_pack_start (GTK_BOX (wview), table, 1, 1, 0);
wview->calendar = calendar;
-
for (i = 0; i < 7; i++) {
wview->days[i] = GNCAL_DAY_VIEW (gncal_day_view_new (calendar, 0, 0));
gtk_signal_connect (GTK_OBJECT (wview->days [i]), "button_press_event",
GTK_SIGNAL_FUNC(double_click_on_weekday), wview);
if (i < 5)
- gtk_table_attach (GTK_TABLE (wview), GTK_WIDGET (wview->days[i]),
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (wview->days[i]),
i, i + 1,
0, 1,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
else
- gtk_table_attach (GTK_TABLE (wview), GTK_WIDGET (wview->days[i]),
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (wview->days[i]),
i - 2, i - 1,
1, 2,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
@@ -135,7 +138,7 @@ gncal_week_view_new (GnomeCalendar *calendar, time_t start_of_week)
gtk_calendar_display_options (wview->gtk_calendar,
GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_SHOW_DAY_NAMES);
- gtk_table_attach (GTK_TABLE (wview), GTK_WIDGET (wview->gtk_calendar),
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (wview->gtk_calendar),
0, 3,
1, 2,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
@@ -172,7 +175,7 @@ gncal_week_view_update (GncalWeekView *wview, iCalObject *ico, int flags)
void
gncal_week_view_set (GncalWeekView *wview, time_t start_of_week)
{
- struct tm tm;
+ struct tm tm, start;
time_t day_start, day_end;
int i;
@@ -192,7 +195,8 @@ gncal_week_view_set (GncalWeekView *wview, time_t start_of_week)
tm.tm_sec = 0;
day_start = mktime (&tm);
-
+ start = tm;
+
/* Calendar */
gtk_calendar_select_month (wview->gtk_calendar, tm.tm_mon, tm.tm_year + 1900);
@@ -207,6 +211,20 @@ gncal_week_view_set (GncalWeekView *wview, time_t start_of_week)
day_start = day_end;
}
-
+
update (wview, FALSE, NULL, 0);
+
+ /* The label */
+ {
+ char buf [80];
+ int len;
+
+ strftime (buf, sizeof (buf), "%A %d %Y - ", &start);
+ len = strlen (buf);
+
+ strftime (buf + len, sizeof (buf) - len, "%A %d %Y", &tm);
+ gtk_label_set (GTK_LABEL (wview->label), buf);
+
+ }
}
+
diff --git a/calendar/gncal-week-view.h b/calendar/gncal-week-view.h
index 16dfa40eb0..1514890504 100644
--- a/calendar/gncal-week-view.h
+++ b/calendar/gncal-week-view.h
@@ -27,7 +27,7 @@ typedef struct _GncalWeekView GncalWeekView;
typedef struct _GncalWeekViewClass GncalWeekViewClass;
struct _GncalWeekView {
- GtkTable table;
+ GtkVBox box;
GnomeCalendar *calendar; /* the calendar we are associated to */
@@ -35,10 +35,11 @@ struct _GncalWeekView {
GncalDayView *days[7]; /* the day view widgets */
GtkCalendar *gtk_calendar; /* At least for now; see the FIXME comments in the .c file */
+ GtkWidget *label;
};
struct _GncalWeekViewClass {
- GtkTableClass parent_class;
+ GtkVBoxClass parent_class;
};
diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c
index 34020adf38..d564c81a9d 100644
--- a/calendar/gui/calendar.c
+++ b/calendar/gui/calendar.c
@@ -110,6 +110,12 @@ calendar_add_object (Calendar *cal, iCalObject *obj)
g_assert_not_reached ();
}
+ if (!obj->uid){
+ char buffer [80];
+
+ snprintf (buffer, sizeof (buffer), "GnomeCalendar-%ld\n", time (NULL));
+ }
+
cal->modified = TRUE;
/* FIXME: do we have to set the last_mod field in the object? */
diff --git a/calendar/gui/eventedit.c b/calendar/gui/eventedit.c
index 12d548d3b5..0158d29673 100644
--- a/calendar/gui/eventedit.c
+++ b/calendar/gui/eventedit.c
@@ -229,7 +229,6 @@ event_editor_setup_time_frame (EventEditor *ee)
ee->ical->dtend = time_add_minutes (ee->ical->dtstart, 30);
}
ee->start_time = start_time = gnome_date_edit_new (ee->ical->dtstart, TRUE);
- print_time_t (ee->ical->dtstart);
gnome_date_edit_set_popup_range ((GnomeDateEdit *) start_time, day_begin, day_end);
gtk_signal_connect (GTK_OBJECT (start_time), "date_changed",
GTK_SIGNAL_FUNC (check_dates), ee);
diff --git a/calendar/gui/gncal-day-panel.c b/calendar/gui/gncal-day-panel.c
index d546cda34f..099b02f384 100644
--- a/calendar/gui/gncal-day-panel.c
+++ b/calendar/gui/gncal-day-panel.c
@@ -96,7 +96,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
w = gtk_label_new ("");
dpanel->date_label = GTK_LABEL (w);
gtk_table_attach (GTK_TABLE (dpanel), w,
- 1, 2, 0, 1,
+ 0, 1, 0, 1,
GTK_FILL | GTK_SHRINK,
GTK_FILL | GTK_SHRINK,
0, 0);
@@ -110,7 +110,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_table_attach (GTK_TABLE (dpanel), w,
- 1, 2, 1, 3,
+ 0, 1, 1, 3,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
@@ -140,7 +140,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
(GtkSignalFunc) calendar_day_selected,
dpanel);
gtk_table_attach (GTK_TABLE (dpanel), w,
- 0, 1, 1, 2,
+ 1, 2, 1, 2,
GTK_FILL | GTK_SHRINK,
GTK_FILL | GTK_SHRINK,
0, 0);
@@ -151,7 +151,7 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
w = gtk_button_new_with_label ("TODO");
dpanel->todo_list = w;
gtk_table_attach (GTK_TABLE (dpanel), w,
- 0, 1, 2, 3,
+ 1, 2, 2, 3,
GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
diff --git a/calendar/gui/gncal-week-view.c b/calendar/gui/gncal-week-view.c
index e73c0ccf25..7de8899cb3 100644
--- a/calendar/gui/gncal-week-view.c
+++ b/calendar/gui/gncal-week-view.c
@@ -29,7 +29,7 @@ gncal_week_view_get_type (void)
(GtkArgGetFunc) NULL
};
- week_view_type = gtk_type_unique (gtk_table_get_type (), &week_view_info);
+ week_view_type = gtk_type_unique (gtk_vbox_get_type (), &week_view_info);
}
return week_view_type;
@@ -93,30 +93,33 @@ GtkWidget *
gncal_week_view_new (GnomeCalendar *calendar, time_t start_of_week)
{
GncalWeekView *wview;
+ GtkWidget *table;
int i;
g_return_val_if_fail (calendar != NULL, NULL);
wview = gtk_type_new (gncal_week_view_get_type ());
- gtk_table_set_homogeneous (GTK_TABLE (wview), TRUE);
-
+ table = gtk_table_new (0, 0, 0);
+ gtk_table_set_homogeneous (GTK_TABLE (table), TRUE);
+ wview->label = gtk_label_new ("");
+ gtk_box_pack_start (GTK_BOX (wview), wview->label, 0, 0, 0);
+ gtk_box_pack_start (GTK_BOX (wview), table, 1, 1, 0);
wview->calendar = calendar;
-
for (i = 0; i < 7; i++) {
wview->days[i] = GNCAL_DAY_VIEW (gncal_day_view_new (calendar, 0, 0));
gtk_signal_connect (GTK_OBJECT (wview->days [i]), "button_press_event",
GTK_SIGNAL_FUNC(double_click_on_weekday), wview);
if (i < 5)
- gtk_table_attach (GTK_TABLE (wview), GTK_WIDGET (wview->days[i]),
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (wview->days[i]),
i, i + 1,
0, 1,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
else
- gtk_table_attach (GTK_TABLE (wview), GTK_WIDGET (wview->days[i]),
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (wview->days[i]),
i - 2, i - 1,
1, 2,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
@@ -135,7 +138,7 @@ gncal_week_view_new (GnomeCalendar *calendar, time_t start_of_week)
gtk_calendar_display_options (wview->gtk_calendar,
GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_SHOW_DAY_NAMES);
- gtk_table_attach (GTK_TABLE (wview), GTK_WIDGET (wview->gtk_calendar),
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (wview->gtk_calendar),
0, 3,
1, 2,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
@@ -172,7 +175,7 @@ gncal_week_view_update (GncalWeekView *wview, iCalObject *ico, int flags)
void
gncal_week_view_set (GncalWeekView *wview, time_t start_of_week)
{
- struct tm tm;
+ struct tm tm, start;
time_t day_start, day_end;
int i;
@@ -192,7 +195,8 @@ gncal_week_view_set (GncalWeekView *wview, time_t start_of_week)
tm.tm_sec = 0;
day_start = mktime (&tm);
-
+ start = tm;
+
/* Calendar */
gtk_calendar_select_month (wview->gtk_calendar, tm.tm_mon, tm.tm_year + 1900);
@@ -207,6 +211,20 @@ gncal_week_view_set (GncalWeekView *wview, time_t start_of_week)
day_start = day_end;
}
-
+
update (wview, FALSE, NULL, 0);
+
+ /* The label */
+ {
+ char buf [80];
+ int len;
+
+ strftime (buf, sizeof (buf), "%A %d %Y - ", &start);
+ len = strlen (buf);
+
+ strftime (buf + len, sizeof (buf) - len, "%A %d %Y", &tm);
+ gtk_label_set (GTK_LABEL (wview->label), buf);
+
+ }
}
+
diff --git a/calendar/gui/gncal-week-view.h b/calendar/gui/gncal-week-view.h
index 16dfa40eb0..1514890504 100644
--- a/calendar/gui/gncal-week-view.h
+++ b/calendar/gui/gncal-week-view.h
@@ -27,7 +27,7 @@ typedef struct _GncalWeekView GncalWeekView;
typedef struct _GncalWeekViewClass GncalWeekViewClass;
struct _GncalWeekView {
- GtkTable table;
+ GtkVBox box;
GnomeCalendar *calendar; /* the calendar we are associated to */
@@ -35,10 +35,11 @@ struct _GncalWeekView {
GncalDayView *days[7]; /* the day view widgets */
GtkCalendar *gtk_calendar; /* At least for now; see the FIXME comments in the .c file */
+ GtkWidget *label;
};
struct _GncalWeekViewClass {
- GtkTableClass parent_class;
+ GtkVBoxClass parent_class;
};
diff --git a/calendar/pcs/calobj.c b/calendar/pcs/calobj.c
index b7578ca397..cb1bd8b560 100644
--- a/calendar/pcs/calobj.c
+++ b/calendar/pcs/calobj.c
@@ -1135,7 +1135,6 @@ duration_callback (iCalObject *ico, time_t start, time_t end, void *closure)
int *count = closure;
struct tm *tm;
- print_time_t (start);
tm = localtime (&start);
(*count)++;