diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index df031e4d8..fd7238631 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -622,7 +622,7 @@ void LLPanelLandGeneral::refresh() bool group_owned = parcel->getIsGroupOwned(); // Is it owned? - mTextOwner->setValue(is_public ? LLSD(LLUUID::null) : LLSD().with("id", owner_id).with("group", group_owned)); + mTextOwner->setValue(is_public ? LLSD(LLUUID::null) : LLSD().with("id", owner_id).with("type", group_owned ? LFIDBearer::GROUP : LFIDBearer::AVATAR)); mTextGroup->setValue(is_public ? LLUUID::null : group_id); if (is_public) { @@ -828,7 +828,7 @@ void LLPanelLandGeneral::refreshNames() } bool group_owned = parcel->getIsGroupOwned(); - mTextOwner->setValue(LLSD().with("id", parcel->getOwnerID()).with("group", group_owned)); + mTextOwner->setValue(LLSD().with("id", parcel->getOwnerID()).with("type", group_owned ? LFIDBearer::GROUP : LFIDBearer::AVATAR)); if (group_owned) { mTextOwner->setText(getString("group_owned_text")); diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index be90f20f5..653360b8f 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -39,17 +39,17 @@ static LLRegisterWidget r("name_box"); LLNameBox::LLNameBox(const std::string& name, const LLUUID& name_id, - bool is_group, + const Type& type, const std::string& loading, bool rlv_sensitive, const std::string& name_system) -: LLNameUI(loading, rlv_sensitive, name_id, is_group, name_system) +: LLNameUI(loading, rlv_sensitive, name_id, type, name_system) , LLTextBox(name, LLRect(), LLStringUtil::null, nullptr, TRUE) { setClickedCallback(boost::bind(&LLNameUI::showProfile, this)); if (!name_id.isNull()) { - setNameID(name_id, is_group); + setNameID(name_id, type); } else setText(mInitialValue); } @@ -104,8 +104,8 @@ LLXMLNodePtr LLNameBox::getXML(bool save_children) const // static LLView* LLNameBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { - bool is_group = false; - node->getAttribute_bool("is_group", is_group); + S8 type = AVATAR; + node->getAttributeS8("type", type); LLUUID id; node->getAttributeUUID("id", id); std::string loading; @@ -114,7 +114,7 @@ LLView* LLNameBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f node->getAttribute_bool("rlv_sensitive", 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); + LLNameBox* name_box = new LLNameBox("name_box", id, (Type)type, loading, rlv_sensitive, name_system); name_box->initFromXML(node,parent); return name_box; diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h index a6b6bcc8c..eef31745f 100644 --- a/indra/newview/llnamebox.h +++ b/indra/newview/llnamebox.h @@ -54,7 +54,7 @@ public: LLNameBox(const std::string& name, const LLUUID& name_id = LLUUID::null, - bool is_group = false, + const Type& type = AVATAR, const std::string& loading = LLStringUtil::null, bool rlv_sensitive = false, const std::string& name_system = LLStringUtil::null); diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp index 9ad95f0dd..68dd58b95 100644 --- a/indra/newview/llnameeditor.cpp +++ b/indra/newview/llnameeditor.cpp @@ -42,20 +42,20 @@ static LLRegisterWidget r("name_editor"); LLNameEditor::LLNameEditor(const std::string& name, const LLRect& rect, const LLUUID& name_id, - bool is_group, + const Type& type, 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, name_system) +: LLNameUI(loading, rlv_sensitive, name_id, type, name_system) , LLLineEditor(name, rect, LLStringUtil::null, glfont, max_text_length) , mClickForProfile(click_for_profile) { if (!name_id.isNull()) { - setNameID(name_id, is_group); + setNameID(name_id, type); } else setText(mInitialValue); } @@ -83,7 +83,7 @@ BOOL LLNameEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) } else // TODO: This is lazy, but I cannot recall a name editor that switches between group and avatar, so logic is not needed yet. { - new_menu = mIsGroup ? "menu_nameeditor_group.xml" : "menu_nameeditor_avatar.xml"; + new_menu = mType == GROUP ? "menu_nameeditor_group.xml" : "menu_nameeditor_avatar.xml"; } if (!new_menu.empty()) setContextMenu(LLUICtrlFactory::instance().buildMenu(new_menu, LLMenuGL::sMenuContainer)); setActive(); @@ -136,8 +136,8 @@ LLView* LLNameEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory S32 max_text_length = 1024; node->getAttributeS32("max_length", max_text_length); - bool is_group = false; - node->getAttribute_bool("is_group", is_group); + S8 type = AVATAR; + node->getAttributeS8("type", type); LLUUID id; node->getAttributeUUID("id", id); std::string loading; @@ -151,7 +151,7 @@ LLView* LLNameEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory LLNameEditor* line_editor = new LLNameEditor("name_editor", rect, - id, is_group, loading, rlv_sensitive, name_system, + id, (Type)type, loading, rlv_sensitive, name_system, click_for_profile, LLView::selectFont(node), max_text_length); diff --git a/indra/newview/llnameeditor.h b/indra/newview/llnameeditor.h index 65b542a7c..47fa38000 100644 --- a/indra/newview/llnameeditor.h +++ b/indra/newview/llnameeditor.h @@ -44,7 +44,7 @@ class LLNameEditor final public: LLNameEditor(const std::string& name, const LLRect& rect, const LLUUID& name_id = LLUUID::null, - bool is_group = false, + const Type& type = AVATAR, const std::string& loading = LLStringUtil::null, bool rlv_sensitive = false, const std::string& name_system = LLStringUtil::null, diff --git a/indra/newview/llnameui.cpp b/indra/newview/llnameui.cpp index e411c6e99..48494c3a5 100644 --- a/indra/newview/llnameui.cpp +++ b/indra/newview/llnameui.cpp @@ -46,35 +46,36 @@ // statics std::set LLNameUI::sInstances; -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) +LLNameUI::LLNameUI(const std::string& loading, bool rlv_sensitive, const LLUUID& id, const Type& type, const std::string& name_system) +: mNameID(id), mRLVSensitive(rlv_sensitive), mType(NONE), mAllowInteract(false) , mNameSystem(name_system.empty() ? "PhoenixNameSystem" : name_system), mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData")) { - setIsGroup(is_group); + setType(type); } -void LLNameUI::setIsGroup(bool is_group) +void LLNameUI::setType(const Type& type) { // Disconnect active connections if needed for (auto& connection : mConnections) connection.disconnect(); - if (mIsGroup != is_group) + if (mType != type) { - if (mIsGroup = is_group) + if (type == GROUP) sInstances.insert(this); else { sInstances.erase(this); mConnections[1] = gSavedSettings.getControl(mNameSystem)->getCommitSignal()->connect(boost::bind(&LLNameUI::setNameText, this)); } + mType = type; } } -void LLNameUI::setNameID(const LLUUID& name_id, bool is_group) +void LLNameUI::setNameID(const LLUUID& name_id, const Type& type) { mNameID = name_id; - setIsGroup(is_group); + setType(type); if (mAllowInteract = mNameID.notNull()) { @@ -82,7 +83,7 @@ void LLNameUI::setNameID(const LLUUID& name_id, bool is_group) } else { - setText(LLTrans::getString(mIsGroup ? "GroupNameNone" : "AvatarNameNobody")); + setText(LLTrans::getString(mType == GROUP ? "GroupNameNone" : "AvatarNameNobody")); displayAsLink(false); } } @@ -92,7 +93,7 @@ void LLNameUI::setNameText() std::string name; bool got_name = false; - if (mIsGroup) + if (mType == GROUP) { got_name = gCacheName->getGroupName(mNameID, name); } @@ -105,7 +106,7 @@ void LLNameUI::setNameText() mConnections[0] = LLAvatarNameCache::get(mNameID, boost::bind(&LLNameUI::setNameText, this)); } - if (!mIsGroup && got_name && mRLVSensitive) // Filter if needed + if (mType == AVATAR && got_name && mRLVSensitive) // Filter if needed { if ((RlvActions::hasBehaviour(RLV_BHVR_SHOWNAMES) || RlvActions::hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && mNameID != gAgentID && RlvUtil::isNearbyAgent(mNameID)) @@ -143,8 +144,10 @@ void LLNameUI::showProfile() { if (!mAllowInteract) return; - if (mIsGroup) - LLGroupActions::show(mNameID); - else - LLAvatarActions::showProfile(mNameID); + switch (LFIDBearer::getActiveType()) + { + case LFIDBearer::GROUP: LLGroupActions::show(mNameID); break; + case LFIDBearer::AVATAR: LLAvatarActions::showProfile(mNameID); break; + default: break; + } } diff --git a/indra/newview/llnameui.h b/indra/newview/llnameui.h index 146f3bf97..e71994877 100644 --- a/indra/newview/llnameui.h +++ b/indra/newview/llnameui.h @@ -38,21 +38,20 @@ struct LLNameUI : public LFIDBearer { - 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); + LLNameUI(const std::string& loading = LLStringUtil::null, bool rlv_sensitive = false, const LLUUID& id = LLUUID::null, const Type& type = AVATAR, const std::string& name_system = LLStringUtil::null); virtual ~LLNameUI() { - if (mIsGroup) - sInstances.erase(this); + if (mType == GROUP) sInstances.erase(this); for (auto& connection : mConnections) connection.disconnect(); } LLUUID getStringUUIDSelectedItem() const override final { return mNameID; } S32 getNumSelected() const override final { return 1; } - Type getSelectedType() const override final { return mIsGroup ? GROUP : AVATAR; } + Type getSelectedType() const override final { return mType; } - void setIsGroup(bool is_group); - void setNameID(const LLUUID& name_id, bool is_group); + void setType(const Type& type); + void setNameID(const LLUUID& name_id, const Type& type); void setNameText(); // Sets the name to whatever the name cache has at the moment void refresh(const LLUUID& id, const std::string& name); static void refreshAll(const LLUUID& id, const std::string& name); @@ -66,9 +65,9 @@ struct LLNameUI : public LFIDBearer virtual void setValue(const LLSD& value) { if (value.has("id")) - setNameID(value["id"].asUUID(), value["group"].asBoolean()); + setNameID(value["id"].asUUID(), (Type)value["type"].asInteger()); else - setNameID(value.asUUID(), mIsGroup); + setNameID(value.asUUID(), mType); } // Return agent UUIDs virtual LLSD getValue() const { return LLSD(mNameID); } @@ -80,7 +79,7 @@ private: protected: LLUUID mNameID; bool mRLVSensitive; // Whether or not we're doing RLV filtering - bool mIsGroup; + Type mType; bool mAllowInteract; std::string mInitialValue; std::string mNameSystem; diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 5e65862cd..f12a7d348 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -1241,7 +1241,7 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id) if (mAvatarID.notNull()) LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarID, this); mAvatarID = avatar_id; - getChild("dnname")->setNameID(avatar_id, false); + getChild("dnname")->setNameID(avatar_id, LFIDBearer::AVATAR); } if (avatar_id.isNull()) return; diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp index d9e5d4ad2..2b0043372 100644 --- a/indra/newview/llpanelmediasettingspermissions.cpp +++ b/indra/newview/llpanelmediasettingspermissions.cpp @@ -101,15 +101,15 @@ void LLPanelMediaSettingsPermissions::draw() { if(mPermsGroupName) { - mPermsGroupName->setNameID(group_id, true); + mPermsGroupName->setNameID(group_id, LFIDBearer::GROUP); } } else { if(mPermsGroupName) { - mPermsGroupName->setNameID(LLUUID::null, TRUE); - mPermsGroupName->refresh(LLUUID::null, std::string(), true); + mPermsGroupName->setNameID(LLUUID::null, LFIDBearer::GROUP); + mPermsGroupName->refresh(LLUUID::null, std::string()); } } } diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index a2818d263..3564e0b3d 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -445,7 +445,7 @@ void LLPanelPermissions::refresh() { if(mLabelGroupName) { - mLabelGroupName->setNameID(group_id, TRUE); + mLabelGroupName->setNameID(group_id, LFIDBearer::GROUP); mLabelGroupName->setEnabled(TRUE); } } @@ -453,8 +453,8 @@ void LLPanelPermissions::refresh() { if(mLabelGroupName) { - mLabelGroupName->setNameID(LLUUID::null, TRUE); - mLabelGroupName->refresh(LLUUID::null, std::string(), true); + mLabelGroupName->setNameID(LLUUID::null, LFIDBearer::GROUP); + mLabelGroupName->refresh(LLUUID::null, std::string()); mLabelGroupName->setEnabled(FALSE); } } @@ -1016,7 +1016,7 @@ void LLPanelPermissions::cbGroupID(LLUUID group_id) { if(mLabelGroupName) { - mLabelGroupName->setNameID(group_id, TRUE); + mLabelGroupName->setNameID(group_id, LFIDBearer::GROUP); } LLSelectMgr::getInstance()->sendGroup(group_id); } 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 92c563028..0b8c90b13 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 @@ -78,7 +78,7 @@ + mouse_opaque="true" name="GroupText" v_pad="0" type="1"/>