Add name_system attribute to NameBoxes and NameEditors

Uses the main one by default.
Removes old show complete names on profile setting in favor of
ProfileNameSystem, which is now offered under Adv. Chat->Chat UI

Forces nameui to refresh on name setting update, or should, not important though
This commit is contained in:
Liru Færs
2019-11-23 22:37:50 -05:00
parent fb20751330
commit d9ff42ab3c
18 changed files with 55 additions and 42 deletions

View File

@@ -91,6 +91,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>ProfileNameSystem</key>
<map>
<key>Comment</key>
<string>For a name displayed on its profile. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RadarNameSystem</key>
<map>
<key>Comment</key>
@@ -840,17 +851,6 @@
<key>Value</key>
<string>/open</string>
</map>
<key>SinguCompleteNameProfiles</key>
<map>
<key>Comment</key>
<string>Use the complete name "Display Name (legacy.name)" in profiles, instead of following the choice set by PhoenixNameSystem.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>SinguDefaultEaseIn</key>
<map>
<key>Comment</key>

View File

@@ -257,6 +257,7 @@ void LLPrefsAscentChat::refreshValues()
mFriendNames = gSavedSettings.getS32("FriendNameSystem");
mGroupMembersNames = gSavedSettings.getS32("GroupMembersNameSystem");
mLandManagementNames = gSavedSettings.getS32("LandManagementNameSystem");
mProfileNames = gSavedSettings.getS32("ProfileNameSystem");
mRadarNames = gSavedSettings.getS32("RadarNameSystem");
mSpeakerNames = gSavedSettings.getS32("SpeakerNameSystem");
@@ -454,6 +455,7 @@ void LLPrefsAscentChat::cancel()
gSavedSettings.setS32("FriendNameSystem", mFriendNames);
gSavedSettings.setS32("GroupMembersNameSystem", mGroupMembersNames);
gSavedSettings.setS32("LandManagementNameSystem", mLandManagementNames);
gSavedSettings.setS32("ProfileNameSystem", mProfileNames);
gSavedSettings.setS32("RadarNameSystem", mRadarNames);
gSavedSettings.setS32("SpeakerNameSystem", mSpeakerNames);

View File

@@ -91,6 +91,7 @@ private:
S32 mFriendNames;
S32 mGroupMembersNames;
S32 mLandManagementNames;
S32 mProfileNames;
S32 mRadarNames;
S32 mSpeakerNames;

View File

@@ -130,7 +130,6 @@ void LLPrefsAscentVan::refreshValues()
mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata");
mInactiveFloaterTransparency = gSavedSettings.getF32("InactiveFloaterTransparency");
mActiveFloaterTransparency = gSavedSettings.getF32("ActiveFloaterTransparency");
mCompleteNameProfiles = gSavedSettings.getBOOL("SinguCompleteNameProfiles");
mScriptErrorsStealFocus = gSavedSettings.getBOOL("LiruScriptErrorsStealFocus");
mConnectToNeighbors = gSavedSettings.getBOOL("AlchemyConnectToNeighbors");
mRestartMinimized = gSavedSettings.getBOOL("LiruRegionRestartMinimized");
@@ -205,7 +204,6 @@ void LLPrefsAscentVan::cancel()
gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata);
gSavedSettings.setF32("InactiveFloaterTransparency", mInactiveFloaterTransparency);
gSavedSettings.setF32("ActiveFloaterTransparency", mActiveFloaterTransparency);
gSavedSettings.setBOOL("SinguCompleteNameProfiles", mCompleteNameProfiles);
gSavedSettings.setBOOL("LiruScriptErrorsStealFocus", mScriptErrorsStealFocus);
gSavedSettings.setBOOL("AlchemyConnectToNeighbors", mConnectToNeighbors);
gSavedSettings.setBOOL("LiruRegionRestartMinimized", mRestartMinimized);

View File

@@ -63,7 +63,6 @@ private:
bool mAnnounceSnapshots;
bool mAnnounceStreamMetadata;
F32 mInactiveFloaterTransparency, mActiveFloaterTransparency;
bool mCompleteNameProfiles;
bool mScriptErrorsStealFocus;
bool mConnectToNeighbors;
bool mRestartMinimized;

View File

