diff options
Diffstat (limited to 'src/ui/console.c')
-rw-r--r-- | src/ui/console.c | 80 |
1 files changed, 60 insertions, 20 deletions
diff --git a/src/ui/console.c b/src/ui/console.c index cb5a10b0..9bead705 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -1,7 +1,7 @@ /* * console.c * - * Copyright (C) 2012 - 2017 James Booth <boothj5@gmail.com> + * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com> * * This file is part of Profanity. * @@ -412,7 +412,7 @@ cons_about(void) } } - win_println(console, THEME_DEFAULT, '-', "Copyright (C) 2012 - 2017 James Booth <%s>.", PACKAGE_BUGREPORT); + win_println(console, THEME_DEFAULT, '-', "Copyright (C) 2012 - 2018 James Booth <%s>.", PACKAGE_BUGREPORT); win_println(console, THEME_DEFAULT, '-', "License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>"); win_println(console, THEME_DEFAULT, '-', ""); win_println(console, THEME_DEFAULT, '-', "This is free software; you are free to change and redistribute it."); @@ -684,8 +684,9 @@ cons_show_bookmarks(const GList *list) Bookmark *item = list->data; theme_item_t presence_colour = THEME_TEXT; + ProfWin *roomwin = (ProfWin*)wins_get_muc(item->barejid); - if (muc_active(item->barejid)) { + if (muc_active(item->barejid) && roomwin) { presence_colour = THEME_ONLINE; } win_print(console, presence_colour, '-', " %s", item->barejid); @@ -698,12 +699,9 @@ cons_show_bookmarks(const GList *list) if (item->password) { win_append(console, presence_colour, " (private)"); } - if (muc_active(item->barejid)) { - ProfWin *roomwin = (ProfWin*)wins_get_muc(item->barejid); - if (roomwin) { - int num = wins_get_num(roomwin); - win_append(console, presence_colour, " (win %d)", num); - } + if (muc_active(item->barejid) && roomwin) { + int num = wins_get_num(roomwin); + win_append(console, presence_colour, " (win %d)", num); } win_newline(console); list = g_list_next(list); @@ -1126,15 +1124,6 @@ cons_wrap_setting(void) } void -cons_winstidy_setting(void) -{ - if (prefs_get_boolean(PREF_WINS_AUTO_TIDY)) - cons_show("Window Auto Tidy (/wins) : ON"); - else - cons_show("Window Auto Tidy (/wins) : OFF"); -} - -void cons_encwarn_setting(void) { if (prefs_get_boolean(PREF_ENC_WARN)) { @@ -1248,6 +1237,16 @@ cons_occupants_setting(void) } void +cons_rooms_cache_setting(void) +{ + if (prefs_get_boolean(PREF_ROOM_LIST_CACHE)) { + cons_show("Room list cache (/rooms cache) : ON"); + } else { + cons_show("Room list cache (/rooms cache) : OFF"); + } +} + +void cons_autoconnect_setting(void) { char *pref_connect_account = prefs_get_string(PREF_CONNECT_ACCOUNT); @@ -1523,7 +1522,6 @@ cons_show_ui_prefs(void) cons_splash_setting(); cons_winpos_setting(); cons_wrap_setting(); - cons_winstidy_setting(); cons_time_setting(); cons_resource_setting(); cons_vercheck_setting(); @@ -1536,6 +1534,7 @@ cons_show_ui_prefs(void) cons_presence_setting(); cons_inpblock_setting(); cons_tlsshow_setting(); + cons_statusbar_setting(); cons_alert(); } @@ -1740,6 +1739,46 @@ cons_inpblock_setting(void) } void +cons_statusbar_setting(void) +{ + if (prefs_get_boolean(PREF_STATUSBAR_SHOW_NAME)) { + cons_show("Show tab names (/statusbar) : ON"); + } else { + cons_show("Show tab names (/statusbar) : OFF"); + } + if (prefs_get_boolean(PREF_STATUSBAR_SHOW_NUMBER)) { + cons_show("Show tab numbers (/statusbar) : ON"); + } else { + cons_show("Show tab numbers (/statusbar) : OFF"); + } + + cons_show("Max tabs (/statusbar) : %d", prefs_get_statusbartabs()); + + gint pref_len = prefs_get_statusbartablen(); + if (pref_len == 0) { + cons_show("Max tab length (/statusbar) : OFF"); + } else { + cons_show("Max tab length (/statusbar) : %d", pref_len); + } + + char *pref_self = prefs_get_string(PREF_STATUSBAR_SELF); + if (g_strcmp0(pref_self, "off") == 0) { + cons_show("Self statusbar display (/statusbar) : OFF"); + } else { + cons_show("Self statusbar display (/statusbar) : %s", pref_self); + } + prefs_free_string(pref_self); + + char *pref_chat = prefs_get_string(PREF_STATUSBAR_CHAT); + cons_show("Chat tab display (/statusbar) : %s", pref_chat); + prefs_free_string(pref_chat); + + char *pref_room = prefs_get_string(PREF_STATUSBAR_ROOM); + cons_show("Room tab display (/statusbar) : %s", pref_room); + prefs_free_string(pref_room); +} + +void cons_winpos_setting(void) { ProfWinPlacement *placement = prefs_get_win_placement(); @@ -1906,6 +1945,7 @@ cons_show_connection_prefs(void) cons_reconnect_setting(); cons_autoping_setting(); cons_autoconnect_setting(); + cons_rooms_cache_setting(); cons_alert(); } @@ -2152,7 +2192,7 @@ cons_alert(void) { ProfWin *current = wins_get_current(); if (current->type != WIN_CONSOLE) { - status_bar_new(1); + status_bar_new(1, WIN_CONSOLE, "console"); } } |