aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterregioninfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterregioninfo.cpp')
-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 505f8e6..08bda48 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)
@@ -1829,16 +1816,6 @@ std::string all_estates_text()
1829 } 1816 }
1830} 1817}
1831 1818
1832// static
1833bool LLPanelEstateInfo::isLindenEstate()
1834{
1835 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
1836 if (!panel) return false;
1837
1838 U32 estate_id = panel->getEstateID();
1839 return (estate_id <= ESTATE_LAST_LINDEN);
1840}
1841
1842typedef std::vector<LLUUID> AgentOrGroupIDsVector; 1819typedef std::vector<LLUUID> AgentOrGroupIDsVector;
1843struct LLEstateAccessChangeInfo 1820struct LLEstateAccessChangeInfo
1844{ 1821{
@@ -1890,14 +1867,7 @@ void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data)
1890 params.payload(payload) 1867 params.payload(payload)
1891 .substitutions(args) 1868 .substitutions(args)
1892 .functor(accessCoreConfirm); 1869 .functor(accessCoreConfirm);
1893 if (isLindenEstate()) 1870 LLNotifications::instance().add(params);
1894 {
1895 LLNotifications::instance().forceResponse(params, 0);
1896 }
1897 else
1898 {
1899 LLNotifications::instance().add(params);
1900 }
1901} 1871}
1902 1872
1903// static 1873// static
@@ -1908,19 +1878,12 @@ void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dia
1908 payload["dialog_name"] = dialog_name; 1878 payload["dialog_name"] = dialog_name;
1909 // agent id filled in after avatar picker 1879 // agent id filled in after avatar picker
1910 1880
1911 LLNotification::Params params("ChangeLindenAccess"); 1881 LLNotification::Params params("PfftLindenCrap");
1912 params.payload(payload) 1882 params.payload(payload)
1913 .functor(accessAddCore2); 1883 .functor(accessAddCore2);
1914 1884
1915 if (isLindenEstate()) 1885 // same as clicking "OK"
1916 { 1886 LLNotifications::instance().forceResponse(params, 0);
1917 LLNotifications::instance().add(params);
1918 }
1919 else
1920 {
1921 // same as clicking "OK"
1922 LLNotifications::instance().forceResponse(params, 0);
1923 }
1924} 1887}
1925 1888
1926// static 1889// static
@@ -2000,16 +1963,8 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co
2000 .payload(change_info->asLLSD()) 1963 .payload(change_info->asLLSD())
2001 .functor(accessCoreConfirm); 1964 .functor(accessCoreConfirm);
2002 1965
2003 if (isLindenEstate()) 1966 // ask if this estate or all estates with this owner
2004 { 1967 LLNotifications::instance().add(params);
2005 // just apply to this estate
2006 LLNotifications::instance().forceResponse(params, 0);
2007 }
2008 else
2009 {
2010 // ask if this estate or all estates with this owner
2011 LLNotifications::instance().add(params);
2012 }
2013} 1968}
2014 1969
2015// static 1970// static
@@ -2036,20 +1991,12 @@ void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string&
2036 payload["allowed_ids"].append(item->getUUID()); 1991 payload["allowed_ids"].append(item->getUUID());
2037 } 1992 }
2038 1993
2039 LLNotification::Params params("ChangeLindenAccess"); 1994 LLNotification::Params params("PfftLindenCrap");
2040 params.payload(payload) 1995 params.payload(payload)
2041 .functor(accessRemoveCore2); 1996 .functor(accessRemoveCore2);
2042 1997
2043 if (isLindenEstate()) 1998 // just proceed, as if clicking OK
2044 { 1999 LLNotifications::instance().forceResponse(params, 0);
2045 // warn on change linden estate
2046 LLNotifications::instance().add(params);
2047 }
2048 else
2049 {
2050 // just proceed, as if clicking OK
2051 LLNotifications::instance().forceResponse(params, 0);
2052 }
2053} 2000}
2054 2001
2055// static 2002// static
@@ -2062,21 +2009,12 @@ bool LLPanelEstateInfo::accessRemoveCore2(const LLSD& notification, const LLSD&
2062 return false; 2009 return false;
2063 } 2010 }
2064 2011
2065 // If Linden estate, can only apply to "this" estate, not all estates 2012 LLSD args;
2066 // owned by NULL. 2013 args["ALL_ESTATES"] = all_estates_text();
2067 if (isLindenEstate()) 2014 LLNotifications::instance().add(notification["payload"]["dialog_name"],
2068 { 2015 args,
2069 accessCoreConfirm(notification, response); 2016 notification["payload"],
2070 } 2017 accessCoreConfirm);
2071 else
2072 {
2073 LLSD args;
2074 args["ALL_ESTATES"] = all_estates_text();
2075 LLNotifications::instance().add(notification["payload"]["dialog_name"],
2076 args,
2077 notification["payload"],
2078 accessCoreConfirm);
2079 }
2080 return false; 2018 return false;
2081} 2019}
2082 2020
@@ -2358,52 +2296,23 @@ BOOL LLPanelEstateInfo::sendUpdate()
2358{ 2296{
2359 llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl; 2297 llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl;
2360 2298
2361 LLNotification::Params params("ChangeLindenEstate"); 2299 // send the update
2362 params.functor(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); 2300 if (!commitEstateInfoCaps())
2363
2364 if (getEstateID() <= ESTATE_LAST_LINDEN)
2365 {
2366 // trying to change reserved estate, warn
2367 LLNotifications::instance().add(params);
2368 }
2369 else
2370 { 2301 {
2371 // for normal estates, just make the change 2302 // the caps method failed, try the old way
2372 LLNotifications::instance().forceResponse(params, 0); 2303 LLFloaterRegionInfo::nextInvoice();
2304 commitEstateInfoDataserver();
2373 } 2305 }
2306 // we don't want to do this because we'll get it automatically from the sim
2307 // after the spaceserver processes it
2308// else
2309// {
2310// // caps method does not automatically send this info
2311// LLFloaterRegionInfo::requestRegionInfo();
2312// }
2374 return TRUE; 2313 return TRUE;
2375} 2314}
2376 2315
2377bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, const LLSD& response)
2378{
2379 S32 option = LLNotification::getSelectedOption(notification, response);
2380 switch(option)
2381 {
2382 case 0:
2383 // send the update
2384 if (!commitEstateInfoCaps())
2385 {
2386 // the caps method failed, try the old way
2387 LLFloaterRegionInfo::nextInvoice();
2388 commitEstateInfoDataserver();
2389 }
2390 // we don't want to do this because we'll get it automatically from the sim
2391 // after the spaceserver processes it
2392// else
2393// {
2394// // caps method does not automatically send this info
2395// LLFloaterRegionInfo::requestRegionInfo();
2396// }
2397 break;
2398 case 1:
2399 default:
2400 // do nothing
2401 break;
2402 }
2403 return false;
2404}
2405
2406
2407/* 2316/*
2408// Request = "getowner" 2317// Request = "getowner"
2409// SParam[0] = "" (empty string) 2318// SParam[0] = "" (empty string)
@@ -2656,47 +2565,6 @@ void LLPanelEstateInfo::setAbuseEmailAddress(const std::string& address)
2656 childSetValue("abuse_email_address", LLSD(address)); 2565 childSetValue("abuse_email_address", LLSD(address));
2657} 2566}
2658 2567
2659void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent,
2660 bool enable_group,
2661 bool enable_ban)
2662{
2663 childSetEnabled("allow_resident_label", enable_agent);
2664 childSetEnabled("allowed_avatar_name_list", enable_agent);
2665 childSetVisible("allowed_avatar_name_list", enable_agent);
2666 childSetEnabled("add_allowed_avatar_btn", enable_agent);
2667 childSetEnabled("remove_allowed_avatar_btn", enable_agent);
2668
2669 // Groups
2670 childSetEnabled("allow_group_label", enable_group);
2671 childSetEnabled("allowed_group_name_list", enable_group);
2672 childSetVisible("allowed_group_name_list", enable_group);
2673 childSetEnabled("add_allowed_group_btn", enable_group);
2674 childSetEnabled("remove_allowed_group_btn", enable_group);
2675
2676 // Ban
2677 childSetEnabled("ban_resident_label", enable_ban);
2678 childSetEnabled("banned_avatar_name_list", enable_ban);
2679 childSetVisible("banned_avatar_name_list", enable_ban);
2680 childSetEnabled("add_banned_avatar_btn", enable_ban);
2681 childSetEnabled("remove_banned_avatar_btn", enable_ban);
2682
2683 // Update removal buttons if needed
2684 if (enable_agent)
2685 {
2686 checkRemovalButton("allowed_avatar_name_list");
2687 }
2688
2689 if (enable_group)
2690 {
2691 checkRemovalButton("allowed_group_name_list");
2692 }
2693
2694 if (enable_ban)
2695 {
2696 checkRemovalButton("banned_avatar_name_list");
2697 }
2698}
2699
2700// static 2568// static
2701void LLPanelEstateInfo::callbackCacheName( 2569void LLPanelEstateInfo::callbackCacheName(
2702 const LLUUID& id, 2570 const LLUUID& id,
@@ -3233,20 +3101,6 @@ bool LLDispatchEstateUpdateInfo::operator()(
3233 panel->setSunHour(sun_hour); 3101 panel->setSunHour(sun_hour);
3234 } 3102 }
3235 3103
3236 bool visible_from_mainland = (bool)(flags & REGION_FLAGS_EXTERNALLY_VISIBLE);
3237 bool god = gAgent.isGodlike();
3238 bool linden_estate = (estate_id <= ESTATE_LAST_LINDEN);
3239
3240 // If visible from mainland, disable the access allowed
3241 // UI, as anyone can teleport there.
3242 // However, gods need to be able to edit the access list for
3243 // linden estates, regardless of visibility, to allow object
3244 // and L$ transfers.
3245 bool enable_agent = (!visible_from_mainland || (god && linden_estate));
3246 bool enable_group = enable_agent;
3247 bool enable_ban = !linden_estate;
3248 panel->setAccessAllowedEnabled(enable_agent, enable_group, enable_ban);
3249
3250 return true; 3104 return true;
3251} 3105}
3252 3106