projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Font Selection: Use a local css_provider instead of the default one
[pspp]
/
src
/
ui
/
gui
/
psppire-conf.c
diff --git
a/src/ui/gui/psppire-conf.c
b/src/ui/gui/psppire-conf.c
index fe4f934bd640193e382f1fc077c7ff661f91850b..09f6d68a124b5cabaa2c6e5d07fb0aefc1be4c14 100644
(file)
--- a/
src/ui/gui/psppire-conf.c
+++ b/
src/ui/gui/psppire-conf.c
@@
-223,6
+223,31
@@
psppire_conf_get_boolean (PsppireConf *conf, const gchar *base,
}
}
+
+gboolean
+psppire_conf_get_string (PsppireConf *conf, const gchar *base,
+ const gchar *name, gchar **value)
+{
+ gboolean ok;
+ gchar *b;
+ GError *err = NULL;
+ conf_read (conf);
+ b = g_key_file_get_string (conf->keyfile,
+ base,
+ name, &err);
+
+ ok = (err == NULL);
+ if ( err != NULL )
+ g_error_free (err);
+
+ if (ok)
+ *value = b;
+
+ return ok;
+}
+
+
+
void
psppire_conf_set_int (PsppireConf *conf,
const gchar *base, const gchar *name,
void
psppire_conf_set_int (PsppireConf *conf,
const gchar *base, const gchar *name,
@@
-241,6
+266,18
@@
psppire_conf_set_boolean (PsppireConf *conf,
conf_write (conf);
}
conf_write (conf);
}
+
+void
+psppire_conf_set_string (PsppireConf *conf,
+ const gchar *base, const gchar *name,
+ const gchar *value)
+{
+ g_key_file_set_string (conf->keyfile, base, name, value);
+ conf_write (conf);
+}
+
+
+
/*
A convenience function to set the geometry of a
window from from a saved config
/*
A convenience function to set the geometry of a
window from from a saved config
@@
-300,10
+337,11
@@
psppire_conf_save_window_geometry (PsppireConf *conf,
if (!maximized)
{
if (!maximized)
{
- gint width, height;
gint x, y;
gint x, y;
- gdk_drawable_get_size (w, &width, &height);
+ gint width = gdk_window_get_width (w);
+ gint height= gdk_window_get_height (w);
+
gdk_window_get_position (w, &x, &y);
psppire_conf_set_int (conf, base, "height", height);
gdk_window_get_position (w, &x, &y);
psppire_conf_set_int (conf, base, "height", height);