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/e-calendar-table.c | |
parent | cfa0f85ab441447009b96f97cd94f4cfb026abef (diff) | |
download | gsoc2013-evolution-dbf54684fc3b1d024253a7415d75d076a1bf4cc9.tar.gz 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/e-calendar-table.c')
-rw-r--r-- | calendar/gui/e-calendar-table.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index b771b338e6..7f7b25ada8 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -28,6 +28,8 @@ */ #include <config.h> +#include <sys/stat.h> +#include <unistd.h> #include <gnome.h> #include <gal/e-table/e-table-scrolled.h> #include <gal/e-table/e-cell-checkbox.h> @@ -220,7 +222,9 @@ e_calendar_table_init (ECalendarTable *cal_table) /* Create the table */ - table = e_table_scrolled_new (model, extras, E_CALENDAR_TABLE_SPEC, NULL); + table = e_table_scrolled_new (model, extras, E_CALENDAR_TABLE_SPEC, + NULL); + cal_table->etable = table; gtk_table_attach (GTK_TABLE (cal_table), table, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (table); @@ -272,8 +276,6 @@ void e_calendar_table_set_cal_client (ECalendarTable *cal_table, CalClient *client) { - g_print ("In e_calendar_table_set_cal_client\n"); - calendar_model_set_cal_client (cal_table->model, client, CALOBJ_TYPE_TODO); } @@ -284,8 +286,6 @@ e_calendar_table_on_double_click (ETable *table, gint row, ECalendarTable *cal_table) { - g_print ("In e_calendar_table_on_double_click row:%i\n", row); - e_calendar_table_open_task (cal_table, row); } @@ -375,11 +375,7 @@ e_calendar_table_on_key_press (ETable *table, GdkEventKey *event, ECalendarTable *cal_table) { - g_print ("In e_calendar_table_on_key_press\n"); - if (event->keyval == GDK_Delete) { - g_print (" delete key!!!\n"); - calendar_model_delete_task (cal_table->model, row); } @@ -402,3 +398,30 @@ e_calendar_table_open_task (ECalendarTable *cal_table, } +/* Loads the state of the table (headers shown etc.) from the given file. */ +void +e_calendar_table_load_state (ECalendarTable *cal_table, + gchar *filename) +{ + struct stat st; + + g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table)); + + if (stat (filename, &st) == 0 && st.st_size > 0 + && S_ISREG (st.st_mode)) { + e_table_scrolled_load_state (E_TABLE_SCROLLED (cal_table->etable), filename); + } +} + + +/* Saves the state of the table (headers shown etc.) to the given file. */ +void +e_calendar_table_save_state (ECalendarTable *cal_table, + gchar *filename) +{ + + g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table)); + + e_table_scrolled_save_state (E_TABLE_SCROLLED (cal_table->etable), + filename); +} |