Commit 8ee9621d authored by Andreas J. Guelzow's avatar Andreas J. Guelzow Committed by Andreas J. Guelzow

add various new preferences fix capitalization switch gnome_config to

2002-04-15  Andreas J. Guelzow <aguelzow@taliesin.ca>

	* schemas/gnumeric-general.schemas : add various new preferences
	* schemas/gnumeric-dialogs.schemas : fix capitalization
	* src/application.c : switch gnome_config to gconf
	* src/gnumeric-gconf.h : new preferences

2002-04-15  Andreas J. Guelzow <aguelzow@taliesin.ca>

	* dialog-preferences.c : add more preferences
parent 0c2f57bd
......@@ -28,8 +28,7 @@ Pending Patches
Long term breakage
------------------
- Remove duplication of code between analysis-tools.c and collect.c (which will be
possible when float_range_function2 obeys its "flags" argument.)
- Remove duplication of code between analysis-tools.c and collect.c
- Make deletion work for multiple ranges.
......@@ -165,6 +164,8 @@ Dialogs
: Fix keyboard interface
: Fix the problem that calling the function selector does not finish
editing (--> GTK+ Bug #76066)
: We should not be allowed to enter ranges directly into the edit line
on the sheet while the formula guru is open.
- Import Dialog
: Rewrite main page preview (see Bug #66393)
......
2002-04-15 Andreas J. Guelzow <aguelzow@taliesin.ca>
* schemas/gnumeric-general.schemas : add various new preferences
* schemas/gnumeric-dialogs.schemas : fix capitalization
* src/application.c : switch gnome_config to gconf
* src/gnumeric-gconf.h : new preferences
2002-04-14 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/rangefunc-strings.c : fix warning
......
2002-04-15 Andreas J. Guelzow <aguelzow@taliesin.ca>
* schemas/gnumeric-general.schemas : add various new preferences
* schemas/gnumeric-dialogs.schemas : fix capitalization
* src/application.c : switch gnome_config to gconf
* src/gnumeric-gconf.h : new preferences
2002-04-14 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/rangefunc-strings.c : fix warning
......
2002-04-15 Andreas J. Guelzow <aguelzow@taliesin.ca>
* schemas/gnumeric-general.schemas : add various new preferences
* schemas/gnumeric-dialogs.schemas : fix capitalization
* src/application.c : switch gnome_config to gconf
* src/gnumeric-gconf.h : new preferences
2002-04-14 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/rangefunc-strings.c : fix warning
......
......@@ -17,7 +17,7 @@
<type>int</type>
<default>12</default>
<locale name="C">
<short>Maximum length of recently used functions list</short>
<short>Maximum Length of Recently Used Functions List</short>
<long>The function selector keeps a list of recently used functions. This is the maximum length of that list.</long>
</locale>
</schema>
......
......@@ -17,7 +17,7 @@
<type>int</type>
<default>12</default>
<locale name="C">
<short>Maximum length of recently used functions list</short>
<short>Maximum Length of Recently Used Functions List</short>
<long>The function selector keeps a list of recently used functions. This is the maximum length of that list.</long>
</locale>
</schema>
......
......@@ -120,6 +120,61 @@
<long>The file menu shows a list of recently used functions. This is that list.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/screen/horizontaldpi</key>
<applyto>/apps/gnumeric/core/gui/screen/horizontaldpi</applyto>
<owner>Gnumeric</owner>
<type>float</type>
<default>96</default>
<locale name="C">
<short>Horizontal DPI</short>
<long>Screen resolution in the horizontal direction.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/screen/verticaldpi</key>
<applyto>/apps/gnumeric/core/gui/screen/verticaldpi</applyto>
<owner>Gnumeric</owner>
<type>float</type>
<default>96</default>
<locale name="C">
<short>Vertical DPI</short>
<long>Screen resolution in the vertical direction.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/editing/autocomplete</key>
<applyto>/apps/gnumeric/core/gui/editing/autocomplete</applyto>
<owner>Gnumeric</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Autocomplete</short>
<long>This variable determines whether autocompletion is set on.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/editing/livescrolling</key>
<applyto>/apps/gnumeric/core/gui/editing/livescrolling</applyto>
<owner>Gnumeric</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Live Scrolling</short>
<long>This variable determines whether live (versus delayed) scrolling is performed.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/editing/recalclag</key>
<applyto>/apps/gnumeric/core/gui/editing/recalclag</applyto>
<owner>Gnumeric</owner>
<type>int</type>
<default>200</default>
<locale name="C">
<short>Auto Expression Recalculation Lag</short>
<long>If this value is positive, auto expressions are recalculated within that many millesecond after a change. If it is negative they are recalculated with the magnitude many milleseconds after the last change where 'last' is defined as the end of a period of that size after a change with no changes.</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
......@@ -120,6 +120,61 @@
<long>The file menu shows a list of recently used functions. This is that list.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/screen/horizontaldpi</key>
<applyto>/apps/gnumeric/core/gui/screen/horizontaldpi</applyto>
<owner>Gnumeric</owner>
<type>float</type>
<default>96</default>
<locale name="C">
<short>Horizontal DPI</short>
<long>Screen resolution in the horizontal direction.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/screen/verticaldpi</key>
<applyto>/apps/gnumeric/core/gui/screen/verticaldpi</applyto>
<owner>Gnumeric</owner>
<type>float</type>
<default>96</default>
<locale name="C">
<short>Vertical DPI</short>
<long>Screen resolution in the vertical direction.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/editing/autocomplete</key>
<applyto>/apps/gnumeric/core/gui/editing/autocomplete</applyto>
<owner>Gnumeric</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Autocomplete</short>
<long>This variable determines whether autocompletion is set on.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/editing/livescrolling</key>
<applyto>/apps/gnumeric/core/gui/editing/livescrolling</applyto>
<owner>Gnumeric</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Live Scrolling</short>
<long>This variable determines whether live (versus delayed) scrolling is performed.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/editing/recalclag</key>
<applyto>/apps/gnumeric/core/gui/editing/recalclag</applyto>
<owner>Gnumeric</owner>
<type>int</type>
<default>200</default>
<locale name="C">
<short>Auto Expression Recalculation Lag</short>
<long>If this value is positive, auto expressions are recalculated within that many millesecond after a change. If it is negative they are recalculated with the magnitude many milleseconds after the last change where 'last' is defined as the end of a period of that size after a change with no changes.</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
......@@ -21,7 +21,6 @@
#include "pixmaps/gnumeric-stock-pixbufs.h"
#include <gtk/gtk.h>
#include <libgnome/gnome-config.h>
#include <gnumeric-gconf.h>
#include <gal/util/e-util.h>
......@@ -149,6 +148,7 @@ application_init (void)
};
unsigned i = 0;
GtkIconFactory *factory = gtk_icon_factory_new ();
GError *err = NULL;
for (i = 0; i < G_N_ELEMENTS (entry) ; i++)
add_icon (factory, entry[i].scalable_data,
......@@ -176,23 +176,28 @@ application_init (void)
* I'll leave it as is for now, and revisit the solution when we shake
* out the flaws in the display code.
*/
gnome_config_push_prefix ("Gnumeric/Screen_Resolution/");
app.horizontal_dpi = gnome_config_get_float ("Horizontal_dpi=96");
app.vertical_dpi = gnome_config_get_float ("Vertical_dpi=96");
gnome_config_pop_prefix ();
gnome_config_push_prefix ("Gnumeric/Editing/");
app.edit_auto_complete = gnome_config_get_bool ("AutoComplete=true");
app.live_scrolling = gnome_config_get_bool ("LiveScrolling=true");
/* If positive auto expressions are recalculated within <lag>
* millesecond after a change.
* if negative they are recalculated with <lag> milleseconds after the
* last change where 'last' is defined as a periond > <lag> after a
* change with no changes.
*/
app.auto_expr_recalc_lag = gnome_config_get_int ("AutoExprRecalcLag=200");
gnome_config_pop_prefix ();
app.horizontal_dpi = gconf_client_get_float (app.gconf_client,
GNUMERIC_GCONF_GUI_RES_H, &err);
if (err || app.horizontal_dpi == 0.0)
app.horizontal_dpi = 96.;
err = NULL;
app.vertical_dpi = gconf_client_get_float (app.gconf_client,
GNUMERIC_GCONF_GUI_RES_V, &err);
if (err || app.vertical_dpi == 0.0)
app.vertical_dpi = 96.;
err = NULL;
app.edit_auto_complete = gconf_client_get_bool (app.gconf_client,
GNUMERIC_GCONF_GUI_ED_AUTOCOMPLETE, &err);
err = NULL;
app.live_scrolling = gconf_client_get_bool (app.gconf_client,
GNUMERIC_GCONF_GUI_ED_LIVESCROLLING, &err);
err = NULL;
app.auto_expr_recalc_lag = gconf_client_get_int (app.gconf_client,
GNUMERIC_GCONF_GUI_ED_RECALC_LAG,
&err);
if (err || app.auto_expr_recalc_lag == 0)
app.auto_expr_recalc_lag = 200;
autocorrect_init ();
}
......
2002-04-15 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-preferences.c : add more preferences
2002-04-14 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-preferences.c : add max number of undo items pref
......
......@@ -138,6 +138,20 @@ static pref_tree_data_t pref_tree_data[] = {
"/schemas" GNUMERIC_GCONF_FILE_HISTORY_N},
{GNUMERIC_GCONF_WORKBOOK_NSHEETS, NULL,
"/schemas" GNUMERIC_GCONF_WORKBOOK_NSHEETS},
{GNUMERIC_GCONF_GUI_ED_AUTOCOMPLETE, NULL,
"/schemas" GNUMERIC_GCONF_GUI_ED_AUTOCOMPLETE},
{GNUMERIC_GCONF_GUI_ED_LIVESCROLLING, NULL,
"/schemas" GNUMERIC_GCONF_GUI_ED_LIVESCROLLING},
{NULL, NULL, NULL}
};
static pref_tree_data_t pref_tree_data_danger[] = {
{GNUMERIC_GCONF_GUI_RES_H, NULL,
"/schemas" GNUMERIC_GCONF_GUI_RES_H},
{GNUMERIC_GCONF_GUI_RES_V, NULL,
"/schemas" GNUMERIC_GCONF_GUI_RES_V},
{GNUMERIC_GCONF_GUI_ED_RECALC_LAG, NULL,
"/schemas" GNUMERIC_GCONF_GUI_ED_RECALC_LAG},
{NULL, NULL, NULL}
};
......@@ -223,6 +237,15 @@ pref_tree_set_model (GConfClient *gconf, GtkTreeModel *model, GtkTreeIter *iter)
value_string = g_strdup_printf ("%i", gconf_client_get_int (gconf, key,
NULL));
break;
case GCONF_VALUE_FLOAT:
value_string = g_strdup_printf ("%f", gconf_client_get_float (gconf, key,
NULL));
break;
case GCONF_VALUE_BOOL:
value_string = gconf_client_get_bool (gconf, key, NULL) ?
g_strdup (_("TRUE")) :
g_strdup (_("FALSE"));
break;
default:
value_string = g_strdup ("ERROR FIXME");
}
......@@ -263,9 +286,12 @@ cb_value_edited (GtkCellRendererText *cell,
char *key;
char *schema;
gint the_int;
gnum_float the_float;
gboolean the_bool;
Value *value;
GConfClient *client = application_get_gconf_client ();
GConfSchema *the_schema;
gboolean err;
path = gtk_tree_path_new_from_string (path_string);
......@@ -280,9 +306,19 @@ cb_value_edited (GtkCellRendererText *cell,
case GCONF_VALUE_STRING:
gconf_client_set_string (client, key, new_text, NULL);
break;
case GCONF_VALUE_FLOAT:
value = format_match_number (new_text, NULL);
if (value != NULL) {
the_float = value_get_as_float (value);
gconf_client_set_float (application_get_gconf_client (),
key, the_float, NULL);
}
if (value)
value_release (value);
break;
case GCONF_VALUE_INT:
value = format_match_number (new_text, NULL);
if ((value != NULL) && (value->type == VALUE_INTEGER)) {
if (value != NULL) {
the_int = value_get_as_int (value);
gconf_client_set_int (application_get_gconf_client (),
key, the_int, NULL);
......@@ -290,6 +326,17 @@ cb_value_edited (GtkCellRendererText *cell,
if (value)
value_release (value);
break;
case GCONF_VALUE_BOOL:
value = format_match_number (new_text, NULL);
if (value != NULL) {
err = FALSE;
the_bool = value_get_as_bool (value, &err);
gconf_client_set_bool (application_get_gconf_client (),
key, the_bool, NULL);
}
if (value)
value_release (value);
break;
default:
g_warning ("Unsupported gconf type in preference dialog");
}
......@@ -709,6 +756,7 @@ static page_info_t page_info[] = {
{NULL, GTK_STOCK_ITALIC, pref_font_initializer, pref_font_page_open, NULL},
{NULL, GTK_STOCK_UNDO, pref_undo_page_initializer, pref_undo_page_open, NULL},
{NULL, GTK_STOCK_PREFERENCES, pref_tree_initializer, pref_tree_page_open, pref_tree_data},
{NULL, GTK_STOCK_DIALOG_ERROR, pref_tree_initializer, pref_tree_page_open, pref_tree_data_danger},
{NULL, NULL, NULL, NULL, NULL},
};
......
......@@ -8,6 +8,12 @@
#define GNUMERIC_GCONF_FILE_HISTORY_N "/apps/gnumeric/core/file/history/n"
#define GNUMERIC_GCONF_FILE_HISTORY_FILES "/apps/gnumeric/core/file/history/files"
#define GNUMERIC_GCONF_WORKBOOK_NSHEETS "/apps/gnumeric/core/workbook/n-sheet"
#define GNUMERIC_GCONF_GUI_RES_H "/apps/gnumeric/core/gui/screen/horizontaldpi"
#define GNUMERIC_GCONF_GUI_RES_V "/apps/gnumeric/core/gui/screen/verticaldpi"
#define GNUMERIC_GCONF_GUI_ED_AUTOCOMPLETE "/apps/gnumeric/core/gui/editing/autocomplete"
#define GNUMERIC_GCONF_GUI_ED_LIVESCROLLING "/apps/gnumeric/core/gui/editing/livescrolling"
#define GNUMERIC_GCONF_GUI_ED_RECALC_LAG "/apps/gnumeric/core/gui/editing/recalclag"
#define FUNCTION_SELECT_GCONF_RECENT "/apps/gnumeric/functionselector/recentfunctions"
#define FUNCTION_SELECT_GCONF_NUM_OF_RECENT "/apps/gnumeric/functionselector/num-of-recent"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment