From 21d165011b81909c8cab944755b53f908e51ad16 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 9 Jul 2018 13:26:48 -0700 Subject: Attempting to create a settings inventory item on a non-eep region will now show a visible failure message to the user. Menu items for greating settings in inventory are disabled on non eep regions. --- indra/newview/llpanelmaininventory.cpp | 9 + indra/newview/llpanelmaininventory.h | 1 + indra/newview/llsettingsvo.cpp | 9 + .../skins/default/xui/en/menu_inventory.xml | 6 + .../skins/default/xui/en/menu_inventory_add.xml | 554 +++++++++++---------- .../newview/skins/default/xui/en/notifications.xml | 10 + 6 files changed, 316 insertions(+), 273 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a9ad41e6f7..b5e24b6efb 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -58,6 +58,7 @@ #include "llsidepanelinventory.h" #include "llfolderview.h" #include "llradiogroup.h" +#include "llenvironment.h" const std::string FILTERS_FILENAME("filters.xml"); @@ -128,6 +129,9 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mCommitCallbackRegistrar.add("Inventory.SetSortBy", boost::bind(&LLPanelMainInventory::setSortBy, this, _2)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this)); + mEnableCallbackRegistrar.add("Inventory.EnvironmentEnabled", [](LLUICtrl *, const LLSD &) { return LLPanelMainInventory::hasSettingsInventory(); }); + + mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); } @@ -1555,5 +1559,10 @@ void LLPanelMainInventory::setUploadCostIfNeeded() } } +bool LLPanelMainInventory::hasSettingsInventory() +{ + return LLEnvironment::instance().isInventoryEnabled(); +} + // List Commands // //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 732a3b04e3..a6bdee233d 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -161,6 +161,7 @@ protected: BOOL isActionChecked(const LLSD& userdata); void onCustomAction(const LLSD& command_name); bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept); + static bool hasSettingsInventory(); /** * Set upload cost in "Upload" sub menu. */ diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 5ea29fb609..dba7e00b93 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -95,6 +95,13 @@ void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings LLTransactionID tid; U32 nextOwnerPerm = LLPermissions::DEFAULT.getMaskNextOwner(); + if (!LLEnvironment::instance().isInventoryEnabled()) + { + LL_WARNS("SETTINGS") << "Region does not support settings inventory objects." << LL_ENDL; + LLNotificationsUtil::add("SettingsUnsuported"); + return; + } + tid.generate(); LLPointer cb = new LLSettingsInventoryCB([settings, callback](const LLUUID &inventoryId) { @@ -127,6 +134,7 @@ void LLSettingsVOBase::updateInventoryItem(const LLSettingsBase::ptr_t &settings if (!LLEnvironment::instance().isInventoryEnabled()) { LL_WARNS("SETTINGS") << "Region does not support settings inventory objects." << LL_ENDL; + LLNotificationsUtil::add("SettingsUnsuported"); return; } @@ -156,6 +164,7 @@ void LLSettingsVOBase::updateInventoryItem(const LLSettingsBase::ptr_t &settings if (!LLEnvironment::instance().isInventoryEnabled()) { LL_WARNS("SETTINGS") << "Region does not support settings inventory objects." << LL_ENDL; + LLNotificationsUtil::add("SettingsUnsuported"); return; } diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 6dea791dd9..6f04785e8c 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -324,6 +324,8 @@ + + + - - - - - - - - - - - - - - - - - - - - - - + layout="topleft" + left="0" + mouse_opaque="false" + can_tear_off="false" + name="menu_inventory_add" + visible="false"> + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 6473ec9bc3..26e947b3ca 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -11150,5 +11150,15 @@ Unable to set the environment for this parcel. Please enter or select a parcel that you have rights to modify. fail + + +Settings are not supported on this region. +Please move to a settings enabled region and retry your action. + fail + -- cgit v1.2.3