aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index e96a6add8b..9731bd855c 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -71,6 +71,21 @@ get_current_page (GnomeCalendar *gcal)
return GTK_NOTEBOOK (gcal->notebook)->cur_page->child;
}
+char *
+gnome_calendar_get_current_view_name (GnomeCalendar *gcal)
+{
+ GtkWidget *page = get_current_page (gcal);
+
+ if (page == gcal->day_view)
+ return "dayview";
+ else if (page == gcal->week_view)
+ return "weekview";
+ else if (page == gcal->year_view)
+ return "yearview";
+ else
+ return "dayview";
+}
+
void
gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time)
{
@@ -134,6 +149,20 @@ gnome_calendar_dayjump (GnomeCalendar *gcal, time_t time)
gnome_calendar_goto (gcal, time);
}
+void
+gnome_calendar_set_view (GnomeCalendar *gcal, char *page_name)
+{
+ int page = 0;
+
+ if (strcmp (page_name, "dayview") == 0)
+ page = 0;
+ else if (strcmp (page_name, "weekview") == 0)
+ page = 1;
+ else if (strcmp (page_name, "yearview") == 0)
+ page = 2;
+ gtk_notebook_set_page (GTK_NOTEBOOK (gcal->notebook), page);
+}
+
GtkWidget *
gnome_calendar_new (char *title)
{