Feature Request: Add an option to keep last name Resident.

Should work to solve Issue 517: Legacy log handling of "Resident" name
This commit is contained in:
Lirusaito
2013-07-19 07:16:51 -04:00
parent aaf010da4c
commit 863c35710f
4 changed files with 24 additions and 3 deletions

View File

@@ -29,6 +29,7 @@
#include "llcachename.h"
// linden library includes
#include "llcontrol.h" // For LLCachedControl
#include "lldbstrings.h"
#include "llframetimer.h"
#include "llhost.h"
@@ -506,9 +507,10 @@ BOOL LLCacheName::getUUID(const std::string& full_name, LLUUID& id)
//static
std::string LLCacheName::buildFullName(const std::string& first, const std::string& last)
{
static const LLCachedControl<bool> show_resident("LiruShowLastNameResident", false);
std::string fullname = first;
if (!last.empty()
&& last != "Resident")
&& (show_resident || last != "Resident"))
{
fullname += ' ';
fullname += last;
@@ -519,6 +521,8 @@ std::string LLCacheName::buildFullName(const std::string& first, const std::stri
//static
std::string LLCacheName::cleanFullName(const std::string& full_name)
{
static const LLCachedControl<bool> show_resident("LiruShowLastNameResident", false);
if (show_resident) return full_name;
return full_name.substr(0, full_name.find(" Resident"));
}
@@ -539,7 +543,8 @@ std::string LLCacheName::buildUsername(const std::string& full_name)
username = full_name.substr(0, index);
std::string lastname = full_name.substr(index+1);
if (lastname != "Resident")
static const LLCachedControl<bool> show_resident("LiruShowLastNameResident", false);
if (lastname != "Resident" || show_resident)
{
username = username + "." + lastname;
}

View File

@@ -763,6 +763,17 @@ Found in Advanced->Rendering->Info Displays</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>LiruShowLastNameResident</key>
<map>
<key>Comment</key>
<string>Whether or not to bypass stripping out the last name Resident</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ContactsUseHorizontalButtons</key>
<map>
<key>Comment</key>

View File

@@ -62,6 +62,8 @@ BOOL LLPanelGeneral::postBuild()
LLComboBox* namesystem_combobox = getChild<LLComboBox>("namesystem_combobox");
namesystem_combobox->setCurrentByIndex(gSavedSettings.getS32("PhoenixNameSystem"));
getChild<LLUICtrl>("show_resident_checkbox")->setValue(gSavedSettings.getBOOL("LiruShowLastNameResident"));
std::string login_location = gSavedSettings.getString("LoginLocation");
if(login_location != "last" && login_location != "home")
login_location = "last";
@@ -141,8 +143,10 @@ void LLPanelGeneral::apply()
gSavedSettings.setS32("RenderName", fade_out_combobox->getCurrentIndex());
LLComboBox* namesystem_combobox = getChild<LLComboBox>("namesystem_combobox");
if(gSavedSettings.getS32("PhoenixNameSystem")!=namesystem_combobox->getCurrentIndex()){
LLUICtrl* show_resident_checkbox = getChild<LLUICtrl>("show_resident_checkbox");
if(gSavedSettings.getS32("PhoenixNameSystem")!=namesystem_combobox->getCurrentIndex() || gSavedSettings.getBOOL("LiruShowLastNameResident")!=show_resident_checkbox->getValue().asBoolean()){
gSavedSettings.setS32("PhoenixNameSystem", namesystem_combobox->getCurrentIndex());
gSavedSettings.setBOOL("LiruShowLastNameResident", show_resident_checkbox->getValue());
if(gAgent.getRegion()){
if(namesystem_combobox->getCurrentIndex()<=0 || namesystem_combobox->getCurrentIndex()>2) LLAvatarNameCache::setUseDisplayNames(false);
else LLAvatarNameCache::setUseDisplayNames(true);

View File

@@ -15,6 +15,7 @@
<combo_item name="Display Names (with Username)" value="Display Names (with Username)">Display Names(w/Username)</combo_item>
<combo_item name="Display Names only" value="Display Names only">Display Names only</combo_item>
</combo_box>
<check_box bottom_delta="0" follows="top" height="16" label="Show Resident" left_delta="174" name="show_resident_checkbox"/>
<check_box bottom_delta="-25" follows="top" height="16" initial_value="true" label="Small Avatar Names" left="101" name="small_avatar_names_checkbox"/>
<check_box bottom_delta="-18" follows="top" height="16" initial_value="false" label="Hide My Name On My Screen" name="show_my_name_checkbox"/>
<text bottom_delta="-24" follows="top" height="16" left="10" name="group_titles_textbox">Group Titles:</text>