Commit ff7cf8af authored by Andreas J. Guelzow's avatar Andreas J. Guelzow

/home/aguelzow/tmp/cvsXdLl7i

parent 8bf194a8
...@@ -62,14 +62,12 @@ ...@@ -62,14 +62,12 @@
#include "style-color.h" #include "style-color.h"
#include "summary.h" #include "summary.h"
#include "tools/dao.h" #include "tools/dao.h"
#include "gnumeric-gconf.h"
#include <libgnome/gnome-i18n.h> #include <libgnome/gnome-i18n.h>
#include <gal/util/e-util.h> #include <gal/util/e-util.h>
#include <ctype.h> #include <ctype.h>
#define MAX_DESCRIPTOR_WIDTH 15
#define GNUMERIC_GCONF_UNDO_SIZE "/apps/gnumeric/core/undosize"
/* /*
* There are several distinct stages to wrapping each command. * There are several distinct stages to wrapping each command.
* *
...@@ -97,7 +95,6 @@ ...@@ -97,7 +95,6 @@
* *
* FIXME: Filter the list of commands when a sheet is deleted. * FIXME: Filter the list of commands when a sheet is deleted.
* *
* TODO : Add user preference for undo buffer size limit
* TODO : Possibly clear lists on save. * TODO : Possibly clear lists on save.
* *
* TODO : Reqs for selective undo * TODO : Reqs for selective undo
...@@ -178,6 +175,67 @@ static E_MAKE_TYPE (func, #type, type, \ ...@@ -178,6 +175,67 @@ static E_MAKE_TYPE (func, #type, type, \
/******************************************************************/ /******************************************************************/
/**
* returns the range name depending on the preference setting
*
* char const *undo_global_range_name
*
* @pos: CellPos
*
* Returns :
*/
static char *
undo_global_range_name (Sheet *sheet, Range const * const range)
{
gboolean show_sheet_name;
GConfClient *client;
GError *err = NULL;
client = application_get_gconf_client ();
show_sheet_name = gconf_client_get_bool (client,
GNUMERIC_GCONF_UNDO_SHOW_SHEET_NAME, &err);
if (err)
show_sheet_name = FALSE;
return global_range_name (show_sheet_name ? sheet : NULL, range);
}
/**
* returns the cell position name depending on the preference setting
*
* char *cmd_cell_pos_name_utility
*
* @pos: CellPos
*
* Returns :
*/
char *
cmd_cell_pos_name_utility (Sheet *sheet, CellPos const *pos)
{
Range range;
range.start = *pos;
range.end = *pos;
return undo_global_range_name (sheet, &range);
}
static guint
max_descriptor_width (void)
{
guint max_width;
GConfClient *client;
GError *err = NULL;
client = application_get_gconf_client ();
max_width = (guint) gconf_client_get_int (client,
GNUMERIC_GCONF_UNDO_MAX_DESCRIPTOR_WIDTH, &err);
if (err)
max_width = 10;
return max_width;
}
/** /**
* get_menu_label : Utility routine to get the descriptor associated * get_menu_label : Utility routine to get the descriptor associated
* with a list of commands. * with a list of commands.
...@@ -230,19 +288,21 @@ update_after_action (Sheet *sheet) ...@@ -230,19 +288,21 @@ update_after_action (Sheet *sheet)
} }
/* /*
* range_list_to_string: Convert a list of ranges into a string. * cmd_range_list_to_string_utility: Convert a list of ranges into a string.
* (The result will be something like : * (The result will be something like :
* "A1:C3, D4:E5"). The string will be * "A1:C3, D4:E5"). The string will be
* automatically truncated to MAX_DESCRIPTOR_WIDTH. * automatically truncated to max_descriptor_width ().
* The caller should free the GString that is returned. * The caller should free the GString that is returned.
* *
* @ranges : GSList containing Range *'s * @ranges : GSList containing Range *'s
*/ */
static GString * GString *
range_list_to_string (GSList const *ranges) cmd_range_list_to_string_utility (Sheet *sheet, GSList const *ranges)
{ {
GString *names; GString *names;
GSList const *l; GSList const *l;
char *name;
guint max_width;
g_return_val_if_fail (ranges != NULL, NULL); g_return_val_if_fail (ranges != NULL, NULL);
...@@ -250,8 +310,9 @@ range_list_to_string (GSList const *ranges) ...@@ -250,8 +310,9 @@ range_list_to_string (GSList const *ranges)
for (l = ranges; l != NULL; l = l->next) { for (l = ranges; l != NULL; l = l->next) {
Range const * const r = l->data; Range const * const r = l->data;
/* No need to free range_name, uses static buffer */ name = undo_global_range_name (sheet , r);
g_string_append (names, range_name (r)); g_string_append (names, name);
g_free (name);
if (l->next) if (l->next)
g_string_append (names, ", "); g_string_append (names, ", ");
...@@ -261,9 +322,11 @@ range_list_to_string (GSList const *ranges) ...@@ -261,9 +322,11 @@ range_list_to_string (GSList const *ranges)
* There is no need to do this for "types", because that * There is no need to do this for "types", because that
* will never grow indefinitely * will never grow indefinitely
*/ */
if (strlen (names->str) > MAX_DESCRIPTOR_WIDTH) { max_width = max_descriptor_width ();
g_string_truncate (names, MAX_DESCRIPTOR_WIDTH - 3); if (strlen (names->str) > max_width) {
g_string_append (names, "..."); /* FIXME: this does not look right for UTF8 !!*/
g_string_truncate (names, max_width - 3);
g_string_append (names, _("..."));
} }
return names; return names;
...@@ -668,6 +731,8 @@ cmd_set_text (WorkbookControl *wbc, ...@@ -668,6 +731,8 @@ cmd_set_text (WorkbookControl *wbc,
const gchar *pad = ""; const gchar *pad = "";
gchar *text, *corrected_text, *tmp, c = '\0'; gchar *text, *corrected_text, *tmp, c = '\0';
Cell const *cell; Cell const *cell;
guint max_width;
char *where;
g_return_val_if_fail (IS_SHEET (sheet), TRUE); g_return_val_if_fail (IS_SHEET (sheet), TRUE);
g_return_val_if_fail (new_text != NULL, TRUE); g_return_val_if_fail (new_text != NULL, TRUE);
...@@ -703,18 +768,20 @@ cmd_set_text (WorkbookControl *wbc, ...@@ -703,18 +768,20 @@ cmd_set_text (WorkbookControl *wbc,
} }
/* Limit the size of the descriptor to something reasonable */ /* Limit the size of the descriptor to something reasonable */
if (strlen (corrected_text) > MAX_DESCRIPTOR_WIDTH || c != '\0') { max_width = max_descriptor_width ();
if (strlen (corrected_text) > max_width || c != '\0') {
pad = "..."; /* length of 3 */ pad = "..."; /* length of 3 */
text = g_strndup (corrected_text, text = g_strndup (corrected_text,
MAX_DESCRIPTOR_WIDTH - 3); max_width - 3);
} else } else
text = corrected_text; text = corrected_text;
me->parent.sheet = sheet; me->parent.sheet = sheet;
me->parent.size = 1; me->parent.size = 1;
where = cmd_cell_pos_name_utility (sheet, pos);
me->parent.cmd_descriptor = me->parent.cmd_descriptor =
g_strdup_printf (_("Typing \"%s%s\" in %s"), text, pad, g_strdup_printf (_("Typing \"%s%s\" in %s"), text, pad, where);
cell_pos_name (pos)); g_free (where);
if (text != corrected_text) if (text != corrected_text)
g_free (text); g_free (text);
...@@ -866,6 +933,7 @@ cmd_area_set_text (WorkbookControl *wbc, ParsePos const *pos, ...@@ -866,6 +933,7 @@ cmd_area_set_text (WorkbookControl *wbc, ParsePos const *pos,
CmdAreaSetText *me; CmdAreaSetText *me;
gchar *text; gchar *text;
const gchar *pad = ""; const gchar *pad = "";
guint max_width;
obj = g_object_new (CMD_AREA_SET_TEXT_TYPE, NULL); obj = g_object_new (CMD_AREA_SET_TEXT_TYPE, NULL);
me = CMD_AREA_SET_TEXT (obj); me = CMD_AREA_SET_TEXT (obj);
...@@ -877,10 +945,11 @@ cmd_area_set_text (WorkbookControl *wbc, ParsePos const *pos, ...@@ -877,10 +945,11 @@ cmd_area_set_text (WorkbookControl *wbc, ParsePos const *pos,
me->selection = selection_get_ranges (pos->sheet, FALSE /* No intersection */); me->selection = selection_get_ranges (pos->sheet, FALSE /* No intersection */);
me->old_content = NULL; me->old_content = NULL;
if (strlen (new_text) > MAX_DESCRIPTOR_WIDTH) { max_width = max_descriptor_width ();
if (strlen (new_text) > max_width) {
pad = "..."; /* length of 3 */ pad = "..."; /* length of 3 */
text = g_strndup (new_text, text = g_strndup (new_text,
MAX_DESCRIPTOR_WIDTH - 3); max_width - 3);
} else } else
text = (gchar *) new_text; text = (gchar *) new_text;
...@@ -1354,7 +1423,7 @@ cmd_clear_selection (WorkbookControl *wbc, Sheet *sheet, int clear_flags) ...@@ -1354,7 +1423,7 @@ cmd_clear_selection (WorkbookControl *wbc, Sheet *sheet, int clear_flags)
* need to truncate the "types" list because it will not grow * need to truncate the "types" list because it will not grow
* indefinitely * indefinitely
*/ */
names = range_list_to_string (me->selection); names = cmd_range_list_to_string_utility (sheet, me->selection);
me->parent.cmd_descriptor = g_strdup_printf (_("Clearing %s in %s"), types->str, names->str); me->parent.cmd_descriptor = g_strdup_printf (_("Clearing %s in %s"), types->str, names->str);
g_string_free (names, TRUE); g_string_free (names, TRUE);
...@@ -1548,7 +1617,7 @@ cmd_format (WorkbookControl *wbc, Sheet *sheet, ...@@ -1548,7 +1617,7 @@ cmd_format (WorkbookControl *wbc, Sheet *sheet,
me->borders = NULL; me->borders = NULL;
if (opt_translated_name == NULL) { if (opt_translated_name == NULL) {
GString *names = range_list_to_string (me->selection); GString *names = cmd_range_list_to_string_utility (sheet, me->selection);
me->parent.cmd_descriptor = g_strdup_printf (_("Changing format of %s"), names->str); me->parent.cmd_descriptor = g_strdup_printf (_("Changing format of %s"), names->str);
g_string_free (names, TRUE); g_string_free (names, TRUE);
...@@ -1633,6 +1702,7 @@ cmd_resize_colrow (WorkbookControl *wbc, Sheet *sheet, ...@@ -1633,6 +1702,7 @@ cmd_resize_colrow (WorkbookControl *wbc, Sheet *sheet,
CmdResizeColRow *me; CmdResizeColRow *me;
GString *list; GString *list;
gboolean is_single; gboolean is_single;
guint max_width;
g_return_val_if_fail (IS_SHEET (sheet), TRUE); g_return_val_if_fail (IS_SHEET (sheet), TRUE);
...@@ -1651,8 +1721,9 @@ cmd_resize_colrow (WorkbookControl *wbc, Sheet *sheet, ...@@ -1651,8 +1721,9 @@ cmd_resize_colrow (WorkbookControl *wbc, Sheet *sheet,
list = colrow_index_list_to_string (selection, is_cols, &is_single); list = colrow_index_list_to_string (selection, is_cols, &is_single);
/* Make sure the string doesn't get overly wide */ /* Make sure the string doesn't get overly wide */
if (strlen (list->str) > MAX_DESCRIPTOR_WIDTH) { max_width = max_descriptor_width ();
g_string_truncate (list, MAX_DESCRIPTOR_WIDTH - 3); if (strlen (list->str) > max_width) {
g_string_truncate (list, max_width - 3);
g_string_append (list, "..."); g_string_append (list, "...");
} }
...@@ -2263,6 +2334,7 @@ cmd_paste_cut (WorkbookControl *wbc, GnmExprRelocateInfo const *info, ...@@ -2263,6 +2334,7 @@ cmd_paste_cut (WorkbookControl *wbc, GnmExprRelocateInfo const *info,
GObject *obj; GObject *obj;
CmdPasteCut *me; CmdPasteCut *me;
Range r; Range r;
char *where;
g_return_val_if_fail (info != NULL, TRUE); g_return_val_if_fail (info != NULL, TRUE);
...@@ -2272,9 +2344,10 @@ cmd_paste_cut (WorkbookControl *wbc, GnmExprRelocateInfo const *info, ...@@ -2272,9 +2344,10 @@ cmd_paste_cut (WorkbookControl *wbc, GnmExprRelocateInfo const *info,
return TRUE; return TRUE;
/* FIXME: Do we want to show the destination range as well ? */ /* FIXME: Do we want to show the destination range as well ? */
where = undo_global_range_name (info->origin_sheet, &info->origin);
if (descriptor == NULL) if (descriptor == NULL)
descriptor = g_strdup_printf (_("Moving %s"), descriptor = g_strdup_printf (_("Moving %s"), where);
range_name (&info->origin)); g_free (where);
g_return_val_if_fail (info != NULL, TRUE); g_return_val_if_fail (info != NULL, TRUE);
...@@ -2840,7 +2913,7 @@ cmd_autoformat (WorkbookControl *wbc, Sheet *sheet, FormatTemplate *ft) ...@@ -2840,7 +2913,7 @@ cmd_autoformat (WorkbookControl *wbc, Sheet *sheet, FormatTemplate *ft)
me->parent.sheet = sheet; me->parent.sheet = sheet;
me->parent.size = 1; /* FIXME? */ me->parent.size = 1; /* FIXME? */
names = range_list_to_string (me->selection); names = cmd_range_list_to_string_utility (sheet, me->selection);
me->parent.cmd_descriptor = g_strdup_printf (_("Autoformatting %s"), me->parent.cmd_descriptor = g_strdup_printf (_("Autoformatting %s"),
names->str); names->str);
g_string_free (names, TRUE); g_string_free (names, TRUE);
...@@ -2950,7 +3023,7 @@ cmd_unmerge_cells (WorkbookControl *wbc, Sheet *sheet, GSList const *selection) ...@@ -2950,7 +3023,7 @@ cmd_unmerge_cells (WorkbookControl *wbc, Sheet *sheet, GSList const *selection)
me->parent.sheet = sheet; me->parent.sheet = sheet;
me->parent.size = 1; me->parent.size = 1;
names = range_list_to_string (selection); names = cmd_range_list_to_string_utility (sheet, selection);
me->parent.cmd_descriptor = g_strdup_printf (_("Unmerging %s"), names->str); me->parent.cmd_descriptor = g_strdup_printf (_("Unmerging %s"), names->str);
g_string_free (names, TRUE); g_string_free (names, TRUE);
...@@ -3088,7 +3161,7 @@ cmd_merge_cells (WorkbookControl *wbc, Sheet *sheet, GSList const *selection) ...@@ -3088,7 +3161,7 @@ cmd_merge_cells (WorkbookControl *wbc, Sheet *sheet, GSList const *selection)
me->parent.sheet = sheet; me->parent.sheet = sheet;
me->parent.size = 1; me->parent.size = 1;
names = range_list_to_string (selection); names = cmd_range_list_to_string_utility (sheet, selection);
me->parent.cmd_descriptor = g_strdup_printf (_("Merging %s"), me->parent.cmd_descriptor = g_strdup_printf (_("Merging %s"),
names->str); names->str);
g_string_free (names, TRUE); g_string_free (names, TRUE);
...@@ -3731,6 +3804,7 @@ cmd_zoom (WorkbookControl *wbc, GSList *sheets, double factor) ...@@ -3731,6 +3804,7 @@ cmd_zoom (WorkbookControl *wbc, GSList *sheets, double factor)
GString *namelist; GString *namelist;
GSList *l; GSList *l;
int i; int i;
guint max_width;
g_return_val_if_fail (wbc != NULL, TRUE); g_return_val_if_fail (wbc != NULL, TRUE);
g_return_val_if_fail (sheets != NULL, TRUE); g_return_val_if_fail (sheets != NULL, TRUE);
...@@ -3756,8 +3830,9 @@ cmd_zoom (WorkbookControl *wbc, GSList *sheets, double factor) ...@@ -3756,8 +3830,9 @@ cmd_zoom (WorkbookControl *wbc, GSList *sheets, double factor)
} }
/* Make sure the string doesn't get overly wide */ /* Make sure the string doesn't get overly wide */
if (strlen (namelist->str) > MAX_DESCRIPTOR_WIDTH) { max_width = max_descriptor_width ();
g_string_truncate (namelist, MAX_DESCRIPTOR_WIDTH - 3); if (strlen (namelist->str) > max_width) {
g_string_truncate (namelist, max_width - 3);
g_string_append (namelist, "..."); g_string_append (namelist, "...");
} }
...@@ -4316,6 +4391,7 @@ cmd_set_comment (WorkbookControl *wbc, ...@@ -4316,6 +4391,7 @@ cmd_set_comment (WorkbookControl *wbc,
GObject *obj; GObject *obj;
CmdSetComment *me; CmdSetComment *me;
CellComment *comment; CellComment *comment;
char *where;
g_return_val_if_fail (IS_SHEET (sheet), TRUE); g_return_val_if_fail (IS_SHEET (sheet), TRUE);
g_return_val_if_fail (new_text != NULL, TRUE); g_return_val_if_fail (new_text != NULL, TRUE);
...@@ -4329,11 +4405,13 @@ cmd_set_comment (WorkbookControl *wbc, ...@@ -4329,11 +4405,13 @@ cmd_set_comment (WorkbookControl *wbc,
me->new_text = NULL; me->new_text = NULL;
else else
me->new_text = g_strdup (new_text); me->new_text = g_strdup (new_text);
where = cmd_cell_pos_name_utility (sheet, pos);
me->parent.cmd_descriptor = me->parent.cmd_descriptor =
g_strdup_printf (me->new_text == NULL ? g_strdup_printf (me->new_text == NULL ?
_("Clearing comment of %s") : _("Clearing comment of %s") :
_("Setting comment of %s"), _("Setting comment of %s"),
cell_pos_name (pos)); where);
g_free (where);
me->old_text = NULL; me->old_text = NULL;
me->pos = *pos; me->pos = *pos;
me->sheet = sheet; me->sheet = sheet;
......
...@@ -12,6 +12,9 @@ void command_redo (WorkbookControl *wbc); ...@@ -12,6 +12,9 @@ void command_redo (WorkbookControl *wbc);
void command_setup_combos (WorkbookControl *wbc); void command_setup_combos (WorkbookControl *wbc);
void command_list_release (GSList *cmds); void command_list_release (GSList *cmds);
GString *cmd_range_list_to_string_utility (Sheet *sheet, GSList const *ranges);
char *cmd_cell_pos_name_utility (Sheet *sheet, CellPos const *pos);
gboolean cmd_set_text (WorkbookControl *wbc, Sheet *sheet, gboolean cmd_set_text (WorkbookControl *wbc, Sheet *sheet,
CellPos const *pos, const char *new_text); CellPos const *pos, const char *new_text);
......
2002-04-13 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-function-select.c : move defines into gnumeric-gconf.h
* dialog-preferences.c : add `undo'-preferences page
2002-04-12 Jon K Hellan <hellan@acm.org> 2002-04-12 Jon K Hellan <hellan@acm.org>
* dialog-preferences.c: Replace Gnome stock text/italic pixmap * dialog-preferences.c: Replace Gnome stock text/italic pixmap
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <str.h> #include <str.h>
#include <workbook-edit.h> #include <workbook-edit.h>
#include <application.h> #include <application.h>
#include <gnumeric-gconf.h>
#include <ctype.h> #include <ctype.h>
#include <glade/glade.h> #include <glade/glade.h>
...@@ -44,9 +45,6 @@ ...@@ -44,9 +45,6 @@
#define FUNCTION_SELECT_KEY "function-selector-dialog" #define FUNCTION_SELECT_KEY "function-selector-dialog"
#define FUNCTION_SELECT_DIALOG_KEY "function-selector-dialog" #define FUNCTION_SELECT_DIALOG_KEY "function-selector-dialog"
#define FUNCTION_SELECT_GCONF_RECENT "/apps/gnumeric/functionselector/recentfunctions"
#define FUNCTION_SELECT_GCONF_NUM_OF_RECENT "/apps/gnumeric/functionselector/num-of-recent"
typedef struct { typedef struct {
WorkbookControlGUI *wbcg; WorkbookControlGUI *wbcg;
Workbook *wb; Workbook *wb;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "number-match.h" #include "number-match.h"
#include "widgets/widget-font-selector.h" #include "widgets/widget-font-selector.h"
#include "widgets/gnumeric-cell-renderer-text.h" #include "widgets/gnumeric-cell-renderer-text.h"
#include "gnumeric-gconf.h"
#include <gui-util.h> #include <gui-util.h>
#include <libgnome/gnome-i18n.h> #include <libgnome/gnome-i18n.h>
...@@ -95,6 +96,14 @@ dialog_pref_load_description_from_schema (PrefState *state, char const *schema_p ...@@ -95,6 +96,14 @@ dialog_pref_load_description_from_schema (PrefState *state, char const *schema_p
gconf_schema_free (the_schema); gconf_schema_free (the_schema);
} }
static void
dialog_pref_load_description (PrefState *state, char const *text)
{
GtkTextBuffer *buffer = gtk_text_view_get_buffer (state->description);
gtk_text_buffer_set_text (buffer, text, -1);
}
/*******************************************************************************************/ /*******************************************************************************************/
/* Tree View of selected configuration variables */ /* Tree View of selected configuration variables */
/*******************************************************************************************/ /*******************************************************************************************/
...@@ -123,8 +132,8 @@ typedef struct { ...@@ -123,8 +132,8 @@ typedef struct {
static pref_tree_data_t pref_tree_data[] = { static pref_tree_data_t pref_tree_data[] = {
{"/apps/gnumeric/functionselector/num-of-recent", NULL, "/schemas/apps/gnumeric/functionselector/num-of-recent"}, {FUNCTION_SELECT_GCONF_NUM_OF_RECENT, NULL,
{"/apps/gnumeric/core/undosize", NULL, "/schemas/apps/gnumeric/core/undosize"}, "/schemas" FUNCTION_SELECT_GCONF_NUM_OF_RECENT},
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
...@@ -465,12 +474,185 @@ GtkWidget *pref_font_initializer (PrefState *state, gpointer data, ...@@ -465,12 +474,185 @@ GtkWidget *pref_font_initializer (PrefState *state, gpointer data,
return page; return page;
} }
/*******************************************************************************************/
/* Undo Preferences Page */
/*******************************************************************************************/
#define GCONF_FONT_NAME "/apps/gnumeric/core/defaultfont/name"
#define GCONF_FONT_SIZE "/apps/gnumeric/core/defaultfont/size"
#define GCONF_FONT_BOLD "/apps/gnumeric/core/defaultfont/bold"
#define GCONF_FONT_ITALIC "/apps/gnumeric/core/defaultfont/italic"
static void
pref_undo_page_open (PrefState *state, gpointer data,
GtkNotebook *notebook, gint page_num)
{
dialog_pref_load_description (state,
_("The items on this page customize the "
"behaviour of the undo/redo system."));
}
static void
cb_pref_undo_set_sheet_name (GConfClient *gconf, guint cnxn_id, GConfEntry *entry,
GtkToggleButton *button)
{
gboolean is_set_gconf = gconf_client_get_bool (gconf,
GNUMERIC_GCONF_UNDO_SHOW_SHEET_NAME,
NULL);
gboolean is_set_button = gtk_toggle_button_get_active (button);
if (is_set_gconf != is_set_button)
gtk_toggle_button_set_active (button, is_set_gconf);
}
static void
cb_pref_undo_sheet_name_toggled (GtkToggleButton *button, PrefState *state)
{
gconf_client_set_bool (state->gconf,
GNUMERIC_GCONF_UNDO_SHOW_SHEET_NAME,
gtk_toggle_button_get_active (button),
NULL);
}
static void
cb_pref_undo_set_max_descriptor_width (GConfClient *gconf, guint cnxn_id, GConfEntry *entry,
GtkSpinButton *button)
{
gint int_in_gconf = gconf_client_get_int (gconf,
GNUMERIC_GCONF_UNDO_MAX_DESCRIPTOR_WIDTH,
NULL);
gint int_in_button = gtk_spin_button_get_value_as_int (button);
if (int_in_gconf != int_in_button)
gtk_spin_button_set_value (button, (gdouble) int_in_gconf);
}
static void
cb_pref_undo_max_descriptor_width_changed (GtkSpinButton *button, PrefState *state)
{
gconf_client_set_int (state->gconf,
GNUMERIC_GCONF_UNDO_MAX_DESCRIPTOR_WIDTH,
gtk_spin_button_get_value_as_int (button),
NULL);
}
static void
cb_pref_undo_set_size (GConfClient *gconf, guint cnxn_id, GConfEntry *entry,
GtkSpinButton *button)
{
gint int_in_gconf = gconf_client_get_int (gconf,
GNUMERIC_GCONF_UNDO_SIZE,
NULL);
gint int_in_button = gtk_spin_button_get_value_as_int (button);
if (int_in_gconf != int_in_button)
gtk_spin_button_set_value (button, (gdouble) int_in_gconf);
}
static void
cb_pref_undo_size_changed (GtkSpinButton *button, PrefState *state)
{
gconf_client_set_int (state->gconf