X-Git-Url: http://wpitchoune.net/gitweb/?p=psensor-pkg-debian.git;a=blobdiff_plain;f=src%2Fcfg.c;h=a5014ff58a9deb68d2399eaef87a69e71a94be14;hp=41aa09ae2af97a202de873b030e94c1ea81f3e33;hb=ecd968930278d22ce234485d1bddced831c82f0f;hpb=1438bc505641cd98fe3af323fb2329c3284e157f diff --git a/src/cfg.c b/src/cfg.c index 41aa09a..a5014ff 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013 jeanfi@gmail.com + * Copyright (C) 2010-2014 jeanfi@gmail.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -22,7 +22,7 @@ #include #include "cfg.h" -#include "log.h" +#include static const char *KEY_SENSORS = "/apps/psensor/sensors"; @@ -33,6 +33,9 @@ static const char *ATT_SENSOR_COLOR = "color"; static const char *ATT_SENSOR_ENABLED = "enabled"; static const char *ATT_SENSOR_NAME = "name"; static const char *ATT_SENSOR_APPINDICATOR_DISABLED = "appindicator/disabled"; +static const char *ATT_SENSOR_APPINDICATOR_LABEL_ENABLED += "appindicator/menu/enabled"; + static const char *ATT_SENSOR_POSITION = "position"; static const char *KEY_SENSOR_UPDATE_INTERVAL @@ -434,6 +437,27 @@ void config_set_appindicator_enabled(const char *sid, bool enabled) free(key); } +bool config_is_appindicator_label_enabled(const char *sid) +{ + char *key; + gboolean b; + + key = get_sensor_att_key(sid, ATT_SENSOR_APPINDICATOR_LABEL_ENABLED); + b = gconf_client_get_bool(client, key, NULL); + free(key); + + return b; +} + +void config_set_appindicator_label_enabled(const char *sid, bool enabled) +{ + char *key; + + key = get_sensor_att_key(sid, ATT_SENSOR_APPINDICATOR_LABEL_ENABLED); + gconf_client_set_bool(client, key, enabled, NULL); + free(key); +} + bool is_slog_enabled() { return gconf_client_get_bool(client, KEY_SLOG_ENABLED, NULL);