X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=blobdiff_plain;f=src%2Fcfg.c;h=5a6f8e80fbb5c810fe23bfcdc8f42c80f1d7ffdf;hp=f0e53aab49e8a67157c969021d730f6704f57bd9;hb=12388f81cb55cca6fba194a1fc02870242dddef5;hpb=bbf057177b1f8dd6d7865981600083f8c7494547 diff --git a/src/cfg.c b/src/cfg.c index f0e53aa..5a6f8e8 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -91,6 +91,8 @@ static const char *KEY_INTERFACE_WINDOW_DIVIDER_POS static const char *KEY_INTERFACE_TEMPERATURE_UNIT = "/apps/psensor/interface/temperature_unit"; +static const char *KEY_SLOG_ENABLED = "/apps/psensor/slog/enabled"; + static GConfClient *client; static char *get_string(const char *key, const char *default_value) @@ -385,6 +387,15 @@ void config_set_appindicator_enabled(const char *sid, bool enabled) free(key); } +static bool is_slog_enabled() +{ + return gconf_client_get_bool(client, KEY_SLOG_ENABLED, NULL); +} + +static void set_slog_enabled(bool enabled) +{ + gconf_client_set_bool(client, KEY_SLOG_ENABLED, enabled, NULL); +} static bool is_window_decoration_enabled() { @@ -446,6 +457,7 @@ struct config *config_load() c->sensorlist_position = get_sensorlist_position(); c->window_decoration_enabled = is_window_decoration_enabled(); c->window_keep_below_enabled = is_window_keep_below_enabled(); + c->slog_enabled = is_slog_enabled(); c->sensor_update_interval = gconf_client_get_int(client, KEY_SENSOR_UPDATE_INTERVAL, NULL); @@ -526,6 +538,7 @@ void config_save(const struct config *c) set_sensorlist_position(c->sensorlist_position); set_window_decoration_enabled(c->window_decoration_enabled); set_window_keep_below_enabled(c->window_keep_below_enabled); + set_slog_enabled(c->slog_enabled); gconf_client_set_int(client, KEY_GRAPH_UPDATE_INTERVAL,