summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterland.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterland.cpp')
-rw-r--r--indra/newview/llfloaterland.cpp207
1 files changed, 95 insertions, 112 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index f0ed659f5a..b186e0c366 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -37,7 +37,7 @@
#include "llfloaterland.h"
-#include "llcachename.h"
+#include "llavatarnamecache.h"
#include "llfocusmgr.h"
#include "llnotificationsutil.h"
#include "llparcel.h"
@@ -371,7 +371,7 @@ BOOL LLPanelLandGeneral::postBuild()
{
mEditName = getChild<LLLineEditor>("Name");
mEditName->setCommitCallback(onCommitAny, this);
- childSetPrevalidate("Name", LLTextValidate::validateASCIIPrintableNoPipe);
+ getChild<LLLineEditor>("Name")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe);
mEditDesc = getChild<LLTextEditor>("Description");
mEditDesc->setCommitOnFocusLost(TRUE);
@@ -388,7 +388,7 @@ BOOL LLPanelLandGeneral::postBuild()
mLandType = getChild<LLTextBox>("LandTypeText");
mBtnProfile = getChild<LLButton>("Profile...");
- mBtnProfile->setClickedCallback(onClickProfile, this);
+ mBtnProfile->setClickedCallback(boost::bind(&LLPanelLandGeneral::onClickProfile, this));
mTextGroupLabel = getChild<LLTextBox>("Group:");
@@ -865,11 +865,9 @@ void LLPanelLandGeneral::onClickSetGroup()
}
}
-// static
-void LLPanelLandGeneral::onClickProfile(void* data)
+void LLPanelLandGeneral::onClickProfile()
{
- LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data;
- LLParcel* parcel = panelp->mParcel->getParcel();
+ LLParcel* parcel = mParcel->getParcel();
if (!parcel) return;
if (parcel->getIsGroupOwned())
@@ -920,13 +918,6 @@ void LLPanelLandGeneral::onClickScriptLimits(void* data)
}
}
-BOOL LLPanelLandGeneral::enableDeedToGroup(void* data)
-{
- LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data;
- LLParcel* parcel = panelp->mParcel->getParcel();
- return (parcel != NULL) && (parcel->getParcelFlag(PF_ALLOW_DEED_TO_GROUP));
-}
-
// static
void LLPanelLandGeneral::onClickDeed(void*)
{
@@ -1140,7 +1131,7 @@ BOOL LLPanelLandObjects::postBuild()
mCleanOtherObjectsTime->setFocusLostCallback(boost::bind(onLostFocus, _1, this));
mCleanOtherObjectsTime->setCommitCallback(onCommitClean, this);
- childSetPrevalidate("clean other time", LLTextValidate::validateNonNegativeS32);
+ getChild<LLLineEditor>("clean other time")->setPrevalidate(LLTextValidate::validateNonNegativeS32);
mBtnRefresh = getChild<LLButton>("Refresh List");
mBtnRefresh->setClickedCallback(onClickRefresh, this);
@@ -1392,10 +1383,7 @@ bool LLPanelLandObjects::callbackReturnOwnerObjects(const LLSD& notification, co
}
else
{
- std::string first, last;
- gCacheName->getName(owner_id, first, last);
- args["FIRST"] = first;
- args["LAST"] = last;
+ args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString();
LLNotificationsUtil::add("OtherObjectsReturned", args);
}
send_return_objects_message(parcel->getLocalID(), RT_OWNER);
@@ -1613,9 +1601,9 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
}
// Placeholder for name.
- std::string name;
- gCacheName->getFullName(owner_id, name);
- item_params.columns.add().value(name).font(FONT).column("name");
+ LLAvatarName av_name;
+ LLAvatarNameCache::get(owner_id, &av_name);
+ item_params.columns.add().value(av_name.getCompleteName()).font(FONT).column("name");
object_count_str = llformat("%d", object_count);
item_params.columns.add().value(object_count_str).font(FONT).column("count");
@@ -1724,9 +1712,7 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata)
}
else
{
- std::string name;
- gCacheName->getFullName(owner_id, name);
- args["NAME"] = name;
+ args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString();
LLNotificationsUtil::add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, panelp, _1, _2));
}
}
@@ -1785,10 +1771,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata)
}
else
{
- std::string name;
- gCacheName->getFullName(owner_id, name);
- args["NAME"] = name;
-
+ args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString();
LLNotificationsUtil::add("ReturnObjectsNotOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2));
}
}
@@ -2405,18 +2388,18 @@ void LLPanelLandAccess::refresh()
BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP);
BOOL public_access = !use_access_list && !use_group;
- childSetValue("public_access", public_access );
- childSetValue("GroupCheck", use_group );
+ getChild<LLUICtrl>("public_access")->setValue(public_access );
+ getChild<LLUICtrl>("GroupCheck")->setValue(use_group );
std::string group_name;
gCacheName->getGroupName(parcel->getGroupID(), group_name);
- childSetLabelArg("GroupCheck", "[GROUP]", group_name );
+ getChild<LLUICtrl>("GroupCheck")->setLabelArg("[GROUP]", group_name );
// Allow list
{
S32 count = parcel->mAccessList.size();
- childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",count));
- childSetToolTipArg("AccessList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST));
+ getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count));
+ getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST));
for (access_map_const_iterator cit = parcel->mAccessList.begin();
cit != parcel->mAccessList.end(); ++cit)
@@ -2457,8 +2440,8 @@ void LLPanelLandAccess::refresh()
{
S32 count = parcel->mBanList.size();
- childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",count));
- childSetToolTipArg("BannedList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST));
+ getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count));
+ getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST));
for (access_map_const_iterator cit = parcel->mBanList.begin();
cit != parcel->mBanList.end(); ++cit)
@@ -2517,27 +2500,27 @@ void LLPanelLandAccess::refresh()
if(parcel->getRegionDenyAnonymousOverride())
{
- childSetValue("limit_payment", TRUE);
- childSetLabelArg( "limit_payment", "[ESTATE_PAYMENT_LIMIT]", getString("access_estate_defined") );
+ getChild<LLUICtrl>("limit_payment")->setValue(TRUE);
+ getChild<LLUICtrl>("limit_payment")->setLabelArg("[ESTATE_PAYMENT_LIMIT]", getString("access_estate_defined") );
}
else
{
- childSetValue("limit_payment", (parcel->getParcelFlag(PF_DENY_ANONYMOUS)));
- childSetLabelArg( "limit_payment", "[ESTATE_PAYMENT_LIMIT]", std::string() );
+ getChild<LLUICtrl>("limit_payment")->setValue((parcel->getParcelFlag(PF_DENY_ANONYMOUS)));
+ getChild<LLUICtrl>("limit_payment")->setLabelArg("[ESTATE_PAYMENT_LIMIT]", std::string() );
}
if(parcel->getRegionDenyAgeUnverifiedOverride())
{
- childSetValue("limit_age_verified", TRUE);
- childSetLabelArg( "limit_age_verified", "[ESTATE_AGE_LIMIT]", getString("access_estate_defined") );
+ getChild<LLUICtrl>("limit_age_verified")->setValue(TRUE);
+ getChild<LLUICtrl>("limit_age_verified")->setLabelArg("[ESTATE_AGE_LIMIT]", getString("access_estate_defined") );
}
else
{
- childSetValue("limit_age_verified", (parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED)));
- childSetLabelArg( "limit_age_verified", "[ESTATE_AGE_LIMIT]", std::string() );
+ getChild<LLUICtrl>("limit_age_verified")->setValue((parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED)));
+ getChild<LLUICtrl>("limit_age_verified")->setLabelArg("[ESTATE_AGE_LIMIT]", std::string() );
}
BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST);
- childSetValue("PassCheck", use_pass );
+ getChild<LLUICtrl>("PassCheck")->setValue(use_pass );
LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo");
if (passcombo)
{
@@ -2548,40 +2531,40 @@ void LLPanelLandAccess::refresh()
}
S32 pass_price = parcel->getPassPrice();
- childSetValue( "PriceSpin", (F32)pass_price );
+ getChild<LLUICtrl>("PriceSpin")->setValue((F32)pass_price );
F32 pass_hours = parcel->getPassHours();
- childSetValue( "HoursSpin", pass_hours );
+ getChild<LLUICtrl>("HoursSpin")->setValue(pass_hours );
}
else
{
- childSetValue("public_access", FALSE);
- childSetValue("limit_payment", FALSE);
- childSetValue("limit_age_verified", FALSE);
- childSetValue("GroupCheck", FALSE);
- childSetLabelArg("GroupCheck", "[GROUP]", LLStringUtil::null );
- childSetValue("PassCheck", FALSE);
- childSetValue("PriceSpin", (F32)PARCEL_PASS_PRICE_DEFAULT);
- childSetValue( "HoursSpin", PARCEL_PASS_HOURS_DEFAULT );
- childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",0));
- childSetToolTipArg("AccessList", "[MAX]", llformat("%d",0));
- childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",0));
- childSetToolTipArg("BannedList", "[MAX]", llformat("%d",0));
+ getChild<LLUICtrl>("public_access")->setValue(FALSE);
+ getChild<LLUICtrl>("limit_payment")->setValue(FALSE);
+ getChild<LLUICtrl>("limit_age_verified")->setValue(FALSE);
+ getChild<LLUICtrl>("GroupCheck")->setValue(FALSE);
+ getChild<LLUICtrl>("GroupCheck")->setLabelArg("[GROUP]", LLStringUtil::null );
+ getChild<LLUICtrl>("PassCheck")->setValue(FALSE);
+ getChild<LLUICtrl>("PriceSpin")->setValue((F32)PARCEL_PASS_PRICE_DEFAULT);
+ getChild<LLUICtrl>("HoursSpin")->setValue(PARCEL_PASS_HOURS_DEFAULT );
+ getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0));
+ getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0));
+ getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0));
+ getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0));
}
}
void LLPanelLandAccess::refresh_ui()
{
- childSetEnabled("public_access", FALSE);
- childSetEnabled("limit_payment", FALSE);
- childSetEnabled("limit_age_verified", FALSE);
- childSetEnabled("GroupCheck", FALSE);
- childSetEnabled("PassCheck", FALSE);
- childSetEnabled("pass_combo", FALSE);
- childSetEnabled("PriceSpin", FALSE);
- childSetEnabled("HoursSpin", FALSE);
- childSetEnabled("AccessList", FALSE);
- childSetEnabled("BannedList", FALSE);
+ getChildView("public_access")->setEnabled(FALSE);
+ getChildView("limit_payment")->setEnabled(FALSE);
+ getChildView("limit_age_verified")->setEnabled(FALSE);
+ getChildView("GroupCheck")->setEnabled(FALSE);
+ getChildView("PassCheck")->setEnabled(FALSE);
+ getChildView("pass_combo")->setEnabled(FALSE);
+ getChildView("PriceSpin")->setEnabled(FALSE);
+ getChildView("HoursSpin")->setEnabled(FALSE);
+ getChildView("AccessList")->setEnabled(FALSE);
+ getChildView("BannedList")->setEnabled(FALSE);
LLParcel *parcel = mParcel->getParcel();
if (parcel)
@@ -2589,73 +2572,73 @@ void LLPanelLandAccess::refresh_ui()
BOOL can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED);
BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED);
- childSetEnabled("public_access", can_manage_allowed);
- BOOL public_access = childGetValue("public_access").asBoolean();
+ getChildView("public_access")->setEnabled(can_manage_allowed);
+ BOOL public_access = getChild<LLUICtrl>("public_access")->getValue().asBoolean();
if (public_access)
{
bool override = false;
if(parcel->getRegionDenyAnonymousOverride())
{
override = true;
- childSetEnabled("limit_payment", FALSE);
+ getChildView("limit_payment")->setEnabled(FALSE);
}
else
{
- childSetEnabled("limit_payment", can_manage_allowed);
+ getChildView("limit_payment")->setEnabled(can_manage_allowed);
}
if(parcel->getRegionDenyAgeUnverifiedOverride())
{
override = true;
- childSetEnabled("limit_age_verified", FALSE);
+ getChildView("limit_age_verified")->setEnabled(FALSE);
}
else
{
- childSetEnabled("limit_age_verified", can_manage_allowed);
+ getChildView("limit_age_verified")->setEnabled(can_manage_allowed);
}
if (override)
{
- childSetToolTip("Only Allow", getString("estate_override"));
+ getChildView("Only Allow")->setToolTip(getString("estate_override"));
}
else
{
- childSetToolTip("Only Allow", std::string());
+ getChildView("Only Allow")->setToolTip(std::string());
}
- childSetEnabled("GroupCheck", FALSE);
- childSetEnabled("PassCheck", FALSE);
- childSetEnabled("pass_combo", FALSE);
- childSetEnabled("AccessList", FALSE);
+ getChildView("GroupCheck")->setEnabled(FALSE);
+ getChildView("PassCheck")->setEnabled(FALSE);
+ getChildView("pass_combo")->setEnabled(FALSE);
+ getChildView("AccessList")->setEnabled(FALSE);
}
else
{
- childSetEnabled("limit_payment", FALSE);
- childSetEnabled("limit_age_verified", FALSE);
+ getChildView("limit_payment")->setEnabled(FALSE);
+ getChildView("limit_age_verified")->setEnabled(FALSE);
std::string group_name;
if (gCacheName->getGroupName(parcel->getGroupID(), group_name))
{
- childSetEnabled("GroupCheck", can_manage_allowed);
+ getChildView("GroupCheck")->setEnabled(can_manage_allowed);
}
- BOOL group_access = childGetValue("GroupCheck").asBoolean();
- BOOL sell_passes = childGetValue("PassCheck").asBoolean();
- childSetEnabled("PassCheck", can_manage_allowed);
+ BOOL group_access = getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean();
+ BOOL sell_passes = getChild<LLUICtrl>("PassCheck")->getValue().asBoolean();
+ getChildView("PassCheck")->setEnabled(can_manage_allowed);
if (sell_passes)
{
- childSetEnabled("pass_combo", group_access && can_manage_allowed);
- childSetEnabled("PriceSpin", can_manage_allowed);
- childSetEnabled("HoursSpin", can_manage_allowed);
+ getChildView("pass_combo")->setEnabled(group_access && can_manage_allowed);
+ getChildView("PriceSpin")->setEnabled(can_manage_allowed);
+ getChildView("HoursSpin")->setEnabled(can_manage_allowed);
}
}
- childSetEnabled("AccessList", can_manage_allowed);
+ getChildView("AccessList")->setEnabled(can_manage_allowed);
S32 allowed_list_count = parcel->mAccessList.size();
- childSetEnabled("add_allowed", can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST);
+ getChildView("add_allowed")->setEnabled(can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST);
BOOL has_selected = mListAccess->getSelectionInterface()->getFirstSelectedIndex() >= 0;
- childSetEnabled("remove_allowed", can_manage_allowed && has_selected);
+ getChildView("remove_allowed")->setEnabled(can_manage_allowed && has_selected);
- childSetEnabled("BannedList", can_manage_banned);
+ getChildView("BannedList")->setEnabled(can_manage_banned);
S32 banned_list_count = parcel->mBanList.size();
- childSetEnabled("add_banned", can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST);
+ getChildView("add_banned")->setEnabled(can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST);
has_selected = mListBanned->getSelectionInterface()->getFirstSelectedIndex() >= 0;
- childSetEnabled("remove_banned", can_manage_banned && has_selected);
+ getChildView("remove_banned")->setEnabled(can_manage_banned && has_selected);
}
}
@@ -2669,7 +2652,7 @@ void LLPanelLandAccess::refreshNames()
{
gCacheName->getGroupName(parcel->getGroupID(), group_name);
}
- childSetLabelArg("GroupCheck", "[GROUP]", group_name);
+ getChild<LLUICtrl>("GroupCheck")->setLabelArg("[GROUP]", group_name);
}
@@ -2692,13 +2675,13 @@ void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata)
}
// If we disabled public access, enable group access by default (if applicable)
- BOOL public_access = self->childGetValue("public_access").asBoolean();
+ BOOL public_access = self->getChild<LLUICtrl>("public_access")->getValue().asBoolean();
if (public_access == FALSE)
{
std::string group_name;
if (gCacheName->getGroupName(parcel->getGroupID(), group_name))
{
- self->childSetValue("GroupCheck", public_access ? FALSE : TRUE);
+ self->getChild<LLUICtrl>("GroupCheck")->setValue(public_access ? FALSE : TRUE);
}
}
@@ -2717,8 +2700,8 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
}
// Extract data from UI
- BOOL public_access = self->childGetValue("public_access").asBoolean();
- BOOL use_access_group = self->childGetValue("GroupCheck").asBoolean();
+ BOOL public_access = self->getChild<LLUICtrl>("public_access")->getValue().asBoolean();
+ BOOL use_access_group = self->getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean();
if (use_access_group)
{
std::string group_name;
@@ -2736,13 +2719,13 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
{
use_access_list = FALSE;
use_access_group = FALSE;
- limit_payment = self->childGetValue("limit_payment").asBoolean();
- limit_age_verified = self->childGetValue("limit_age_verified").asBoolean();
+ limit_payment = self->getChild<LLUICtrl>("limit_payment")->getValue().asBoolean();
+ limit_age_verified = self->getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean();
}
else
{
use_access_list = TRUE;
- use_pass_list = self->childGetValue("PassCheck").asBoolean();
+ use_pass_list = self->getChild<LLUICtrl>("PassCheck")->getValue().asBoolean();
if (use_access_group && use_pass_list)
{
LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo");
@@ -2756,8 +2739,8 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
}
}
- S32 pass_price = llfloor((F32)self->childGetValue("PriceSpin").asReal());
- F32 pass_hours = (F32)self->childGetValue("HoursSpin").asReal();
+ S32 pass_price = llfloor((F32)self->getChild<LLUICtrl>("PriceSpin")->getValue().asReal());
+ F32 pass_hours = (F32)self->getChild<LLUICtrl>("HoursSpin")->getValue().asReal();
// Push data into current parcel
parcel->setParcelFlag(PF_USE_ACCESS_GROUP, use_access_group);
@@ -2779,12 +2762,12 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
void LLPanelLandAccess::onClickAddAccess()
{
- gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1,_2)) );
+ gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1)) );
}
-void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector<std::string>& names, const uuid_vec_t& ids)
+void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids)
{
- if (!names.empty() && !ids.empty())
+ if (!ids.empty())
{
LLUUID id = ids[0];
LLParcel* parcel = mParcel->getParcel();
@@ -2823,13 +2806,13 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data)
// static
void LLPanelLandAccess::onClickAddBanned()
{
- gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1,_2)));
+ gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1)));
}
// static
-void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector<std::string>& names, const uuid_vec_t& ids)
+void LLPanelLandAccess::callbackAvatarCBBanned(const uuid_vec_t& ids)
{
- if (!names.empty() && !ids.empty())
+ if (!ids.empty())
{
LLUUID id = ids[0];
LLParcel* parcel = mParcel->getParcel();