[gnumeric] [UI] Pref to choose default autosave timeout
- From: Jody Goldberg <jody src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] [UI] Pref to choose default autosave timeout
- Date: Tue, 28 Apr 2009 19:02:52 -0400 (EDT)
commit 37838fd36214ad52ac5fea9e5948f50bd33f87e7
Author: Jody Goldberg <jody gnome org>
Date: Fri Dec 19 08:14:23 2008 -0500
[UI] Pref to choose default autosave timeout
---
ChangeLog | 6 ++++++
NEWS | 1 +
src/dialogs/ChangeLog | 5 +++++
src/dialogs/dialog-preferences.c | 4 ++++
src/gnumeric-gconf-priv.h | 1 +
src/gnumeric-gconf.c | 11 +++++++++++
src/gnumeric-gconf.h | 2 ++
src/wbc-gtk.c | 2 ++
8 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a882ad0..a2ba0f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-28 Jody Goldberg <jody gnome org>
+
+ * src/wbc-gtk.c (wbc_gtk_init) : use the pref for autosave.
+ * src/gnumeric-gconf.c (gnm_conf_init_essential) : load it here.
+ (gnm_gconf_set_workbook_autosave_time) : new.
+
2009-04-28 Morten Welinder <terra gnome org>
* src/parse-util.c (std_expr_name_handler): Handle shadowed global
diff --git a/NEWS b/NEWS
index 805dcc0..b184aff 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Andreas:
Jody:
* XLSX start reading external refs.
* XL2003-XML enable the use of builtin formats, and drop '.sml' kludge.
+ * Add pref entry to set default value of autsave.
Morten:
* Fix xls save problem with sheets that are too big for the format.
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 012bfe0..4d3c3e4 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-28 Jody Goldberg <jody gnome org>
+
+ * dialog-preferences.c (pref_window_page_initializer) : entry for
+ default autosave setting.
+
2009-04-27 Andreas J. Guelzow <aguelzow pyrshep ca>
* dialog-so-styled.c (cb_dialog_so_styled_text_widget_changed): retrieve
diff --git a/src/dialogs/dialog-preferences.c b/src/dialogs/dialog-preferences.c
index 2d13891..021f0e5 100644
--- a/src/dialogs/dialog-preferences.c
+++ b/src/dialogs/dialog-preferences.c
@@ -605,6 +605,10 @@ pref_window_page_initializer (PrefState *state,
gnm_gconf_set_workbook_ncols,
_("Default Number of Columns in a Sheet"));
+ int_pref_create_widget (state->root, GNM_CONF_WORKBOOK_AUTOSAVE_TIME,
+ page, row++, 0, 0, 365*24*60*60, 60,
+ gnm_gconf_set_workbook_autosave_time,
+ _("Default autosave frequency in seconds"));
bool_pref_create_widget (node, GNM_CONF_GUI_ED_LIVESCROLLING,
page, row++,
gnm_gconf_set_gui_livescrolling,
diff --git a/src/gnumeric-gconf-priv.h b/src/gnumeric-gconf-priv.h
index bdf8909..a753a90 100644
--- a/src/gnumeric-gconf-priv.h
+++ b/src/gnumeric-gconf-priv.h
@@ -100,6 +100,7 @@ G_BEGIN_DECLS
#define GNM_CONF_WORKBOOK_NSHEETS "core/workbook/n-sheet"
#define GNM_CONF_WORKBOOK_NROWS "core/workbook/n-rows"
#define GNM_CONF_WORKBOOK_NCOLS "core/workbook/n-cols"
+#define GNM_CONF_WORKBOOK_AUTOSAVE_TIME "core/workbook/autosave_time"
#define GNM_CONF_GUI_DIR "core/gui"
#define GNM_CONF_GUI_RES_H "screen/horizontaldpi"
diff --git a/src/gnumeric-gconf.c b/src/gnumeric-gconf.c
index ec78117..1cdddaf 100644
--- a/src/gnumeric-gconf.c
+++ b/src/gnumeric-gconf.c
@@ -191,6 +191,8 @@ gnm_conf_init_essential (void)
root, GNM_CONF_WORKBOOK_NCOLS, GNM_MIN_COLS, GNM_MAX_COLS, GNM_DEFAULT_COLS);
gnm_sheet_suggest_size (&prefs.col_number,
&prefs.row_number);
+ prefs.autosave_time = go_conf_load_int (
+ root, GNM_CONF_WORKBOOK_AUTOSAVE_TIME, 0, 365*24*60*60, 0);
prefs.horizontal_window_fraction = go_conf_load_double (
node, GNM_CONF_GUI_WINDOW_X, .1, 1., .6);
prefs.vertical_window_fraction = go_conf_load_double (
@@ -842,6 +844,15 @@ gnm_gconf_set_workbook_nsheets (gint val)
prefs.initial_sheet_number = val;
go_conf_set_int (root, GNM_CONF_WORKBOOK_NSHEETS, val);
}
+void
+gnm_gconf_set_workbook_autosave_time (gint val)
+
+{
+ if (val < 0)
+ val = 0;
+ prefs.autosave_time = val;
+ go_conf_set_int (root, GNM_CONF_WORKBOOK_AUTOSAVE_TIME, val);
+}
void
gnm_gconf_set_workbook_nrows (gint val)
diff --git a/src/gnumeric-gconf.h b/src/gnumeric-gconf.h
index bc5ca11..5c82be7 100644
--- a/src/gnumeric-gconf.h
+++ b/src/gnumeric-gconf.h
@@ -42,6 +42,7 @@ typedef struct {
gint initial_sheet_number;
gint row_number;
gint col_number;
+ gint autosave_time;
float horizontal_window_fraction;
float vertical_window_fraction;
float zoom;
@@ -193,6 +194,7 @@ void gnm_gconf_set_sort_ascending (gboolean value);
void gnm_gconf_set_workbook_nsheets (gint value);
void gnm_gconf_set_workbook_nrows (gint value);
void gnm_gconf_set_workbook_ncols (gint value);
+void gnm_gconf_set_workbook_autosave_time (gint value);
void gnm_gconf_set_unfocused_rs (gboolean value);
/* function selector and formula guru */
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index f56d841..d66531d 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -4866,6 +4866,8 @@ wbc_gtk_init (GObject *obj)
wbc_gtk_set_toggle_action_state (wbcg, "ViewSheets", FALSE);
wbc_gtk_set_toggle_action_state (wbcg, "ViewStatusbar", FALSE);
#endif
+
+ wbcg_set_autosave_time (wbcg, gnm_app_prefs->autosave_time);
}
GSF_CLASS_FULL (WBCGtk, wbc_gtk, NULL, NULL, wbc_gtk_class_init, NULL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]