@@ -41,8 +41,9 @@ LLNameBox::LLNameBox(const std::string& name,
const LLUUID& name_id,
bool is_group,
const std::string& loading,
bool rlv_sensitive)
: LLNameUI(loading, rlv_sensitive, name_id, is_group)
bool rlv_sensitive,
const std::string& name_system)
: LLNameUI(loading, rlv_sensitive, name_id, is_group, name_system)
, LLTextBox(name, LLRect(), LLStringUtil::null, nullptr, TRUE)
{
setClickedCallback(boost::bind(&LLNameUI::showProfile, this));
@@ -99,7 +100,9 @@ LLView* LLNameBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f
node->getAttributeString("initial_value", loading);
bool rlv_sensitive = false;
node->getAttribute_bool("rlv_sensitive", rlv_sensitive);
LLNameBox* name_box = new LLNameBox("name_box", id, is_group, loading, rlv_sensitive);
std::string name_system;
node->getAttributeString("name_system", name_system);
LLNameBox* name_box = new LLNameBox("name_box", id, is_group, loading, rlv_sensitive, name_system);
name_box->initFromXML(node,parent);
return name_box;

View File

@@ -55,7 +55,8 @@ public:
const LLUUID& name_id = LLUUID::null,
bool is_group = false,
const std::string& loading = LLStringUtil::null,
bool rlv_sensitive = false);
bool rlv_sensitive = false,
const std::string& name_system = LLStringUtil::null);
};
#endif

View File

@@ -45,10 +45,11 @@ LLNameEditor::LLNameEditor(const std::string& name, const LLRect& rect,
bool is_group,
const std::string& loading,
bool rlv_sensitive,
const std::string& name_system,
bool click_for_profile,
const LLFontGL* glfont,
S32 max_text_length)
: LLNameUI(loading, rlv_sensitive, name_id, is_group)
: LLNameUI(loading, rlv_sensitive, name_id, is_group, name_system)
, LLLineEditor(name, rect, LLStringUtil::null, glfont, max_text_length)
, mClickForProfile(click_for_profile)
{
@@ -124,6 +125,7 @@ LLXMLNodePtr LLNameEditor::getXML(bool save_children) const
node->createChild("label", TRUE)->setStringValue(mInitialValue);
node->createChild("rlv_sensitive", TRUE)->setBoolValue(mRLVSensitive);
node->createChild("click_for_profile", TRUE)->setBoolValue(mClickForProfile);
node->createChild("name_system", TRUE)->setStringValue(mNameSystem);
return node;
}
@@ -145,10 +147,12 @@ LLView* LLNameEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
node->getAttribute_bool("rlv_sensitive", rlv_sensitive);
bool click_for_profile = true;
node->getAttribute_bool("click_for_profile", click_for_profile);
std::string name_system;
node->getAttributeString("name_system", name_system);
LLNameEditor* line_editor = new LLNameEditor("name_editor",
rect,
id, is_group, loading, rlv_sensitive,
id, is_group, loading, rlv_sensitive, name_system,
click_for_profile,
LLView::selectFont(node),
max_text_length);

View File

@@ -36,7 +36,7 @@
#include "lllineeditor.h"
#include "llnameui.h"
class LLNameEditor
class LLNameEditor final
: public LLLineEditor
, public LLNameUI
{
@@ -47,6 +47,7 @@ public:
bool is_group = false,
const std::string& loading = LLStringUtil::null,
bool rlv_sensitive = false,
const std::string& name_system = LLStringUtil::null,
bool click_for_profile = true,
const LLFontGL* glfont = nullptr,
S32 max_text_length = 254);

View File

