From e3d45d99da53d40a966dd5500282a86dbe76fdf4 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 10 Nov 2014 16:09:43 -0500 Subject: [PATCH] Address Issue 1732: Display name in the Communication box Adds Chat Tabs namesystem combobox to Adv. Chat->Chat UI. --- indra/newview/app_settings/settings_ascent.xml | 11 +++++++++++ indra/newview/ascentprefschat.cpp | 4 ++++ indra/newview/ascentprefschat.h | 1 + indra/newview/llimpanel.cpp | 12 +++++++++++- .../xui/en-us/panel_preferences_ascent_chat.xml | 7 +++++++ 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 5d49b854c..41207d047 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -47,6 +47,17 @@ Value 1 + IMNameSystem + + Comment + For names in chat tabs. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name) + Persist + 1 + Type + S32 + Value + 0 + LandManagementNameSystem Comment diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index 8862d1604..c604a3260 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -265,6 +265,7 @@ void LLPrefsAscentChat::refreshValues() mLegacyEndScroll = gSavedSettings.getBOOL("LiruLegacyScrollToEnd"); mItalicizeActions = gSavedSettings.getBOOL("LiruItalicizeActions"); mLegacyLogLaunch = gSavedSettings.getBOOL("LiruLegacyLogLaunch"); + mChatTabNames = gSavedSettings.getS32("IMNameSystem"); mFriendNames = gSavedSettings.getS32("FriendNameSystem"); mGroupMembersNames = gSavedSettings.getS32("GroupMembersNameSystem"); mLandManagementNames = gSavedSettings.getS32("LandManagementNameSystem"); @@ -348,6 +349,8 @@ void LLPrefsAscentChat::refresh() } //Chat UI ----------------------------------------------------------------------------- + if (combo = getChild("chat_tabs_namesystem_combobox")) + combo->setCurrentByIndex(mChatTabNames); if (combo = getChild("friends_namesystem_combobox")) combo->setCurrentByIndex(mFriendNames); if (combo = getChild("group_members_namesystem_combobox")) @@ -501,6 +504,7 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setBOOL("LiruLegacyScrollToEnd", mLegacyEndScroll); gSavedSettings.setBOOL("LiruItalicizeActions", mItalicizeActions); gSavedSettings.setBOOL("LiruLegacyLogLaunch", mLegacyLogLaunch); + gSavedSettings.setS32("IMNameSystem", mChatTabNames); gSavedSettings.setS32("FriendNameSystem", mFriendNames); gSavedSettings.setS32("GroupMembersNameSystem", mGroupMembersNames); gSavedSettings.setS32("LandManagementNameSystem", mLandManagementNames); diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h index c04a2d297..709635d4f 100644 --- a/indra/newview/ascentprefschat.h +++ b/indra/newview/ascentprefschat.h @@ -87,6 +87,7 @@ private: bool mLegacyEndScroll; bool mItalicizeActions; bool mLegacyLogLaunch; + S32 mChatTabNames; S32 mFriendNames; S32 mGroupMembersNames; S32 mLandManagementNames; diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index da0f11280..ccc13b61c 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -404,7 +404,17 @@ void LLFloaterIMPanel::onAvatarNameLookup(const LLAvatarName& avatar_name) std::string title; LLAvatarNameCache::getPNSName(avatar_name, title); setTitle(title); - // Singu Note: We could set tab name here, too now. + const S32& ns(gSavedSettings.getS32("IMNameSystem")); + LLAvatarNameCache::getPNSName(avatar_name, title, ns); + if (!ns || ns == 3) // Remove Resident, if applicable. + { + size_t pos(title.find(" Resident")); + if (pos != std::string::npos && !gSavedSettings.getBOOL("LiruShowLastNameResident")) + title.erase(pos, 9); + } + setShortTitle(title); + if (LLMultiFloater* mf = dynamic_cast(getParent())) + mf->updateFloaterTitle(this); } LLFloaterIMPanel::~LLFloaterIMPanel() diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 024f4d5e7..8199d3d8d 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -56,6 +56,13 @@ Format for names in lists of/for: + Chat Tabs: + + Old Names + Display Names (w/Username) + Display Names only + Old Names (w/Display) + Friends: Old Names