diff options
author | pavelkproductengine <pavelkproductengine@lindenlab.com> | 2017-05-30 20:35:05 +0300 |
---|---|---|
committer | pavelkproductengine <pavelkproductengine@lindenlab.com> | 2017-05-30 20:35:05 +0300 |
commit | 735ae02583558544a4a3b65f72cdf52fe7d27677 (patch) | |
tree | ce04ad5c13c3787896a0db8e05694907430c8d1e /indra/newview | |
parent | d65db1f16c75a8d5f54c9e6f52c3755d29b39b3e (diff) |
MAINT-7356 Feature - Force item delete warning to prompt once per session
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 29 | ||||
-rw-r--r-- | indra/newview/llinventoryfunctions.h | 2 |
2 files changed, 31 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index bccc654fbf..2bb6fb853c 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -92,6 +92,8 @@ BOOL LLInventoryState::sWearNewClothing = FALSE; LLUUID LLInventoryState::sWearNewClothingTransactionID; std::list<LLUUID> LLInventoryAction::sMarketplaceFolders; +const int LLInventoryAction::sConfirmOnDeleteItemsNumber = 5; + // Helper function : callback to update a folder after inventory action happened in the background void update_folder_cb(const LLUUID& dest_folder) { @@ -2297,6 +2299,33 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root { LLSD args; args["QUESTION"] = LLTrans::getString(root->getSelectedCount() > 1 ? "DeleteItems" : "DeleteItem"); + static bool sDisplayedAtSession = false; + std::set<LLFolderViewItem*>::iterator set_iter = selected_items.begin(); + LLFolderViewModelItemInventory * viewModel = NULL; + bool has_folder_items = false; + for (; set_iter != selected_items.end(); ++set_iter) + { + viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*set_iter)->getViewModelItem()); + if (viewModel && viewModel->hasChildren()) + { + has_folder_items = true; + break; + } + } + if (root->getSelectedCount() >= sConfirmOnDeleteItemsNumber || has_folder_items) + { + bool ignore = !(LLUI::sSettingGroups["ignores"]->getBOOL("DeleteItems")); + if (ignore) + { + + if (!sDisplayedAtSession) + { + LLUI::sSettingGroups["ignores"]->setBOOL("DeleteItems", TRUE); + sDisplayedAtSession = true; + } + + } + } LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLInventoryAction::onItemsRemovalConfirmation, _1, _2, root->getHandle())); // Note: marketplace listings will be updated in the callback if delete confirmed return; diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 649db4032d..d454d7e00b 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -460,6 +460,8 @@ struct LLInventoryAction static void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFolderView> root); static void removeItemFromDND(LLFolderView* root); + static const int sConfirmOnDeleteItemsNumber; + private: static void buildMarketplaceFolders(LLFolderView* root); static void updateMarketplaceFolders(); |