Commit 080c68a9 authored by Andreas J. Guelzow's avatar Andreas J. Guelzow Committed by Andreas J. Guelzow

add window size schemas add window size keys add window size set/get

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

	* schemas/gnumeric-general.schemas : add window size schemas
	* src/gnumeric-gconf-priv.h : add window size keys
	* src/gnumeric-gconf.[ch] : add window size set/get methods
	* src/workbook-control-gui.c : use gconf for all preferences

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

	* dialog-preferences.c : add window-size preference to
	  catch-all page
parent 997401af
......@@ -175,6 +175,28 @@
<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>
<schema>
<key>/schemas/apps/gnumeric/core/gui/window/x</key>
<applyto>/apps/gnumeric/core/gui/window/x</applyto>
<owner>Gnumeric</owner>
<type>float</type>
<default>0.75</default>
<locale name="C">
<short>Default Horizontal Window Size</short>
<long>This number (between 0.25 and 1.00) gives the horizontal fraction of the screen size covered by the default window.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/window/y</key>
<applyto>/apps/gnumeric/core/gui/window/y</applyto>
<owner>Gnumeric</owner>
<type>float</type>
<default>0.75</default>
<locale name="C">
<short>Default Vertical Window Size</short>
<long>This number (between 0.25 and 1.00) gives the vertical fraction of the screen size covered by the default window.</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
......@@ -175,6 +175,28 @@
<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>
<schema>
<key>/schemas/apps/gnumeric/core/gui/window/x</key>
<applyto>/apps/gnumeric/core/gui/window/x</applyto>
<owner>Gnumeric</owner>
<type>float</type>
<default>0.75</default>
<locale name="C">
<short>Default Horizontal Window Size</short>
<long>This number (between 0.25 and 1.00) gives the horizontal fraction of the screen size covered by the default window.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/window/y</key>
<applyto>/apps/gnumeric/core/gui/window/y</applyto>
<owner>Gnumeric</owner>
<type>float</type>
<default>0.75</default>
<locale name="C">
<short>Default Vertical Window Size</short>
<long>This number (between 0.25 and 1.00) gives the vertical fraction of the screen size covered by the default window.</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
2002-04-15 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-preferences.c : add window-size preference to
catch-all page
2002-04-15 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-function-select.c : use get/set methods of gnumeric-gconf.h
......
......@@ -134,6 +134,10 @@ typedef struct {
static pref_tree_data_t pref_tree_data[] = {
{GNUMERIC_GCONF_GUI_WINDOW_X, NULL,
"/schemas" GNUMERIC_GCONF_GUI_WINDOW_X},
{GNUMERIC_GCONF_GUI_WINDOW_Y, NULL,
"/schemas" GNUMERIC_GCONF_GUI_WINDOW_Y},
{FUNCTION_SELECT_GCONF_NUM_OF_RECENT, NULL,
"/schemas" FUNCTION_SELECT_GCONF_NUM_OF_RECENT},
{GNUMERIC_GCONF_FILE_HISTORY_N, NULL,
......
......@@ -56,11 +56,14 @@
#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 GNUMERIC_GCONF_GUI_DIRECTORY "/apps/gnumeric/core/gui"
#define GNUMERIC_GCONF_GUI_RES_H GNUMERIC_GCONF_GUI_DIRECTORY "/screen/horizontaldpi"
#define GNUMERIC_GCONF_GUI_RES_V GNUMERIC_GCONF_GUI_DIRECTORY "/screen/verticaldpi"
#define GNUMERIC_GCONF_GUI_ED_AUTOCOMPLETE GNUMERIC_GCONF_GUI_DIRECTORY "/editing/autocomplete"
#define GNUMERIC_GCONF_GUI_ED_LIVESCROLLING GNUMERIC_GCONF_GUI_DIRECTORY "/editing/livescrolling"
#define GNUMERIC_GCONF_GUI_ED_RECALC_LAG GNUMERIC_GCONF_GUI_DIRECTORY "/editing/recalclag"
#define GNUMERIC_GCONF_GUI_WINDOW_X GNUMERIC_GCONF_GUI_DIRECTORY "/window/x"
#define GNUMERIC_GCONF_GUI_WINDOW_Y GNUMERIC_GCONF_GUI_DIRECTORY "/window/y"
......
......@@ -526,3 +526,40 @@ gnm_gconf_set_autoformat_usr_dirs (char const * string)
string, NULL);
}
gnum_float
gnm_gconf_get_horizontal_window_fraction (void)
{
gnum_float val = gconf_client_get_float (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_WINDOW_X,
NULL);
val = MIN (val, 1.0);
val = MAX (0.25, val);
return val;
}
void
gnm_gconf_set_horizontal_window_fraction (gnum_float val)
{
gconf_client_set_float (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_WINDOW_X,
val, NULL);
}
gnum_float
gnm_gconf_get_vertical_window_fraction (void)
{
gnum_float val = gconf_client_get_float (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_WINDOW_Y,
NULL);
val = MIN (val, 1.0);
val = MAX (0.25, val);
return val;
}
void
gnm_gconf_set_vertical_window_fraction (gnum_float val)
{
gconf_client_set_float (application_get_gconf_client (),
GNUMERIC_GCONF_GUI_WINDOW_Y,
val, NULL);
}
......@@ -96,7 +96,11 @@ void gnm_gconf_set_autoformat_sys_dirs (char const * string);
char * gnm_gconf_get_autoformat_usr_dirs (void);
void gnm_gconf_set_autoformat_usr_dirs (char const * string);
gnum_float gnm_gconf_get_horizontal_window_fraction (void);
void gnm_gconf_set_horizontal_window_fraction (gnum_float val);
gnum_float gnm_gconf_get_vertical_window_fraction (void);
void gnm_gconf_set_vertical_window_fraction (gnum_float val);
......
......@@ -83,7 +83,6 @@
#include <gal/widgets/gtk-combo-stack.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-config.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <ctype.h>
......@@ -4231,14 +4230,8 @@ show_gui (WorkbookControlGUI *wbcg)
GdkGeometry geometry;
GdkWindowHints size_hints = GDK_HINT_MAX_SIZE;
fx = gnome_config_get_float_with_default (
"Gnumeric/Placement/WindowRelativeSizeX=0.75", NULL);
fy = gnome_config_get_float_with_default (
"Gnumeric/Placement/WindowRelativeSizeY=0.75", NULL);
fx = MIN (fx, 1.0);
fx = MAX (0.25, fx);
fy = MIN (fy, 1.0);
fy = MAX (0.2, fy);
fx = gnm_gconf_get_horizontal_window_fraction ();
fy = gnm_gconf_get_vertical_window_fraction ();
if (x_geometry && wbv && wbcg->toplevel) {
gint result;
......
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