diff options
author | maxim_productengine <mnikolenko@productengine.com> | 2018-09-26 17:39:55 +0300 |
---|---|---|
committer | maxim_productengine <mnikolenko@productengine.com> | 2018-09-26 17:39:55 +0300 |
commit | 405f5c879c44f32635dcb94de2c7dfb9e4a8673a (patch) | |
tree | 04f799fe444cca826caac89a5ed2303954e7f2ac /indra/newview/llfloaterfixedenvironment.cpp | |
parent | cca55533f88e6e50ac006f34708b7184b6a6859c (diff) |
SL-9732 FIXED [EEP] Save As does not provide dialogue to supply new setting name
Diffstat (limited to 'indra/newview/llfloaterfixedenvironment.cpp')
-rw-r--r-- | indra/newview/llfloaterfixedenvironment.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 2eda405f51..b9ea044a06 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -355,7 +355,9 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) } else if (ctrl_action == ACTION_SAVEAS) { - doApplyCreateNewInventory(); + LLSD args; + args["DESC"] = mSettings->getName(); + LLNotificationsUtil::add("SaveSettingAs", args, LLSD(), boost::bind(&LLFloaterFixedEnvironment::onSaveAsCommit, this, _1, _2)); } else if ((ctrl_action == ACTION_APPLY_LOCAL) || (ctrl_action == ACTION_APPLY_PARCEL) || @@ -369,6 +371,17 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) } } +void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) + { + std::string settings_name = response["message"].asString(); + LLStringUtil::trim(settings_name); + doApplyCreateNewInventory(settings_name); + } +} + void LLFloaterFixedEnvironment::onClickCloseBtn(bool app_quitting) { if (!app_quitting) @@ -382,11 +395,11 @@ void LLFloaterFixedEnvironment::onButtonLoad() checkAndConfirmSettingsLoss([this](){ doSelectFromInventory(); }); } -void LLFloaterFixedEnvironment::doApplyCreateNewInventory() +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, + LLSettingsVOBase::createInventoryItem(mSettings, parent_id, settings_name, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } @@ -396,7 +409,7 @@ void LLFloaterFixedEnvironment::doApplyUpdateInventory() if (mInventoryId.isNull()) { LL_WARNS("LAPRAS") << "Inventory ID is NULL. Creating New!!!" << LL_ENDL; - LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), + LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), std::string(), [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } else |