diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 1573 | ||||
-rw-r--r-- | indra/newview/llfloaterregioninfo.h | 72 | ||||
-rw-r--r-- | indra/newview/llnamelistctrl.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llnamelistctrl.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerregion.cpp | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 49 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_region_access.xml | 313 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_region_estate.xml | 206 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 3 |
9 files changed, 1248 insertions, 985 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index af68a2aae1..64e621d4cc 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -98,6 +98,7 @@ #include "llexperiencecache.h" #include "llpanelexperiences.h" #include "llcorehttputil.h" +#include "llavatarnamecache.h" const S32 TERRAIN_TEXTURE_COUNT = 4; const S32 CORNER_COUNT = 4; @@ -120,18 +121,6 @@ public: const sparam_t& strings); }; -class LLDispatchSetEstateAccess : public LLDispatchHandler -{ -public: - LLDispatchSetEstateAccess() {} - virtual ~LLDispatchSetEstateAccess() {} - virtual bool operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const LLUUID& invoice, - const sparam_t& strings); -}; - class LLDispatchSetEstateExperience : public LLDispatchHandler { public: @@ -207,6 +196,11 @@ BOOL LLFloaterRegionInfo::postBuild() panel->buildFromFile("panel_region_estate.xml"); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); + panel = new LLPanelEstateAccess; + mInfoPanels.push_back(panel); + panel->buildFromFile("panel_region_access.xml"); + mTab->addTabPanel(panel); + panel = new LLPanelEstateCovenant; mInfoPanels.push_back(panel); panel->buildFromFile("panel_region_covenant.xml"); @@ -269,6 +263,12 @@ void LLFloaterRegionInfo::onOpen(const LLSD& key) refreshFromRegion(gAgent.getRegion()); requestRegionInfo(); requestMeshRezInfo(); + + LLPanelEstateAccess* panel_access = LLFloaterRegionInfo::getPanelAccess(); + if (panel_access) + { + panel_access->updateLists(); + } } // static @@ -280,6 +280,7 @@ void LLFloaterRegionInfo::requestRegionInfo() tab->getChild<LLPanel>("Debug")->setCtrlsEnabled(FALSE); tab->getChild<LLPanel>("Terrain")->setCtrlsEnabled(FALSE); tab->getChild<LLPanel>("Estate")->setCtrlsEnabled(FALSE); + tab->getChild<LLPanel>("Access")->setCtrlsEnabled(FALSE); // Must allow anyone to request the RegionInfo data // so non-owners/non-gods can see the values. @@ -307,8 +308,7 @@ void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**) LLPanelEstateInfo::initDispatch(dispatch); } - LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); - LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate"); + LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); // unpack the message std::string request; @@ -324,7 +324,10 @@ void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**) //dispatch the message dispatch.dispatch(request, invoice, strings); - panel->updateControls(gAgent.getRegion()); + if (panel) + { + panel->updateControls(gAgent.getRegion()); + } } @@ -464,6 +467,16 @@ LLPanelEstateInfo* LLFloaterRegionInfo::getPanelEstate() } // static +LLPanelEstateAccess* LLFloaterRegionInfo::getPanelAccess() +{ + LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); + if (!floater) return NULL; + LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); + LLPanelEstateAccess* panel = (LLPanelEstateAccess*)tab->getChild<LLPanel>("Access"); + return panel; +} + +// static LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() { LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); @@ -517,6 +530,7 @@ void LLFloaterRegionInfo::disableTabCtrls() tab->getChild<LLPanel>("Terrain")->setCtrlsEnabled(FALSE); tab->getChild<LLPanel>("panel_env_info")->setCtrlsEnabled(FALSE); tab->getChild<LLPanel>("Estate")->setCtrlsEnabled(FALSE); + tab->getChild<LLPanel>("Access")->setCtrlsEnabled(FALSE); } void LLFloaterRegionInfo::onTabSelected(const LLSD& param) @@ -1522,20 +1536,11 @@ LLPanelEstateInfo::LLPanelEstateInfo() void LLPanelEstateInfo::initDispatch(LLDispatcher& dispatch) { std::string name; - -// name.assign("setowner"); -// static LLDispatchSetEstateOwner set_owner; -// dispatch.addHandler(name, &set_owner); - + name.assign("estateupdateinfo"); static LLDispatchEstateUpdateInfo estate_update_info; dispatch.addHandler(name, &estate_update_info); - name.assign("setaccess"); - static LLDispatchSetEstateAccess set_access; - dispatch.addHandler(name, &set_access); - - name.assign("setexperience"); static LLDispatchSetEstateExperience set_experience; dispatch.addHandler(name, &set_experience); @@ -1544,124 +1549,6 @@ void LLPanelEstateInfo::initDispatch(LLDispatcher& dispatch) } //--------------------------------------------------------------------------- -// Add/Remove estate access button callbacks -//--------------------------------------------------------------------------- -void LLPanelEstateInfo::onClickAddAllowedAgent() -{ - LLCtrlListInterface *list = childGetListInterface("allowed_avatar_name_list"); - if (!list) return; - if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) - { - //args - - LLSD args; - args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); - LLNotificationsUtil::add("MaxAllowedAgentOnRegion", args); - return; - } - accessAddCore(ESTATE_ACCESS_ALLOWED_AGENT_ADD, "EstateAllowedAgentAdd"); -} - -void LLPanelEstateInfo::onClickRemoveAllowedAgent() -{ - accessRemoveCore(ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, "EstateAllowedAgentRemove", "allowed_avatar_name_list"); -} - -void LLPanelEstateInfo::onClickAddAllowedGroup() -{ - LLCtrlListInterface *list = childGetListInterface("allowed_group_name_list"); - if (!list) return; - if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) - { - LLSD args; - args["MAX_GROUPS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); - LLNotificationsUtil::add("MaxAllowedGroupsOnRegion", args); - return; - } - - LLNotification::Params params("ChangeLindenAccess"); - params.functor.function(boost::bind(&LLPanelEstateInfo::addAllowedGroup, this, _1, _2)); - if (isLindenEstate()) - { - LLNotifications::instance().add(params); - } - else - { - LLNotifications::instance().forceResponse(params, 0); - } -} - -bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option != 0) return false; - - LLFloater* parent_floater = gFloaterView->getParentFloater(this); - - LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(gAgent.getID())); - if (widget) - { - widget->removeNoneOption(); - widget->setSelectGroupCallback(boost::bind(&LLPanelEstateInfo::addAllowedGroup2, this, _1)); - if (parent_floater) - { - LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, widget); - widget->setOrigin(new_rect.mLeft, new_rect.mBottom); - parent_floater->addDependentFloater(widget); - } - } - - return false; -} - -void LLPanelEstateInfo::onClickRemoveAllowedGroup() -{ - accessRemoveCore(ESTATE_ACCESS_ALLOWED_GROUP_REMOVE, "EstateAllowedGroupRemove", "allowed_group_name_list"); -} - -void LLPanelEstateInfo::onClickAddBannedAgent() -{ - LLCtrlListInterface *list = childGetListInterface("banned_avatar_name_list"); - if (!list) return; - if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) - { - LLSD args; - args["MAX_BANNED"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); - LLNotificationsUtil::add("MaxBannedAgentsOnRegion", args); - return; - } - accessAddCore(ESTATE_ACCESS_BANNED_AGENT_ADD, "EstateBannedAgentAdd"); -} - -void LLPanelEstateInfo::onClickRemoveBannedAgent() -{ - accessRemoveCore(ESTATE_ACCESS_BANNED_AGENT_REMOVE, "EstateBannedAgentRemove", "banned_avatar_name_list"); -} - -// static -void LLPanelEstateInfo::onClickAddEstateManager() -{ - LLCtrlListInterface *list = childGetListInterface("estate_manager_name_list"); - if (!list) return; - if (list->getItemCount() >= ESTATE_MAX_MANAGERS) - { // Tell user they can't add more managers - LLSD args; - args["MAX_MANAGER"] = llformat("%d",ESTATE_MAX_MANAGERS); - LLNotificationsUtil::add("MaxManagersOnRegion", args); - } - else - { // Go pick managers to add - accessAddCore(ESTATE_ACCESS_MANAGER_ADD, "EstateManagerAdd"); - } -} - -// static -void LLPanelEstateInfo::onClickRemoveEstateManager() -{ - accessRemoveCore(ESTATE_ACCESS_MANAGER_REMOVE, "EstateManagerRemove", "estate_manager_name_list"); -} - -//--------------------------------------------------------------------------- // Kick from estate methods //--------------------------------------------------------------------------- @@ -1788,346 +1675,6 @@ struct LLEstateAccessChangeInfo uuid_vec_t mAgentOrGroupIDs; // List of agent IDs to apply to this change }; -// Special case callback for groups, since it has different callback format than names -void LLPanelEstateInfo::addAllowedGroup2(LLUUID id) -{ - LLSD payload; - payload["operation"] = (S32)ESTATE_ACCESS_ALLOWED_GROUP_ADD; - payload["dialog_name"] = "EstateAllowedGroupAdd"; - payload["allowed_ids"].append(id); - - LLSD args; - args["ALL_ESTATES"] = all_estates_text(); - - LLNotification::Params params("EstateAllowedGroupAdd"); - params.payload(payload) - .substitutions(args) - .functor.function(accessCoreConfirm); - if (isLindenEstate()) - { - LLNotifications::instance().forceResponse(params, 0); - } - else - { - LLNotifications::instance().add(params); - } -} - -// static -void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dialog_name) -{ - LLSD payload; - payload["operation"] = (S32)operation_flag; - payload["dialog_name"] = dialog_name; - // agent id filled in after avatar picker - - LLNotification::Params params("ChangeLindenAccess"); - params.payload(payload) - .functor.function(accessAddCore2); - - if (isLindenEstate()) - { - LLNotifications::instance().add(params); - } - else - { - // same as clicking "OK" - LLNotifications::instance().forceResponse(params, 0); - } -} - -// static -bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option != 0) - { - // abort change - return false; - } - - LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]); - //Get parent floater name - LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - LLFloater* parent_floater = panel ? gFloaterView->getParentFloater(panel) : NULL; - const std::string& parent_floater_name = parent_floater ? parent_floater->getName() : ""; - - //Determine the button that triggered opening of the avatar picker - //(so that a shadow frustum from the button to the avatar picker can be created) - LLView * button = NULL; - switch(change_info->mOperationFlag) - { - case ESTATE_ACCESS_ALLOWED_AGENT_ADD: - button = panel->findChild<LLButton>("add_allowed_avatar_btn"); - break; - - case ESTATE_ACCESS_BANNED_AGENT_ADD: - button = panel->findChild<LLButton>("add_banned_avatar_btn"); - break; - - case ESTATE_ACCESS_MANAGER_ADD: - button = panel->findChild<LLButton>("add_estate_manager_btn"); - break; - } - - // avatar picker yes multi-select, yes close-on-select - LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::accessAddCore3, _1, (void*)change_info), - TRUE, TRUE, FALSE, parent_floater_name, button); - - //Allows the closed parent floater to close the child floater (avatar picker) - if (child_floater) - { - parent_floater->addDependentFloater(child_floater); - } - - return false; -} - -// static -void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, void* data) -{ - LLEstateAccessChangeInfo* change_info = (LLEstateAccessChangeInfo*)data; - if (!change_info) return; - if (ids.empty()) - { - // User didn't select a name. - delete change_info; - change_info = NULL; - return; - } - // User did select a name. - change_info->mAgentOrGroupIDs = ids; - // Can't put estate owner on ban list - LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - if (!panel) return; - LLViewerRegion* region = gAgent.getRegion(); - if (!region) return; - - if (change_info->mOperationFlag & ESTATE_ACCESS_ALLOWED_AGENT_ADD) - { - LLCtrlListInterface *list = panel->childGetListInterface("allowed_avatar_name_list"); - int currentCount = (list ? list->getItemCount() : 0); - if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS) - { - LLSD args; - args["NUM_ADDED"] = llformat("%d",ids.size()); - args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); - args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeAllowedAgents"); - args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS); - LLNotificationsUtil::add("MaxAgentOnRegionBatch", args); - delete change_info; - return; - } - } - if (change_info->mOperationFlag & ESTATE_ACCESS_BANNED_AGENT_ADD) - { - LLCtrlListInterface *list = panel->childGetListInterface("banned_avatar_name_list"); - int currentCount = (list ? list->getItemCount() : 0); - if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS) - { - LLSD args; - args["NUM_ADDED"] = llformat("%d",ids.size()); - args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); - args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeBannedAgents"); - args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS); - LLNotificationsUtil::add("MaxAgentOnRegionBatch", args); - delete change_info; - return; - } - } - - LLSD args; - args["ALL_ESTATES"] = all_estates_text(); - - LLNotification::Params params(change_info->mDialogName); - params.substitutions(args) - .payload(change_info->asLLSD()) - .functor.function(accessCoreConfirm); - - if (isLindenEstate()) - { - // just apply to this estate - LLNotifications::instance().forceResponse(params, 0); - } - else - { - // ask if this estate or all estates with this owner - LLNotifications::instance().add(params); - } -} - -// static -void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name) -{ - LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - if (!panel) return; - LLNameListCtrl* name_list = panel->getChild<LLNameListCtrl>(list_ctrl_name); - if (!name_list) return; - - std::vector<LLScrollListItem*> list_vector = name_list->getAllSelected(); - if (list_vector.size() == 0) - return; - - LLSD payload; - payload["operation"] = (S32)operation_flag; - payload["dialog_name"] = dialog_name; - - for (std::vector<LLScrollListItem*>::const_iterator iter = list_vector.begin(); - iter != list_vector.end(); - iter++) - { - LLScrollListItem *item = (*iter); - payload["allowed_ids"].append(item->getUUID()); - } - - LLNotification::Params params("ChangeLindenAccess"); - params.payload(payload) - .functor.function(accessRemoveCore2); - - if (isLindenEstate()) - { - // warn on change linden estate - LLNotifications::instance().add(params); - } - else - { - // just proceed, as if clicking OK - LLNotifications::instance().forceResponse(params, 0); - } -} - -// static -bool LLPanelEstateInfo::accessRemoveCore2(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option != 0) - { - // abort - return false; - } - - // If Linden estate, can only apply to "this" estate, not all estates - // owned by NULL. - if (isLindenEstate()) - { - accessCoreConfirm(notification, response); - } - else - { - LLSD args; - args["ALL_ESTATES"] = all_estates_text(); - LLNotificationsUtil::add(notification["payload"]["dialog_name"], - args, - notification["payload"], - accessCoreConfirm); - } - return false; -} - -// Used for both access add and remove operations, depending on the mOperationFlag -// passed in (ESTATE_ACCESS_BANNED_AGENT_ADD, ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, etc.) -// static -bool LLPanelEstateInfo::accessCoreConfirm(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - const U32 originalFlags = (U32)notification["payload"]["operation"].asInteger(); - - LLViewerRegion* region = gAgent.getRegion(); - - LLSD::array_const_iterator end_it = notification["payload"]["allowed_ids"].endArray(); - - for (LLSD::array_const_iterator iter = notification["payload"]["allowed_ids"].beginArray(); - iter != end_it; - iter++) - { - U32 flags = originalFlags; - if (iter + 1 != end_it) - flags |= ESTATE_ACCESS_NO_REPLY; - - const LLUUID id = iter->asUUID(); - if (((U32)notification["payload"]["operation"].asInteger() & ESTATE_ACCESS_BANNED_AGENT_ADD) - && region && (region->getOwner() == id)) - { - LLNotificationsUtil::add("OwnerCanNotBeDenied"); - break; - } - switch(option) - { - case 0: - // This estate - sendEstateAccessDelta(flags, id); - break; - case 1: - { - // All estates, either than I own or manage for this owner. - // This will be verified on simulator. JC - if (!region) break; - if (region->getOwner() == gAgent.getID() - || gAgent.isGodlike()) - { - flags |= ESTATE_ACCESS_APPLY_TO_ALL_ESTATES; - sendEstateAccessDelta(flags, id); - } - else if (region->isEstateManager()) - { - flags |= ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES; - sendEstateAccessDelta(flags, id); - } - break; - } - case 2: - default: - break; - } - } - return false; -} - -// key = "estateaccessdelta" -// str(estate_id) will be added to front of list by forward_EstateOwnerRequest_to_dataserver -// str[0] = str(agent_id) requesting the change -// str[1] = str(flags) (ESTATE_ACCESS_DELTA_*) -// str[2] = str(agent_id) to add or remove -// static -void LLPanelEstateInfo::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_group_id) -{ - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("EstateOwnerMessage"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used - - msg->nextBlock("MethodData"); - msg->addString("Method", "estateaccessdelta"); - msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); - - std::string buf; - gAgent.getID().toString(buf); - msg->nextBlock("ParamList"); - msg->addString("Parameter", buf); - - buf = llformat("%u", flags); - msg->nextBlock("ParamList"); - msg->addString("Parameter", buf); - - agent_or_group_id.toString(buf); - msg->nextBlock("ParamList"); - msg->addString("Parameter", buf); - - - LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - - if (flags & (ESTATE_ACCESS_ALLOWED_AGENT_ADD | ESTATE_ACCESS_ALLOWED_AGENT_REMOVE | - ESTATE_ACCESS_BANNED_AGENT_ADD | ESTATE_ACCESS_BANNED_AGENT_REMOVE)) - { - - panel->clearAccessLists(); - } - - gAgent.sendReliableMessage(); -} - // static void LLPanelEstateInfo::updateEstateOwnerName(const std::string& name) { @@ -2157,36 +1704,9 @@ void LLPanelEstateInfo::updateControls(LLViewerRegion* region) getChildView("apply_btn")->setEnabled(FALSE); - BOOL has_allowed_avatar = getChild<LLNameListCtrl>("allowed_avatar_name_list")->getFirstSelected() ? TRUE : FALSE; - BOOL has_allowed_group = getChild<LLNameListCtrl>("allowed_group_name_list")->getFirstSelected() ? TRUE : FALSE; - BOOL has_banned_agent = getChild<LLNameListCtrl>("banned_avatar_name_list")->getFirstSelected() ? TRUE : FALSE; - BOOL has_estate_manager = getChild<LLNameListCtrl>("estate_manager_name_list")->getFirstSelected() ? TRUE : FALSE; - - getChildView("add_allowed_avatar_btn")->setEnabled(god || owner || manager); - getChildView("remove_allowed_avatar_btn")->setEnabled(has_allowed_avatar && (god || owner || manager)); - getChildView("allowed_avatar_name_list")->setEnabled(god || owner || manager); - - getChildView("add_allowed_group_btn")->setEnabled(god || owner || manager); - getChildView("remove_allowed_group_btn")->setEnabled(has_allowed_group && (god || owner || manager) ); - getChildView("allowed_group_name_list")->setEnabled(god || owner || manager); - - // Can't ban people from mainland, orientation islands, etc. because this - // creates much network traffic and server load. - // Disable their accounts in CSR tool instead. - bool linden_estate = isLindenEstate(); - bool enable_ban = (god || owner || manager) && !linden_estate; - getChildView("add_banned_avatar_btn")->setEnabled(enable_ban); - getChildView("remove_banned_avatar_btn")->setEnabled(has_banned_agent && enable_ban); - getChildView("banned_avatar_name_list")->setEnabled(god || owner || manager); - getChildView("message_estate_btn")->setEnabled(god || owner || manager); getChildView("kick_user_from_estate_btn")->setEnabled(god || owner || manager); - // estate managers can't add estate managers - getChildView("add_estate_manager_btn")->setEnabled(god || owner); - getChildView("remove_estate_manager_btn")->setEnabled(has_estate_manager && (god || owner)); - getChildView("estate_manager_name_list")->setEnabled(god || owner); - refresh(); } @@ -2208,10 +1728,6 @@ bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region) //integers.push_back(LLFloaterRegionInfo::());::getPanelEstate(); - LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - panel->clearAccessLists(); - - sendEstateOwnerMessage(gMessageSystem, "getinfo", invoice, strings); refresh(); @@ -2242,49 +1758,6 @@ BOOL LLPanelEstateInfo::postBuild() initCtrl("voice_chat_check"); initCtrl("parcel_access_override"); - getChild<LLUICtrl>("allowed_avatar_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); - LLNameListCtrl *avatar_name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); - if (avatar_name_list) - { - avatar_name_list->setCommitOnSelectionChange(TRUE); - avatar_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); - } - - childSetAction("add_allowed_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickAddAllowedAgent, this)); - childSetAction("remove_allowed_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveAllowedAgent, this)); - - getChild<LLUICtrl>("allowed_group_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); - LLNameListCtrl* group_name_list = getChild<LLNameListCtrl>("allowed_group_name_list"); - if (group_name_list) - { - group_name_list->setCommitOnSelectionChange(TRUE); - group_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); - } - - getChild<LLUICtrl>("add_allowed_group_btn")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onClickAddAllowedGroup, this)); - childSetAction("remove_allowed_group_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveAllowedGroup, this)); - - getChild<LLUICtrl>("banned_avatar_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); - LLNameListCtrl* banned_name_list = getChild<LLNameListCtrl>("banned_avatar_name_list"); - if (banned_name_list) - { - banned_name_list->setCommitOnSelectionChange(TRUE); - banned_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); - } - - childSetAction("add_banned_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickAddBannedAgent, this)); - childSetAction("remove_banned_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveBannedAgent, this)); - - getChild<LLUICtrl>("estate_manager_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); - LLNameListCtrl* manager_name_list = getChild<LLNameListCtrl>("estate_manager_name_list"); - if (manager_name_list) - { - manager_name_list->setCommitOnSelectionChange(TRUE); - manager_name_list->setMaxItemCount(ESTATE_MAX_MANAGERS * 4); // Allow extras for dupe issue - } - - childSetAction("add_estate_manager_btn", boost::bind(&LLPanelEstateInfo::onClickAddEstateManager, this)); - childSetAction("remove_estate_manager_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveEstateManager, this)); childSetAction("message_estate_btn", boost::bind(&LLPanelEstateInfo::onClickMessageEstate, this)); childSetAction("kick_user_from_estate_btn", boost::bind(&LLPanelEstateInfo::onClickKickUser, this)); @@ -2429,22 +1902,6 @@ void LLPanelEstateInfo::setOwnerName(const std::string& name) getChild<LLUICtrl>("estate_owner")->setValue(LLSD(name)); } -void LLPanelEstateInfo::clearAccessLists() -{ - LLNameListCtrl* name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); - if (name_list) - { - name_list->deleteAllItems(); - } - - name_list = getChild<LLNameListCtrl>("banned_avatar_name_list"); - if (name_list) - { - name_list->deleteAllItems(); - } - updateControls(gAgent.getRegion()); -} - // static void LLPanelEstateInfo::onClickMessageEstate(void* userdata) { @@ -2858,185 +2315,6 @@ bool LLDispatchEstateUpdateInfo::operator()( return true; } - -// key = "setaccess" -// strings[0] = str(estate_id) -// strings[1] = str(packed_access_lists) -// strings[2] = str(num allowed agent ids) -// strings[3] = str(num allowed group ids) -// strings[4] = str(num banned agent ids) -// strings[5] = str(num estate manager agent ids) -// strings[6] = bin(uuid) -// strings[7] = bin(uuid) -// strings[8] = bin(uuid) -// ... -bool LLDispatchSetEstateAccess::operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const LLUUID& invoice, - const sparam_t& strings) -{ - LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - if (!panel) return true; - - S32 index = 1; // skip estate_id - U32 access_flags = strtoul(strings[index++].c_str(), NULL,10); - S32 num_allowed_agents = strtol(strings[index++].c_str(), NULL, 10); - S32 num_allowed_groups = strtol(strings[index++].c_str(), NULL, 10); - S32 num_banned_agents = strtol(strings[index++].c_str(), NULL, 10); - S32 num_estate_managers = strtol(strings[index++].c_str(), NULL, 10); - - // sanity ckecks - if (num_allowed_agents > 0 - && !(access_flags & ESTATE_ACCESS_ALLOWED_AGENTS)) - { - LL_WARNS() << "non-zero count for allowed agents, but no corresponding flag" << LL_ENDL; - } - if (num_allowed_groups > 0 - && !(access_flags & ESTATE_ACCESS_ALLOWED_GROUPS)) - { - LL_WARNS() << "non-zero count for allowed groups, but no corresponding flag" << LL_ENDL; - } - if (num_banned_agents > 0 - && !(access_flags & ESTATE_ACCESS_BANNED_AGENTS)) - { - LL_WARNS() << "non-zero count for banned agents, but no corresponding flag" << LL_ENDL; - } - if (num_estate_managers > 0 - && !(access_flags & ESTATE_ACCESS_MANAGERS)) - { - LL_WARNS() << "non-zero count for managers, but no corresponding flag" << LL_ENDL; - } - - // grab the UUID's out of the string fields - if (access_flags & ESTATE_ACCESS_ALLOWED_AGENTS) - { - LLNameListCtrl* allowed_agent_name_list; - allowed_agent_name_list = panel->getChild<LLNameListCtrl>("allowed_avatar_name_list"); - - int totalAllowedAgents = num_allowed_agents; - - if (allowed_agent_name_list) - { - totalAllowedAgents += allowed_agent_name_list->getItemCount(); - } - - LLStringUtil::format_map_t args; - args["[ALLOWEDAGENTS]"] = llformat ("%d", totalAllowedAgents); - args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_ACCESS_IDS); - std::string msg = LLTrans::getString("RegionInfoAllowedResidents", args); - panel->getChild<LLUICtrl>("allow_resident_label")->setValue(LLSD(msg)); - - if (allowed_agent_name_list) - { - // Don't sort these as we add them, sort them when we are done. - allowed_agent_name_list->clearSortOrder(); - for (S32 i = 0; i < num_allowed_agents && i < ESTATE_MAX_ACCESS_IDS; i++) - { - LLUUID id; - memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ - allowed_agent_name_list->addNameItem(id); - } - allowed_agent_name_list->sortByName(TRUE); - } - } - - if (access_flags & ESTATE_ACCESS_ALLOWED_GROUPS) - { - LLNameListCtrl* allowed_group_name_list; - allowed_group_name_list = panel->getChild<LLNameListCtrl>("allowed_group_name_list"); - - LLStringUtil::format_map_t args; - args["[ALLOWEDGROUPS]"] = llformat ("%d", num_allowed_groups); - args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_GROUP_IDS); - std::string msg = LLTrans::getString("RegionInfoAllowedGroups", args); - panel->getChild<LLUICtrl>("allow_group_label")->setValue(LLSD(msg)); - - if (allowed_group_name_list) - { - // Don't sort these as we add them, sort them when we are done. - allowed_group_name_list->clearSortOrder(); - allowed_group_name_list->deleteAllItems(); - for (S32 i = 0; i < num_allowed_groups && i < ESTATE_MAX_GROUP_IDS; i++) - { - LLUUID id; - memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ - allowed_group_name_list->addGroupNameItem(id); - } - allowed_group_name_list->sortByName(TRUE); - } - } - - if (access_flags & ESTATE_ACCESS_BANNED_AGENTS) - { - LLNameListCtrl* banned_agent_name_list; - banned_agent_name_list = panel->getChild<LLNameListCtrl>("banned_avatar_name_list"); - - int totalBannedAgents = num_banned_agents; - - if (banned_agent_name_list) - { - totalBannedAgents += banned_agent_name_list->getItemCount(); - } - - - LLStringUtil::format_map_t args; - args["[BANNEDAGENTS]"] = llformat("%d", totalBannedAgents); - args["[MAXBANNED]"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); - std::string msg = LLTrans::getString("RegionInfoBannedResidents", args); - panel->getChild<LLUICtrl>("ban_resident_label")->setValue(LLSD(msg)); - - if (banned_agent_name_list) - { - // Don't sort these as we add them, sort them when we are done. - banned_agent_name_list->clearSortOrder(); - - for (S32 i = 0; i < num_banned_agents && i < ESTATE_MAX_ACCESS_IDS; i++) - { - LLUUID id; - memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ - banned_agent_name_list->addNameItem(id); - } - banned_agent_name_list->sortByName(TRUE); - } - } - - if (access_flags & ESTATE_ACCESS_MANAGERS) - { - LLStringUtil::format_map_t args; - args["[ESTATEMANAGERS]"] = llformat("%d", num_estate_managers); - args["[MAXMANAGERS]"] = llformat("%d", ESTATE_MAX_MANAGERS); - std::string msg = LLTrans::getString("RegionInfoEstateManagers", args); - panel->getChild<LLUICtrl>("estate_manager_label")->setValue(LLSD(msg)); - - LLNameListCtrl* estate_manager_name_list = - panel->getChild<LLNameListCtrl>("estate_manager_name_list"); - if (estate_manager_name_list) - { - // Don't sort these as we add them, sort them when we are done. - estate_manager_name_list->clearSortOrder(); - - estate_manager_name_list->deleteAllItems(); // Clear existing entries - - // There should be only ESTATE_MAX_MANAGERS people in the list, but if the database gets more (SL-46107) don't - // truncate the list unless it's really big. Go ahead and show the extras so the user doesn't get confused, - // and they can still remove them. - for (S32 i = 0; i < num_estate_managers && i < (ESTATE_MAX_MANAGERS * 4); i++) - { - LLUUID id; - memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ - estate_manager_name_list->addNameItem(id); - } - estate_manager_name_list->sortByName(TRUE); - } - } - - // Update the buttons which may change based on the list contents but also needs to account for general access features. - panel->updateControls(gAgent.getRegion()); - - return true; -} - LLSD LLDispatchSetEstateExperience::getIDs( sparam_t::const_iterator it, sparam_t::const_iterator end, S32 count ) { LLSD idList = LLSD::emptyArray(); @@ -3942,3 +3220,794 @@ void LLPanelRegionExperiences::itemChanged( U32 event_type, const LLUUID& id ) onChangeAnything(); } + + + + + +BOOL LLPanelEstateAccess::postBuild() +{ + getChild<LLUICtrl>("allowed_avatar_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); + LLNameListCtrl *avatar_name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); + if (avatar_name_list) + { + avatar_name_list->setCommitOnSelectionChange(TRUE); + avatar_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); + } + + childSetAction("add_allowed_avatar_btn", boost::bind(&LLPanelEstateAccess::onClickAddAllowedAgent, this)); + childSetAction("remove_allowed_avatar_btn", boost::bind(&LLPanelEstateAccess::onClickRemoveAllowedAgent, this)); + + getChild<LLUICtrl>("allowed_group_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); + LLNameListCtrl* group_name_list = getChild<LLNameListCtrl>("allowed_group_name_list"); + if (group_name_list) + { + group_name_list->setCommitOnSelectionChange(TRUE); + group_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); + } + + getChild<LLUICtrl>("add_allowed_group_btn")->setCommitCallback(boost::bind(&LLPanelEstateAccess::onClickAddAllowedGroup, this)); + childSetAction("remove_allowed_group_btn", boost::bind(&LLPanelEstateAccess::onClickRemoveAllowedGroup, this)); + + getChild<LLUICtrl>("banned_avatar_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); + LLNameListCtrl* banned_name_list = getChild<LLNameListCtrl>("banned_avatar_name_list"); + if (banned_name_list) + { + banned_name_list->setCommitOnSelectionChange(TRUE); + banned_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); + } + + childSetAction("add_banned_avatar_btn", boost::bind(&LLPanelEstateAccess::onClickAddBannedAgent, this)); + childSetAction("remove_banned_avatar_btn", boost::bind(&LLPanelEstateAccess::onClickRemoveBannedAgent, this)); + + getChild<LLUICtrl>("estate_manager_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); + LLNameListCtrl* manager_name_list = getChild<LLNameListCtrl>("estate_manager_name_list"); + if (manager_name_list) + { + manager_name_list->setCommitOnSelectionChange(TRUE); + manager_name_list->setMaxItemCount(ESTATE_MAX_MANAGERS * 4); // Allow extras for dupe issue + } + + childSetAction("add_estate_manager_btn", boost::bind(&LLPanelEstateAccess::onClickAddEstateManager, this)); + childSetAction("remove_estate_manager_btn", boost::bind(&LLPanelEstateAccess::onClickRemoveEstateManager, this)); + + return TRUE; +} + +void LLPanelEstateAccess::updateControls(LLViewerRegion* region) +{ + BOOL god = gAgent.isGodlike(); + BOOL owner = (region && (region->getOwner() == gAgent.getID())); + BOOL manager = (region && region->isEstateManager()); + setCtrlsEnabled(god || owner || manager); + + BOOL has_allowed_avatar = getChild<LLNameListCtrl>("allowed_avatar_name_list")->getFirstSelected() ? TRUE : FALSE; + BOOL has_allowed_group = getChild<LLNameListCtrl>("allowed_group_name_list")->getFirstSelected() ? TRUE : FALSE; + BOOL has_banned_agent = getChild<LLNameListCtrl>("banned_avatar_name_list")->getFirstSelected() ? TRUE : FALSE; + BOOL has_estate_manager = getChild<LLNameListCtrl>("estate_manager_name_list")->getFirstSelected() ? TRUE : FALSE; + + getChildView("add_allowed_avatar_btn")->setEnabled(god || owner || manager); + getChildView("remove_allowed_avatar_btn")->setEnabled(has_allowed_avatar && (god || owner || manager)); + getChildView("allowed_avatar_name_list")->setEnabled(god || owner || manager); + + getChildView("add_allowed_group_btn")->setEnabled(god || owner || manager); + getChildView("remove_allowed_group_btn")->setEnabled(has_allowed_group && (god || owner || manager)); + getChildView("allowed_group_name_list")->setEnabled(god || owner || manager); + + // Can't ban people from mainland, orientation islands, etc. because this + // creates much network traffic and server load. + // Disable their accounts in CSR tool instead. + bool linden_estate = LLPanelEstateInfo::isLindenEstate(); + bool enable_ban = (god || owner || manager) && !linden_estate; + getChildView("add_banned_avatar_btn")->setEnabled(enable_ban); + getChildView("remove_banned_avatar_btn")->setEnabled(has_banned_agent && enable_ban); + getChildView("banned_avatar_name_list")->setEnabled(god || owner || manager); + + // estate managers can't add estate managers + getChildView("add_estate_manager_btn")->setEnabled(god || owner); + getChildView("remove_estate_manager_btn")->setEnabled(has_estate_manager && (god || owner)); + getChildView("estate_manager_name_list")->setEnabled(god || owner); +} + +//--------------------------------------------------------------------------- +// Add/Remove estate access button callbacks +//--------------------------------------------------------------------------- +void LLPanelEstateAccess::onClickAddAllowedAgent() +{ + LLCtrlListInterface *list = childGetListInterface("allowed_avatar_name_list"); + if (!list) return; + if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) + { + //args + + LLSD args; + args["MAX_AGENTS"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); + LLNotificationsUtil::add("MaxAllowedAgentOnRegion", args); + return; + } + accessAddCore(ESTATE_ACCESS_ALLOWED_AGENT_ADD, "EstateAllowedAgentAdd"); +} + +void LLPanelEstateAccess::onClickRemoveAllowedAgent() +{ + accessRemoveCore(ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, "EstateAllowedAgentRemove", "allowed_avatar_name_list"); +} + +void LLPanelEstateAccess::onClickAddAllowedGroup() +{ + LLCtrlListInterface *list = childGetListInterface("allowed_group_name_list"); + if (!list) return; + if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) + { + LLSD args; + args["MAX_GROUPS"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); + LLNotificationsUtil::add("MaxAllowedGroupsOnRegion", args); + return; + } + + LLNotification::Params params("ChangeLindenAccess"); + params.functor.function(boost::bind(&LLPanelEstateAccess::addAllowedGroup, this, _1, _2)); + if (LLPanelEstateInfo::isLindenEstate()) + { + LLNotifications::instance().add(params); + } + else + { + LLNotifications::instance().forceResponse(params, 0); + } +} + +bool LLPanelEstateAccess::addAllowedGroup(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) return false; + + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + + LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(gAgent.getID())); + if (widget) + { + widget->removeNoneOption(); + widget->setSelectGroupCallback(boost::bind(&LLPanelEstateAccess::addAllowedGroup2, this, _1)); + if (parent_floater) + { + LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, widget); + widget->setOrigin(new_rect.mLeft, new_rect.mBottom); + parent_floater->addDependentFloater(widget); + } + } + + return false; +} + +void LLPanelEstateAccess::onClickRemoveAllowedGroup() +{ + accessRemoveCore(ESTATE_ACCESS_ALLOWED_GROUP_REMOVE, "EstateAllowedGroupRemove", "allowed_group_name_list"); +} + +void LLPanelEstateAccess::onClickAddBannedAgent() +{ + LLCtrlListInterface *list = childGetListInterface("banned_avatar_name_list"); + if (!list) return; + if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) + { + LLSD args; + args["MAX_BANNED"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); + LLNotificationsUtil::add("MaxBannedAgentsOnRegion", args); + return; + } + accessAddCore(ESTATE_ACCESS_BANNED_AGENT_ADD, "EstateBannedAgentAdd"); +} + +void LLPanelEstateAccess::onClickRemoveBannedAgent() +{ + accessRemoveCore(ESTATE_ACCESS_BANNED_AGENT_REMOVE, "EstateBannedAgentRemove", "banned_avatar_name_list"); +} + +// static +void LLPanelEstateAccess::onClickAddEstateManager() +{ + LLCtrlListInterface *list = childGetListInterface("estate_manager_name_list"); + if (!list) return; + if (list->getItemCount() >= ESTATE_MAX_MANAGERS) + { // Tell user they can't add more managers + LLSD args; + args["MAX_MANAGER"] = llformat("%d", ESTATE_MAX_MANAGERS); + LLNotificationsUtil::add("MaxManagersOnRegion", args); + } + else + { // Go pick managers to add + accessAddCore(ESTATE_ACCESS_MANAGER_ADD, "EstateManagerAdd"); + } +} + +// static +void LLPanelEstateAccess::onClickRemoveEstateManager() +{ + accessRemoveCore(ESTATE_ACCESS_MANAGER_REMOVE, "EstateManagerRemove", "estate_manager_name_list"); +} + + +// Special case callback for groups, since it has different callback format than names +void LLPanelEstateAccess::addAllowedGroup2(LLUUID id) +{ + LLSD payload; + payload["operation"] = (S32)ESTATE_ACCESS_ALLOWED_GROUP_ADD; + payload["dialog_name"] = "EstateAllowedGroupAdd"; + payload["allowed_ids"].append(id); + + LLSD args; + args["ALL_ESTATES"] = all_estates_text(); + + LLNotification::Params params("EstateAllowedGroupAdd"); + params.payload(payload) + .substitutions(args) + .functor.function(accessCoreConfirm); + if (LLPanelEstateInfo::isLindenEstate()) + { + LLNotifications::instance().forceResponse(params, 0); + } + else + { + LLNotifications::instance().add(params); + } +} + +// static +void LLPanelEstateAccess::accessAddCore(U32 operation_flag, const std::string& dialog_name) +{ + LLSD payload; + payload["operation"] = (S32)operation_flag; + payload["dialog_name"] = dialog_name; + // agent id filled in after avatar picker + + LLNotification::Params params("ChangeLindenAccess"); + params.payload(payload) + .functor.function(accessAddCore2); + + if (LLPanelEstateInfo::isLindenEstate()) + { + LLNotifications::instance().add(params); + } + else + { + // same as clicking "OK" + LLNotifications::instance().forceResponse(params, 0); + } +} + +// static +bool LLPanelEstateAccess::accessAddCore2(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) + { + // abort change + return false; + } + + LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]); + //Get parent floater name + LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess(); + LLFloater* parent_floater = panel ? gFloaterView->getParentFloater(panel) : NULL; + const std::string& parent_floater_name = parent_floater ? parent_floater->getName() : ""; + + //Determine the button that triggered opening of the avatar picker + //(so that a shadow frustum from the button to the avatar picker can be created) + LLView * button = NULL; + switch (change_info->mOperationFlag) + { + case ESTATE_ACCESS_ALLOWED_AGENT_ADD: + button = panel->findChild<LLButton>("add_allowed_avatar_btn"); + break; + + case ESTATE_ACCESS_BANNED_AGENT_ADD: + button = panel->findChild<LLButton>("add_banned_avatar_btn"); + break; + + case ESTATE_ACCESS_MANAGER_ADD: + button = panel->findChild<LLButton>("add_estate_manager_btn"); + break; + } + + // avatar picker yes multi-select, yes close-on-select + LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateAccess::accessAddCore3, _1, (void*)change_info), + TRUE, TRUE, FALSE, parent_floater_name, button); + + //Allows the closed parent floater to close the child floater (avatar picker) + if (child_floater) + { + parent_floater->addDependentFloater(child_floater); + } + + return false; +} + +// static +void LLPanelEstateAccess::accessAddCore3(const uuid_vec_t& ids, void* data) +{ + LLEstateAccessChangeInfo* change_info = (LLEstateAccessChangeInfo*)data; + if (!change_info) return; + if (ids.empty()) + { + // User didn't select a name. + delete change_info; + change_info = NULL; + return; + } + // User did select a name. + change_info->mAgentOrGroupIDs = ids; + // Can't put estate owner on ban list + LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess(); + if (!panel) return; + LLViewerRegion* region = gAgent.getRegion(); + if (!region) return; + + if (change_info->mOperationFlag & ESTATE_ACCESS_ALLOWED_AGENT_ADD) + { + LLNameListCtrl* name_list = panel->getChild<LLNameListCtrl>("allowed_avatar_name_list"); + int currentCount = (name_list ? name_list->getItemCount() : 0); + if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS) + { + LLSD args; + args["NUM_ADDED"] = llformat("%d", ids.size()); + args["MAX_AGENTS"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); + args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeAllowedAgents"); + args["NUM_EXCESS"] = llformat("%d", (ids.size() + currentCount) - ESTATE_MAX_ACCESS_IDS); + LLNotificationsUtil::add("MaxAgentOnRegionBatch", args); + delete change_info; + return; + } + + std::string already_allowed; + bool single = true; + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + LLScrollListItem* item = name_list->getNameItemByAgentId(*it); + if (item) + { + if (!already_allowed.empty()) + { + already_allowed += ", "; + single = false; + } + already_allowed += item->getColumn(0)->getValue().asString(); + } + } + if (!already_allowed.empty()) + { + LLSD args; + args["AGENT"] = already_allowed; + args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeAllowedAgents"); + LLNotificationsUtil::add(single ? "AgentIsAlreadyInList" : "AgentsAreAlreadyInList", args); + delete change_info; + return; + } + } + if (change_info->mOperationFlag & ESTATE_ACCESS_BANNED_AGENT_ADD) + { + LLNameListCtrl* name_list = panel->getChild<LLNameListCtrl>("banned_avatar_name_list"); + LLNameListCtrl* em_list = panel->getChild<LLNameListCtrl>("estate_manager_name_list"); + int currentCount = (name_list ? name_list->getItemCount() : 0); + if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS) + { + LLSD args; + args["NUM_ADDED"] = llformat("%d", ids.size()); + args["MAX_AGENTS"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); + args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeBannedAgents"); + args["NUM_EXCESS"] = llformat("%d", (ids.size() + currentCount) - ESTATE_MAX_ACCESS_IDS); + LLNotificationsUtil::add("MaxAgentOnRegionBatch", args); + delete change_info; + return; + } + + std::string already_banned; + std::string em_ban; + bool single = true; + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + LLScrollListItem* em_item = em_list->getNameItemByAgentId(*it); + if (em_item) + { + em_ban = em_item->getColumn(0)->getValue().asString(); + break; + } + + LLScrollListItem* item = name_list->getNameItemByAgentId(*it); + if (item) + { + if (!already_banned.empty()) + { + already_banned += ", "; + single = false; + } + already_banned += item->getColumn(0)->getValue().asString(); + } + } + if (!em_ban.empty()) + { + LLSD args; + args["AGENT"] = em_ban; + LLNotificationsUtil::add("ProblemBanningEstateManager", args); + delete change_info; + return; + } + if (!already_banned.empty()) + { + LLSD args; + args["AGENT"] = already_banned; + args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeBannedAgents"); + LLNotificationsUtil::add(single ? "AgentIsAlreadyInList" : "AgentsAreAlreadyInList", args); + delete change_info; + return; + } + } + + LLSD args; + args["ALL_ESTATES"] = all_estates_text(); + + LLNotification::Params params(change_info->mDialogName); + params.substitutions(args) + .payload(change_info->asLLSD()) + .functor.function(accessCoreConfirm); + + if (LLPanelEstateInfo::isLindenEstate()) + { + // just apply to this estate + LLNotifications::instance().forceResponse(params, 0); + } + else + { + // ask if this estate or all estates with this owner + LLNotifications::instance().add(params); + } +} + +// static +void LLPanelEstateAccess::accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name) +{ + LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess(); + if (!panel) return; + LLNameListCtrl* name_list = panel->getChild<LLNameListCtrl>(list_ctrl_name); + if (!name_list) return; + + std::vector<LLScrollListItem*> list_vector = name_list->getAllSelected(); + if (list_vector.size() == 0) + return; + + LLSD payload; + payload["operation"] = (S32)operation_flag; + payload["dialog_name"] = dialog_name; + + for (std::vector<LLScrollListItem*>::const_iterator iter = list_vector.begin(); + iter != list_vector.end(); + iter++) + { + LLScrollListItem *item = (*iter); + payload["allowed_ids"].append(item->getUUID()); + } + + LLNotification::Params params("ChangeLindenAccess"); + params.payload(payload) + .functor.function(accessRemoveCore2); + + if (LLPanelEstateInfo::isLindenEstate()) + { + // warn on change linden estate + LLNotifications::instance().add(params); + } + else + { + // just proceed, as if clicking OK + LLNotifications::instance().forceResponse(params, 0); + } +} + +// static +bool LLPanelEstateAccess::accessRemoveCore2(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) + { + // abort + return false; + } + + // If Linden estate, can only apply to "this" estate, not all estates + // owned by NULL. + if (LLPanelEstateInfo::isLindenEstate()) + { + accessCoreConfirm(notification, response); + } + else + { + LLSD args; + args["ALL_ESTATES"] = all_estates_text(); + LLNotificationsUtil::add(notification["payload"]["dialog_name"], + args, + notification["payload"], + accessCoreConfirm); + } + return false; +} + +// Used for both access add and remove operations, depending on the mOperationFlag +// passed in (ESTATE_ACCESS_BANNED_AGENT_ADD, ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, etc.) +// static +bool LLPanelEstateAccess::accessCoreConfirm(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + const U32 originalFlags = (U32)notification["payload"]["operation"].asInteger(); + U32 flags = originalFlags; + + LLViewerRegion* region = gAgent.getRegion(); + + if (option == 2) // cancel + { + return false; + } + else if (option == 1) + { + // All estates, either than I own or manage for this owner. + // This will be verified on simulator. JC + if (!region) return false; + if (region->getOwner() == gAgent.getID() + || gAgent.isGodlike()) + { + flags |= ESTATE_ACCESS_APPLY_TO_ALL_ESTATES; + } + else if (region->isEstateManager()) + { + flags |= ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES; + } + } + + std::string names; + bool single = true; + + LLSD::array_const_iterator end_it = notification["payload"]["allowed_ids"].endArray(); + for (LLSD::array_const_iterator iter = notification["payload"]["allowed_ids"].beginArray(); + iter != end_it; + iter++) + { + if (iter + 1 != end_it) + flags |= ESTATE_ACCESS_NO_REPLY; + + const LLUUID id = iter->asUUID(); + if (((U32)notification["payload"]["operation"].asInteger() & ESTATE_ACCESS_BANNED_AGENT_ADD) + && region && (region->getOwner() == id)) + { + LLNotificationsUtil::add("OwnerCanNotBeDenied"); + break; + } + + sendEstateAccessDelta(flags, id); + + // fill the name list for confirmation + LLAvatarName av_name; + if (LLAvatarNameCache::get(id, &av_name)) + { + if (!names.empty()) + { + names += ", "; + single = false; + } + names += av_name.getCompleteName(); + } + } + + if (!names.empty()) // show the conirmation + { + LLSD args; + args["AGENT"] = names; + + if (flags & (ESTATE_ACCESS_ALLOWED_AGENT_ADD | ESTATE_ACCESS_ALLOWED_AGENT_REMOVE)) + { + args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeAllowedAgents"); + } + else if (flags & (ESTATE_ACCESS_BANNED_AGENT_ADD | ESTATE_ACCESS_BANNED_AGENT_REMOVE)) + { + args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeBannedAgents"); + } + + if (flags & ESTATE_ACCESS_APPLY_TO_ALL_ESTATES) + { + args["ESTATE"] = LLTrans::getString("RegionInfoAllEstates"); + } + else if (flags & ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES) + { + args["ESTATE"] = LLTrans::getString("RegionInfoManagedEstates"); + } + else + { + args["ESTATE"] = LLTrans::getString("RegionInfoThisEstate"); + } + + if (flags & (ESTATE_ACCESS_ALLOWED_AGENT_ADD | ESTATE_ACCESS_BANNED_AGENT_ADD)) + { + LLNotificationsUtil::add(single ? "AgentWasAddedToList" : "AgentsWereAddedToList", args); + } + else if (flags & (ESTATE_ACCESS_ALLOWED_AGENT_REMOVE | ESTATE_ACCESS_BANNED_AGENT_REMOVE)) + { + LLNotificationsUtil::add(single ? "AgentWasRemovedFromList" : "AgentsWereRemovedFromList", args); + } + } + + return false; +} + +// key = "estateaccessdelta" +// str(estate_id) will be added to front of list by forward_EstateOwnerRequest_to_dataserver +// str[0] = str(agent_id) requesting the change +// str[1] = str(flags) (ESTATE_ACCESS_DELTA_*) +// str[2] = str(agent_id) to add or remove +// static +void LLPanelEstateAccess::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_group_id) +{ + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("EstateOwnerMessage"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used + + msg->nextBlock("MethodData"); + msg->addString("Method", "estateaccessdelta"); + msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); + + std::string buf; + gAgent.getID().toString(buf); + msg->nextBlock("ParamList"); + msg->addString("Parameter", buf); + + buf = llformat("%u", flags); + msg->nextBlock("ParamList"); + msg->addString("Parameter", buf); + + agent_or_group_id.toString(buf); + msg->nextBlock("ParamList"); + msg->addString("Parameter", buf); + + gAgent.sendReliableMessage(); + + + LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess(); + if (panel) + { + panel->updateLists(); + } +} + +void LLPanelEstateAccess::updateChild(LLUICtrl* child_ctrl) +{ + // Ensure appropriate state of the management ui. + updateControls(gAgent.getRegion()); +} + +void LLPanelEstateAccess::updateLists() +{ + std::string cap_url = gAgent.getRegionCapability("EstateAccess"); + if (!cap_url.empty()) + { + LLCoros::instance().launch("LLFloaterRegionInfo::requestEstateGetAccessCoro", boost::bind(LLPanelEstateAccess::requestEstateGetAccessCoro, cap_url)); + } +} + +void LLPanelEstateAccess::requestEstateGetAccessCoro(std::string url) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestEstateGetAccessoCoro", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + + LLSD result = httpAdapter->getAndSuspend(httpRequest, url); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess(); + if (!panel) return; + + LLNameListCtrl* allowed_agent_name_list = panel->getChild<LLNameListCtrl>("allowed_avatar_name_list"); + if (allowed_agent_name_list && result.has("AllowedAgents")) + { + LLStringUtil::format_map_t args; + args["[ALLOWEDAGENTS]"] = llformat("%d", result["AllowedAgents"].size()); + args["[MAXACCESS]"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedResidents", args); + panel->getChild<LLUICtrl>("allow_resident_label")->setValue(LLSD(msg)); + + allowed_agent_name_list->clearSortOrder(); + allowed_agent_name_list->deleteAllItems(); + for (LLSD::array_const_iterator it = result["AllowedAgents"].beginArray(); it != result["AllowedAgents"].endArray(); ++it) + { + LLUUID id = (*it)["id"].asUUID(); + allowed_agent_name_list->addNameItem(id); + } + allowed_agent_name_list->sortByName(TRUE); + } + + LLNameListCtrl* banned_agent_name_list = panel->getChild<LLNameListCtrl>("banned_avatar_name_list"); + if (banned_agent_name_list && result.has("BannedAgents")) + { + LLStringUtil::format_map_t args; + args["[BANNEDAGENTS]"] = llformat("%d", result["BannedAgents"].size()); + args["[MAXBANNED]"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); + std::string msg = LLTrans::getString("RegionInfoBannedResidents", args); + panel->getChild<LLUICtrl>("ban_resident_label")->setValue(LLSD(msg)); + + banned_agent_name_list->clearSortOrder(); + banned_agent_name_list->deleteAllItems(); + for (LLSD::array_const_iterator it = result["BannedAgents"].beginArray(); it != result["BannedAgents"].endArray(); ++it) + { + LLSD item; + item["id"] = (*it)["id"].asUUID(); + LLSD& columns = item["columns"]; + + columns[0]["column"] = "name"; // to be populated later + + columns[1]["column"] = "last_login_date"; + columns[1]["value"] = (*it)["last_login_date"].asString().substr(0, 16); // cut the seconds + + std::string ban_date = (*it)["ban_date"].asString(); + columns[2]["column"] = "ban_date"; + columns[2]["value"] = ban_date[0] != '0' ? ban_date.substr(0, 16) : LLTrans::getString("na"); // server returns the "0000-00-00 00:00:00" date in case it doesn't know it + + columns[3]["column"] = "bannedby"; + LLUUID banning_id = (*it)["banning_id"].asUUID(); + LLAvatarName av_name; + if (banning_id.isNull()) + { + columns[3]["value"] = LLTrans::getString("na"); + } + else if (LLAvatarNameCache::get(banning_id, &av_name)) + { + columns[3]["value"] = av_name.getCompleteName(); //TODO: fetch the name if it wasn't cached + } + + banned_agent_name_list->addElement(item); + } + banned_agent_name_list->sortByName(TRUE); + } + + LLNameListCtrl* allowed_group_name_list = panel->getChild<LLNameListCtrl>("allowed_group_name_list"); + if (allowed_group_name_list && result.has("AllowedGroups")) + { + LLStringUtil::format_map_t args; + args["[ALLOWEDGROUPS]"] = llformat("%d", result["AllowedGroups"].size()); + args["[MAXACCESS]"] = llformat("%d", ESTATE_MAX_GROUP_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedGroups", args); + panel->getChild<LLUICtrl>("allow_group_label")->setValue(LLSD(msg)); + + allowed_group_name_list->clearSortOrder(); + allowed_group_name_list->deleteAllItems(); + for (LLSD::array_const_iterator it = result["AllowedGroups"].beginArray(); it != result["AllowedGroups"].endArray(); ++it) + { + LLUUID id = (*it)["id"].asUUID(); + allowed_group_name_list->addNameItem(id); + } + allowed_group_name_list->sortByName(TRUE); + } + + LLNameListCtrl* estate_manager_name_list = panel->getChild<LLNameListCtrl>("estate_manager_name_list"); + if (estate_manager_name_list && result.has("Managers")) + { + LLStringUtil::format_map_t args; + args["[ESTATEMANAGERS]"] = llformat("%d", result["Managers"].size()); + args["[MAXMANAGERS]"] = llformat("%d", ESTATE_MAX_MANAGERS); + std::string msg = LLTrans::getString("RegionInfoEstateManagers", args); + panel->getChild<LLUICtrl>("estate_manager_label")->setValue(LLSD(msg)); + + estate_manager_name_list->clearSortOrder(); + estate_manager_name_list->deleteAllItems(); + for (LLSD::array_const_iterator it = result["Managers"].beginArray(); it != result["Managers"].endArray(); ++it) + { + LLUUID id = (*it)["agent_id"].asUUID(); + estate_manager_name_list->addNameItem(id); + } + estate_manager_name_list->sortByName(TRUE); + } + + + panel->updateControls(gAgent.getRegion()); +} + diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index c9d0e51640..20ba3a7d9c 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -64,6 +64,7 @@ class LLPanelEstateCovenant; class LLPanelExperienceListEditor; class LLPanelExperiences; class LLPanelRegionExperiences; +class LLPanelEstateAccess; class LLEventTimer; class LLEnvironmentSettings; @@ -92,6 +93,7 @@ public: //static void incrementSerial() { sRequestSerial++; } static LLPanelEstateInfo* getPanelEstate(); + static LLPanelEstateAccess* getPanelAccess(); static LLPanelEstateCovenant* getPanelCovenant(); static LLPanelRegionTerrainInfo* getPanelRegionTerrain(); static LLPanelRegionExperiences* getPanelExperiences(); @@ -110,8 +112,6 @@ private: LLFloaterRegionInfo(const LLSD& seed); ~LLFloaterRegionInfo(); - - protected: void onTabSelected(const LLSD& param); void disableTabCtrls(); @@ -281,35 +281,11 @@ public: void onClickEditDayCycle(); void onClickEditDayCycleHelp(); - void onClickAddAllowedAgent(); - void onClickRemoveAllowedAgent(); - void onClickAddAllowedGroup(); - void onClickRemoveAllowedGroup(); - void onClickAddBannedAgent(); - void onClickRemoveBannedAgent(); - void onClickAddEstateManager(); - void onClickRemoveEstateManager(); void onClickKickUser(); - // Group picker callback is different, can't use core methods below - bool addAllowedGroup(const LLSD& notification, const LLSD& response); - void addAllowedGroup2(LLUUID id); - // Core methods for all above add/remove button clicks - static void accessAddCore(U32 operation_flag, const std::string& dialog_name); - static bool accessAddCore2(const LLSD& notification, const LLSD& response); - static void accessAddCore3(const uuid_vec_t& ids, void* data); - - static void accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name); - static bool accessRemoveCore2(const LLSD& notification, const LLSD& response); - - // used for both add and remove operations - static bool accessCoreConfirm(const LLSD& notification, const LLSD& response); bool kickUserConfirm(const LLSD& notification, const LLSD& response); - // Send the actual EstateOwnerRequest "estateaccessdelta" message - static void sendEstateAccessDelta(U32 flags, const LLUUID& agent_id); - void onKickUserCommit(const uuid_vec_t& ids); static void onClickMessageEstate(void* data); bool onMessageCommit(const LLSD& notification, const LLSD& response); @@ -345,7 +321,6 @@ protected: void commitEstateAccess(); void commitEstateManagers(); - void clearAccessLists(); BOOL checkSunHourSlider(LLUICtrl* child_ctrl); U32 mEstateID; @@ -507,4 +482,47 @@ private: LLUUID mDefaultExperience; }; + +class LLPanelEstateAccess : public LLPanelRegionInfo +{ + LOG_CLASS(LLPanelEnvironmentInfo); + +public: + virtual BOOL postBuild(); + virtual void updateChild(LLUICtrl* child_ctrl); + + void updateControls(LLViewerRegion* region); + void updateLists(); + +private: + void onClickAddAllowedAgent(); + void onClickRemoveAllowedAgent(); + void onClickAddAllowedGroup(); + void onClickRemoveAllowedGroup(); + void onClickAddBannedAgent(); + void onClickRemoveBannedAgent(); + void onClickAddEstateManager(); + void onClickRemoveEstateManager(); + + // Group picker callback is different, can't use core methods below + bool addAllowedGroup(const LLSD& notification, const LLSD& response); + void addAllowedGroup2(LLUUID id); + + // Core methods for all above add/remove button clicks + static void accessAddCore(U32 operation_flag, const std::string& dialog_name); + static bool accessAddCore2(const LLSD& notification, const LLSD& response); + static void accessAddCore3(const uuid_vec_t& ids, void* data); + + static void accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name); + static bool accessRemoveCore2(const LLSD& notification, const LLSD& response); + + // used for both add and remove operations + static bool accessCoreConfirm(const LLSD& notification, const LLSD& response); + + // Send the actual EstateOwnerRequest "estateaccessdelta" message + static void sendEstateAccessDelta(U32 flags, const LLUUID& agent_id); + + static void requestEstateGetAccessCoro(std::string url); +}; + #endif diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index fe75ab8e50..949f70d8dc 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -415,6 +415,20 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) } } +// public +LLScrollListItem* LLNameListCtrl::getNameItemByAgentId(const LLUUID& agent_id) +{ + for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++) + { + LLScrollListItem* item = *it; + if (item && item->getUUID() == agent_id) + { + return item; + } + } + return NULL; +} + void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, std::string suffix, diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 677b49e667..50b4d80302 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -154,6 +154,8 @@ public: void removeNameItem(const LLUUID& agent_id); + LLScrollListItem* getNameItemByAgentId(const LLUUID& agent_id); + // LLView interface /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index feaafad2e1..dba47fe656 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2829,6 +2829,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("DispatchRegionInfo"); capabilityNames.append("DirectDelivery"); capabilityNames.append("EnvironmentSettings"); + capabilityNames.append("EstateAccess"); capabilityNames.append("EstateChangeInfo"); capabilityNames.append("EventQueueGet"); capabilityNames.append("FacebookConnect"); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 7f9dc0c41f..a1494515ed 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3805,6 +3805,55 @@ Can't add estate owner to estate 'Banned Resident' list. type="alertmodal"> Unable to add banned resident to estate manager list. </notification> + + <notification + icon="alertmodal.tga" + name="ProblemBanningEstateManager" + type="alertmodal"> +Unable to add estate manager [AGENT] to banned list. + </notification> + + <notification + icon="alertmodal.tga" + name="AgentIsAlreadyInList" + type="alertmodal"> +[AGENT] is already in your [LIST_TYPE] list. + </notification> + + <notification + icon="alertmodal.tga" + name="AgentsAreAlreadyInList" + type="alertmodal"> +[AGENT] are already in your [LIST_TYPE] list. + </notification> + + <notification + icon="alertmodal.tga" + name="AgentWasAddedToList" + type="alertmodal"> +[AGENT] was added to [LIST_TYPE] list of [ESTATE]. + </notification> + + <notification + icon="alertmodal.tga" + name="AgentsWereAddedToList" + type="alertmodal"> +[AGENT] were added to [LIST_TYPE] list of [ESTATE]. + + </notification> + <notification + icon="alertmodal.tga" + name="AgentWasRemovedFromList" + type="alertmodal"> +[AGENT] was removed from [LIST_TYPE] list of [ESTATE]. + </notification> + + <notification + icon="alertmodal.tga" + name="AgentsWereRemovedFromList" + type="alertmodal"> +[AGENT] were removed from [LIST_TYPE] list of [ESTATE]. + </notification> <notification icon="alertmodal.tga" diff --git a/indra/newview/skins/default/xui/en/panel_region_access.xml b/indra/newview/skins/default/xui/en/panel_region_access.xml new file mode 100644 index 0000000000..7f6df426de --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_region_access.xml @@ -0,0 +1,313 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="top|left" + height="510" + help_topic="panel_region_access_tab" + label="Access" + layout="topleft" + left="0" + name="Access" + top="320" + width="530"> + + +<tab_container + bottom="-10" + follows="all" + layout="topleft" + left="3" + name="tabs" + tab_min_width="70" + tab_height="30" + tab_position="top" + top="10" + halign="center" + right="-5"> + +<!-- ============================= ESTATE MANAGERS tab ====================== --> + <panel + background_opaque="true" + background_visible="true" + bg_alpha_color="DkGray" + bg_opaque_color="DkGray" + bottom="-1" + follows="all" + label="ESTATE MANAGERS" + layout="topleft" + left="0" + help_topic="estate_managers_tab" + name="estate_managers_panel" + right="-1" + top="0"> + <text + type="string" + length="1" + bottom="34" + follows="left|top" + height="20" + layout="topleft" + name="estate_manager_label" + top_pad="10" + left="10" + width="200"> + Estate Managers: + </text> + <!-- Estate Managers box --> + <view_border + bevel_style="none" + follows="top|left" + height="400" + layout="topleft" + left="10" + top_pad="-5" + width="498" /> + <name_list + follows="left|top" + height="400" + layout="topleft" + left_delta="0" + multi_select="true" + name="estate_manager_name_list" + top_delta="0" + width="498" /> + <!-- Estate Managers buttons --> + <button + follows="left|top" + height="23" + label="Add..." + layout="topleft" + left="10" + name="add_estate_manager_btn" + top_pad="6" + width="114" /> + <button + follows="left|top" + height="23" + label="Remove..." + layout="topleft" + name="remove_estate_manager_btn" + left_pad="6" + width="114" /> + </panel> + + +<!-- ================================ ALLOWED tab =========================== --> + <panel + background_opaque="true" + background_visible="true" + bg_alpha_color="DkGray" + bg_opaque_color="DkGray" + bottom="-1" + follows="all" + label="ALLOWED" + layout="topleft" + left="0" + help_topic="allowed_tab" + name="allowed_panel" + right="-1" + top="0"> + <text + type="string" + length="1" + bottom="34" + follows="left|top" + height="20" + layout="topleft" + name="allow_resident_label" + top_pad="10" + left="10" + width="200"> + Always allowed: + </text> + <!-- Always allowed box --> + <view_border + bevel_style="none" + follows="top|left" + height="400" + layout="topleft" + left="10" + top_pad="-5" + width="498" /> + <name_list + follows="left|top" + height="400" + layout="topleft" + left_delta="0" + multi_select="true" + name="allowed_avatar_name_list" + top_delta="0" + width="498" /> + <!-- Always allowed buttons --> + <button + follows="left|top" + height="23" + label="Add..." + layout="topleft" + left="10" + name="add_allowed_avatar_btn" + top_pad="6" + width="114" /> + <button + follows="left|top" + height="23" + label="Remove..." + layout="topleft" + name="remove_allowed_avatar_btn" + left_pad="6" + width="114" /> + </panel> + + <!-- ============================= ALLOWED GROUPS tab ======================= --> + <panel + background_opaque="true" + background_visible="true" + bg_alpha_color="DkGray" + bg_opaque_color="DkGray" + bottom="-1" + follows="all" + label="ALLOWED GROUPS" + layout="topleft" + left="0" + help_topic="allowed_groups_tab" + name="allowed_groups_panel" + right="-1" + top="0"> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="allow_group_label" + top_pad="10" + width="200"> + Groups always allowed: + </text> + <!-- Groups always allowed box --> + <view_border + bevel_style="none" + follows="top|left" + height="400" + layout="topleft" + left="10" + top_pad="-5" + width="498" /> + <name_list + follows="left|top" + height="400" + layout="topleft" + left_delta="0" + multi_select="true" + name="allowed_group_name_list" + top_delta="0" + width="498" /> + <!-- Groups always allowed buttons --> + <button + follows="left|top" + height="23" + label="Add..." + layout="topleft" + left="10" + name="add_allowed_group_btn" + top_pad="6" + width="114" /> + <button + follows="left|top" + height="23" + label="Remove..." + layout="topleft" + name="remove_allowed_group_btn" + left_pad="6" + top_delta="0" + width="114" /> + </panel> + + <!-- ================================ BANNED tab ============================ --> + <panel + background_opaque="true" + background_visible="true" + bg_alpha_color="DkGray" + bg_opaque_color="DkGray" + bottom="-1" + follows="all" + label="BANNED" + layout="topleft" + left="0" + help_topic="banned_tab" + name="banned_panel" + right="-1" + top="0"> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="ban_resident_label" + top_pad="10" + width="200"> + Always banned: + </text> + <!-- Always banned box --> + <view_border + bevel_style="none" + follows="top|left" + height="400" + layout="topleft" + left="10" + top_pad="-5" + width="498" /> + <name_list + draw_heading="true" + follows="left|top" + height="400" + layout="topleft" + left_delta="0" + multi_select="true" + name="banned_avatar_name_list" + top_delta="0" + width="498"> + <columns + label="Name" + name="name" + width="140" /> + <columns + label="Last login date" + name="last_login_date" + width="100" /> + <columns + label="Date banned" + name="ban_date" + width="100" /> + <columns + label="Banned by" + name="bannedby" + width="140" /> + </name_list> + <!-- Always banned buttons --> + <button + follows="left|top" + height="23" + label="Add..." + layout="topleft" + left="10" + name="add_banned_avatar_btn" + top_pad="6" + width="114" /> + <button + follows="left|top" + height="23" + label="Remove..." + layout="topleft" + name="remove_banned_avatar_btn" + left_pad="6" + top_delta="0" + width="114" /> + </panel> + + +</tab_container> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_estate.xml b/indra/newview/skins/default/xui/en/panel_region_estate.xml index a0c1dd0be6..0e99fb1c14 100644 --- a/indra/newview/skins/default/xui/en/panel_region_estate.xml +++ b/indra/newview/skins/default/xui/en/panel_region_estate.xml @@ -159,212 +159,6 @@ top_pad="30" left_delta="0" width="97" /> - - <text - type="string" - length="1" - bottom="34" - follows="left|top" - height="20" - layout="topleft" - name="estate_manager_label" - top_pad="25" - left="10" - width="200"> - Estate Managers: - </text> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left="280" - name="allow_resident_label" - top_delta="0" - width="200"> - Always allowed: - </text> - - <!-- Estate Managers box --> - <view_border - bevel_style="none" - follows="top|left" - height="71" - layout="topleft" - left="10" - top_pad="-5" - width="235" /> - <name_list - follows="left|top" - height="71" - layout="topleft" - left_delta="0" - multi_select="true" - name="estate_manager_name_list" - top_delta="0" - width="235" /> - - <!-- Always allowed box --> - <view_border - bevel_style="none" - follows="top|left" - height="71" - layout="topleft" - left="280" - top_delta="0" - width="235" /> - <name_list - follows="left|top" - height="71" - layout="topleft" - left_delta="0" - multi_select="true" - name="allowed_avatar_name_list" - top_delta="0" - width="235" /> - - <!-- Estate Managers buttons --> - <button - follows="left|top" - height="23" - label="Add..." - layout="topleft" - left="10" - name="add_estate_manager_btn" - top_pad="6" - width="114" /> - <button - follows="left|top" - height="23" - label="Remove..." - layout="topleft" - name="remove_estate_manager_btn" - left_pad="6" - width="114" /> - - <!-- Always allowed buttons --> - <button - follows="left|top" - height="23" - left="280" - label="Add..." - layout="topleft" - name="add_allowed_avatar_btn" - top_delta="0" - width="114" /> - <button - follows="left|top" - height="23" - label="Remove..." - layout="topleft" - name="remove_allowed_avatar_btn" - left_pad="6" - top_delta="0" - width="114" /> - - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left="10" - name="allow_group_label" - top_pad="10" - width="200"> - Groups always allowed: - </text> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left="280" - name="ban_resident_label" - top_delta="0" - width="200"> - Always banned: - </text> - - <!-- Groups always allowed box --> - <view_border - bevel_style="none" - follows="top|left" - height="71" - layout="topleft" - left="10" - top_pad="-5" - width="235" /> - <name_list - follows="left|top" - height="71" - layout="topleft" - left_delta="0" - multi_select="true" - name="allowed_group_name_list" - top_delta="0" - width="235" /> - - <!-- Always banned box --> - <view_border - bevel_style="none" - follows="top|left" - height="71" - layout="topleft" - left="280" - top_delta="0" - width="235" /> - <name_list - follows="left|top" - height="71" - layout="topleft" - left_delta="0" - multi_select="true" - name="banned_avatar_name_list" - top_delta="0" - width="235" /> - - <!-- Groups always allowed buttons --> - <button - follows="left|top" - height="23" - label="Add..." - layout="topleft" - left="10" - name="add_allowed_group_btn" - top_pad="6" - width="114" /> - <button - follows="left|top" - height="23" - label="Remove..." - layout="topleft" - name="remove_allowed_group_btn" - left_pad="6" - top_delta="0" - width="114" /> - - <!-- Always banned buttons --> - <button - follows="left|top" - height="23" - label="Add..." - layout="topleft" - left="280" - name="add_banned_avatar_btn" - top_delta="0" - width="114" /> - <button - follows="left|top" - height="23" - label="Remove..." - layout="topleft" - name="remove_banned_avatar_btn" - top_delta="0" - left_pad="6" - width="114" /> <button follows="left|top" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 882fbaf634..fd2749bb81 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2658,6 +2658,9 @@ If you continue to receive this message, please contact Second Life support for <string name="RegionInfoBannedResidents">Always banned: ([BANNEDAGENTS], max [MAXBANNED])</string> <string name="RegionInfoListTypeAllowedAgents">Always allowed</string> <string name="RegionInfoListTypeBannedAgents">Always banned</string> + <string name="RegionInfoAllEstates">all estates</string> + <string name="RegionInfoManagedEstates">managed estates</string> + <string name="RegionInfoThisEstate">this estate</string> <!-- script limits floater --> <string name="ScriptLimitsParcelScriptMemory">Parcel Script Memory</string> |