diff options
author | James Booth <boothj5@gmail.com> | 2013-04-21 01:25:10 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-04-21 01:25:10 +0100 |
commit | b3ed4dd0feba6b707b156cc34d5464bc84889cf7 (patch) | |
tree | 02d8c880684857869005f5dc8cd2bc7e341f5957 /src/ui/console.c | |
parent | 6253897ea7a8006c95a019578cf1c010c45c145a (diff) | |
download | profani-tty-b3ed4dd0feba6b707b156cc34d5464bc84889cf7.tar.gz |
Moved preferences display functions to console module
Diffstat (limited to 'src/ui/console.c')
-rw-r--r-- | src/ui/console.c | 243 |
1 files changed, 243 insertions, 0 deletions
diff --git a/src/ui/console.c b/src/ui/console.c index 71075785..59aa5df9 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -778,6 +778,249 @@ cons_show_account(ProfAccount *account) } } +void +cons_show_ui_prefs(void) +{ + cons_show("UI preferences:"); + cons_show(""); + + gchar *theme = prefs_get_string(PREF_THEME); + if (theme == NULL) { + cons_show("Theme (/theme) : default"); + } else { + cons_show("Theme (/theme) : %s", theme); + } + + if (prefs_get_boolean(PREF_BEEP)) + cons_show("Terminal beep (/beep) : ON"); + else + cons_show("Terminal beep (/beep) : OFF"); + + if (prefs_get_boolean(PREF_FLASH)) + cons_show("Terminal flash (/flash) : ON"); + else + cons_show("Terminal flash (/flash) : OFF"); + + if (prefs_get_boolean(PREF_INTYPE)) + cons_show("Show typing (/intype) : ON"); + else + cons_show("Show typing (/intype) : OFF"); + + if (prefs_get_boolean(PREF_SPLASH)) + cons_show("Splash screen (/splash) : ON"); + else + cons_show("Splash screen (/splash) : OFF"); + + if (prefs_get_boolean(PREF_HISTORY)) + cons_show("Chat history (/history) : ON"); + else + cons_show("Chat history (/history) : OFF"); + + if (prefs_get_boolean(PREF_VERCHECK)) + cons_show("Version checking (/vercheck) : ON"); + else + cons_show("Version checking (/vercheck) : OFF"); + + if (prefs_get_boolean(PREF_MOUSE)) + cons_show("Mouse handling (/mouse) : ON"); + else + cons_show("Mouse handling (/mouse) : OFF"); + + if (prefs_get_boolean(PREF_STATUSES)) + cons_show("Status (/statuses) : ON"); + else + cons_show("Status (/statuses) : OFF"); + + dirty = TRUE; + if (!win_current_is_console()) { + status_bar_new(0); + } +} + +void +cons_show_desktop_prefs(void) +{ + cons_show("Desktop notification preferences:"); + cons_show(""); + + if (prefs_get_boolean(PREF_NOTIFY_MESSAGE)) + cons_show("Messages (/notify message) : ON"); + else + cons_show("Messages (/notify message) : OFF"); + + if (prefs_get_boolean(PREF_NOTIFY_TYPING)) + cons_show("Composing (/notify typing) : ON"); + else + cons_show("Composing (/notify typing) : OFF"); + + gint remind_period = prefs_get_notify_remind(); + if (remind_period == 0) { + cons_show("Reminder period (/notify remind) : OFF"); + } else if (remind_period == 1) { + cons_show("Reminder period (/notify remind) : 1 second"); + } else { + cons_show("Reminder period (/notify remind) : %d seconds", remind_period); + } +} + +void +cons_show_chat_prefs(void) +{ + cons_show("Chat preferences:"); + cons_show(""); + + if (prefs_get_boolean(PREF_STATES)) + cons_show("Send chat states (/states) : ON"); + else + cons_show("Send chat states (/states) : OFF"); + + if (prefs_get_boolean(PREF_OUTTYPE)) + cons_show("Send composing (/outtype) : ON"); + else + cons_show("Send composing (/outtype) : OFF"); + + gint gone_time = prefs_get_gone(); + if (gone_time == 0) { + cons_show("Leave conversation (/gone) : OFF"); + } else if (gone_time == 1) { + cons_show("Leave conversation (/gone) : 1 minute"); + } else { + cons_show("Leave conversation (/gone) : %d minutes", gone_time); + } + + dirty = TRUE; + if (!win_current_is_console()) { + status_bar_new(0); + } +} + +void +cons_show_log_prefs(void) +{ + cons_show("Logging preferences:"); + cons_show(""); + + cons_show("Max log size (/log maxsize) : %d bytes", prefs_get_max_log_size()); + + if (prefs_get_boolean(PREF_CHLOG)) + cons_show("Chat logging (/chlog) : ON"); + else + cons_show("Chat logging (/chlog) : OFF"); + + dirty = TRUE; + if (!win_current_is_console()) { + status_bar_new(0); + } +} + +void +cons_show_presence_prefs(void) +{ + cons_show("Presence preferences:"); + cons_show(""); + + if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "off") == 0) { + cons_show("Autoaway (/autoaway mode) : OFF"); + } else { + cons_show("Autoaway (/autoaway mode) : %s", prefs_get_string(PREF_AUTOAWAY_MODE)); + } + + cons_show("Autoaway minutes (/autoaway time) : %d minutes", prefs_get_autoaway_time()); + + if ((prefs_get_string(PREF_AUTOAWAY_MESSAGE) == NULL) || + (strcmp(prefs_get_string(PREF_AUTOAWAY_MESSAGE), "") == 0)) { + cons_show("Autoaway message (/autoaway message) : OFF"); + } else { + cons_show("Autoaway message (/autoaway message) : \"%s\"", prefs_get_string(PREF_AUTOAWAY_MESSAGE)); + } + + if (prefs_get_boolean(PREF_AUTOAWAY_CHECK)) { + cons_show("Autoaway check (/autoaway check) : ON"); + } else { + cons_show("Autoaway check (/autoaway check) : OFF"); + } + + dirty = TRUE; + if (!win_current_is_console()) { + status_bar_new(0); + } +} + +void +cons_show_connection_prefs(void) +{ + cons_show("Connection preferences:"); + cons_show(""); + + gint reconnect_interval = prefs_get_reconnect(); + if (reconnect_interval == 0) { + cons_show("Reconnect interval (/reconnect) : OFF"); + } else if (reconnect_interval == 1) { + cons_show("Reconnect interval (/reconnect) : 1 second"); + } else { + cons_show("Reconnect interval (/reconnect) : %d seconds", reconnect_interval); + } + + gint autoping_interval = prefs_get_autoping(); + if (autoping_interval == 0) { + cons_show("Autoping interval (/autoping) : OFF"); + } else if (autoping_interval == 1) { + cons_show("Autoping interval (/autoping) : 1 second"); + } else { + cons_show("Autoping interval (/autoping) : %d seconds", autoping_interval); + } + + dirty = TRUE; + if (!win_current_is_console()) { + status_bar_new(0); + } +} + +void +cons_show_themes(GSList *themes) +{ + cons_show(""); + + if (themes == NULL) { + cons_show("No available themes."); + } else { + cons_show("Available themes:"); + while (themes != NULL) { + cons_show(themes->data); + themes = g_slist_next(themes); + } + } + + dirty = TRUE; + if (!win_current_is_console()) { + status_bar_new(0); + } +} + +void +cons_prefs(void) +{ + cons_show(""); + cons_show_ui_prefs(); + cons_show(""); + cons_show_desktop_prefs(); + cons_show(""); + cons_show_chat_prefs(); + cons_show(""); + cons_show_log_prefs(); + cons_show(""); + cons_show_presence_prefs(); + cons_show(""); + cons_show_connection_prefs(); + cons_show(""); + + dirty = TRUE; + if (!win_current_is_console()) { + status_bar_new(0); + } +} + + static void _cons_splash_logo(void) { |