summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-12-05 18:08:31 +0000
committerRider Linden <rider@lindenlab.com>2018-12-05 18:08:31 +0000
commit031dabede84d3772bf857b7aca20b5378b99d06c (patch)
tree760856237361fe663f4908f3be4476addb855a5a
parent2f188b36d9b892e48ba72c3485b34036273d755b (diff)
parent25e046594464551d6d66eceee0471f10722c53ce (diff)
Merged in andreykproductengine/maint-eep (pull request #195)
SL-9924 [EEP] Environment Settings permissions can be dropped by Save As button
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp17
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp16
-rw-r--r--indra/newview/llsettingsvo.cpp9
-rw-r--r--indra/newview/llsettingsvo.h3
4 files changed, 35 insertions, 10 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 36958a948a..d02aa89780 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -1337,11 +1337,20 @@ void LLFloaterEditExtDayCycle::reblendSettings()
void LLFloaterEditExtDayCycle::doApplyCreateNewInventory(const LLSettingsDay::ptr_t &day, std::string settings_name)
{
- // This method knows what sort of settings object to create.
- LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS);
-
- LLSettingsVOBase::createInventoryItem(day, parent_id, settings_name,
+ if (mInventoryItem)
+ {
+ LLUUID parent_id = mInventoryItem->getParentUUID();
+ U32 next_owner_perm = mInventoryItem->getPermissions().getMaskNextOwner();
+ LLSettingsVOBase::createInventoryItem(day, next_owner_perm, parent_id, settings_name,
+ [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
+ }
+ else
+ {
+ LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS);
+ // This method knows what sort of settings object to create.
+ LLSettingsVOBase::createInventoryItem(day, parent_id, settings_name,
[this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
+ }
}
void LLFloaterEditExtDayCycle::doApplyUpdateInventory(const LLSettingsDay::ptr_t &day)
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index d35dd5ec98..b9e23fb245 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -448,10 +448,20 @@ void LLFloaterFixedEnvironment::onButtonLoad()
void LLFloaterFixedEnvironment::doApplyCreateNewInventory(std::string settings_name)
{
- LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS);
- // This method knows what sort of settings object to create.
- LLSettingsVOBase::createInventoryItem(mSettings, parent_id, settings_name,
+ if (mInventoryItem)
+ {
+ LLUUID parent_id = mInventoryItem->getParentUUID();
+ U32 next_owner_perm = mInventoryItem->getPermissions().getMaskNextOwner();
+ LLSettingsVOBase::createInventoryItem(mSettings, next_owner_perm, parent_id, settings_name,
[this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
+ }
+ else
+ {
+ LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS);
+ // This method knows what sort of settings object to create.
+ LLSettingsVOBase::createInventoryItem(mSettings, parent_id, settings_name,
+ [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
+ }
}
void LLFloaterFixedEnvironment::doApplyUpdateInventory()
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 3925f37703..0def17b32d 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -121,8 +121,13 @@ void LLSettingsVOBase::createNewInventoryItem(LLSettingsType::type_e stype, cons
void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings, const LLUUID &parent_id, std::string settings_name, inventory_result_fn callback)
{
+ U32 nextOwnerPerm = LLPermissions::DEFAULT.getMaskNextOwner();
+ createInventoryItem(settings, nextOwnerPerm, parent_id, settings_name, callback);
+}
+
+void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings, U32 next_owner_perm, const LLUUID &parent_id, std::string settings_name, inventory_result_fn callback)
+{
LLTransactionID tid;
- U32 nextOwnerPerm = LLPermissions::DEFAULT.getMaskNextOwner();
if (!LLEnvironment::instance().isInventoryEnabled())
{
@@ -144,7 +149,7 @@ void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings
create_inventory_settings(gAgent.getID(), gAgent.getSessionID(),
parent_id, tid,
settings_name, "",
- settings->getSettingsTypeValue(), nextOwnerPerm, cb);
+ settings->getSettingsTypeValue(), next_owner_perm, cb);
}
void LLSettingsVOBase::onInventoryItemCreated(const LLUUID &inventoryId, LLSettingsBase::ptr_t settings, inventory_result_fn callback)
diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h
index 0e8312b849..1ad0091871 100644
--- a/indra/newview/llsettingsvo.h
+++ b/indra/newview/llsettingsvo.h
@@ -51,7 +51,8 @@ public:
static void createNewInventoryItem(LLSettingsType::type_e stype, const LLUUID &parent_id, inventory_result_fn callback = inventory_result_fn());
static void createInventoryItem(const LLSettingsBase::ptr_t &settings, const LLUUID &parent_id, std::string settings_name, inventory_result_fn callback = inventory_result_fn());
-
+ static void createInventoryItem(const LLSettingsBase::ptr_t &settings, U32 next_owner_perm, const LLUUID &parent_id, std::string settings_name, inventory_result_fn callback = inventory_result_fn());
+
static void updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID inv_item_id, inventory_result_fn callback = inventory_result_fn(), bool update_name = true);
static void updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID object_id, LLUUID inv_item_id, inventory_result_fn callback = inventory_result_fn());