34 #define GNC_PREF_FILE_COMPRESSION "file-compression"
35 #define GNC_PREF_RETAIN_TYPE_NEVER "retain-type-never"
36 #define GNC_PREF_RETAIN_TYPE_DAYS "retain-type-days"
37 #define GNC_PREF_RETAIN_TYPE_FOREVER "retain-type-forever"
38 #define GNC_PREF_RETAIN_DAYS "retain-days"
44 file_retain_changed_cb(gpointer gsettings, gchar *key, gpointer user_data)
49 gnc_prefs_set_file_retention_days (days);
54 file_retain_type_changed_cb(gpointer gsettings, gchar *key, gpointer user_data)
56 XMLFileRetentionType type = XML_RETAIN_ALL;
61 type = XML_RETAIN_NONE;
63 type = XML_RETAIN_DAYS;
65 PWARN(
"no file retention policy was set, assuming conservative policy 'forever'");
67 gnc_prefs_set_file_retention_policy (type);
72 file_compression_changed_cb(gpointer gsettings, gchar *key, gpointer user_data)
76 gboolean file_compression =
gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_FILE_COMPRESSION);
77 gnc_prefs_set_file_save_compressed (file_compression);
89 file_retain_changed_cb (NULL, NULL, NULL);
90 file_retain_type_changed_cb (NULL, NULL, NULL);
91 file_compression_changed_cb (NULL, NULL, NULL);
103 if ( (gnc_prefs_get_file_retention_policy () == XML_RETAIN_DAYS) &&
104 (gnc_prefs_get_file_retention_days () == 0 ) )
106 gnc_prefs_set_file_retention_policy (XML_RETAIN_ALL);
107 gnc_prefs_set_file_retention_days (30);
110 PWARN(
"retain 0 days policy was set, but this is probably not what the user wanted,\n"
111 "assuming conservative policy 'forever'");
116 file_retain_changed_cb, NULL);
118 file_retain_type_changed_cb, NULL);
120 file_retain_type_changed_cb, NULL);
122 file_retain_type_changed_cb, NULL);
124 file_compression_changed_cb, NULL);
gulong gnc_prefs_register_cb(const char *group, const gchar *pref_name, gpointer func, gpointer user_data)
#define G_LOG_DOMAIN
Functions providing the SX List as a plugin page.
#define PWARN(format, args...)
gboolean gnc_prefs_set_bool(const gchar *group, const gchar *pref_name, gboolean value)
Preferences initialization function.
gboolean gnc_prefs_set_float(const gchar *group, const gchar *pref_name, gdouble value)
Generic api to store and retrieve preferences.
void gnc_prefs_init(void)
void gnc_gsettings_load_backend(void)
gboolean gnc_prefs_get_bool(const gchar *group, const gchar *pref_name)
load and save data to files
GSettings helper routines.
gboolean gnc_prefs_is_set_up(void)
const gchar * QofLogModule
gdouble gnc_prefs_get_float(const gchar *group, const gchar *pref_name)