diff options
author | 2011-09-08 08:25:15 +0000 | |
---|---|---|
committer | 2011-09-08 08:25:15 +0000 | |
commit | 20e277802983fa9d16a5f406f27c8cc120200e46 (patch) | |
tree | e745cff05e79c1d3f391199fd1e4cc422c64a6d2 /src/trg-prefs.c | |
parent | c5b0c941f310f2b90e9d23f5dc5d89f3167cd817 (diff) |
use glib message functions instead of g_printf(). make view state selector/notebook a persistent setting. add toggling of tracker/dir filters to view menu. I might add more from preferences another time.
Diffstat (limited to 'src/trg-prefs.c')
-rw-r--r-- | src/trg-prefs.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/trg-prefs.c b/src/trg-prefs.c index 9a507b1..7ea742f 100644 --- a/src/trg-prefs.c +++ b/src/trg-prefs.c @@ -73,12 +73,12 @@ static void trg_prefs_create_defaults(TrgPrefs *p) { trg_prefs_add_default_int(p, TRG_PREFS_KEY_UPDATE_INTERVAL, TRG_INTERVAL_DEFAULT); trg_prefs_add_default_int(p, TRG_PREFS_KEY_MINUPDATE_INTERVAL, TRG_MININTERVAL_DEFAULT); - trg_prefs_add_default_bool(p, TRG_PREFS_KEY_FILTER_DIRS, TRUE); - trg_prefs_add_default_bool(p, TRG_PREFS_KEY_FILTER_TRACKERS, TRUE); - trg_prefs_add_default_bool(p, TRG_PREFS_KEY_AUTO_CONNECT, FALSE); - trg_prefs_add_default_bool(p, TRG_PREFS_KEY_SHOW_GRAPH, TRUE); - trg_prefs_add_default_bool(p, TRG_PREFS_KEY_SHOW_GRAPH, TRUE); - trg_prefs_add_default_bool(p, TRG_PREFS_KEY_ADD_OPTIONS_DIALOG, TRUE); + trg_prefs_add_default_bool_true(p, TRG_PREFS_KEY_FILTER_DIRS); + trg_prefs_add_default_bool_true(p, TRG_PREFS_KEY_FILTER_TRACKERS); + trg_prefs_add_default_bool_true(p, TRG_PREFS_KEY_SHOW_GRAPH); + trg_prefs_add_default_bool_true(p, TRG_PREFS_KEY_ADD_OPTIONS_DIALOG); + trg_prefs_add_default_bool_true(p, TRG_PREFS_KEY_SHOW_STATE_SELECTOR); + trg_prefs_add_default_bool_true(p, TRG_PREFS_KEY_SHOW_NOTEBOOK); } static GObject *trg_prefs_constructor(GType type, guint n_construct_properties, @@ -138,9 +138,10 @@ void trg_prefs_add_default_double(TrgPrefs *p, gchar *key, double value) { json_object_set_double_member(priv->defaultsObj, key, value); } -void trg_prefs_add_default_bool(TrgPrefs *p, gchar *key, gboolean value) { +/* Not much point adding a default of FALSE, as that's the fallback */ +void trg_prefs_add_default_bool_true(TrgPrefs *p, gchar *key) { TrgPrefsPrivate *priv = GET_PRIVATE(p); - json_object_set_boolean_member(priv->defaultsObj, key, value); + json_object_set_boolean_member(priv->defaultsObj, key, TRUE); } gint trg_prefs_get_profile_id(TrgPrefs *p) { @@ -171,9 +172,8 @@ JsonNode *trg_prefs_get_value(TrgPrefs *p, gchar *key, int flags) { } } - if (priv->defaultsObj && json_object_has_member(priv->defaultsObj, key)) { + if (priv->defaultsObj && json_object_has_member(priv->defaultsObj, key)) return json_object_get_member(priv->defaultsObj, key); - } return NULL; } |