@@ -46,29 +46,34 @@
// statics
std::set<LLNameUI*> LLNameUI::sInstances;
LLNameUI::LLNameUI(const std::string& loading, bool rlv_sensitive, const LLUUID& id, bool is_group)
LLNameUI::LLNameUI(const std::string& loading, bool rlv_sensitive, const LLUUID& id, bool is_group, const std::string& name_system)
: mNameID(id), mRLVSensitive(rlv_sensitive), mIsGroup(!is_group), mAllowInteract(false)
, mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData"))
, mNameSystem(name_system.empty() ? "PhoenixNameSystem" : name_system), mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData"))
{
setIsGroup(is_group);
}
void LLNameUI::setIsGroup(bool is_group)
{
// Disconnect active connections if needed
for (auto& connection : mConnections)
connection.disconnect();
if (mIsGroup != is_group)
{
if (mIsGroup = is_group)
sInstances.insert(this);
else
{
sInstances.erase(this);
mConnections[1] = gSavedSettings.getControl(mNameSystem)->getCommitSignal()->connect(boost::bind(&LLNameUI::setNameText, this));
}
}
}
void LLNameUI::setNameID(const LLUUID& name_id, bool is_group)
{
mNameID = name_id;
mConnection.disconnect();
setIsGroup(is_group);
if (mAllowInteract = mNameID.notNull())
@@ -95,9 +100,9 @@ void LLNameUI::setNameText()
{
LLAvatarName av_name;
if (got_name = LLAvatarNameCache::get(mNameID, &av_name))
name = mShowCompleteName ? av_name.getCompleteName() : av_name.getNSName();
name = mNameSystem.empty() ? av_name.getNSName() : av_name.getNSName(gSavedSettings.getS32(mNameSystem));
else
mConnection = LLAvatarNameCache::get(mNameID, boost::bind(&LLNameUI::setNameText, this));
mConnections[0] = LLAvatarNameCache::get(mNameID, boost::bind(&LLNameUI::setNameText, this));
}
if (!mIsGroup && got_name && mRLVSensitive) // Filter if needed

View File

@@ -38,13 +38,13 @@
struct LLNameUI : public LFIDBearer
{
LLNameUI(const std::string& loading = LLStringUtil::null, bool rlv_sensitive = false, const LLUUID& id = LLUUID::null, bool is_group = false);
LLNameUI(const std::string& loading = LLStringUtil::null, bool rlv_sensitive = false, const LLUUID& id = LLUUID::null, bool is_group = false, const std::string& name_system = LLStringUtil::null);
virtual ~LLNameUI()
{
if (mIsGroup)
sInstances.erase(this);
else
mConnection.disconnect();
for (auto& connection : mConnections)
connection.disconnect();
}
LLUUID getStringUUIDSelectedItem() const override final { return mNameID; }
@@ -56,7 +56,6 @@ struct LLNameUI : public LFIDBearer
void refresh(const LLUUID& id, const std::string& full_name, bool is_group);
static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group);
void setShowCompleteName(bool show) { mShowCompleteName = show; }
void showProfile();
virtual void displayAsLink(bool link) = 0; // Override to make the name display as a link
@@ -75,8 +74,7 @@ struct LLNameUI : public LFIDBearer
private:
static std::set<LLNameUI*> sInstances;
boost::signals2::connection mConnection;
bool mShowCompleteName = false;
std::array<boost::signals2::connection, 2> mConnections;
protected:
LLUUID mNameID;
@@ -84,4 +82,5 @@ protected:
bool mIsGroup;
bool mAllowInteract;
std::string mInitialValue;
std::string mNameSystem;
};

View File

@@ -1236,13 +1236,12 @@ void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status)
void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id)
{
auto dnname = getChild<LLNameEditor>("dnname");
if (avatar_id != mAvatarID)
{
if (mAvatarID.notNull())
LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarID, this);
mAvatarID = avatar_id;
dnname->setNameID(avatar_id, false);
getChild<LLNameEditor>("dnname")->setNameID(avatar_id, false);
}
if (avatar_id.isNull()) return;
@@ -1271,8 +1270,6 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id)
if (LLDropTarget* drop_target = findChild<LLDropTarget>("drop_target_rect"))
drop_target->setEntityID(mAvatarID);
dnname->setShowCompleteName(gSavedSettings.getBOOL("SinguCompleteNameProfiles"));
if (auto key_edit = getChildView("avatar_key"))
key_edit->setValue(mAvatarID.asString());

View File

@@ -11,7 +11,6 @@
<check_box label="Turn around when walking backwards" tool_tip="Certain AOs may turn you around even with this disabled." name="turn_around"/>
<check_box label="Announce when someone takes a snapshot" tool_tip="Won't announce for people who hide the fact that they are taking a snapshot." name="announce_snapshots"/>
<check_box label="Announce music stream's metadata in local chat when tuned in" tool_tip="When a new song comes on, a message will be displayed in local chat with available information about the track." name="announce_stream_metadata"/>
<check_box label="Zeige komplette Namen (Display Namen und Benutzernamen) in Profilen" tool_tip="Disregards the global name display settings, will not work if display names are switched off." name="complete_name_profiles"/>
<check_box label="Let scripts steal focus when they can't compile due to errors" name="script_errors_steal_focus"/>
</panel>
<panel label="Tags/Colors" name="TagsColors">

View File

@@ -30,7 +30,7 @@
border_thickness="1" bottom="-48" enabled="false" follows="left|top"
font="SansSerifSmall" height="16" is_unicode="false" left_delta="75"
max_length="254" mouse_opaque="false" name="dnname"
width="181" click_for_profile="false"/>
width="181" name_system="ProfileNameSystem" click_for_profile="false"/>
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-48" drop_shadow_visible="true" follows="left|top"
font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="185"

View File

