chimara_CFLAGS = @TEST_CFLAGS@ $(AM_CFLAGS)
chimara_LDADD = @TEST_LIBS@ $(top_builddir)/libchimara/libchimara.la
+schemasdir = $(datadir)/glib-2.0/schemas
+dist_schemas_DATA = org.chimara-if.gschema.xml
+
+install-data-hook:
+ glib-compile-schemas $(datadir)/glib-2.0/schemas
+
endif
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
- <object class="GtkFixed" id="fixed1">
+ <object class="GtkCheckButton" id="flep">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkLabel" id="flep-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Turn on flepping</property>
+ </object>
+ </child>
</object>
</child>
<child type="tab">
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+/* Use a custom GSettings backend for our preferences file */
+#define G_SETTINGS_ENABLE_BACKEND
+#include <gio/gsettingsbackend.h>
+
#include "error.h"
#include <libchimara/chimara-glk.h>
#include <libchimara/chimara-if.h>
GtkWidget *aboutwindow = NULL;
GtkWidget *prefswindow = NULL;
GtkWidget *toolbar = NULL;
+GSettings *settings = NULL;
GObject *
load_object(const gchar *name)
g_signal_connect(glk, "notify::story-name", G_CALLBACK(change_window_title), window);
/* Create preferences window */
- //preferences_create(CHIMARA_GLK(glk));
+ preferences_create(CHIMARA_GLK(glk));
}
int
gdk_threads_init();
gtk_init(&argc, &argv);
+ /* Initialize settings file */
+ gchar *keyfile = g_build_filename(g_get_home_dir(), ".chimara", NULL);
+ GSettingsBackend *backend = g_keyfile_settings_backend_new(keyfile, "/", "player");
+ settings = g_settings_new_with_backend("org.chimara-if.chimara-player", backend);
+
create_window();
gtk_widget_show_all(window);
--- /dev/null
+<schemalist>
+ <schema id="org.chimara-if.chimara-player" path="/">
+
+ <!-- Keys and key names are subject to change without notice, until we have
+ a spec-->
+ <!-- "b" = boolean; see documentation of GVariantType -->
+
+ <key name="flep" type="b">
+ <default>false</default>
+ <summary>Flepping</summary>
+ <description>
+ Whether to flep or not while gronking a bloop.
+ </description>
+ </key>
+
+ </schema>
+</schemalist>
\ No newline at end of file
gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
g_signal_connect(selection, "changed", G_CALLBACK(style_tree_select_callback), glk);
+
+ /* Bind the preferences to the entries in the preferences file */
+ extern GSettings *settings;
+ GObject *flep = G_OBJECT( load_object("flep") );
+ g_settings_bind(settings, "flep", flep, "active", G_SETTINGS_BIND_DEFAULT);
}
static void