diff options
author | Damon Chaplin <damon@helixcode.com> | 2000-10-21 23:39:38 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2000-10-21 23:39:38 +0800 |
commit | dbf54684fc3b1d024253a7415d75d076a1bf4cc9 (patch) | |
tree | 9229185e2e388ac8d825cdac4691bde407de7624 /calendar/gui/gnome-cal.c | |
parent | cfa0f85ab441447009b96f97cd94f4cfb026abef (diff) | |
download | gsoc2013-evolution-dbf54684fc3b1d024253a7415d75d076a1bf4cc9.tar gsoc2013-evolution-dbf54684fc3b1d024253a7415d75d076a1bf4cc9.tar.gz gsoc2013-evolution-dbf54684fc3b1d024253a7415d75d076a1bf4cc9.tar.bz2 gsoc2013-evolution-dbf54684fc3b1d024253a7415d75d076a1bf4cc9.tar.lz gsoc2013-evolution-dbf54684fc3b1d024253a7415d75d076a1bf4cc9.tar.xz gsoc2013-evolution-dbf54684fc3b1d024253a7415d75d076a1bf4cc9.tar.zst gsoc2013-evolution-dbf54684fc3b1d024253a7415d75d076a1bf4cc9.zip |
removed debug message.
2000-10-21 Damon Chaplin <damon@helixcode.com>
* gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_use_24_hour_toggled): removed debug message.
* gui/e-calendar-table.c (e_calendar_table_save_state): new function
to save the state of the table to a given file.
* gui/e-calendar-table.h (struct _ECalendarTable): added etable field
so we can access it to save the state.
* gui/gnome-cal.c (gnome_calendar_destroy): call
e_calendar_table_save_state() to save the state of the TaskPad.
(setup_widgets): load the state of the TaskPad.
* gui/calendar-config.c: added support for the default view.
* gui/gnome-cal.c (gnome_calendar_construct):
(gnome_calendar_set_view_internal): use/set the default view setting.
svn path=/trunk/; revision=6097
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 46eb66e58e..379bbfec95 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -24,6 +24,7 @@ #include "e-week-view.h" #include "event-editor.h" #include "gnome-cal.h" +#include "component-factory.h" #include "calendar-commands.h" #include "calendar-config.h" @@ -197,6 +198,7 @@ setup_widgets (GnomeCalendar *gcal) { GnomeCalendarPrivate *priv; GtkWidget *w; + gchar *filename; priv = gcal->priv; @@ -245,6 +247,10 @@ setup_widgets (GnomeCalendar *gcal) e_paned_pack2 (E_PANED (priv->vpane), priv->todo, TRUE, TRUE); gtk_widget_show (priv->todo); + filename = g_strdup_printf ("%s/config/TaskPad", evolution_dir); + e_calendar_table_load_state (E_CALENDAR_TABLE (priv->todo), filename); + g_free (filename); + /* The Day View. */ priv->day_view = e_day_view_new (); e_day_view_set_calendar (E_DAY_VIEW (priv->day_view), gcal); @@ -337,6 +343,7 @@ gnome_calendar_destroy (GtkObject *object) { GnomeCalendar *gcal; GnomeCalendarPrivate *priv; + gchar *filename; g_return_if_fail (object != NULL); g_return_if_fail (GNOME_IS_CALENDAR (object)); @@ -344,6 +351,11 @@ gnome_calendar_destroy (GtkObject *object) gcal = GNOME_CALENDAR (object); priv = gcal->priv; + /* Save the TaskPad layout. */ + filename = g_strdup_printf ("%s/config/TaskPad", evolution_dir); + e_calendar_table_save_state (E_CALENDAR_TABLE (priv->todo), filename); + g_free (filename); + priv->load_state = LOAD_STATE_NOT_LOADED; if (priv->loading_uri) { @@ -604,6 +616,8 @@ gnome_calendar_set_view_internal (GnomeCalendar *gcal, priv->current_view_type = view; priv->range_selected = range_selected; + calendar_config_set_default_view (view); + gtk_notebook_set_page (GTK_NOTEBOOK (priv->notebook), view); if (focus) @@ -1280,6 +1294,8 @@ GtkWidget * gnome_calendar_construct (GnomeCalendar *gcal) { GnomeCalendarPrivate *priv; + gint view; + gchar *page; g_return_val_if_fail (gcal != NULL, NULL); g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL); @@ -1304,7 +1320,23 @@ gnome_calendar_construct (GnomeCalendar *gcal) e_week_view_set_cal_client (E_WEEK_VIEW (priv->week_view), priv->client); e_week_view_set_cal_client (E_WEEK_VIEW (priv->month_view), priv->client); - gnome_calendar_set_view (gcal, "dayview", FALSE, FALSE); + view = calendar_config_get_default_view (); + switch (view) { + case 1: + page = "workweekview"; + break; + case 2: + page = "weekview"; + break; + case 3: + page = "monthview"; + break; + default: + page = "dayview"; + break; + } + + gnome_calendar_set_view (gcal, page, FALSE, FALSE); return GTK_WIDGET (gcal); } |