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