diff options
author | Miguel de Icaza <miguel@nuclecu.unam.mx> | 1998-07-08 07:02:56 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1998-07-08 07:02:56 +0800 |
commit | 857a41f6d717197b3df3d3c28245eb36a3b8cdcc (patch) | |
tree | 4253799e4fed4bf178a862ea7d76cdf87fecb82e /calendar/gui/gnome-cal.c | |
parent | 13bbf3992f34c7a9ca29bdb73f4b495ec9934e12 (diff) | |
download | gsoc2013-evolution-857a41f6d717197b3df3d3c28245eb36a3b8cdcc.tar gsoc2013-evolution-857a41f6d717197b3df3d3c28245eb36a3b8cdcc.tar.gz gsoc2013-evolution-857a41f6d717197b3df3d3c28245eb36a3b8cdcc.tar.bz2 gsoc2013-evolution-857a41f6d717197b3df3d3c28245eb36a3b8cdcc.tar.lz gsoc2013-evolution-857a41f6d717197b3df3d3c28245eb36a3b8cdcc.tar.xz gsoc2013-evolution-857a41f6d717197b3df3d3c28245eb36a3b8cdcc.tar.zst gsoc2013-evolution-857a41f6d717197b3df3d3c28245eb36a3b8cdcc.zip |
Add support for --view flag. (session_save_state): Save the view mode;
1998-07-07 Miguel de Icaza <miguel@nuclecu.unam.mx>
* main.c: Add support for --view flag.
(session_save_state): Save the view mode;
(new_calendar): Now takes a view mode flag.
* gnome-cal.c (gnome_calendar_get_current_view_name): New
function for enhancing the session management support for
gnomecal.
(gnome_calendar_set_view): New function that makes a given page
active.
svn path=/trunk/; revision=278
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 29 |
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) { |