diff options
author | James Booth <boothj5@gmail.com> | 2014-05-11 13:32:59 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-05-11 13:32:59 +0100 |
commit | 015780662edad1ff959ed3451a38a446cadb9e75 (patch) | |
tree | 5984c728e470e56becd43e8274d5eb71695fe13c /src/ui | |
parent | ddbb4872b3ac8e362b37bfa565f80c888718cf7a (diff) | |
download | profani-tty-015780662edad1ff959ed3451a38a446cadb9e75.tar.gz |
Added /prefs otr
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/console.c | 69 | ||||
-rw-r--r-- | src/ui/ui.h | 3 |
2 files changed, 39 insertions, 33 deletions
diff --git a/src/ui/console.c b/src/ui/console.c index 7aac2e21..f5f352b5 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -1075,9 +1075,9 @@ _cons_statuses_setting(void) char *chat = prefs_get_string(PREF_STATUSES_CHAT); char *muc = prefs_get_string(PREF_STATUSES_MUC); - cons_show("Console statuses (/statuses) : %s", console); - cons_show("Chat win statuses (/statuses) : %s", chat); - cons_show("Chat room statuses (/statuses) : %s", muc); + cons_show("Console statuses (/statuses) : %s", console); + cons_show("Chat statuses (/statuses) : %s", chat); + cons_show("MUC statuses (/statuses) : %s", muc); } static void @@ -1091,16 +1091,6 @@ _cons_titlebar_setting(void) } static void -_cons_otrwarn_setting(void) -{ - if (prefs_get_boolean(PREF_OTR_WARN)) { - cons_show("Warn non-OTR (/otr warn) : ON"); - } else { - cons_show("Warn non-OTR (/otr warn) : OFF"); - } -} - -static void _cons_show_ui_prefs(void) { ProfWin *console = wins_get_console(); @@ -1114,7 +1104,6 @@ _cons_show_ui_prefs(void) cons_mouse_setting(); cons_statuses_setting(); cons_titlebar_setting(); - cons_otrwarn_setting(); if (wins_is_current(console)) { win_update_virtual(console); @@ -1272,20 +1261,6 @@ _cons_grlog_setting(void) } static void -_cons_otr_log_setting(void) -{ - char *value = prefs_get_string(PREF_OTR_LOG); - - if (strcmp(value, "on") == 0) { - cons_show("OTR logging (/otr log) : ON"); - } else if (strcmp(value, "off") == 0) { - cons_show("OTR logging (/otr log) : OFF"); - } else { - cons_show("OTR logging (/otr log) : Redacted"); - } -} - -static void _cons_show_log_prefs(void) { ProfWin *console = wins_get_console(); @@ -1294,7 +1269,6 @@ _cons_show_log_prefs(void) cons_log_setting(); cons_chlog_setting(); cons_grlog_setting(); - cons_otr_log_setting(); if (wins_is_current(console)) { win_update_virtual(console); @@ -1391,6 +1365,38 @@ _cons_show_connection_prefs(void) } static void +_cons_show_otr_prefs(void) +{ + ProfWin *console = wins_get_console(); + cons_show("OTR preferences:"); + cons_show(""); + + char *policy_value = prefs_get_string(PREF_OTR_POLICY); + cons_show("OTR policy (/otr policy) : %s", policy_value); + + if (prefs_get_boolean(PREF_OTR_WARN)) { + cons_show("Warn non-OTR (/otr warn) : ON"); + } else { + cons_show("Warn non-OTR (/otr warn) : OFF"); + } + + char *log_value = prefs_get_string(PREF_OTR_LOG); + + if (strcmp(log_value, "on") == 0) { + cons_show("OTR logging (/otr log) : ON"); + } else if (strcmp(log_value, "off") == 0) { + cons_show("OTR logging (/otr log) : OFF"); + } else { + cons_show("OTR logging (/otr log) : Redacted"); + } + + if (wins_is_current(console)) { + win_update_virtual(console); + } + cons_alert(); +} + +static void _cons_show_themes(GSList *themes) { ProfWin *console = wins_get_console(); @@ -1429,6 +1435,8 @@ _cons_prefs(void) cons_show(""); cons_show_connection_prefs(); cons_show(""); + cons_show_otr_prefs(); + cons_show(""); if (wins_is_current(console)) { win_update_virtual(console); @@ -1767,11 +1775,10 @@ console_init_module(void) cons_log_setting = _cons_log_setting; cons_chlog_setting = _cons_chlog_setting; cons_grlog_setting = _cons_grlog_setting; - cons_otr_log_setting = _cons_otr_log_setting; - cons_otrwarn_setting = _cons_otrwarn_setting; cons_show_log_prefs = _cons_show_log_prefs; cons_autoaway_setting = _cons_autoaway_setting; cons_show_presence_prefs = _cons_show_presence_prefs; + cons_show_otr_prefs = _cons_show_otr_prefs; cons_reconnect_setting = _cons_reconnect_setting; cons_autoping_setting = _cons_autoping_setting; cons_priority_setting = _cons_priority_setting; diff --git a/src/ui/ui.h b/src/ui/ui.h index c4d42939..32bb782a 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -196,6 +196,7 @@ void (*cons_show_chat_prefs)(void); void (*cons_show_log_prefs)(void); void (*cons_show_presence_prefs)(void); void (*cons_show_connection_prefs)(void); +void (*cons_show_otr_prefs)(void); void (*cons_show_account)(ProfAccount *account); void (*cons_debug)(const char * const msg, ...); void (*cons_show_time)(void); @@ -246,8 +247,6 @@ void (*cons_history_setting)(void); void (*cons_log_setting)(void); void (*cons_chlog_setting)(void); void (*cons_grlog_setting)(void); -void (*cons_otr_log_setting)(void); -void (*cons_otrwarn_setting)(void); void (*cons_autoaway_setting)(void); void (*cons_reconnect_setting)(void); void (*cons_autoping_setting)(void); |