From d8aadc4ffa654fa505770a9c5d9a842129f94cf7 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 4 Jul 2014 13:02:45 +0200 Subject: [PATCH] Add planets-char and aspects-char settings to GSettings schema --- data/eu.polonkai.gergely.astrognome.gschema.xml | 10 ++++++++++ src/ag-settings.c | 14 +++++++++++++- src/ag-settings.h | 1 + 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/data/eu.polonkai.gergely.astrognome.gschema.xml b/data/eu.polonkai.gergely.astrognome.gschema.xml index cff5a2b..2d03e80 100644 --- a/data/eu.polonkai.gergely.astrognome.gschema.xml +++ b/data/eu.polonkai.gergely.astrognome.gschema.xml @@ -1,6 +1,16 @@ + + false + Display planet symbols as UTF-8 characters + Whether to show planet symbols as their UTF-8 representation. Uses less memory, but not all system fonts have them defined. If a planet (like most dwarves) don’t have a character representation, an image fallback will be used. + + + false + Display aspect symbols as UTF-8 characters + Whether to show aspect symbols as their UTF-8 representation. Uses less memory, but not all system fonts have them defined. If an aspect don’t have a character representation, an image fallback will be used. + diff --git a/src/ag-settings.c b/src/ag-settings.c index f73307a..8026015 100644 --- a/src/ag-settings.c +++ b/src/ag-settings.c @@ -1,11 +1,13 @@ #include "ag-settings.h" +#define SETTINGS_SCHEMA_ID_MAIN "eu.polonkai.gergely.Astrognome" #define SETTINGS_SCHEMA_ID_WINDOW "eu.polonkai.gergely.Astrognome.state.window" -#define SETTINGS_SCHEMA_ID_CHART "eu.polonkai.gergely.Astrognome.state.chart" +#define SETTINGS_SCHEMA_ID_CHART "eu.polonkai.gergely.Astrognome.state.chart" static AgSettings *singleton = NULL; struct _AgSettingsPrivate { + GSettings *settings_main; GSettings *settings_window; GSettings *settings_chart; }; @@ -17,6 +19,7 @@ ag_settings_init(AgSettings *settings) { AgSettingsPrivate *priv = ag_settings_get_instance_private(settings); + priv->settings_main = g_settings_new(SETTINGS_SCHEMA_ID_MAIN); priv->settings_window = g_settings_new(SETTINGS_SCHEMA_ID_WINDOW); priv->settings_chart = g_settings_new(SETTINGS_SCHEMA_ID_CHART); } @@ -28,6 +31,7 @@ ag_settings_dispose(GObject *object) g_clear_object(&priv->settings_window); g_clear_object(&priv->settings_chart); + g_clear_object(&priv->settings_main); G_OBJECT_CLASS(ag_settings_parent_class)->dispose(object); } @@ -63,6 +67,14 @@ ag_settings_get(void) return singleton; } +GSettings * +ag_settings_peek_main_settings(AgSettings *settings) +{ + AgSettingsPrivate *priv = ag_settings_get_instance_private(settings); + + return priv->settings_main; +} + GSettings * ag_settings_peek_window_settings(AgSettings *settings) { diff --git a/src/ag-settings.h b/src/ag-settings.h index ac15863..82acc5d 100644 --- a/src/ag-settings.h +++ b/src/ag-settings.h @@ -29,6 +29,7 @@ GType ag_settings_get_type(void); AgSettings *ag_settings_get(void); +GSettings *ag_settings_peek_main_settings(AgSettings *settings); GSettings *ag_settings_peek_window_settings(AgSettings *settings); GSettings *ag_settings_peek_chart_settings(AgSettings *settings);