@@ -85,6 +85,13 @@
<combo_item name="Display Names only" value="2">Display Names only</combo_item>
<combo_item name="Old Names (with Display Names)" value="3">Old Names (w/Display)</combo_item>
</combo_box>
<text bottom_delta="-18" left="20" follows="top" name="profile_namesystem_text_box">Profiles:</text>
<combo_box bottom_delta="-5" left_delta="140" follows="top" height="18" control_name="ProfileNameSystem" name="profile_namesystem_combobox" width="130">
<combo_item name="Old Names" value="0">Old Names</combo_item>
<combo_item name="Display Names (with Username)" value="1">Display Names (w/Username)</combo_item>
<combo_item name="Display Names only" value="2">Display Names only</combo_item>
<combo_item name="Old Names (with Display Names)" value="3">Old Names (w/Display)</combo_item>
</combo_box>
<text bottom_delta="-18" left="20" follows="top" name="radar_namesystem_text_box">Radar:</text>
<combo_box bottom_delta="-5" left_delta="140" follows="top" height="18" control_name="RadarNameSystem" name="radar_namesystem_combobox" width="130">
<combo_item name="Old Names" value="0">Old Names</combo_item>

View File

@@ -12,7 +12,6 @@
<check_box bottom_delta="-20" control_name="TurnAroundWhenWalkingBackwards" follows="top" height="16" label="Turn around when walking backwards" tool_tip="Certain AOs may turn you around even with this disabled." name="turn_around"/>
<check_box bottom_delta="-20" control_name="AnnounceSnapshots" follows="top" height="16" label="Announce when someone takes a snapshot" tool_tip="Won't announce for people who hide the fact that they are taking a snapshot." name="announce_snapshots"/>
<check_box bottom_delta="-20" control_name="AnnounceStreamMetadata" follows="top" height="16" label="Announce music stream's metadata in local chat when tuned in" tool_tip="When a new song comes on, a message will be displayed in local chat with available information about the track." name="announce_stream_metadata"/>
<check_box bottom_delta="-20" control_name="SinguCompleteNameProfiles" follows="top" height="16" label="Show complete names (display name and username) in profiles" tool_tip="Disregards the global name display settings, will not work if display names are switched off." name="complete_name_profiles"/>
<check_box bottom_delta="-20" control_name="LiruScriptErrorsStealFocus" follows="top" height="16" label="Let scripts steal focus when they can't compile due to errors" name="script_errors_steal_focus"/>
<check_box bottom_delta="-20" control_name="AlchemyConnectToNeighbors" follows="top" height="16" label="Connect to neighboring regions" name="connect_to_neighbors"/>
<check_box bottom_delta="-20" follows="top" label="Auto-minimize region restart notice" name="region_restart_minimized" control_name="LiruRegionRestartMinimized" tool_tip="Useful for sim owners and people who need to pack up before leaving"/>

View File

@@ -12,7 +12,6 @@
<check_box label="Dar la vuelta al caminar hacía atrás" tool_tip="Es posible que algunos AOs puedan darte vuelta incluso con esta opción deshabilitada." name="turn_around"/>
<check_box label="Anunciar cuando alguien toma una foto" tool_tip="No avisa si el usuario ha deshabilitado en su visor el no anunciar que está tomando fotografías." name="announce_snapshots"/>
<check_box label="Mostrar los metadatos de la música en stream en el chat local cuando es activada" tool_tip="Cuando comienza una nueva canción, se mostrará un mensaje en el chat local con la información disponible del tema." name="announce_stream_metadata"/>
<check_box label="Mostrar nombres completos (Nombres mostrados y nombres de usuario) en perfiles" tool_tip="Sin importar la configuración global del mostrado de nombres, no funcionará si los nombres mostrados están desactivados." name="complete_name_profiles"/>
<check_box label="Permitir a los scripts apropiarse del foco cuando no se puedan compilar debido a errores" name="script_errors_steal_focus"/>
<check_box label="Conectarse con regiones contiguas" name="connect_to_neighbors"/>
<check_box label="Minimizar automáticamente aviso de reinicio de región" name="region_restart_minimized" tool_tip="Útil para dueños de sim y personas que necesitan recoger sus cosas antes de salir"/>

View File

@@ -12,7 +12,6 @@
<check_box label="Pivote l'avatar quand on marche en arriere" tool_tip="Certains AO peuvent empecher la fontion." name="turn_around"/>
<check_box label="Préviens quand quelqu'un prend une photo" tool_tip="Sauf si la personne a elle même choisi le mode silencieux." name="announce_snapshots"/>
<check_box label="Annonce les titres des chansons dans le chat local" tool_tip="" name="announce_stream_metadata"/>
<check_box label="Montrer les noms complets : display + ancient names dans les profils" tool_tip="Ne fonctionnera pas si les display sont désactivés dans le menu général." name="complete_name_profiles"/>
<check_box label="Garder les scripts en premier plan quand ils ne peuvent pas être compilés suite a une erreur" name="script_errors_steal_focus"/>
<check_box label="Se connecter aux régions voisines" name="connect_to_neighbors"/>
<check_box label="Reduit automatiquement la notice de redémarrage de la sim" name="region_restart_minimized"/>