diff options
author | Rider Linden <rider@lindenlab.com> | 2018-06-04 16:50:13 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-06-04 16:50:13 -0700 |
commit | b06803225bff30e863ea18cae1d33f42a4fd937e (patch) | |
tree | 7cc96c7fcb573bc20dc6db93a606b846474ce7c9 /indra/newview/llinventorybridge.cpp | |
parent | 2a613d7363c4e91a7258d4f0ea3971db1569e788 (diff) |
Reconnect apply to region and parcel reconnected to interface.
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index fe7d302992..58f6c2065b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -81,6 +81,8 @@ #include "llwearableitemslist.h" #include "lllandmarkactions.h" #include "llpanellandmarks.h" +#include "llviewerparcelmgr.h" +#include "llparcel.h" #include "llenvironment.h" @@ -6920,11 +6922,16 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action if (!item) return; LLUUID asset_id = item->getProtectedAssetUUID(); - // *LAPRAS* TODO update on simulator. - LL_WARNS("LAPRAS") << "Only updating locally!!! NOT REALLY PARCEL UPDATE" << LL_ENDL; - LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_PARCEL, asset_id); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + + LLParcel *parcel = LLViewerParcelMgr::instance().getAgentParcel(); + if (!parcel) + { + LL_WARNS("INVENTORY") << "could not identify parcel." << LL_ENDL; + return; + } + S32 parcel_id = parcel->getLocalID(); + + LLEnvironment::instance().updateParcel(parcel_id, asset_id, -1, -1); } else if ("apply_settings_region" == action) { @@ -6933,11 +6940,8 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action if (!item) return; LLUUID asset_id = item->getProtectedAssetUUID(); - // *LAPRAS* TODO update on simulator. - LL_WARNS("LAPRAS") << "Only updating locally!!! NOT REALLY REGION UPDATE" << LL_ENDL; - LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_REGION, asset_id); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + + LLEnvironment::instance().updateRegion(asset_id, -1, -1); } else LLItemBridge::performAction(model, action); @@ -6988,24 +6992,34 @@ void LLSettingsBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back("Settings Apply Local"); items.push_back("Settings Apply Parcel"); - // *LAPRAS* TODO: test for permission - + if (!canUpdateParcel()) + disabled_items.push_back("Settings Apply Parcel"); + items.push_back("Settings Apply Region"); - // *LAPRAS* TODO: test for permission + if (!canUpdateRegion()) + disabled_items.push_back("Settings Apply Region"); } addLinkReplaceMenuOption(items, disabled_items); hide_context_entries(menu, items, disabled_items); } -std::string LLSettingsBridge::getLabelSuffix() const -{ - return LLItemBridge::getLabelSuffix(); -} BOOL LLSettingsBridge::renameItem(const std::string& new_name) { + /*TODO: change internal settings name? */ return LLItemBridge::renameItem(new_name); } +bool LLSettingsBridge::canUpdateParcel() const +{ + return LLEnvironment::instance().canAgentUpdateParcelEnvironment(); +} + +bool LLSettingsBridge::canUpdateRegion() const +{ + return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); +} + + // +=================================================+ // | LLLinkBridge | // +=================================================+ |