From 0c40a38a4522f4afb6c76566a32fe5453b7ebdac Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sat, 24 Aug 2013 19:20:56 -0400 Subject: [PATCH] Append the count of unread IMs to the IM session's name in the communicate button's flyout list ShowUnreadIMsCount can be set false to turn this off --- indra/newview/app_settings/settings.xml | 11 ++++++++++ indra/newview/lltoolbar.cpp | 20 ++++++++++++++++++- .../skins/default/xui/en-us/panel_toolbar.xml | 2 ++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b9c84b4b5..8e1cda872 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -962,6 +962,17 @@ This should be as low as possible, but too low may break functionality Value 0 + ShowUnreadIMsCounts + + Comment + Show the count of unread IMs in the communicate flyout list + Persist + 1 + Type + Boolean + Value + 1 + StatusBarPositionBeforeParcel Comment diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index 78d3f21bf..985d27f15 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -389,8 +389,26 @@ void LLToolBar::updateCommunicateList() LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)floater_handle_it->get(); if (im_floaterp) { - std::string floater_title = im_floaterp->getNumUnreadMessages() > 0 ? "*" : ""; + static LLCachedControl show_counts("ShowUnreadIMsCounts", true); + S32 count = im_floaterp->getNumUnreadMessages(); + std::string floater_title; + if (count > 0) floater_title = "*"; floater_title.append(im_floaterp->getShortTitle()); + if (show_counts && count > 0) + { + floater_title += " - "; + if (count > 1) + { + LLStringUtil::format_map_t args; + args["COUNT"] = llformat("%d", count); + floater_title += getString("IMs", args); + } + else + { + floater_title += getString("IM"); + } + } + itemp = communicate_button->add(floater_title, im_floaterp->getSessionID(), ADD_TOP); if (im_floaterp == frontmost_floater) { diff --git a/indra/newview/skins/default/xui/en-us/panel_toolbar.xml b/indra/newview/skins/default/xui/en-us/panel_toolbar.xml index 4c6b39881..8f86616e4 100644 --- a/indra/newview/skins/default/xui/en-us/panel_toolbar.xml +++ b/indra/newview/skins/default/xui/en-us/panel_toolbar.xml @@ -1,6 +1,8 @@ Redock Windows + [COUNT] IMs + 1 IM