summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorKent Quirk <q@lindenlab.com>2007-11-15 19:10:29 +0000
committerKent Quirk <q@lindenlab.com>2007-11-15 19:10:29 +0000
commit138bf17c3c51cbf3826a05887d73c49908025f95 (patch)
treed47a36708813b3f93b4049d822f966c48de4e576 /indra/newview
parentc1920e3c1c60fb792cf091750b05de618b355878 (diff)
merge of age verification changes from QAR-76 to release; changes were originally made on the age_verification_2007xxxx branches; final changes were QA'd on age_verification_20071112.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp1
-rw-r--r--indra/newview/llfloateravatartextures.cpp2
-rw-r--r--indra/newview/llfloaterland.cpp713
-rw-r--r--indra/newview/llfloaterland.h82
-rw-r--r--indra/newview/llfloaterregioninfo.cpp52
-rw-r--r--indra/newview/llfloaterregioninfo.h4
-rw-r--r--indra/newview/llpanelavatar.cpp8
-rw-r--r--indra/newview/llstatusbar.cpp2
-rw-r--r--indra/newview/lltexturectrl.cpp8
-rw-r--r--indra/newview/llviewermessage.cpp33
-rw-r--r--indra/newview/llviewermessage.h2
-rw-r--r--indra/newview/llviewerparcelmgr.cpp13
-rw-r--r--indra/newview/llweb.cpp21
-rw-r--r--indra/newview/llweb.h16
14 files changed, 456 insertions, 501 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index c763ff928c..fc8d44e990 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1137,6 +1137,7 @@ bool LLAppViewer::init()
ui_audio_callback,
&LLUI::sGLScaleFactor);
+ LLWeb::initClass(); // do this after LLUI
gUICtrlFactory->setupPaths(); // update paths with correct language set
/////////////////////////////////////////////////
diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp
index 904f47de3c..64dc96807c 100644
--- a/indra/newview/llfloateravatartextures.cpp
+++ b/indra/newview/llfloateravatartextures.cpp
@@ -110,7 +110,7 @@ static void update_texture_ctrl(LLVOAvatar* avatarp,
if (id == IMG_DEFAULT_AVATAR)
{
ctrl->setImageAssetID(LLUUID::null);
- ctrl->setToolTip("IMG_DEFAULT_AVATAR");
+ ctrl->setToolTip(LLString("IMG_DEFAULT_AVATAR"));
}
else
{
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 283b3f45fa..543dd94f3b 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -239,7 +239,6 @@ LLFloaterLand::LLFloaterLand()
factory_map["land_options_panel"] = LLCallbackMap(createPanelLandOptions, this);
factory_map["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this);
factory_map["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this);
- factory_map["land_ban_panel"] = LLCallbackMap(createPanelLandBan, this);
gUICtrlFactory->buildFloater(this, "floater_about_land.xml", &factory_map);
@@ -271,7 +270,6 @@ void LLFloaterLand::refresh()
mPanelOptions->refresh();
mPanelMedia->refresh();
mPanelAccess->refresh();
- mPanelBan->refresh();
}
@@ -326,15 +324,6 @@ void* LLFloaterLand::createPanelLandAccess(void* data)
return self->mPanelAccess;
}
-// static
-void* LLFloaterLand::createPanelLandBan(void* data)
-{
- LLFloaterLand* self = (LLFloaterLand*)data;
- self->mPanelBan = new LLPanelLandBan(self->mParcel);
- return self->mPanelBan;
-}
-
-
//---------------------------------------------------------------------------
// LLPanelLandGeneral
//---------------------------------------------------------------------------
@@ -2558,35 +2547,27 @@ LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel)
BOOL LLPanelLandAccess::postBuild()
{
-
-
- mCheckGroup = LLUICtrlFactory::getCheckBoxByName(this, "GroupCheck");
+ childSetCommitCallback("public_access", onCommitAny, this);
+ childSetCommitCallback("limit_payment", onCommitAny, this);
+ childSetCommitCallback("limit_age_verified", onCommitAny, this);
childSetCommitCallback("GroupCheck", onCommitAny, this);
-
- mCheckAccess = LLUICtrlFactory::getCheckBoxByName(this, "AccessCheck");
- childSetCommitCallback("AccessCheck", onCommitAny, this);
-
- mListAccess = LLUICtrlFactory::getNameListByName(this, "AccessList");
- mListAccess->sortByColumn(0, TRUE); // ascending
-
- mBtnAddAccess = LLUICtrlFactory::getButtonByName(this, "Add...");
-
- mBtnAddAccess->setClickedCallback(onClickAdd, this);
-
- mBtnRemoveAccess = LLUICtrlFactory::getButtonByName(this, "Remove");
-
- mBtnRemoveAccess->setClickedCallback(onClickRemove, this);
-
- mCheckPass = LLUICtrlFactory::getCheckBoxByName(this, "PassCheck");
childSetCommitCallback("PassCheck", onCommitAny, this);
-
-
- mSpinPrice = LLUICtrlFactory::getSpinnerByName(this, "PriceSpin");
+ childSetCommitCallback("pass_combo", onCommitAny, this);
childSetCommitCallback("PriceSpin", onCommitAny, this);
-
- mSpinHours = LLUICtrlFactory::getSpinnerByName(this, "HoursSpin");
childSetCommitCallback("HoursSpin", onCommitAny, this);
+ childSetAction("add_allowed", onClickAddAccess, this);
+ childSetAction("remove_allowed", onClickRemoveAccess, this);
+ childSetAction("add_banned", onClickAddBanned, this);
+ childSetAction("remove_banned", onClickRemoveBanned, this);
+
+ mListAccess = LLUICtrlFactory::getNameListByName(this, "AccessList");
+ if (mListAccess)
+ mListAccess->sortByColumn(0, TRUE); // ascending
+
+ mListBanned = LLUICtrlFactory::getNameListByName(this, "BannedList");
+ if (mListBanned)
+ mListBanned->sortByColumn(0, TRUE); // ascending
return TRUE;
}
@@ -2598,106 +2579,241 @@ LLPanelLandAccess::~LLPanelLandAccess()
void LLPanelLandAccess::refresh()
{
- mListAccess->deleteAllItems();
-
+ if (mListAccess)
+ mListAccess->deleteAllItems();
+ if (mListBanned)
+ mListBanned->deleteAllItems();
+
LLParcel *parcel = mParcel->getParcel();
-
+
+ // Display options
if (parcel)
{
- // Display options
+ BOOL use_access_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST);
BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP);
- mCheckGroup->set( use_group );
+ BOOL public_access = !use_access_list && !use_group;
+
+ childSetValue("public_access", public_access );
+ childSetValue("GroupCheck", use_group );
char group_name[MAX_STRING]; /*Flawfinder: ignore*/
gCacheName->getGroupName(parcel->getGroupID(), group_name);
- mCheckGroup->setLabelArg( "[GROUP]", LLString(group_name) );
-
- S32 count = parcel->mAccessList.size();
-
- BOOL use_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST);
- mCheckAccess->set( use_list );
- mCheckAccess->setLabelArg( "[LISTED]", llformat("%d",count));
- mCheckAccess->setLabelArg( "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST));
-
- access_map_const_iterator cit = parcel->mAccessList.begin();
- access_map_const_iterator end = parcel->mAccessList.end();
-
- for (; cit != end; ++cit)
+ childSetLabelArg("GroupCheck", "[GROUP]", LLString(group_name) );
+
+ // Allow list
{
- const LLAccessEntry& entry = (*cit).second;
- LLString suffix;
- if (entry.mTime != 0)
+ S32 count = parcel->mAccessList.size();
+ childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",count));
+ childSetToolTipArg("AccessList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST));
+
+ // *TODO: Translate
+ for (access_map_const_iterator cit = parcel->mAccessList.begin();
+ cit != parcel->mAccessList.end(); ++cit)
{
- S32 now = time(NULL);
- S32 seconds = entry.mTime - now;
- if (seconds < 0) seconds = 0;
- suffix.assign(" (");
- if (seconds >= 120)
+ const LLAccessEntry& entry = (*cit).second;
+ LLString suffix;
+ if (entry.mTime != 0)
{
- char buf[30]; /*Flawfinder: ignore*/
- snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /* Flawfinder: ignore */
- suffix.append(buf);
+ S32 now = time(NULL);
+ S32 seconds = entry.mTime - now;
+ if (seconds < 0) seconds = 0;
+ suffix.assign(" (");
+ if (seconds >= 120)
+ {
+ std::string buf = llformat("%d minutes", (seconds/60));
+ suffix.append(buf);
+ }
+ else if (seconds >= 60)
+ {
+ suffix.append("1 minute");
+ }
+ else
+ {
+ std::string buf = llformat("%d seconds", seconds);
+ suffix.append(buf);
+ }
+ suffix.append(" remaining)");
}
- else if (seconds >= 60)
- {
- suffix.append("1 minute");
- }
- else
- {
- char buf[30]; /*Flawfinder: ignore*/
- snprintf(buf, sizeof(buf), "%d seconds", seconds); /* Flawfinder: ignore */
- suffix.append(buf);
- }
- suffix.append(" remaining)");
+ if (mListAccess)
+ mListAccess->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix);
}
- mListAccess->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix);
}
- BOOL can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED);
-
- BOOL enable_add = can_manage_allowed && (count < PARCEL_MAX_ACCESS_LIST);
- mBtnAddAccess->setEnabled(enable_add);
+ // Ban List
+ {
+ S32 count = parcel->mBanList.size();
- BOOL enable_remove = can_manage_allowed && (count > 0);
- mBtnRemoveAccess->setEnabled(enable_remove);
+ childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",count));
+ childSetToolTipArg("BannedList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST));
- // Can only sell passes when limiting the access.
- BOOL can_manage_passes = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_PASSES);
- mCheckPass->setEnabled( (use_group || use_list) && can_manage_passes );
+ for (access_map_const_iterator cit = parcel->mBanList.begin();
+ cit != parcel->mBanList.end(); ++cit)
+ {
+ const LLAccessEntry& entry = (*cit).second;
+ LLString suffix;
+ if (entry.mTime != 0)
+ {
+ S32 now = time(NULL);
+ S32 seconds = entry.mTime - now;
+ if (seconds < 0) seconds = 0;
+ suffix.assign(" (");
+ if (seconds >= 120)
+ {
+ std::string buf = llformat("%d minutes", (seconds/60));
+ suffix.append(buf);
+ }
+ else if (seconds >= 60)
+ {
+ suffix.append("1 minute");
+ }
+ else
+ {
+ std::string buf = llformat("%d seconds", seconds);
+ suffix.append(buf);
+ }
+ suffix.append(" remaining)");
+ }
+ mListBanned->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix);
+ }
+ }
+ if(parcel->getRegionDenyAnonymousOverride())
+ {
+ childSetValue("limit_payment", TRUE);
+ }
+ else
+ {
+ childSetValue("limit_payment", (parcel->getParcelFlag(PF_DENY_ANONYMOUS)));
+ }
+ if(parcel->getRegionDenyAgeUnverifiedOverride())
+ {
+ childSetValue("limit_age_verified", TRUE);
+ }
+ else
+ {
+ childSetValue("limit_age_verified", (parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED)));
+ }
+
BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST);
- mCheckPass->set( use_pass );
-
- BOOL enable_pass = can_manage_passes && use_pass;
- mSpinPrice->setEnabled( enable_pass );
- mSpinHours->setEnabled( enable_pass );
-
+ childSetValue("PassCheck", use_pass );
+ LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo");
+ if (passcombo)
+ {
+ if (public_access || !use_pass || !use_group)
+ {
+ passcombo->selectByValue("anyone");
+ }
+ }
+
S32 pass_price = parcel->getPassPrice();
- mSpinPrice->set( F32(pass_price) );
+ childSetValue( "PriceSpin", (F32)pass_price );
F32 pass_hours = parcel->getPassHours();
- mSpinHours->set( pass_hours );
-
- mCheckGroup->setEnabled( can_manage_allowed );
- mCheckAccess->setEnabled( can_manage_allowed );
-
+ childSetValue( "HoursSpin", pass_hours );
}
else
{
- mCheckGroup->set(FALSE);
- mCheckGroup->setLabelArg( "[GROUP]", LLString::null );
- mCheckAccess->set(FALSE);
- mCheckAccess->setLabelArg( "[LISTED]", llformat("%d",0));
- mBtnAddAccess->setEnabled(FALSE);
- mBtnRemoveAccess->setEnabled(FALSE);
- mSpinPrice->set((F32)PARCEL_PASS_PRICE_DEFAULT);
- mSpinPrice->setEnabled(FALSE);
- mSpinHours->set( PARCEL_PASS_HOURS_DEFAULT );
- mSpinHours->setEnabled(FALSE);
- mCheckGroup->setEnabled(FALSE);
- mCheckAccess->setEnabled(FALSE);
+ childSetValue("public_access", FALSE);
+ childSetValue("limit_payment", FALSE);
+ childSetValue("limit_age_verified", FALSE);
+ childSetValue("GroupCheck", FALSE);
+ childSetLabelArg("GroupCheck", "[GROUP]", LLString::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));
+ }
+}
+
+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);
+
+ LLParcel *parcel = mParcel->getParcel();
+ if (parcel)
+ {
+ 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();
+ if (public_access)
+ {
+ bool override = false;
+ if(parcel->getRegionDenyAnonymousOverride())
+ {
+ override = true;
+ childSetEnabled("limit_payment", FALSE);
+ }
+ else
+ {
+ childSetEnabled("limit_payment", can_manage_allowed);
+ }
+ if(parcel->getRegionDenyAgeUnverifiedOverride())
+ {
+ override = true;
+ childSetEnabled("limit_age_verified", FALSE);
+ }
+ else
+ {
+ childSetEnabled("limit_age_verified", can_manage_allowed);
+ }
+ if (override)
+ {
+ childSetToolTip("Only Allow", getUIString("estate_override"));
+ }
+ else
+ {
+ childSetToolTip("Only Allow", LLString());
+ }
+ childSetEnabled("GroupCheck", FALSE);
+ childSetEnabled("PassCheck", FALSE);
+ childSetEnabled("pass_combo", FALSE);
+ childSetEnabled("AccessList", FALSE);
+ }
+ else
+ {
+ childSetEnabled("limit_payment", FALSE);
+ childSetEnabled("limit_age_verified", FALSE);
+ char group_name[MAX_STRING]; /*Flawfinder: ignore*/
+ if (gCacheName->getGroupName(parcel->getGroupID(), group_name))
+ {
+ childSetEnabled("GroupCheck", can_manage_allowed);
+ }
+ BOOL group_access = childGetValue("GroupCheck").asBoolean();
+ BOOL sell_passes = childGetValue("PassCheck").asBoolean();
+ childSetEnabled("PassCheck", can_manage_allowed);
+ if (sell_passes)
+ {
+ childSetEnabled("pass_combo", group_access && can_manage_allowed);
+ childSetEnabled("PriceSpin", can_manage_allowed);
+ childSetEnabled("HoursSpin", can_manage_allowed);
+ }
+ }
+ childSetEnabled("AccessList", can_manage_allowed);
+ S32 allowed_list_count = parcel->mAccessList.size();
+ childSetEnabled("add_allowed", can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST);
+ childSetEnabled("remove_allowed", can_manage_allowed && allowed_list_count > 0);
+
+ childSetEnabled("BannedList", can_manage_banned);
+ S32 banned_list_count = parcel->mBanList.size();
+ childSetEnabled("add_banned", can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST);
+ childSetEnabled("remove_banned", can_manage_banned && banned_list_count > 0);
}
}
+
// public
void LLPanelLandAccess::refreshNames()
@@ -2709,23 +2825,19 @@ void LLPanelLandAccess::refreshNames()
{
gCacheName->getGroupName(parcel->getGroupID(), group_name);
}
- mCheckGroup->setLabelArg("[GROUP]", LLString(group_name));
+ childSetLabelArg("GroupCheck", "[GROUP]", LLString(group_name));
}
// virtual
void LLPanelLandAccess::draw()
{
+ refresh_ui();
refreshNames();
LLPanel::draw();
}
-void LLPanelLandAccess::onAccessLevelChange(LLUICtrl*, void *userdata)
-{
- LLPanelLandAccess::onCommitAny(NULL, userdata);
-}
-
// static
void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
{
@@ -2738,27 +2850,53 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
}
// Extract data from UI
- BOOL use_access_group = self->mCheckGroup->get();
- BOOL use_access_list = self->mCheckAccess->get();
- BOOL use_pass_list = self->mCheckPass->get();
-
-
-
- // Must be limiting access to sell passes
- if (!use_access_group && !use_access_list)
+ BOOL public_access = self->childGetValue("public_access").asBoolean();
+ BOOL limit_payment = FALSE, limit_age_verified = FALSE;
+ BOOL use_access_group = FALSE;
+ BOOL use_access_list = FALSE;
+ BOOL use_pass_list = FALSE;
+ if (public_access)
{
- use_pass_list = FALSE;
+ use_access_list = FALSE;
+ limit_payment = self->childGetValue("limit_payment").asBoolean();
+ limit_age_verified = self->childGetValue("limit_age_verified").asBoolean();
+ }
+ else
+ {
+ use_access_list = TRUE;
+ use_access_group = self->childGetValue("GroupCheck").asBoolean();
+ use_pass_list = self->childGetValue("PassCheck").asBoolean();
+ if (use_access_group)
+ {
+ char group_name[MAX_STRING]; /*Flawfinder: ignore*/
+ if (!gCacheName->getGroupName(parcel->getGroupID(), group_name))
+ {
+ use_access_group = FALSE;
+ }
+ if (use_pass_list)
+ {
+ LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo");
+ if (passcombo)
+ {
+ if (passcombo->getSimpleSelectedValue().asString() == "group")
+ {
+ use_access_list = FALSE;
+ }
+ }
+ }
+ }
}
- S32 pass_price = llfloor(self->mSpinPrice->get());
- F32 pass_hours = self->mSpinHours->get();
-
- // Validate extracted data
+ S32 pass_price = llfloor((F32)self->childGetValue("PriceSpin").asReal());
+ F32 pass_hours = (F32)self->childGetValue("HoursSpin").asReal();
// Push data into current parcel
parcel->setParcelFlag(PF_USE_ACCESS_GROUP, use_access_group);
parcel->setParcelFlag(PF_USE_ACCESS_LIST, use_access_list);
parcel->setParcelFlag(PF_USE_PASS_LIST, use_pass_list);
+ parcel->setParcelFlag(PF_USE_BAN_LIST, TRUE);
+ parcel->setParcelFlag(PF_DENY_ANONYMOUS, limit_payment);
+ parcel->setParcelFlag(PF_DENY_AGEUNVERIFIED, limit_age_verified);
parcel->setPassPrice( pass_price );
parcel->setPassHours( pass_hours );
@@ -2771,287 +2909,100 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
}
// static
-void LLPanelLandAccess::onClickAdd(void* data)
+void LLPanelLandAccess::onClickAddAccess(void* data)
{
LLPanelLandAccess* panelp = (LLPanelLandAccess*)data;
- gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, data) );
-}
-
-// static
-void LLPanelLandAccess::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
-{
- LLPanelLandAccess* self = (LLPanelLandAccess*)userdata;
- if (names.empty() || ids.empty()) return;
- self->addAvatar(ids[0]);
-}
-
-
-void LLPanelLandAccess::addAvatar(LLUUID id)
-{
- LLParcel* parcel = mParcel->getParcel();
- if (!parcel) return;
-
- parcel->addToAccessList(id, 0);
-
- gParcelMgr->sendParcelAccessListUpdate(AL_ACCESS);
-
- refresh();
+ if (panelp)
+ {
+ gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarCBAccess, data) );
+ }
}
-
// static
-void LLPanelLandAccess::onClickRemove(void* data)
+void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
{
- LLPanelLandAccess* self = (LLPanelLandAccess*)data;
- if (!self) return;
-
- LLScrollListItem* item = self->mListAccess->getFirstSelected();
- if (!item) return;
-
- LLParcel* parcel = self->mParcel->getParcel();
- if (!parcel) return;
-
- const LLUUID& agent_id = item->getUUID();
-
- parcel->removeFromAccessList(agent_id);
-
- gParcelMgr->sendParcelAccessListUpdate(AL_ACCESS);
-
- self->refresh();
-}
-
-
-
-//---------------------------------------------------------------------------
-// LLPanelLandBan
-//---------------------------------------------------------------------------
-LLPanelLandBan::LLPanelLandBan(LLParcelSelectionHandle& parcel)
-: LLPanel("land_ban_panel"), mParcel(parcel)
-{
-
-}
-
-
-
-BOOL LLPanelLandBan::postBuild()
-{
-
- mCheck = LLUICtrlFactory::getCheckBoxByName(this, "LandBanCheck");
- childSetCommitCallback("LandBanCheck", onCommitAny, this);
-
- mList = LLUICtrlFactory::getNameListByName(this, "LandBanList");
- mList->sortByColumn(0, TRUE); // ascending
-
- mBtnAdd = LLUICtrlFactory::getButtonByName(this, "Add...");
-
- mBtnAdd->setClickedCallback(onClickAdd, this);
-
- mBtnRemove = LLUICtrlFactory::getButtonByName(this, "Remove");
-
- mBtnRemove->setClickedCallback(onClickRemove, this);
-
- mCheckDenyAnonymous = LLUICtrlFactory::getCheckBoxByName(this, "DenyAnonymousCheck");
- childSetCommitCallback("DenyAnonymousCheck", onCommitAny, this);
-
- mCheckDenyIdentified = LLUICtrlFactory::getCheckBoxByName(this, "DenyIdentifiedCheck");
- childSetCommitCallback("DenyIdentifiedCheck", onCommitAny, this);
-
- mCheckDenyTransacted = LLUICtrlFactory::getCheckBoxByName(this, "DenyTransactedCheck");
- childSetCommitCallback("DenyTransactedCheck", onCommitAny, this);
-
- return TRUE;
-
-}
-
-
-LLPanelLandBan::~LLPanelLandBan()
-{ }
-
-void LLPanelLandBan::refresh()
-{
- mList->deleteAllItems();
-
- LLParcel *parcel = mParcel->getParcel();
-
- if (parcel)
+ LLPanelLandAccess* panelp = (LLPanelLandAccess*)userdata;
+ if (!names.empty() && !ids.empty())
{
- // Display options
-
- S32 count = parcel->mBanList.size();
-
- BOOL use_ban = parcel->getParcelFlag(PF_USE_BAN_LIST);
- mCheck->set( use_ban );
- mCheck->setLabelArg( "[LISTED]", llformat("%d",count));
- mCheck->setLabelArg( "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST));
-
- access_map_const_iterator cit = parcel->mBanList.begin();
- access_map_const_iterator end = parcel->mBanList.end();
- for ( ; cit != end; ++cit)
- {
- const LLAccessEntry& entry = (*cit).second;
- LLString suffix;
- if (entry.mTime != 0)
- {
- S32 now = time(NULL);
- S32 seconds = entry.mTime - now;
- if (seconds < 0) seconds = 0;
- suffix.assign(" (");
- if (seconds >= 120)
- {
- char buf[30]; /*Flawfinder: ignore*/
- snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /* Flawfinder: ignore */
- suffix.append(buf);
- }
- else if (seconds >= 60)
- {
- suffix.append("1 minute");
- }
- else
- {
- char buf[30]; /*Flawfinder: ignore*/
- snprintf(buf, sizeof(buf), "%d seconds", seconds); /* Flawfinder: ignore */
- suffix.append(buf);
- }
- suffix.append(" remaining)");
- }
- mList->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix);
- }
-
- BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED);
- mCheck->setEnabled( can_manage_banned );
- mCheckDenyAnonymous->setEnabled( FALSE );
- mCheckDenyIdentified->setEnabled( FALSE );
- mCheckDenyTransacted->setEnabled( FALSE );
-
- if(parcel->getRegionDenyAnonymousOverride())
- {
- mCheckDenyAnonymous->set(TRUE);
- }
- else if(can_manage_banned)
- {
- mCheckDenyAnonymous->setEnabled(TRUE);
- mCheckDenyAnonymous->set(parcel->getParcelFlag(PF_DENY_ANONYMOUS));
- }
- if(parcel->getRegionDenyIdentifiedOverride())
- {
- mCheckDenyIdentified->set(TRUE);
- }
- else if(can_manage_banned)
- {
- mCheckDenyIdentified->setEnabled(TRUE);
- mCheckDenyIdentified->set(parcel->getParcelFlag(PF_DENY_IDENTIFIED));
- }
- if(parcel->getRegionDenyTransactedOverride())
- {
- mCheckDenyTransacted->set(TRUE);
- }
- else if(can_manage_banned)
+ LLUUID id = ids[0];
+ LLParcel* parcel = panelp->mParcel->getParcel();
+ if (parcel)
{
- mCheckDenyTransacted->setEnabled(TRUE);
- mCheckDenyTransacted->set(parcel->getParcelFlag(PF_DENY_TRANSACTED));
+ parcel->addToAccessList(id, 0);
+ gParcelMgr->sendParcelAccessListUpdate(AL_ACCESS);
+ panelp->refresh();
}
-
-
- BOOL enable_add = can_manage_banned && (count < PARCEL_MAX_ACCESS_LIST);
- mBtnAdd->setEnabled(enable_add);
-
- BOOL enable_remove = can_manage_banned && (count > 0);
- mBtnRemove->setEnabled(enable_remove);
- }
- else
- {
- mCheck->set(FALSE);
- mCheck->setLabelArg( "[LISTED]", llformat("%d",0));
- mCheck->setEnabled(FALSE);
- mBtnAdd->setEnabled(FALSE);
- mBtnRemove->setEnabled(FALSE);
- mCheckDenyAnonymous->set(FALSE);
- mCheckDenyAnonymous->setEnabled(FALSE);
- mCheckDenyIdentified->set(FALSE);
- mCheckDenyIdentified->setEnabled(FALSE);
- mCheckDenyTransacted->set(FALSE);
- mCheckDenyTransacted->setEnabled(FALSE);
}
}
// static
-void LLPanelLandBan::onCommitAny(LLUICtrl *ctrl, void *userdata)
+void LLPanelLandAccess::onClickRemoveAccess(void* data)
{
- LLPanelLandBan *self = (LLPanelLandBan*)userdata;
-
- LLParcel* parcel = self->mParcel->getParcel();
- if (!parcel)
+ LLPanelLandAccess* panelp = (LLPanelLandAccess*)data;
+ if (panelp && panelp->mListAccess)
{
- return;
+ LLParcel* parcel = panelp->mParcel->getParcel();
+ if (parcel)
+ {
+ std::vector<LLScrollListItem*> names = panelp->mListAccess->getAllSelected();
+ for (std::vector<LLScrollListItem*>::iterator iter = names.begin();
+ iter != names.end(); )
+ {
+ LLScrollListItem* item = *iter++;
+ const LLUUID& agent_id = item->getUUID();
+ parcel->removeFromAccessList(agent_id);
+ }
+ gParcelMgr->sendParcelAccessListUpdate(AL_ACCESS);
+ panelp->refresh();
+ }
}
-
- // Extract data from UI
- BOOL use_ban_list = self->mCheck->get();
- BOOL deny_access_anonymous = self->mCheckDenyAnonymous->get();
- BOOL deny_access_identified = self->mCheckDenyIdentified->get();
- BOOL deny_access_transacted = self->mCheckDenyTransacted->get();
-
- // Push data into current parcel
- parcel->setParcelFlag(PF_USE_BAN_LIST, use_ban_list);
- parcel->setParcelFlag(PF_DENY_ANONYMOUS, deny_access_anonymous);
- parcel->setParcelFlag(PF_DENY_IDENTIFIED, deny_access_identified);
- parcel->setParcelFlag(PF_DENY_TRANSACTED, deny_access_transacted);
-
- // Send current parcel data upstream to server
- gParcelMgr->sendParcelPropertiesUpdate( parcel );
-
- // Might have changed properties, so let's redraw!
- self->refresh();
}
// static
-void LLPanelLandBan::onClickAdd(void* data)
+void LLPanelLandAccess::onClickAddBanned(void* data)
{
- LLPanelLandBan* panelp = (LLPanelLandBan*)data;
- gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, data) );
+ LLPanelLandAccess* panelp = (LLPanelLandAccess*)data;
+ gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarCBBanned, data) );
}
// static
-void LLPanelLandBan::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
+void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
{
- LLPanelLandBan* self = (LLPanelLandBan*)userdata;
- if (names.empty() || ids.empty()) return;
- self->addAvatar(ids[0]);
-}
-
-
-void LLPanelLandBan::addAvatar(LLUUID id)
-{
- LLParcel* parcel = mParcel->getParcel();
- if (!parcel) return;
-
- parcel->addToBanList(id, 0);
-
- gParcelMgr->sendParcelAccessListUpdate(AL_BAN);
-
- refresh();
+ LLPanelLandAccess* panelp = (LLPanelLandAccess*)userdata;
+ if (!names.empty() && !ids.empty())
+ {
+ LLUUID id = ids[0];
+ LLParcel* parcel = panelp->mParcel->getParcel();
+ if (parcel)
+ {
+ parcel->addToBanList(id, 0);
+ gParcelMgr->sendParcelAccessListUpdate(AL_BAN);
+ panelp->refresh();
+ }
+ }
}
-
// static
-void LLPanelLandBan::onClickRemove(void* data)
+void LLPanelLandAccess::onClickRemoveBanned(void* data)
{
- LLPanelLandBan* self = (LLPanelLandBan*)data;
- if (!self) return;
-
- LLScrollListItem* item = self->mList->getFirstSelected();
- if (!item) return;
-
- LLParcel* parcel = self->mParcel->getParcel();
- if (!parcel) return;
-
- const LLUUID& agent_id = item->getUUID();
-
- parcel->removeFromBanList(agent_id);
-
- gParcelMgr->sendParcelAccessListUpdate(AL_BAN);
-
- self->refresh();
+ LLPanelLandAccess* panelp = (LLPanelLandAccess*)data;
+ if (panelp && panelp->mListBanned)
+ {
+ LLParcel* parcel = panelp->mParcel->getParcel();
+ if (parcel)
+ {
+ std::vector<LLScrollListItem*> names = panelp->mListBanned->getAllSelected();
+ for (std::vector<LLScrollListItem*>::iterator iter = names.begin();
+ iter != names.end(); )
+ {
+ LLScrollListItem* item = *iter++;
+ const LLUUID& agent_id = item->getUUID();
+ parcel->removeFromBanList(agent_id);
+ }
+ gParcelMgr->sendParcelAccessListUpdate(AL_BAN);
+ panelp->refresh();
+ }
+ }
}
//---------------------------------------------------------------------------
diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h
index d8b7ecfe88..9be813f8fd 100644
--- a/indra/newview/llfloaterland.h
+++ b/indra/newview/llfloaterland.h
@@ -112,7 +112,6 @@ protected:
LLPanelLandOptions* mPanelOptions;
LLPanelLandMedia* mPanelMedia;
LLPanelLandAccess* mPanelAccess;
- LLPanelLandBan* mPanelBan;
LLPanelLandCovenant* mPanelCovenant;
LLHandle<LLParcelSelection> mParcel;
@@ -392,93 +391,28 @@ public:
LLPanelLandAccess(LLHandle<LLParcelSelection>& parcelp);
virtual ~LLPanelLandAccess();
void refresh();
+ void refresh_ui();
void refreshNames();
virtual void draw();
- void addAvatar(LLUUID id);
-
static void onCommitAny(LLUICtrl* ctrl, void *userdata);
- static void onClickAdd(void*);
- static void onClickRemove(void*);
- static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
- static void onAccessLevelChange(LLUICtrl* ctrl, void* userdata);
+ static void onClickAddAccess(void*);
+ static void callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
+ static void onClickRemoveAccess(void*);
+ static void onClickAddBanned(void*);
+ static void callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
+ static void onClickRemoveBanned(void*);
virtual BOOL postBuild();
protected:
- LLTextBox* mLabelTitle;
-
- LLCheckBoxCtrl* mCheckGroup;
-
- LLCheckBoxCtrl* mCheckAccess;
LLNameListCtrl* mListAccess;
- LLButton* mBtnAddAccess;
- LLButton* mBtnRemoveAccess;
-
- LLCheckBoxCtrl* mCheckPass;
- LLSpinCtrl* mSpinPrice;
- LLSpinCtrl* mSpinHours;
-
- LLCheckBoxCtrl* mCheckIdentified;
- LLCheckBoxCtrl* mCheckTransacted;
- LLRadioGroup* mCheckStatusLevel;
+ LLNameListCtrl* mListBanned;
LLHandle<LLParcelSelection>& mParcel;
};
-class LLPanelLandBan
-: public LLPanel
-{
-public:
- LLPanelLandBan(LLHandle<LLParcelSelection>& parcelp);
- virtual ~LLPanelLandBan();
- void refresh();
-
- void addAvatar(LLUUID id);
-
- static void onCommitAny(LLUICtrl* ctrl, void *userdata);
- static void onClickAdd(void*);
- static void onClickRemove(void*);
- static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
-
- virtual BOOL postBuild();
-
-protected:
- LLTextBox* mLabelTitle;
-
- LLCheckBoxCtrl* mCheck;
- LLNameListCtrl* mList;
- LLButton* mBtnAdd;
- LLButton* mBtnRemove;
- LLCheckBoxCtrl* mCheckDenyAnonymous;
- LLCheckBoxCtrl* mCheckDenyIdentified;
- LLCheckBoxCtrl* mCheckDenyTransacted;
-
- LLHandle<LLParcelSelection>& mParcel;
-};
-
-
-class LLPanelLandRenters
-: public LLPanel
-{
-public:
- LLPanelLandRenters(LLHandle<LLParcelSelection>& parcelp);
- virtual ~LLPanelLandRenters();
- void refresh();
-
- static void onClickAdd(void*);
- static void onClickRemove(void*);
-
-protected:
- LLCheckBoxCtrl* mCheckRenters;
- LLNameListCtrl* mListRenters;
- LLButton* mBtnAddRenter;
- LLButton* mBtnRemoveRenter;
-
- LLHandle<LLParcelSelection>& mParcel;
-};
-
class LLPanelLandCovenant
: public LLPanel
{
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 20f3192939..3306142856 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -408,6 +408,15 @@ void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region)
region));
}
+// public
+void LLFloaterRegionInfo::refresh()
+{
+ for(info_panels_t::iterator iter = mInfoPanels.begin();
+ iter != mInfoPanels.end(); ++iter)
+ {
+ (*iter)->refresh();
+ }
+}
///----------------------------------------------------------------------------
@@ -447,6 +456,7 @@ void LLPanelRegionInfo::onChangeAnything(LLUICtrl* ctrl, void* user_data)
if(panel)
{
panel->enableButton("apply_btn");
+ panel->refresh();
}
}
@@ -455,6 +465,7 @@ BOOL LLPanelRegionInfo::postBuild()
{
childSetAction("apply_btn", onBtnSet, this);
childDisable("apply_btn");
+ refresh();
return TRUE;
}
@@ -716,6 +727,8 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
body["allow_land_resell"] = childGetValue("allow_land_resell_check");
body["agent_limit"] = childGetValue("agent_limit_spin");
body["prim_bonus"] = childGetValue("object_bonus_spin");
+ // the combo box stores strings "Mature" and "PG", but we have to convert back to a number,
+ // because the sim doesn't know from strings for this stuff
body["sim_access"] = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str());
body["restrict_pushobject"] = childGetValue("restrict_pushobject");
body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check");
@@ -1907,6 +1920,7 @@ bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region)
BOOL owner = (region && (region->getOwner() == gAgent.getID()));
BOOL manager = (region && region->isEstateManager());
setCtrlsEnabled(god || owner || manager);
+
childDisable("apply_btn");
childSetEnabled("add_allowed_avatar_btn", god || owner || manager);
childSetEnabled("remove_allowed_avatar_btn", god || owner || manager);
@@ -1942,8 +1956,7 @@ bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region)
sendEstateOwnerMessage(gMessageSystem, "getinfo", invoice, strings);
-
-
+ refresh();
return rv;
}
@@ -1974,9 +1987,8 @@ BOOL LLPanelEstateInfo::postBuild()
initCtrl("use_global_time_check");
initCtrl("fixed_sun_check");
initCtrl("allow_direct_teleport");
- initCtrl("deny_anonymous");
- initCtrl("deny_identified");
- initCtrl("deny_transacted");
+ initCtrl("limit_payment");
+ initCtrl("limit_age_verified");
initCtrl("voice_chat_check");
initHelpBtn("estate_manager_help", "HelpEstateEstateManager");
@@ -2043,6 +2055,19 @@ BOOL LLPanelEstateInfo::postBuild()
return LLPanelRegionInfo::postBuild();
}
+void LLPanelEstateInfo::refresh()
+{
+ bool public_access = childGetValue("externally_visible_check").asBoolean();
+ childSetEnabled("Only Allow", public_access);
+ childSetEnabled("limit_payment", public_access);
+ childSetEnabled("limit_age_verified", public_access);
+ // if this is set to false, then the limit fields are meaningless and should be turned off
+ if (public_access == false)
+ {
+ childSetValue("limit_payment", false);
+ childSetValue("limit_age_verified", false);
+ }
+}
BOOL LLPanelEstateInfo::sendUpdate()
{
@@ -2157,10 +2182,11 @@ void LLPanelEstateInfo::setEstateFlags(U32 flags)
"voice_chat_check",
LLSD(flags & REGION_FLAGS_ALLOW_VOICE ? TRUE : FALSE));
childSetValue("allow_direct_teleport", LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) );
- childSetValue("deny_anonymous", LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) );
- childSetValue("deny_identified", LLSD(flags & REGION_FLAGS_DENY_IDENTIFIED ? TRUE : FALSE) );
- childSetValue("deny_transacted", LLSD(flags & REGION_FLAGS_DENY_TRANSACTED ? TRUE : FALSE) );
+ childSetValue("limit_payment", LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) );
+ childSetValue("limit_age_verified", LLSD(flags & REGION_FLAGS_DENY_AGEUNVERIFIED ? TRUE : FALSE) );
childSetVisible("abuse_email_text", flags & REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER);
+
+ refresh();
}
U32 LLPanelEstateInfo::computeEstateFlags()
@@ -2187,20 +2213,16 @@ U32 LLPanelEstateInfo::computeEstateFlags()
flags |= REGION_FLAGS_SUN_FIXED;
}
- if (childGetValue("deny_anonymous").asBoolean())
+ if (childGetValue("limit_payment").asBoolean())
{
flags |= REGION_FLAGS_DENY_ANONYMOUS;
}
- if (childGetValue("deny_identified").asBoolean())
+ if (childGetValue("limit_age_verified").asBoolean())
{
- flags |= REGION_FLAGS_DENY_IDENTIFIED;
+ flags |= REGION_FLAGS_DENY_AGEUNVERIFIED;
}
- if (childGetValue("deny_transacted").asBoolean())
- {
- flags |= REGION_FLAGS_DENY_TRANSACTED;
- }
return flags;
}
diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h
index 656583b276..abf4789b6d 100644
--- a/indra/newview/llfloaterregioninfo.h
+++ b/indra/newview/llfloaterregioninfo.h
@@ -79,6 +79,9 @@ public:
static LLPanelEstateInfo* getPanelEstate();
static LLPanelEstateCovenant* getPanelCovenant();
+ // from LLPanel
+ virtual void refresh();
+
protected:
LLFloaterRegionInfo(const LLRect& rect);
void refreshFromRegion(LLViewerRegion* region);
@@ -294,6 +297,7 @@ public:
// LLPanel
virtual BOOL postBuild();
virtual void updateChild(LLUICtrl* child_ctrl);
+ virtual void refresh();
U32 computeEstateFlags();
void setEstateFlags(U32 flags);
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 706e05328c..5b43497f03 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -1788,6 +1788,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
//BOOL mature = FALSE;
BOOL identified = FALSE;
BOOL transacted = FALSE;
+ BOOL age_verified = FALSE;
BOOL online = FALSE;
char profile_url[DB_USER_PROFILE_URL_BUF_SIZE]; /*Flawfinder: ignore*/
@@ -1825,6 +1826,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
identified = (flags & AVATAR_IDENTIFIED);
transacted = (flags & AVATAR_TRANSACTED);
+ age_verified = (flags & AVATAR_AGEVERIFIED);
allow_publish = (flags & AVATAR_ALLOW_PUBLISH);
online = (flags & AVATAR_ONLINE);
@@ -1874,6 +1876,12 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
payment_text = "NoPaymentInfoOnFile";
}
args["[PAYMENTINFO]"] = self->mPanelSecondLife->childGetValue(payment_text).asString();
+ LLString age_text = "NotAgeVerified";
+ if(age_verified)
+ {
+ age_text = "AgeVerified";
+ }
+ args["[PAYMENTINFO]"] += self->mPanelSecondLife->childGetValue(age_text).asString();
}
else
{
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 27081d15dc..856943da6e 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -256,7 +256,7 @@ void LLStatusBar::refresh()
<< std::setfill('0') << std::setw(2) << internal_time->tm_mday << " "
<< sMonths[internal_time->tm_mon] << " "
<< internal_time->tm_year + 1900;
- mTextTime->setToolTip(date.str().c_str());
+ mTextTime->setToolTip(date.str());
LLRect r;
const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge();
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index b961053799..706587abb0 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -1037,19 +1037,21 @@ void LLTextureCtrl::setVisible( BOOL visible )
void LLTextureCtrl::setEnabled( BOOL enabled )
{
+ LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)LLFloater::getFloaterByHandle(mFloaterHandle);
if( enabled )
{
- setToolTip( "Click to choose a picture" );
+ LLString tooltip;
+ if (floaterp) tooltip = floaterp->getUIString("choose_picture");
+ setToolTip( tooltip );
}
else
{
- setToolTip( "" );
+ setToolTip( LLString() );
// *TODO: would be better to keep floater open and show
// disabled state.
closeFloater();
}
- LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)LLFloater::getFloaterByHandle(mFloaterHandle);
if( floaterp )
{
floaterp->setActive(enabled);
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index ce3a3f1ae9..2fdc040684 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -4064,18 +4064,18 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data)
process_alert_core(buffer, modal);
}
-void process_alert_core(const char* buffer, BOOL modal)
+void process_alert_core(const std::string& message, BOOL modal)
{
// make sure the cursor is back to the usual default since the
// alert is probably due to some kind of error.
gViewerWindow->getWindow()->resetBusyCount();
- // HACK -- handle callbacks for specific alerts
- if( !strcmp( buffer, "You died and have been teleported to your home location" ) )
+ // HACK -- handle callbacks for specific alerts
+ if ( message == "You died and have been teleported to your home location")
{
gViewerStats->incStat(LLViewerStats::ST_KILLED_COUNT);
}
- else if( !strcmp( buffer, "Home position set." ) )
+ else if( message == "Home position set." )
{
// save the home location image to disk
LLString snap_filename = gDirUtilp->getLindenUserDir();
@@ -4084,19 +4084,26 @@ void process_alert_core(const char* buffer, BOOL modal)
gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, FALSE);
}
- const char ALERT_PREFIX[] = "ALERT: ";
- const size_t ALERT_PREFIX_LEN = sizeof(ALERT_PREFIX) - 1;
- if (!strncmp(buffer, ALERT_PREFIX, ALERT_PREFIX_LEN))
+ const std::string ALERT_PREFIX("ALERT: ");
+ const std::string NOTIFY_PREFIX("NOTIFY: ");
+ if (message.find(ALERT_PREFIX) == 0)
{
// Allow the server to spawn a named alert so that server alerts can be
- // translated out of English. JC
- std::string alert_name(buffer + ALERT_PREFIX_LEN);
+ // translated out of English.
+ std::string alert_name(message.substr(ALERT_PREFIX.length()));
LLAlertDialog::showXml(alert_name);
}
- else if (buffer[0] == '/')
+ else if (message.find(NOTIFY_PREFIX) == 0)
+ {
+ // Allow the server to spawn a named notification so that server notifications can be
+ // translated out of English.
+ std::string notify_name(message.substr(NOTIFY_PREFIX.length()));
+ LLNotifyBox::showXml(notify_name);
+ }
+ else if (message[0] == '/')
{
// System message is important, show in upper-right box not tip
- LLString text(buffer+1);
+ LLString text(message.substr(1));
LLString::format_map_t args;
if (text.substr(0,17) == "RESTART_X_MINUTES")
{
@@ -4123,14 +4130,14 @@ void process_alert_core(const char* buffer, BOOL modal)
{
// *TODO:translate
LLString::format_map_t args;
- args["[ERROR_MESSAGE]"] = buffer;
+ args["[ERROR_MESSAGE]"] = message;
gViewerWindow->alertXml("ErrorMessage", args);
}
else
{
// *TODO:translate
LLString::format_map_t args;
- args["[MESSAGE]"] = buffer;
+ args["[MESSAGE]"] = message;
LLNotifyBox::showXml("SystemMessageTip", args);
}
}
diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h
index 2cbd16377d..2c5005c167 100644
--- a/indra/newview/llviewermessage.h
+++ b/indra/newview/llviewermessage.h
@@ -110,7 +110,7 @@ void process_adjust_balance(LLMessageSystem* msg_system, void**);
void process_alert_message(LLMessageSystem* msg, void**);
void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data);
-void process_alert_core(const char* buffer, BOOL modal);
+void process_alert_core(const std::string& message, BOOL modal);
// "Mean" or player-vs-player abuse
void handle_show_mean_events(void *);
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index d5fc9fa381..f0d6fd11c3 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1398,8 +1398,9 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
F32 parcel_prim_bonus = 1.f;
BOOL region_push_override = false;
BOOL region_deny_anonymous_override = false;
- BOOL region_deny_identified_override = false;
- BOOL region_deny_transacted_override = false;
+ BOOL region_deny_identified_override = false; // Deprecated
+ BOOL region_deny_transacted_override = false; // Deprecated
+ BOOL region_deny_age_unverified_override = false;
S32 other_clean_time = 0;
@@ -1474,8 +1475,9 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
msg->getF32Fast(_PREHASH_ParcelData, _PREHASH_ParcelPrimBonus, parcel_prim_bonus );
msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionPushOverride, region_push_override );
msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionDenyAnonymous, region_deny_anonymous_override );
- msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionDenyIdentified, region_deny_identified_override );
- msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionDenyTransacted, region_deny_transacted_override );
+ msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionDenyIdentified, region_deny_identified_override ); // Deprecated
+ msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionDenyTransacted, region_deny_transacted_override ); // Deprecated
+ msg->getBOOLFast(_PREHASH_AgeVerificationBlock, _PREHASH_RegionDenyAgeUnverified, region_deny_age_unverified_override );
msg->getS32("ParcelData", "OtherCleanTime", other_clean_time );
@@ -1505,8 +1507,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
parcel->setCleanOtherTime(other_clean_time);
parcel->setRegionPushOverride(region_push_override);
parcel->setRegionDenyAnonymousOverride(region_deny_anonymous_override);
- parcel->setRegionDenyIdentifiedOverride(region_deny_identified_override);
- parcel->setRegionDenyTransactedOverride(region_deny_transacted_override);
+ parcel->setRegionDenyAgeUnverifiedOverride(region_deny_age_unverified_override);
parcel->unpackMessage(msg);
if (parcel == gParcelMgr->mAgentParcel)
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 7ee4869153..eac24cebf5 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -40,14 +40,20 @@
#include "llviewercontrol.h"
// static
-void LLWeb::loadURL(std::string url)
+void LLWeb::initClass()
+{
+ LLAlertDialog::setURLLoader(&sAlertURLLoader);
+}
+
+// static
+void LLWeb::loadURL(const std::string& url)
{
loadURLExternal(url);
}
// static
-void LLWeb::loadURLExternal(std::string url)
+void LLWeb::loadURLExternal(const std::string& url)
{
std::string escaped_url = escapeURL(url);
#if LL_LIBXUL_ENABLED
@@ -57,7 +63,7 @@ void LLWeb::loadURLExternal(std::string url)
// static
-std::string LLWeb::escapeURL(std::string url)
+std::string LLWeb::escapeURL(const std::string& url)
{
// The CURL curl_escape() function escapes colons, slashes,
// and all characters but A-Z and 0-9. Do a cheesy mini-escape.
@@ -81,3 +87,12 @@ std::string LLWeb::escapeURL(std::string url)
}
return escaped_url;
}
+
+// virtual
+void LLWeb::URLLoader::load(const std::string& url)
+{
+ loadURL(url);
+}
+
+// static
+LLWeb::URLLoader LLWeb::sAlertURLLoader;
diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h
index b339f2d8fd..318410bb3b 100644
--- a/indra/newview/llweb.h
+++ b/indra/newview/llweb.h
@@ -34,21 +34,31 @@
#define LL_LLWEB_H
#include <string>
+#include "llalertdialog.h"
class LLWeb
{
public:
+ static void initClass();
+
// Loads unescaped url in either internal web browser or external
// browser, depending on user settings.
- static void loadURL(std::string url);
+ static void loadURL(const std::string& url);
static void loadURL(const char* url) { loadURL( std::string(url) ); }
// Loads unescaped url in external browser.
- static void loadURLExternal(std::string url);
+ static void loadURLExternal(const std::string& url);
// Returns escaped (eg, " " to "%20") url
- static std::string escapeURL(std::string url);
+ static std::string escapeURL(const std::string& url);
+
+ class URLLoader : public LLAlertDialog::URLLoader
+ {
+ virtual void load(const std::string& url);
+ };
+
+ static URLLoader sAlertURLLoader;
};
#endif