about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-02-25 00:01:41 +0000
committerJames Booth <boothj5@gmail.com>2015-02-25 00:01:41 +0000
commit22daac5fe9a0b2121deca57ea42e4094b288fb8c (patch)
tree6f9e7eb3ad7e508bdcdcfdb6576111c8371dd437 /src
parent68a8ab3401046d4e8b62a8e0081db2b156f0c5b1 (diff)
downloadprofani-tty-22daac5fe9a0b2121deca57ea42e4094b288fb8c.tar.gz
Upgrade otr warn preference, added UI theme settings
Diffstat (limited to 'src')
-rw-r--r--src/config/preferences.c30
-rw-r--r--src/config/theme.c18
2 files changed, 17 insertions, 31 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c
index d5bd64d3..b29d7322 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -100,30 +100,12 @@ prefs_load(void)
         g_error_free(err);
     }
 
-    // move pre 0.4.1 OTR preferences to [otr] group
+    // move pre 0.4.6 OTR warn preferences to [ui] group
     err = NULL;
-    gboolean ui_otr_warn = g_key_file_get_boolean(prefs, PREF_GROUP_UI, "otr.warn", &err);
+    gboolean otr_warn = g_key_file_get_boolean(prefs, PREF_GROUP_OTR, "warn", &err);
     if (err == NULL) {
-        g_key_file_set_boolean(prefs, PREF_GROUP_OTR, _get_key(PREF_OTR_WARN), ui_otr_warn);
-        g_key_file_remove_key(prefs, PREF_GROUP_UI, "otr.warn", NULL);
-    } else {
-        g_error_free(err);
-    }
-
-    err = NULL;
-    gchar *ui_otr_log = g_key_file_get_string(prefs, PREF_GROUP_LOGGING, "otr", &err);
-    if (err == NULL) {
-        g_key_file_set_string(prefs, PREF_GROUP_OTR, _get_key(PREF_OTR_LOG), ui_otr_log);
-        g_key_file_remove_key(prefs, PREF_GROUP_LOGGING, "otr", NULL);
-    } else {
-        g_error_free(err);
-    }
-
-    err = NULL;
-    gchar *ui_otr_policy = g_key_file_get_string(prefs, "policy", "otr.policy", &err);
-    if (err == NULL) {
-        g_key_file_set_string(prefs, PREF_GROUP_OTR, _get_key(PREF_OTR_POLICY), ui_otr_policy);
-        g_key_file_remove_group(prefs, "policy", NULL);
+        g_key_file_set_boolean(prefs, PREF_GROUP_UI, _get_key(PREF_OTR_WARN), otr_warn);
+        g_key_file_remove_key(prefs, PREF_GROUP_OTR, "warn", NULL);
     } else {
         g_error_free(err);
     }
@@ -531,6 +513,7 @@ _get_group(preference_t pref)
         case PREF_ROSTER_BY:
         case PREF_RESOURCE_TITLE:
         case PREF_RESOURCE_MESSAGE:
+        case PREF_OTR_WARN:
         case PREF_INPBLOCK_DYNAMIC:
             return PREF_GROUP_UI;
         case PREF_STATES:
@@ -559,7 +542,6 @@ _get_group(preference_t pref)
         case PREF_CONNECT_ACCOUNT:
         case PREF_DEFAULT_ACCOUNT:
             return PREF_GROUP_CONNECTION;
-        case PREF_OTR_WARN:
         case PREF_OTR_LOG:
         case PREF_OTR_POLICY:
             return PREF_GROUP_OTR;
@@ -648,7 +630,7 @@ _get_key(preference_t pref)
         case PREF_OTR_LOG:
             return "log";
         case PREF_OTR_WARN:
-            return "warn";
+            return "otr.warn";
         case PREF_OTR_POLICY:
             return "policy";
         case PREF_LOG_ROTATE:
diff --git a/src/config/theme.c b/src/config/theme.c
index e9389417..d2bf0a48 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -421,20 +421,20 @@ _set_boolean_preference(char *prefstr, preference_t pref)
 static void
 _load_preferences(void)
 {
-    _set_boolean_preference("intype", PREF_INTYPE);
     _set_boolean_preference("beep", PREF_BEEP);
     _set_boolean_preference("flash", PREF_FLASH);
-    _set_boolean_preference("privileges", PREF_MUC_PRIVILEGES);
-    _set_boolean_preference("presence", PREF_PRESENCE);
+    _set_boolean_preference("splash", PREF_SPLASH);
     _set_boolean_preference("wrap", PREF_WRAP);
-
     _set_string_preference("time", PREF_TIME);
-    _set_string_preference("statuses.muc", PREF_STATUSES_MUC);
+
+    _set_boolean_preference("resource.title", PREF_RESOURCE_TITLE);
+    _set_boolean_preference("resource.message", PREF_RESOURCE_MESSAGE);
+
     _set_string_preference("statuses.console", PREF_STATUSES_CONSOLE);
     _set_string_preference("statuses.chat", PREF_STATUSES_CHAT);
+    _set_string_preference("statuses.muc", PREF_STATUSES_MUC);
 
     _set_boolean_preference("occupants", PREF_OCCUPANTS);
-
     if (g_key_file_has_key(theme, "ui", "occupants.size", NULL)) {
         gint occupants_size = g_key_file_get_integer(theme, "ui", "occupants.size", NULL);
         prefs_set_occupants_size(occupants_size);
@@ -444,12 +444,16 @@ _load_preferences(void)
     _set_boolean_preference("roster.offline", PREF_ROSTER_OFFLINE);
     _set_boolean_preference("roster.resource", PREF_ROSTER_RESOURCE);
     _set_string_preference("roster.by", PREF_ROSTER_BY);
-
     if (g_key_file_has_key(theme, "ui", "roster.size", NULL)) {
         gint roster_size = g_key_file_get_integer(theme, "ui", "roster.size", NULL);
         prefs_set_roster_size(roster_size);
     }
 
+    _set_boolean_preference("privileges", PREF_MUC_PRIVILEGES);
+
+    _set_boolean_preference("presence", PREF_PRESENCE);
+    _set_boolean_preference("intype", PREF_INTYPE);
+
     _set_boolean_preference("otr.warn", PREF_OTR_WARN);
 }