diff --git a/src/ag-settings.c b/src/ag-settings.c index f4d833b..3cb2fb2 100644 --- a/src/ag-settings.c +++ b/src/ag-settings.c @@ -17,6 +17,7 @@ * . */ #include "ag-settings.h" +#include "astrognome.h" #define SETTINGS_SCHEMA_ID_MAIN "eu.polonkai.gergely.Astrognome" #define SETTINGS_SCHEMA_ID_WINDOW "eu.polonkai.gergely.Astrognome.state.window" @@ -98,3 +99,20 @@ ag_settings_peek_window_settings(AgSettings *settings) return priv->settings_window; } + +GsweHouseSystem +ag_settings_get_house_system(AgSettings *settings) +{ + gchar *house_system_nick; + GsweHouseSystem house_system; + AgSettingsPrivate *priv = ag_settings_get_instance_private(settings); + + house_system_nick = g_settings_get_string( + priv->settings_main, + "default-house-system" + ); + house_system = ag_house_system_nick_to_id(house_system_nick); + g_free(house_system_nick); + + return house_system; +} diff --git a/src/ag-settings.h b/src/ag-settings.h index effe947..bd9c89d 100644 --- a/src/ag-settings.h +++ b/src/ag-settings.h @@ -21,6 +21,7 @@ #include #include +#include G_BEGIN_DECLS @@ -57,6 +58,8 @@ AgSettings *ag_settings_get(void); GSettings *ag_settings_peek_main_settings(AgSettings *settings); GSettings *ag_settings_peek_window_settings(AgSettings *settings); +GsweHouseSystem ag_settings_get_house_system(AgSettings *settings); + G_END_DECLS #endif /* __AG_SETTINGS_H__ */