aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/gnome-cal.c15
-rw-r--r--calendar/gnome-cal.h1
-rw-r--r--calendar/gui/gnome-cal.c15
-rw-r--r--calendar/gui/gnome-cal.h1
5 files changed, 22 insertions, 16 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 1ecef9bc43..c364bc3fbe 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+1999-06-04 Robert Brady <rwb197@ecs.soton.ac.uk>
+
+ * gnome-cal.h, gnome-cal.c: Fix abort() problem with the year view.
+ (Bug #1367). Thanks to Owen Cliffe <oc197@ecs.soton.ac.uk> for
+ helping track it down.
+
1999-06-03 Miguel de Icaza <miguel@nuclecu.unam.mx>
* calobj.c (daynumberlist): One line bug fix from Sergey I Panov.
diff --git a/calendar/gnome-cal.c b/calendar/gnome-cal.c
index d040a9b594..86900dd343 100644
--- a/calendar/gnome-cal.c
+++ b/calendar/gnome-cal.c
@@ -44,7 +44,6 @@ gnome_calendar_get_type (void)
static void
setup_widgets (GnomeCalendar *gcal)
{
- GtkWidget *sw;
time_t now;
now = time (NULL);
@@ -55,16 +54,16 @@ setup_widgets (GnomeCalendar *gcal)
gcal->month_view = month_view_new (gcal, now);
gcal->year_view = year_view_new (gcal, now);
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
+ gcal->year_view_sw = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (gcal->year_view_sw),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (sw), gcal->year_view);
+ gtk_container_add (GTK_CONTAINER (gcal->year_view_sw), gcal->year_view);
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->day_view, gtk_label_new (_("Day View")));
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->week_view, gtk_label_new (_("Week View")));
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->month_view, gtk_label_new (_("Month View")));
- gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), sw, gtk_label_new (_("Year View")));
+ gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->year_view_sw, gtk_label_new (_("Year View")));
gtk_widget_show_all (gcal->notebook);
@@ -93,7 +92,7 @@ gnome_calendar_get_current_view_name (GnomeCalendar *gcal)
return "weekview";
else if (page == gcal->month_view)
return "monthview";
- else if (page == gcal->year_view)
+ else if (page == gcal->year_view_sw)
return "yearview";
else
return "dayview";
@@ -117,7 +116,7 @@ gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time)
gncal_week_view_set (GNCAL_WEEK_VIEW (gcal->week_view), new_time);
else if (current == gcal->month_view)
month_view_set (MONTH_VIEW (gcal->month_view), new_time);
- else if (current == gcal->year_view)
+ else if (current == gcal->year_view_sw)
year_view_set (YEAR_VIEW (gcal->year_view), new_time);
else {
g_warning ("My penguin is gone!");
@@ -139,7 +138,7 @@ gnome_calendar_direction (GnomeCalendar *gcal, int direction)
new_time = time_add_week (time_week_begin (gcal->current_display), 1 * direction);
else if (cp == gcal->month_view)
new_time = time_add_month (time_month_begin (gcal->current_display), 1 * direction);
- else if (cp == gcal->year_view)
+ else if (cp == gcal->year_view_sw)
new_time = time_add_year (time_year_begin (gcal->current_display), 1 * direction);
else {
g_warning ("Weee! Where did the penguin go?");
diff --git a/calendar/gnome-cal.h b/calendar/gnome-cal.h
index 3939becc52..ae4e5292da 100644
--- a/calendar/gnome-cal.h
+++ b/calendar/gnome-cal.h
@@ -28,6 +28,7 @@ typedef struct {
GtkWidget *week_view;
GtkWidget *month_view;
GtkWidget *year_view;
+ GtkWidget *year_view_sw;
void *event_editor;
} GnomeCalendar;
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index d040a9b594..86900dd343 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -44,7 +44,6 @@ gnome_calendar_get_type (void)
static void
setup_widgets (GnomeCalendar *gcal)
{
- GtkWidget *sw;
time_t now;
now = time (NULL);
@@ -55,16 +54,16 @@ setup_widgets (GnomeCalendar *gcal)
gcal->month_view = month_view_new (gcal, now);
gcal->year_view = year_view_new (gcal, now);
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
+ gcal->year_view_sw = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (gcal->year_view_sw),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (sw), gcal->year_view);
+ gtk_container_add (GTK_CONTAINER (gcal->year_view_sw), gcal->year_view);
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->day_view, gtk_label_new (_("Day View")));
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->week_view, gtk_label_new (_("Week View")));
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->month_view, gtk_label_new (_("Month View")));
- gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), sw, gtk_label_new (_("Year View")));
+ gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->year_view_sw, gtk_label_new (_("Year View")));
gtk_widget_show_all (gcal->notebook);
@@ -93,7 +92,7 @@ gnome_calendar_get_current_view_name (GnomeCalendar *gcal)
return "weekview";
else if (page == gcal->month_view)
return "monthview";
- else if (page == gcal->year_view)
+ else if (page == gcal->year_view_sw)
return "yearview";
else
return "dayview";
@@ -117,7 +116,7 @@ gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time)
gncal_week_view_set (GNCAL_WEEK_VIEW (gcal->week_view), new_time);
else if (current == gcal->month_view)
month_view_set (MONTH_VIEW (gcal->month_view), new_time);
- else if (current == gcal->year_view)
+ else if (current == gcal->year_view_sw)
year_view_set (YEAR_VIEW (gcal->year_view), new_time);
else {
g_warning ("My penguin is gone!");
@@ -139,7 +138,7 @@ gnome_calendar_direction (GnomeCalendar *gcal, int direction)
new_time = time_add_week (time_week_begin (gcal->current_display), 1 * direction);
else if (cp == gcal->month_view)
new_time = time_add_month (time_month_begin (gcal->current_display), 1 * direction);
- else if (cp == gcal->year_view)
+ else if (cp == gcal->year_view_sw)
new_time = time_add_year (time_year_begin (gcal->current_display), 1 * direction);
else {
g_warning ("Weee! Where did the penguin go?");
diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h
index 3939becc52..ae4e5292da 100644
--- a/calendar/gui/gnome-cal.h
+++ b/calendar/gui/gnome-cal.h
@@ -28,6 +28,7 @@ typedef struct {
GtkWidget *week_view;
GtkWidget *month_view;
GtkWidget *year_view;
+ GtkWidget *year_view_sw;
void *event_editor;
} GnomeCalendar;