X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor-pkg-ubuntu.git;a=blobdiff_plain;f=src%2Fcfg.h;fp=src%2Fcfg.h;h=aac38de47037c6e1c46df084802ca11063522949;hp=a63bcb08faf39904b50100376151bcf1c773db87;hb=4c50d430bea4b8462b0ae7ab70baf3f538f87718;hpb=0470c31b8a4293914a6fd9b089503775706da084 diff --git a/src/cfg.h b/src/cfg.h index a63bcb0..aac38de 100644 --- a/src/cfg.h +++ b/src/cfg.h @@ -19,10 +19,8 @@ #ifndef _PSENSOR_CONFIG_H_ #define _PSENSOR_CONFIG_H_ -#include - -#include "bool.h" -#include "color.h" +#include +#include enum temperature_unit { CELSIUS, @@ -44,9 +42,7 @@ struct config { bool alpha_channel_enabled; - /* - * Position of the sensors list table - */ + /* Position of the sensors list table */ enum sensorlist_position sensorlist_position; bool window_decoration_enabled; @@ -79,9 +75,7 @@ struct config { int slog_interval; }; -/* - Loads config from GConf -*/ +/* Loads psensor configuration */ struct config *config_load(); void config_save(const struct config *); @@ -100,8 +94,8 @@ void config_set_sensor_alarm_low_threshold(const char *, int); bool config_get_sensor_alarm_enabled(const char *); void config_set_sensor_alarm_enabled(const char *, bool); -bool config_is_sensor_enabled(const char *); -void config_set_sensor_enabled(const char *, bool); +bool config_is_sensor_graph_enabled(const char *); +void config_set_sensor_graph_enabled(const char *, bool); char *config_get_sensor_name(const char *); void config_set_sensor_name(const char *, const char *); @@ -112,8 +106,8 @@ void config_set_appindicator_enabled(const char *, bool); bool config_is_appindicator_label_enabled(const char *); void config_set_appindicator_label_enabled(const char *, bool); -void config_slog_enabled_notify_add(GConfClientNotifyFunc cbk, void *data); bool is_slog_enabled(); +void config_set_slog_enabled_changed_cbk(void (*)(void *), void *); int config_get_slog_interval(); @@ -122,4 +116,19 @@ void config_set_sensor_position(const char *, int); char *config_get_notif_script(); void config_set_notif_script(const char *); + +bool config_is_sensor_enabled(const char *sid); +void config_set_sensor_enabled(const char *sid, bool enabled); + +/* + * Returns the user directory containing psensor data (configuration + * and log). + * Corresponds to $HOME/.psensor/ + * Creates the directory if it does not exist; + * Returns NULL if it cannot be determined. + */ +const char *get_psensor_user_dir(); + +void config_sync(); + #endif