aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterregioninfo.cpp190
1 files changed, 32 insertions, 158 deletions
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index d6eeefe..717358b 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
@@ -1244,10 +1238,10 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1244 llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl; 1238 llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl;
1245 1239
1246 // Make sure user hasn't chosen wacky textures. 1240 // Make sure user hasn't chosen wacky textures.
1247 //if (!validateTextureSizes()) 1241// if (!validateTextureSizes())
1248 //{ 1242// {
1249 // return FALSE; 1243// return FALSE;
1250 //} 1244// }
1251 1245
1252 LLTextureCtrl* texture_ctrl; 1246 LLTextureCtrl* texture_ctrl;
1253 std::string buffer; 1247 std::string buffer;
@@ -1830,16 +1824,6 @@ std::string all_estates_text()
1830 } 1824 }
1831} 1825}
1832 1826
1833// static
1834bool LLPanelEstateInfo::isLindenEstate()
1835{
1836 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
1837 if (!panel) return false;
1838
1839 U32 estate_id = panel->getEstateID();
1840 return (estate_id <= ESTATE_LAST_LINDEN);
1841}
1842
1843typedef std::vector<LLUUID> AgentOrGroupIDsVector; 1827typedef std::vector<LLUUID> AgentOrGroupIDsVector;
1844struct LLEstateAccessChangeInfo 1828struct LLEstateAccessChangeInfo
1845{ 1829{
@@ -1891,14 +1875,7 @@ void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data)
1891 params.payload(payload) 1875 params.payload(payload)
1892 .substitutions(args) 1876 .substitutions(args)
1893 .functor(accessCoreConfirm); 1877 .functor(accessCoreConfirm);
1894 if (isLindenEstate()) 1878 LLNotifications::instance().add(params);
1895 {
1896 LLNotifications::instance().forceResponse(params, 0);
1897 }
1898 else
1899 {
1900 LLNotifications::instance().add(params);
1901 }
1902} 1879}
1903 1880
1904// static 1881// static
@@ -1909,19 +1886,12 @@ void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dia
1909 payload["dialog_name"] = dialog_name; 1886 payload["dialog_name"] = dialog_name;
1910 // agent id filled in after avatar picker 1887 // agent id filled in after avatar picker
1911 1888
1912 LLNotification::Params params("ChangeLindenAccess"); 1889 LLNotification::Params params("PfftLindenCrap");
1913 params.payload(payload) 1890 params.payload(payload)
1914 .functor(accessAddCore2); 1891 .functor(accessAddCore2);
1915 1892
1916 if (isLindenEstate()) 1893 // same as clicking "OK"
1917 { 1894 LLNotifications::instance().forceResponse(params, 0);
1918 LLNotifications::instance().add(params);
1919 }
1920 else
1921 {
1922 // same as clicking "OK"
1923 LLNotifications::instance().forceResponse(params, 0);
1924 }
1925} 1895}
1926 1896
1927// static 1897// static
@@ -2001,16 +1971,8 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co
2001 .payload(change_info->asLLSD()) 1971 .payload(change_info->asLLSD())
2002 .functor(accessCoreConfirm); 1972 .functor(accessCoreConfirm);
2003 1973
2004 if (isLindenEstate()) 1974 // ask if this estate or all estates with this owner
2005 { 1975 LLNotifications::instance().add(params);
2006 // just apply to this estate
2007 LLNotifications::instance().forceResponse(params, 0);
2008 }
2009 else
2010 {
2011 // ask if this estate or all estates with this owner
2012 LLNotifications::instance().add(params);
2013 }
2014} 1976}
2015 1977
2016// static 1978// static
@@ -2037,20 +1999,12 @@ void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string&
2037 payload["allowed_ids"].append(item->getUUID()); 1999 payload["allowed_ids"].append(item->getUUID());
2038 } 2000 }
2039 2001
2040 LLNotification::Params params("ChangeLindenAccess"); 2002 LLNotification::Params params("PfftLindenCrap");
2041 params.payload(payload) 2003 params.payload(payload)
2042 .functor(accessRemoveCore2); 2004 .functor(accessRemoveCore2);
2043 2005
2044 if (isLindenEstate()) 2006 // just proceed, as if clicking OK
2045 { 2007 LLNotifications::instance().forceResponse(params, 0);
2046 // warn on change linden estate
2047 LLNotifications::instance().add(params);
2048 }
2049 else
2050 {
2051 // just proceed, as if clicking OK
2052 LLNotifications::instance().forceResponse(params, 0);
2053 }
2054} 2008}
2055 2009
2056// static 2010// static
@@ -2063,21 +2017,12 @@ bool LLPanelEstateInfo::accessRemoveCore2(const LLSD& notification, const LLSD&
2063 return false; 2017 return false;
2064 } 2018 }
2065 2019
2066 // If Linden estate, can only apply to "this" estate, not all estates 2020 LLSD args;
2067 // owned by NULL. 2021 args["ALL_ESTATES"] = all_estates_text();
2068 if (isLindenEstate()) 2022 LLNotifications::instance().add(notification["payload"]["dialog_name"],
2069 { 2023 args,
2070 accessCoreConfirm(notification, response); 2024 notification["payload"],
2071 } 2025 accessCoreConfirm);
2072 else
2073 {
2074 LLSD args;
2075 args["ALL_ESTATES"] = all_estates_text();
2076 LLNotifications::instance().add(notification["payload"]["dialog_name"],
2077 args,
2078 notification["payload"],
2079 accessCoreConfirm);
2080 }
2081 return false; 2026 return false;
2082} 2027}
2083 2028
@@ -2359,52 +2304,23 @@ BOOL LLPanelEstateInfo::sendUpdate()
2359{ 2304{
2360 llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl; 2305 llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl;
2361 2306
2362 LLNotification::Params params("ChangeLindenEstate"); 2307 // send the update
2363 params.functor(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); 2308 if (!commitEstateInfoCaps())
2364
2365 if (getEstateID() <= ESTATE_LAST_LINDEN)
2366 {
2367 // trying to change reserved estate, warn
2368 LLNotifications::instance().add(params);
2369 }
2370 else
2371 { 2309 {
2372 // for normal estates, just make the change 2310 // the caps method failed, try the old way
2373 LLNotifications::instance().forceResponse(params, 0); 2311 LLFloaterRegionInfo::nextInvoice();
2312 commitEstateInfoDataserver();
2374 } 2313 }
2314 // we don't want to do this because we'll get it automatically from the sim
2315 // after the spaceserver processes it
2316// else
2317// {
2318// // caps method does not automatically send this info
2319// LLFloaterRegionInfo::requestRegionInfo();
2320// }
2375 return TRUE; 2321 return TRUE;
2376} 2322}
2377 2323
2378bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, const LLSD& response)
2379{
2380 S32 option = LLNotification::getSelectedOption(notification, response);
2381 switch(option)
2382 {
2383 case 0:
2384 // send the update
2385 if (!commitEstateInfoCaps())
2386 {
2387 // the caps method failed, try the old way
2388 LLFloaterRegionInfo::nextInvoice();
2389 commitEstateInfoDataserver();
2390 }
2391 // we don't want to do this because we'll get it automatically from the sim
2392 // after the spaceserver processes it
2393// else
2394// {
2395// // caps method does not automatically send this info
2396// LLFloaterRegionInfo::requestRegionInfo();
2397// }
2398 break;
2399 case 1:
2400 default:
2401 // do nothing
2402 break;
2403 }
2404 return false;
2405}
2406
2407
2408/* 2324/*
2409// Request = "getowner" 2325// Request = "getowner"
2410// SParam[0] = "" (empty string) 2326// SParam[0] = "" (empty string)
@@ -2657,47 +2573,6 @@ void LLPanelEstateInfo::setAbuseEmailAddress(const std::string& address)
2657 childSetValue("abuse_email_address", LLSD(address)); 2573 childSetValue("abuse_email_address", LLSD(address));
2658} 2574}
2659 2575
2660void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent,
2661 bool enable_group,
2662 bool enable_ban)
2663{
2664 childSetEnabled("allow_resident_label", enable_agent);
2665 childSetEnabled("allowed_avatar_name_list", enable_agent);
2666 childSetVisible("allowed_avatar_name_list", enable_agent);
2667 childSetEnabled("add_allowed_avatar_btn", enable_agent);
2668 childSetEnabled("remove_allowed_avatar_btn", enable_agent);
2669
2670 // Groups
2671 childSetEnabled("allow_group_label", enable_group);
2672 childSetEnabled("allowed_group_name_list", enable_group);
2673 childSetVisible("allowed_group_name_list", enable_group);
2674 childSetEnabled("add_allowed_group_btn", enable_group);
2675 childSetEnabled("remove_allowed_group_btn", enable_group);
2676
2677 // Ban
2678 childSetEnabled("ban_resident_label", enable_ban);
2679 childSetEnabled("banned_avatar_name_list", enable_ban);
2680 childSetVisible("banned_avatar_name_list", enable_ban);
2681 childSetEnabled("add_banned_avatar_btn", enable_ban);
2682 childSetEnabled("remove_banned_avatar_btn", enable_ban);
2683
2684 // Update removal buttons if needed
2685 if (enable_agent)
2686 {
2687 checkRemovalButton("allowed_avatar_name_list");
2688 }
2689
2690 if (enable_group)
2691 {
2692 checkRemovalButton("allowed_group_name_list");
2693 }
2694
2695 if (enable_ban)
2696 {
2697 checkRemovalButton("banned_avatar_name_list");
2698 }
2699}
2700
2701// static 2576// static
2702void LLPanelEstateInfo::callbackCacheName( 2577void LLPanelEstateInfo::callbackCacheName(
2703 const LLUUID& id, 2578 const LLUUID& id,
@@ -3423,4 +3298,3 @@ void LLFloaterRegionInfo::open()
3423 LLFloater::open(); 3298 LLFloater::open();
3424} 3299}
3425// [/RLVa:KB] 3300// [/RLVa:KB]
3426