Add GSettings value for the default theme

This obsoletes the Astrognome.state.chart schema, which is removed.
This commit is contained in:
Gergely Polonkai 2014-09-04 23:37:00 +02:00
parent 944d623379
commit c38bba8707
3 changed files with 7 additions and 23 deletions

View File

@ -22,6 +22,11 @@
<summary>The default house system</summary> <summary>The default house system</summary>
<description>The house system to use by default in new charts</description> <description>The house system to use by default in new charts</description>
</key> </key>
<key name="default-display-theme" type="i">
<default>-1</default>
<summary>The ID of the default display theme to use</summary>
<description>The database ID of the display theme to be used when a chart is created/opened.</description>
</key>
</schema> </schema>
<schema id="eu.polonkai.gergely.Astrognome.state" path="/eu/polonkai/gergely/Astrognome/state/"> <schema id="eu.polonkai.gergely.Astrognome.state" path="/eu/polonkai/gergely/Astrognome/state/">
<child name="window" schema="eu.polonkai.gergely.Astrognome.state.window" /> <child name="window" schema="eu.polonkai.gergely.Astrognome.state.window" />
@ -44,11 +49,4 @@
<description>The height of newly created windows.</description> <description>The height of newly created windows.</description>
</key> </key>
</schema> </schema>
<schema id="eu.polonkai.gergely.Astrognome.state.chart" path="/eu/polonkai/gergely/Astrognome/state/chart/">
<key name="classic-only" type="b">
<default>false</default>
<summary>Use the classical view</summary>
<description>Use the classical view: planets only between Sun and Saturn, only Ptolemaic aspects, no antiscia.</description>
</key>
</schema>
</schemalist> </schemalist>

View File

@ -2,15 +2,13 @@
#define SETTINGS_SCHEMA_ID_MAIN "eu.polonkai.gergely.Astrognome" #define SETTINGS_SCHEMA_ID_MAIN "eu.polonkai.gergely.Astrognome"
#define SETTINGS_SCHEMA_ID_WINDOW "eu.polonkai.gergely.Astrognome.state.window" #define SETTINGS_SCHEMA_ID_WINDOW "eu.polonkai.gergely.Astrognome.state.window"
#define SETTINGS_SCHEMA_ID_CHART "eu.polonkai.gergely.Astrognome.state.chart"
static AgSettings *singleton = NULL; static AgSettings *singleton = NULL;
struct _AgSettingsPrivate { typedef struct _AgSettingsPrivate {
GSettings *settings_main; GSettings *settings_main;
GSettings *settings_window; GSettings *settings_window;
GSettings *settings_chart; } AgSettingsPrivate;
};
G_DEFINE_TYPE_WITH_PRIVATE(AgSettings, ag_settings, G_TYPE_OBJECT); G_DEFINE_TYPE_WITH_PRIVATE(AgSettings, ag_settings, G_TYPE_OBJECT);
@ -21,7 +19,6 @@ ag_settings_init(AgSettings *settings)
priv->settings_main = g_settings_new(SETTINGS_SCHEMA_ID_MAIN); priv->settings_main = g_settings_new(SETTINGS_SCHEMA_ID_MAIN);
priv->settings_window = g_settings_new(SETTINGS_SCHEMA_ID_WINDOW); priv->settings_window = g_settings_new(SETTINGS_SCHEMA_ID_WINDOW);
priv->settings_chart = g_settings_new(SETTINGS_SCHEMA_ID_CHART);
} }
static void static void
@ -32,7 +29,6 @@ ag_settings_dispose(GObject *object)
); );
g_clear_object(&priv->settings_window); g_clear_object(&priv->settings_window);
g_clear_object(&priv->settings_chart);
g_clear_object(&priv->settings_main); g_clear_object(&priv->settings_main);
G_OBJECT_CLASS(ag_settings_parent_class)->dispose(object); G_OBJECT_CLASS(ag_settings_parent_class)->dispose(object);
@ -84,11 +80,3 @@ ag_settings_peek_window_settings(AgSettings *settings)
return priv->settings_window; return priv->settings_window;
} }
GSettings *
ag_settings_peek_chart_settings(AgSettings *settings)
{
AgSettingsPrivate *priv = ag_settings_get_instance_private(settings);
return priv->settings_chart;
}

View File

@ -23,7 +23,6 @@ G_BEGIN_DECLS
typedef struct _AgSettings AgSettings; typedef struct _AgSettings AgSettings;
typedef struct _AgSettingsClass AgSettingsClass; typedef struct _AgSettingsClass AgSettingsClass;
typedef struct _AgSettingsPrivate AgSettingsPrivate;
struct _AgSettings { struct _AgSettings {
GObject parent_instance; GObject parent_instance;
@ -39,7 +38,6 @@ AgSettings *ag_settings_get(void);
GSettings *ag_settings_peek_main_settings(AgSettings *settings); GSettings *ag_settings_peek_main_settings(AgSettings *settings);
GSettings *ag_settings_peek_window_settings(AgSettings *settings); GSettings *ag_settings_peek_window_settings(AgSettings *settings);
GSettings *ag_settings_peek_chart_settings(AgSettings *settings);
G_END_DECLS G_END_DECLS