Sync LLPanelPermissions with (commented out) changes from MAINT-1239
parent
1730f9a999
commit
bde5b9d062
|
|
@ -56,14 +56,18 @@
|
|||
#include "llfloatergroups.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llavataractions.h"
|
||||
//#include "llavatariconctrl.h"
|
||||
#include "llnamebox.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llspinctrl.h"
|
||||
#include "roles_constants.h"
|
||||
#include "llgroupactions.h"
|
||||
//#include "llgroupiconctrl.h"
|
||||
#include "lltrans.h"
|
||||
#include "llinventorymodel.h"
|
||||
//#include "llavatarnamecache.h"
|
||||
//#include "llcachename.h"
|
||||
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a)
|
||||
#include "llslurl.h"
|
||||
#include "rlvactions.h"
|
||||
|
|
@ -225,10 +229,13 @@ void LLPanelPermissions::disableAll()
|
|||
getChild<LLUICtrl>("pathfinding_attributes_value")->setValue(LLStringUtil::null);
|
||||
|
||||
getChildView("Creator:")->setEnabled(FALSE);
|
||||
//getChild<LLUICtrl>("Creator Icon")->setVisible(FALSE);
|
||||
getChild<LLUICtrl>("Creator Name")->setValue(LLStringUtil::null);
|
||||
getChildView("Creator Name")->setEnabled(FALSE);
|
||||
|
||||
getChildView("Owner:")->setEnabled(FALSE);
|
||||
//getChild<LLUICtrl>("Owner Icon")->setVisible(FALSE);
|
||||
//getChild<LLUICtrl>("Owner Group Icon")->setVisible(FALSE);
|
||||
getChild<LLUICtrl>("Owner Name")->setValue(LLStringUtil::null);
|
||||
getChildView("Owner Name")->setEnabled(FALSE);
|
||||
|
||||
|
|
@ -424,13 +431,33 @@ void LLPanelPermissions::refresh()
|
|||
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
|
||||
BOOL creators_identical = FALSE;
|
||||
// [/RLVa:KB]
|
||||
std::string creator_name;
|
||||
std::string creator_app_link;
|
||||
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
|
||||
creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name);
|
||||
creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_app_link);
|
||||
// [/RLVa:KB]
|
||||
// LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name);
|
||||
// LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_app_link);
|
||||
|
||||
// getChild<LLUICtrl>("Creator Name")->setValue(creator_name);
|
||||
// // Style for creator and owner links (both group and agent)
|
||||
// LLStyle::Params style_params;
|
||||
// LLColor4 link_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
// style_params.color = link_color;
|
||||
// style_params.readonly_color = link_color;
|
||||
// style_params.is_link = true; // link will be added later
|
||||
// const LLFontGL* fontp = getChild<LLTextBox>("Creator Name")->getFont();
|
||||
// style_params.font.name = LLFontGL::nameFromFont(fontp);
|
||||
// style_params.font.size = LLFontGL::sizeFromFont(fontp);
|
||||
// style_params.font.style = "UNDERLINE";
|
||||
|
||||
// LLAvatarName av_name;
|
||||
// if (LLAvatarNameCache::get(mCreatorID, &av_name))
|
||||
// {
|
||||
// // If name isn't present, this will 'request' it and trigger refresh() again
|
||||
// LLTextBox* text_box = getChild<LLTextBox>("Creator Name");
|
||||
// style_params.link_href = creator_app_link;
|
||||
// text_box->setText(av_name.getCompleteName(), style_params);
|
||||
// }
|
||||
// getChild<LLAvatarIconCtrl>("Creator Icon")->setValue(mCreatorID);
|
||||
// getChild<LLAvatarIconCtrl>("Creator Icon")->setVisible(TRUE);
|
||||
// getChildView("Creator Name")->setEnabled(TRUE);
|
||||
// [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row
|
||||
|
||||
|
|
@ -438,31 +465,57 @@ void LLPanelPermissions::refresh()
|
|||
getChildView("Owner:")->setEnabled(TRUE);
|
||||
getChildView("Last Owner:")->setEnabled(TRUE);
|
||||
|
||||
std::string owner_name;
|
||||
const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name);
|
||||
std::string owner_app_link;
|
||||
const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_app_link);
|
||||
//KC: Always show last owner
|
||||
// if (mOwnerID.isNull())
|
||||
// {
|
||||
// if (LLSelectMgr::getInstance()->selectIsGroupOwned())
|
||||
// {
|
||||
// Group owned already displayed by selectGetOwner
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
//if (LLSelectMgr::getInstance()->selectIsGroupOwned())
|
||||
//{
|
||||
// // Group owned already displayed by selectGetOwner
|
||||
// LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mOwnerID);
|
||||
// if (group_data && group_data->isGroupPropertiesDataComplete())
|
||||
// {
|
||||
// LLTextBox* text_box = getChild<LLTextBox>("Owner Name");
|
||||
// style_params.link_href = owner_app_link;
|
||||
// text_box->setText(group_data->mName, style_params);
|
||||
// getChild<LLGroupIconCtrl>("Owner Group Icon")->setIconId(group_data->mInsigniaID);
|
||||
// getChild<LLGroupIconCtrl>("Owner Group Icon")->setVisible(TRUE);
|
||||
// getChild<LLUICtrl>("Owner Icon")->setVisible(FALSE);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Triggers refresh
|
||||
// LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mOwnerID);
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// LLUUID owner_id = mOwnerID;
|
||||
// if (owner_id.isNull())
|
||||
// {
|
||||
// Display last owner if public
|
||||
std::string last_owner_name;
|
||||
const BOOL last_owners_identical = LLSelectMgr::getInstance()->selectGetLastOwner(mLastOwnerID, last_owner_name);
|
||||
std::string last_owner_app_link;
|
||||
const BOOL last_owners_identical = LLSelectMgr::getInstance()->selectGetLastOwner(mLastOwnerID, last_owner_app_link);
|
||||
|
||||
// It should never happen that the last owner is null and the owner
|
||||
// is null, but it seems to be a bug in the simulator right now. JC
|
||||
// if (!mLastOwnerID.isNull() && !last_owner_name.empty())
|
||||
// {
|
||||
// owner_name.append(", last ");
|
||||
// owner_name.append(last_owner_name);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// getChild<LLUICtrl>("Owner Name")->setValue(owner_name);
|
||||
//if (!mLastOwnerID.isNull() && !last_owner_app_link.empty())
|
||||
//{
|
||||
// owner_app_link.append(", last ");
|
||||
// owner_app_link.append(last_owner_app_link);
|
||||
//}
|
||||
// owner_id = mLastOwnerID;
|
||||
// }
|
||||
// if (LLAvatarNameCache::get(owner_id, &av_name))
|
||||
// {
|
||||
// // If name isn't present, this will 'request' it and trigger refresh() again
|
||||
// LLTextBox* text_box = getChild<LLTextBox>("Owner Name");
|
||||
// style_params.link_href = owner_app_link;
|
||||
// text_box->setText(av_name.getCompleteName(), style_params);
|
||||
// }
|
||||
// getChild<LLAvatarIconCtrl>("Owner Icon")->setValue(owner_id);
|
||||
// getChild<LLAvatarIconCtrl>("Owner Icon")->setVisible(TRUE);
|
||||
// getChild<LLUICtrl>("Owner Group Icon")->setVisible(FALSE);
|
||||
//}
|
||||
// getChildView("Owner Name")->setEnabled(TRUE);
|
||||
// [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row
|
||||
|
||||
|
|
@ -471,25 +524,25 @@ void LLPanelPermissions::refresh()
|
|||
{
|
||||
// Only anonymize the creator if all of the selection was created by the same avie who's also the owner or they're a nearby avie
|
||||
if ( (creators_identical) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, mCreatorID)) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) )
|
||||
creator_name = LLSLURL("agent", mCreatorID, "rlvanonym").getSLURLString();
|
||||
creator_app_link = LLSLURL("agent", mCreatorID, "rlvanonym").getSLURLString();
|
||||
|
||||
// Only anonymize the owner name if all of the selection is owned by the same avie and isn't group owned
|
||||
if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, mOwnerID)) )
|
||||
owner_name = LLSLURL("agent", mOwnerID, "rlvanonym").getSLURLString();
|
||||
owner_app_link = LLSLURL("agent", mOwnerID, "rlvanonym").getSLURLString();
|
||||
|
||||
// Only anonymize the last owner name if all of the selection was last owned by the same avie
|
||||
if ( (last_owners_identical) && (mLastOwnerID != gAgent.getID()) )
|
||||
last_owner_name = LLSLURL("agent", mLastOwnerID, "rlvanonym").getSLURLString();
|
||||
last_owner_app_link = LLSLURL("agent", mLastOwnerID, "rlvanonym").getSLURLString();
|
||||
}
|
||||
|
||||
getChild<LLUICtrl>("Creator Name")->setValue(creator_name);
|
||||
getChild<LLUICtrl>("Creator Name")->setValue(creator_app_link);
|
||||
getChildView("Creator Name")->setEnabled(TRUE);
|
||||
|
||||
getChild<LLUICtrl>("Owner Name")->setValue(owner_name);
|
||||
getChild<LLUICtrl>("Owner Name")->setValue(owner_app_link);
|
||||
getChildView("Owner Name")->setEnabled(TRUE);
|
||||
// [/RLVa:KB]
|
||||
|
||||
getChild<LLUICtrl>("Last Owner Name")->setValue(last_owner_name);
|
||||
getChild<LLUICtrl>("Last Owner Name")->setValue(last_owner_app_link);
|
||||
getChildView("Last Owner Name")->setEnabled(TRUE);
|
||||
|
||||
// update group text field
|
||||
|
|
@ -501,22 +554,21 @@ void LLPanelPermissions::refresh()
|
|||
{
|
||||
getChild<LLUICtrl>("Group Name")->setValue(LLSLURL("group", group_id, "inspect").getSLURLString());
|
||||
getChild<LLUICtrl>("Group Name")->setEnabled(TRUE);
|
||||
// if (mLabelGroupName)
|
||||
// {
|
||||
// mLabelGroupName->setNameID(group_id,TRUE);
|
||||
// mLabelGroupName->setValue();
|
||||
// mLabelGroupName->setEnabled(TRUE);
|
||||
// }
|
||||
//if (mLabelGroupName)
|
||||
//{
|
||||
// mLabelGroupName->setNameID(group_id,TRUE);
|
||||
// mLabelGroupName->setEnabled(TRUE);
|
||||
//}
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// if (mLabelGroupName)
|
||||
// {
|
||||
// mLabelGroupName->setNameID(LLUUID::null, TRUE);
|
||||
// mLabelGroupName->refresh(LLUUID::null, std::string(), true);
|
||||
// mLabelGroupName->setEnabled(FALSE);
|
||||
// }
|
||||
// }
|
||||
//else
|
||||
//{
|
||||
// if (mLabelGroupName)
|
||||
// {
|
||||
// mLabelGroupName->setNameID(LLUUID::null, TRUE);
|
||||
// mLabelGroupName->refresh(LLUUID::null, std::string(), true);
|
||||
// mLabelGroupName->setEnabled(FALSE);
|
||||
// }
|
||||
//}
|
||||
|
||||
getChildView("button set group")->setEnabled(root_selected && owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue