summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2017-06-02 16:44:00 +0200
committerKitty Barnett <develop@catznip.com>2017-06-02 16:44:00 +0200
commitd7edeb2df8b225c39727bf506b4e5126852e2d5d (patch)
tree4bb5fd882b510662333565c49aaf10d115366fa1 /indra/newview
parent71f580e72a0f16cc4b29a7132af5be154ad128a7 (diff)
STORM-2149: Add a warning notification when deleting a folder of filtered content
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventoryfunctions.cpp33
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml16
2 files changed, 40 insertions, 9 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 2bb6fb853c..90d6e9b8a8 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -2297,15 +2297,12 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
if ("delete" == action)
{
- 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)
+ for (std::set<LLFolderViewItem*>::iterator set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter)
{
- viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*set_iter)->getViewModelItem());
+ LLFolderViewModelItemInventory * viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*set_iter)->getViewModelItem());
if (viewModel && viewModel->hasChildren())
{
has_folder_items = true;
@@ -2317,16 +2314,34 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
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()));
+
+ LLAllDescendentsPassedFilter f;
+ for (std::set<LLFolderViewItem*>::iterator it = selected_items.begin(); (it != selected_items.end()) && (f.allDescendentsPassedFilter()); ++it)
+ {
+ if (LLFolderViewFolder* folder = dynamic_cast<LLFolderViewFolder*>(*it))
+ {
+ folder->applyFunctorRecursively(f);
+ }
+ }
+
+ // Fall through to the generic confirmation if the user choose to ignore the specialized one
+ if ( (!f.allDescendentsPassedFilter()) && (!LLNotifications::instance().getIgnored("DeleteFilteredItems")) )
+ {
+ LLNotificationsUtil::add("DeleteFilteredItems", LLSD(), LLSD(), boost::bind(&LLInventoryAction::onItemsRemovalConfirmation, _1, _2, root->getHandle()));
+ }
+ else
+ {
+ LLSD args;
+ args["QUESTION"] = LLTrans::getString(root->getSelectedCount() > 1 ? "DeleteItems" : "DeleteItem");
+ 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/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 16bf0e344d..97f614cf62 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6010,6 +6010,22 @@ You cannot undo this action.
notext="Cancel"
yestext="OK"/>
</notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="DeleteFilteredItems"
+ type="alertmodal">
+ <unique/>
+ Your inventory is currently filtered and not all of the items you're about to delete are currently visible.
+
+Are you sure you want to delete them?
+ <tag>confirm</tag>
+ <usetemplate
+ ignoretext="Confirm before deleting filtered items"
+ name="okcancelignore"
+ notext="Cancel"
+ yestext="OK"/>
+ </notification>
<notification
icon="alertmodal.tga"