aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ld-window-main.c15
-rw-r--r--src/logdiag.c9
2 files changed, 24 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);
diff --git a/src/logdiag.c b/src/logdiag.c
index 1175ec6..904514e 100644
--- a/src/logdiag.c
+++ b/src/logdiag.c
@@ -131,6 +131,15 @@ main (int argc, char *argv[])
}
#endif
+#ifdef PROJECT_GSETTINGS_DIR
+ /* This is enabled when the build is set up for developing, so the
+ * application can find it's schema. It might also find use when
+ * installing the application into a location that's missing from
+ * g_get_system_data_dirs(), for example /usr/local or ~/.local.
+ */
+ g_setenv ("GSETTINGS_SCHEMA_DIR", PROJECT_GSETTINGS_DIR, 0);
+#endif /* PROJECT_GSETTINGS_DIR */
+
gtk_window_set_default_icon_name (PROJECT_NAME);
/* TODO: Be able to open multiple files. */