aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterregioninfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterregioninfo.cpp214
1 files changed, 34 insertions, 180 deletions
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index 60bdfcd..8810a5c 100644
--- a/linden/indra/newview/llfloaterregioninfo.cpp
+++ b/linden/indra/newview/llfloaterregioninfo.cpp
@@ -362,13 +362,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
362 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) ); 362 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) );
363 panel->childSetValue("access_combo", LLSD(sim_access) ); 363 panel->childSetValue("access_combo", LLSD(sim_access) );
364 364
365 365 panel->childSetEnabled("access_combo", gAgent.isGodlike() || (region && region->canManageEstate() ));
366 // detect teen grid for maturity
367
368 U32 parent_estate_id;
369 msg->getU32("RegionInfo", "ParentEstateID", parent_estate_id);
370 BOOL teen_grid = (parent_estate_id == 5); // *TODO add field to estate table and test that
371 panel->childSetEnabled("access_combo", gAgent.isGodlike() || (region && region->canManageEstate() && !teen_grid));
372 panel->setCtrlsEnabled(allow_modify); 366 panel->setCtrlsEnabled(allow_modify);
373 367
374 // RegionSettings PANEL 368 // RegionSettings PANEL
@@ -1243,10 +1237,10 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1243 llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl; 1237 llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl;
1244 1238
1245 // Make sure user hasn't chosen wacky textures. 1239 // Make sure user hasn't chosen wacky textures.
1246 //if (!validateTextureSizes()) 1240// if (!validateTextureSizes())
1247 //{ 1241// {
1248 // return FALSE; 1242// return FALSE;
1249 //} 1243// }
1250 1244
1251 LLTextureCtrl* texture_ctrl; 1245 LLTextureCtrl* texture_ctrl;
1252 std::string buffer; 1246 std::string buffer;
@@ -1649,16 +1643,9 @@ void LLPanelEstateInfo::onClickAddAllowedGroup(void* user_data)
1649 return; 1643 return;
1650 } 1644 }
1651 1645
1652 LLNotification::Params params("ChangeLindenAccess"); 1646 LLNotification::Params params("PfftLindenCrap");
1653 params.functor(boost::bind(&LLPanelEstateInfo::addAllowedGroup, self, _1, _2)); 1647 params.functor(boost::bind(&LLPanelEstateInfo::addAllowedGroup, self, _1, _2));
1654 if (isLindenEstate()) 1648 LLNotifications::instance().forceResponse(params, 0);
1655 {
1656 LLNotifications::instance().add(params);
1657 }
1658 else
1659 {
1660 LLNotifications::instance().forceResponse(params, 0);
1661 }
1662} 1649}
1663 1650
1664bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& response) 1651bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& response)
@@ -1836,16 +1823,6 @@ std::string all_estates_text()
1836 } 1823 }
1837} 1824}
1838 1825
1839// static
1840bool LLPanelEstateInfo::isLindenEstate()
1841{
1842 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
1843 if (!panel) return false;
1844
1845 U32 estate_id = panel->getEstateID();
1846 return (estate_id <= ESTATE_LAST_LINDEN);
1847}
1848
1849typedef std::vector<LLUUID> AgentOrGroupIDsVector; 1826typedef std::vector<LLUUID> AgentOrGroupIDsVector;
1850struct LLEstateAccessChangeInfo 1827struct LLEstateAccessChangeInfo
1851{ 1828{
@@ -1897,14 +1874,7 @@ void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data)
1897 params.payload(payload) 1874 params.payload(payload)
1898 .substitutions(args) 1875 .substitutions(args)
1899 .functor(accessCoreConfirm); 1876 .functor(accessCoreConfirm);
1900 if (isLindenEstate()) 1877 LLNotifications::instance().add(params);
1901 {
1902 LLNotifications::instance().forceResponse(params, 0);
1903 }
1904 else
1905 {
1906 LLNotifications::instance().add(params);
1907 }
1908} 1878}
1909 1879
1910// static 1880// static
@@ -1915,19 +1885,12 @@ void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dia
1915 payload["dialog_name"] = dialog_name; 1885 payload["dialog_name"] = dialog_name;
1916 // agent id filled in after avatar picker 1886 // agent id filled in after avatar picker
1917 1887
1918 LLNotification::Params params("ChangeLindenAccess"); 1888 LLNotification::Params params("PfftLindenCrap");
1919 params.payload(payload) 1889 params.payload(payload)
1920 .functor(accessAddCore2); 1890 .functor(accessAddCore2);
1921 1891
1922 if (isLindenEstate()) 1892 // same as clicking "OK"
1923 { 1893 LLNotifications::instance().forceResponse(params, 0);
1924 LLNotifications::instance().add(params);
1925 }
1926 else
1927 {
1928 // same as clicking "OK"
1929 LLNotifications::instance().forceResponse(params, 0);
1930 }
1931} 1894}
1932 1895
1933// static 1896// static
@@ -2007,16 +1970,8 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co
2007 .payload(change_info->asLLSD()) 1970 .payload(change_info->asLLSD())
2008 .functor(accessCoreConfirm); 1971 .functor(accessCoreConfirm);
2009 1972
2010 if (isLindenEstate()) 1973 // ask if this estate or all estates with this owner
2011 { 1974 LLNotifications::instance().add(params);
2012 // just apply to this estate
2013 LLNotifications::instance().forceResponse(params, 0);
2014 }
2015 else
2016 {
2017 // ask if this estate or all estates with this owner
2018 LLNotifications::instance().add(params);
2019 }
2020} 1975}
2021 1976
2022// static 1977// static
@@ -2043,20 +1998,12 @@ void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string&
2043 payload["allowed_ids"].append(item->getUUID()); 1998 payload["allowed_ids"].append(item->getUUID());
2044 } 1999 }
2045 2000
2046 LLNotification::Params params("ChangeLindenAccess"); 2001 LLNotification::Params params("PfftLindenCrap");
2047 params.payload(payload) 2002 params.payload(payload)
2048 .functor(accessRemoveCore2); 2003 .functor(accessRemoveCore2);
2049 2004
2050 if (isLindenEstate()) 2005 // just proceed, as if clicking OK
2051 { 2006 LLNotifications::instance().forceResponse(params, 0);
2052 // warn on change linden estate
2053 LLNotifications::instance().add(params);
2054 }
2055 else
2056 {
2057 // just proceed, as if clicking OK
2058 LLNotifications::instance().forceResponse(params, 0);
2059 }
2060} 2007}
2061 2008
2062// static 2009// static
@@ -2069,21 +2016,12 @@ bool LLPanelEstateInfo::accessRemoveCore2(const LLSD& notification, const LLSD&
2069 return false; 2016 return false;
2070 } 2017 }
2071 2018
2072 // If Linden estate, can only apply to "this" estate, not all estates 2019 LLSD args;
2073 // owned by NULL. 2020 args["ALL_ESTATES"] = all_estates_text();
2074 if (isLindenEstate()) 2021 LLNotifications::instance().add(notification["payload"]["dialog_name"],
2075 { 2022 args,
2076 accessCoreConfirm(notification, response); 2023 notification["payload"],
2077 } 2024 accessCoreConfirm);
2078 else
2079 {
2080 LLSD args;
2081 args["ALL_ESTATES"] = all_estates_text();
2082 LLNotifications::instance().add(notification["payload"]["dialog_name"],
2083 args,
2084 notification["payload"],
2085 accessCoreConfirm);
2086 }
2087 return false; 2025 return false;
2088} 2026}
2089 2027
@@ -2365,52 +2303,23 @@ BOOL LLPanelEstateInfo::sendUpdate()
2365{ 2303{
2366 llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl; 2304 llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl;
2367 2305
2368 LLNotification::Params params("ChangeLindenEstate"); 2306 // send the update
2369 params.functor(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); 2307 if (!commitEstateInfoCaps())
2370
2371 if (getEstateID() <= ESTATE_LAST_LINDEN)
2372 {
2373 // trying to change reserved estate, warn
2374 LLNotifications::instance().add(params);
2375 }
2376 else
2377 { 2308 {
2378 // for normal estates, just make the change 2309 // the caps method failed, try the old way
2379 LLNotifications::instance().forceResponse(params, 0); 2310 LLFloaterRegionInfo::nextInvoice();
2311 commitEstateInfoDataserver();
2380 } 2312 }
2313 // we don't want to do this because we'll get it automatically from the sim
2314 // after the spaceserver processes it
2315// else
2316// {
2317// // caps method does not automatically send this info
2318// LLFloaterRegionInfo::requestRegionInfo();
2319// }
2381 return TRUE; 2320 return TRUE;
2382} 2321}
2383 2322
2384bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, const LLSD& response)
2385{
2386 S32 option = LLNotification::getSelectedOption(notification, response);
2387 switch(option)
2388 {
2389 case 0:
2390 // send the update
2391 if (!commitEstateInfoCaps())
2392 {
2393 // the caps method failed, try the old way
2394 LLFloaterRegionInfo::nextInvoice();
2395 commitEstateInfoDataserver();
2396 }
2397 // we don't want to do this because we'll get it automatically from the sim
2398 // after the spaceserver processes it
2399// else
2400// {
2401// // caps method does not automatically send this info
2402// LLFloaterRegionInfo::requestRegionInfo();
2403// }
2404 break;
2405 case 1:
2406 default:
2407 // do nothing
2408 break;
2409 }
2410 return false;
2411}
2412
2413
2414/* 2323/*
2415// Request = "getowner" 2324// Request = "getowner"
2416// SParam[0] = "" (empty string) 2325// SParam[0] = "" (empty string)
@@ -2663,47 +2572,6 @@ void LLPanelEstateInfo::setAbuseEmailAddress(const std::string& address)
2663 childSetValue("abuse_email_address", LLSD(address)); 2572 childSetValue("abuse_email_address", LLSD(address));
2664} 2573}
2665 2574
2666void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent,
2667 bool enable_group,
2668 bool enable_ban)
2669{
2670 childSetEnabled("allow_resident_label", enable_agent);
2671 childSetEnabled("allowed_avatar_name_list", enable_agent);
2672 childSetVisible("allowed_avatar_name_list", enable_agent);
2673 childSetEnabled("add_allowed_avatar_btn", enable_agent);
2674 childSetEnabled("remove_allowed_avatar_btn", enable_agent);
2675
2676 // Groups
2677 childSetEnabled("allow_group_label", enable_group);
2678 childSetEnabled("allowed_group_name_list", enable_group);
2679 childSetVisible("allowed_group_name_list", enable_group);
2680 childSetEnabled("add_allowed_group_btn", enable_group);
2681 childSetEnabled("remove_allowed_group_btn", enable_group);
2682
2683 // Ban
2684 childSetEnabled("ban_resident_label", enable_ban);
2685 childSetEnabled("banned_avatar_name_list", enable_ban);
2686 childSetVisible("banned_avatar_name_list", enable_ban);
2687 childSetEnabled("add_banned_avatar_btn", enable_ban);
2688 childSetEnabled("remove_banned_avatar_btn", enable_ban);
2689
2690 // Update removal buttons if needed
2691 if (enable_agent)
2692 {
2693 checkRemovalButton("allowed_avatar_name_list");
2694 }
2695
2696 if (enable_group)
2697 {
2698 checkRemovalButton("allowed_group_name_list");
2699 }
2700
2701 if (enable_ban)
2702 {
2703 checkRemovalButton("banned_avatar_name_list");
2704 }
2705}
2706
2707// static 2575// static
2708void LLPanelEstateInfo::callbackCacheName( 2576void LLPanelEstateInfo::callbackCacheName(
2709 const LLUUID& id, 2577 const LLUUID& id,
@@ -3240,20 +3108,6 @@ bool LLDispatchEstateUpdateInfo::operator()(
3240 panel->setSunHour(sun_hour); 3108 panel->setSunHour(sun_hour);
3241 } 3109 }
3242 3110
3243 bool visible_from_mainland = (bool)(flags & REGION_FLAGS_EXTERNALLY_VISIBLE);
3244 bool god = gAgent.isGodlike();
3245 bool linden_estate = (estate_id <= ESTATE_LAST_LINDEN);
3246
3247 // If visible from mainland, disable the access allowed
3248 // UI, as anyone can teleport there.
3249 // However, gods need to be able to edit the access list for
3250 // linden estates, regardless of visibility, to allow object
3251 // and L$ transfers.
3252 bool enable_agent = (!visible_from_mainland || (god && linden_estate));
3253 bool enable_group = enable_agent;
3254 bool enable_ban = !linden_estate;
3255 panel->setAccessAllowedEnabled(enable_agent, enable_group, enable_ban);
3256
3257 return true; 3111 return true;
3258} 3112}
3259 3113