diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 36d691a5d..14be57276 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -669,25 +669,31 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) return false; } +const S32& LLAvatarNameCache::phoenix_name_system() +{ + static const LLCachedControl name_system("PhoenixNameSystem", 0); + return name_system; +} + // Return true when name has been set to Phoenix Name System Name, if not return false. -bool LLAvatarNameCache::getPNSName(const LLUUID& agent_id, std::string& name) +bool LLAvatarNameCache::getPNSName(const LLUUID& agent_id, std::string& name, const S32& name_system) { LLAvatarName avatar_name; if (get(agent_id, &avatar_name)) - getPNSName(avatar_name, name); + getPNSName(avatar_name, name, name_system); else return false; return true; } // get() with callback compatible version of getPNSName -void LLAvatarNameCache::getPNSName(const LLAvatarName& avatar_name, std::string& name) +void LLAvatarNameCache::getPNSName(const LLAvatarName& avatar_name, std::string& name, const S32& name_system) { - static LLCachedControl phoenix_name_system("PhoenixNameSystem", 0); - switch (phoenix_name_system) + switch (name_system) { case 0 : name = avatar_name.getLegacyName(); break; case 1 : name = avatar_name.getCompleteName(); break; case 2 : name = avatar_name.mDisplayName; break; + case 3 : name = avatar_name.getLegacyName() + " (" + avatar_name.mDisplayName + ")"; break; default : name = avatar_name.getLegacyName(); break; } } diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index 99e3fba57..f98988769 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -65,12 +65,13 @@ namespace LLAvatarNameCache // If name is in cache, returns true and fills in provided LLAvatarName // otherwise returns false bool get(const LLUUID& agent_id, LLAvatarName *av_name); + const S32& phoenix_name_system(); // If get() succeeds, returns true and fills in name string // via void function below, otherwise returns false - bool getPNSName(const LLUUID& agent_id, std::string& name); + bool getPNSName(const LLUUID& agent_id, std::string& name, const S32& name_system = phoenix_name_system()); // Perform a filling of name string according to Phoenix Name System, // when we have an LLAvatarName already. - void getPNSName(const LLAvatarName& avatar_name, std::string& name); + void getPNSName(const LLAvatarName& avatar_name, std::string& name, const S32& name_system = phoenix_name_system()); // Callback types for get() below typedef boost::signals2::signal< diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index fb5fee7c1..e27156e5a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -768,17 +768,6 @@ Value 1 - LiruLegacySpeakerNames - - Comment - Whether all lists of speakers use legacy names, or your desired way of displaying names. - Persist - 1 - Type - Boolean - Value - 0 - LiruLocalTime Comment diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index bc4537109..f2de17710 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -25,10 +25,43 @@ Value 0 + FriendNameSystem + + Comment + For friends list names. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name) + Persist + 1 + Type + S32 + Value + 1 + + GroupMembersNameSystem + + Comment + For lists of group members names. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name) + Persist + 1 + Type + S32 + Value + 1 + + LandManagementNameSystem + + Comment + For names land management lists. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name) + Persist + 1 + Type + S32 + Value + 1 + PhoenixNameSystem Comment - Use Display Names instead of Legacy Names. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only + For general purpose names in the viewer. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name) Persist 2 Type @@ -36,6 +69,28 @@ Value 1 + RadarNameSystem + + Comment + For names in the radar. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name) + Persist + 1 + Type + S32 + Value + 1 + + SpeakerNameSystem + + Comment + For names in lists of speakers. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name) + Persist + 1 + Type + S32 + Value + 1 + AscentPowerfulWizard Comment diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index d504a38fa..7210c69f0 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -298,7 +298,11 @@ void LLPrefsAscentChat::refreshValues() mOnlyComm = gSavedSettings.getBOOL("CommunicateSpecificShortcut"); mItalicizeActions = gSavedSettings.getBOOL("LiruItalicizeActions"); mLegacyLogLaunch = gSavedSettings.getBOOL("LiruLegacyLogLaunch"); - mLegacySpeakerNames = gSavedSettings.getBOOL("LiruLegacySpeakerNames"); + mFriendNames = gSavedSettings.getBOOL("FriendNameSystem"); + mGroupMembersNames = gSavedSettings.getBOOL("GroupMembersNameSystem"); + mLandManagementNames = gSavedSettings.getBOOL("LandManagementNameSystem"); + mRadarNames = gSavedSettings.getBOOL("RadarNameSystem"); + mSpeakerNames = gSavedSettings.getBOOL("SpeakerNameSystem"); //Autoresponse ------------------------------------------------------------------------ mIMResponseAnyoneItemID = gSavedPerAccountSettings.getString("AutoresponseAnyoneItemID"); @@ -537,7 +541,11 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setBOOL("CommunicateSpecificShortcut", mOnlyComm); gSavedSettings.setBOOL("LiruItalicizeActions", mItalicizeActions); gSavedSettings.setBOOL("LiruLegacyLogLaunch", mLegacyLogLaunch); - gSavedSettings.setBOOL("LiruLegacySpeakerNames", mLegacySpeakerNames); + gSavedSettings.setBOOL("FriendNameSystem", mFriendNames); + gSavedSettings.setBOOL("GroupMembersNameSystem", mGroupMembersNames); + gSavedSettings.setBOOL("LandManagementNameSystem", mLandManagementNames); + gSavedSettings.setBOOL("RadarNameSystem", mRadarNames); + gSavedSettings.setBOOL("SpeakerNameSystem", mSpeakerNames); //Autoresponse ------------------------------------------------------------------------ gSavedPerAccountSettings.setString("AutoresponseAnyoneItemID", mIMResponseAnyoneItemID); diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h index 5b235dafa..d3f324a60 100644 --- a/indra/newview/ascentprefschat.h +++ b/indra/newview/ascentprefschat.h @@ -87,8 +87,12 @@ private: bool mOneLineConfButt; bool mOnlyComm; bool mItalicizeActions; - bool mLegacySpeakerNames; bool mLegacyLogLaunch; + S32 mFriendNames; + S32 mGroupMembersNames; + S32 mLandManagementNames; + S32 mRadarNames; + S32 mSpeakerNames; //Autoresponse ------------------------------------------------------------------------ std::string mIMResponseAnyoneItemID; diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index dadab1ee1..d7d2d3ec3 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -603,8 +603,9 @@ void LLFloaterAvatarList::updateAvatarList() { const LLUUID &avid = avatar_ids[i]; + static const LLCachedControl namesystem("RadarNameSystem"); std::string name; - if (!LLAvatarNameCache::getPNSName(avid, name)) + if (!LLAvatarNameCache::getPNSName(avid, name, namesystem)) continue; //prevent (Loading...) LLAvatarListEntry* entry = getAvatarEntry(avid); diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 303b985c7..d85ea0f59 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -407,6 +407,12 @@ BOOL LLPanelFriends::postBuild() return TRUE; } +static const S32& friend_name_system() +{ + static const LLCachedControl name_system("FriendNameSystem", 0); + return name_system; +} + BOOL LLPanelFriends::addFriend(const LLUUID& agent_id) { LLAvatarTracker& at = LLAvatarTracker::instance(); @@ -417,7 +423,7 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id) bool isOnline = relationInfo->isOnline(); std::string fullname; - BOOL have_name = LLAvatarNameCache::getPNSName(agent_id, fullname); + bool have_name = LLAvatarNameCache::getPNSName(agent_id, fullname, friend_name_system()); if (!have_name) gCacheName->getFullName(agent_id, fullname); LLSD element; @@ -505,7 +511,7 @@ BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh bool isOnline = info->isOnline(); std::string fullname; - BOOL have_name = LLAvatarNameCache::getPNSName(agent_id, fullname); + bool have_name = LLAvatarNameCache::getPNSName(agent_id, fullname, friend_name_system()); if (!have_name) gCacheName->getFullName(agent_id, fullname); // Name of the status icon to use @@ -1083,7 +1089,7 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke comm { LLSD args; std::string fullname; - if (LLAvatarNameCache::getPNSName(rights.begin()->first, fullname)) + if (LLAvatarNameCache::getPNSName(rights.begin()->first, fullname, friend_name_system())) args["NAME"] = fullname; if (command == GRANT) diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index ab2283644..7dd948fc5 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -49,11 +49,11 @@ void LLNameListCtrl::NameTypeNames::declareValues() declare("SPECIAL", LLNameListCtrl::SPECIAL); } -LLNameListCtrl::LLNameListCtrl(const std::string& name, const LLRect& rect, BOOL allow_multiple_selection, BOOL draw_border, bool draw_heading, S32 name_column_index, const std::string& tooltip) +LLNameListCtrl::LLNameListCtrl(const std::string& name, const LLRect& rect, BOOL allow_multiple_selection, BOOL draw_border, bool draw_heading, S32 name_column_index, const std::string& name_system, const std::string& tooltip) : LLScrollListCtrl(name, rect, NULL, allow_multiple_selection, draw_border,draw_heading), mNameColumnIndex(name_column_index), mAllowCallingCardDrop(false), - mShortNames(false), + mNameSystem(name_system), mAvatarNameCacheConnection() { setToolTip(tooltip); @@ -189,10 +189,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( } else if (LLAvatarNameCache::get(id, &av_name)) { - if (mShortNames) - fullname = av_name.mDisplayName; - else - fullname = av_name.getCompleteName(); + LLAvatarNameCache::getPNSName(av_name, fullname, mNameSystem); } else { @@ -266,10 +263,7 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, //mAvatarNameCacheConnection.disconnect(); std::string name; - if (mShortNames) - name = av_name.mDisplayName; - else - name = av_name.getCompleteName(); + LLAvatarNameCache::getPNSName(av_name, name, mNameSystem); LLNameListItem* list_item = item.get(); if (list_item && list_item->getUUID() == agent_id) @@ -326,7 +320,10 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto S32 name_column_index = 0; node->getAttributeS32("name_column_index", name_column_index); - LLNameListCtrl* name_list = new LLNameListCtrl("name_list", rect, multi_select, draw_border, draw_heading, name_column_index); + std::string name_system("PhoenixNameSystem"); + node->getAttributeString("name_system", name_system); + + LLNameListCtrl* name_list = new LLNameListCtrl("name_list", rect, multi_select, draw_border, draw_heading, name_column_index, name_system); if (node->hasAttribute("heading_height")) { S32 heading_height; diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 451f1ae7c..9552ff02d 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -102,7 +102,7 @@ public: }; protected: - LLNameListCtrl(const std::string& name, const LLRect& rect, BOOL allow_multiple_selection, BOOL draw_border = TRUE, bool draw_heading = false, S32 name_column_index = 0, const std::string& tooltip = LLStringUtil::null); + LLNameListCtrl(const std::string& name, const LLRect& rect, BOOL allow_multiple_selection, BOOL draw_border = TRUE, bool draw_heading = false, S32 name_column_index = 0, const std::string& name_system = "PhoenixNameSystem", const std::string& tooltip = LLStringUtil::null); virtual ~LLNameListCtrl() { if (mAvatarNameCacheConnection.connected()) @@ -148,7 +148,7 @@ private: private: S32 mNameColumnIndex; BOOL mAllowCallingCardDrop; - bool mShortNames; // display name only, no SLID + const LLCachedControl mNameSystem; boost::signals2::connection mAvatarNameCacheConnection; }; diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 0f15435dc..215e9f242 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -88,11 +88,11 @@ void LLSpeaker::lookupName() void LLSpeaker::onNameCache(const LLAvatarName& full_name) { - static const LLCachedControl legacy_name("LiruLegacySpeakerNames"); - if (legacy_name) + static const LLCachedControl name_system("SpeakerNameSystem"); + if (!name_system) mDisplayName = gCacheName->cleanFullName(full_name.getLegacyName()); else - LLAvatarNameCache::getPNSName(full_name, mDisplayName); + LLAvatarNameCache::getPNSName(full_name, mDisplayName, name_system); } bool LLSpeaker::isInVoiceChannel() diff --git a/indra/newview/skins/default/xui/en-us/floater_about_land.xml b/indra/newview/skins/default/xui/en-us/floater_about_land.xml index eac223645..24669cf48 100644 --- a/indra/newview/skins/default/xui/en-us/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en-us/floater_about_land.xml @@ -1382,7 +1382,7 @@ Select the thumbnail to choose a different texture.