aboutsummaryrefslogtreecommitdiff
path: root/src/ld-window-main.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-06-10 18:18:58 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2011-06-12 10:05:16 +0200
commitb2223d65951c3ad706d76d35e15df8cf2e17535f (patch)
tree50f8b823c9a115483975f41b7cd2a75401430b22 /src/ld-window-main.c
parente1e9a6d3198516e9924068b4fab0d4df070a76a5 (diff)
downloadlogdiag-b2223d65951c3ad706d76d35e15df8cf2e17535f.tar.gz
logdiag-b2223d65951c3ad706d76d35e15df8cf2e17535f.tar.xz
logdiag-b2223d65951c3ad706d76d35e15df8cf2e17535f.zip
Integrate GSettings, remember View settings.
The org.logdiag ID has been chosen as I haven't found any specific rules and com.github.logdiag seems not to be future-proof. This domain remains available so far, anyway. The schemas are compiled only when installed directly to CMAKE_INSTALL_PREFIX to the root filesystem. When invoking `make install` with DESTDIR, only the XML files are copied over as the schemas would have to be recompiled later anyway.
Diffstat (limited to 'src/ld-window-main.c')
-rw-r--r--src/ld-window-main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ld-window-main.c b/src/ld-window-main.c
index 3602edb..22278ab 100644
--- a/src/ld-window-main.c
+++ b/src/ld-window-main.c
@@ -18,6 +18,7 @@
struct _LdWindowMainPrivate
{
+ GSettings *settings;
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
@@ -353,6 +354,19 @@ ld_window_main_init (LdWindowMain *self)
/* Realize the window. */
gtk_widget_show_all (GTK_WIDGET (self));
+
+ /* Set up GSettings. */
+ priv->settings = g_settings_new ("org." PROJECT_NAME);
+
+ g_settings_bind (priv->settings, "show-main-toolbar",
+ gtk_action_group_get_action (priv->action_group,
+ "MainToolbar"), "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (priv->settings, "show-library-toolbar",
+ gtk_action_group_get_action (priv->action_group,
+ "LibraryToolbar"), "active", G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (priv->settings, "show-grid",
+ gtk_action_group_get_action (priv->action_group,
+ "ShowGrid"), "active", G_SETTINGS_BIND_DEFAULT);
}
static void
@@ -369,6 +383,7 @@ ld_window_main_finalize (GObject *gobject)
g_object_unref (self->priv->diagram);
g_object_unref (self->priv->ui_manager);
g_object_unref (self->priv->action_group);
+ g_object_unref (self->priv->settings);
if (self->priv->filename)
g_free (self->priv->filename);