summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-01-25 22:56:35 +0000
committerCho <cho@lindenlab.com>2013-01-25 22:56:35 +0000
commit427725c2a6d5c50468e7579a4d3b92795425723f (patch)
tree59def37a836e261e1c1a7027a450e59785f25fc3 /indra/newview/llinventoryfunctions.cpp
parent9312cd8709132835878bdbe17f81d1b3e9fa7f45 (diff)
parentdaa9db305a5ae2c0c5b0c2425d6482de6dee7b2c (diff)
merging latest changes
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 6474d56414..ad0a730dd1 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -46,6 +46,7 @@
#include "llappearancemgr.h"
#include "llappviewer.h"
#include "llclipboard.h"
+#include "lldonotdisturbnotificationstorage.h"
#include "llfloaterinventory.h"
#include "llfloatersidepanelcontainer.h"
#include "llfocusmgr.h"
@@ -1132,11 +1133,37 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
}
}
+void LLInventoryAction::removeItemFromDND(LLFolderView* root)
+{
+ if(gAgent.isDoNotDisturb())
+ {
+ //Get selected items
+ LLFolderView::selected_items_t selectedItems = root->getSelectedItems();
+ LLFolderViewModelItemInventory * viewModel = NULL;
+
+ //If user is in DND and deletes item, make sure the notification is not displayed by removing the notification
+ //from DND history and .xml file. Once this is done, upon exit of DND mode the item deleted will not show a notification.
+ for(LLFolderView::selected_items_t::iterator it = selectedItems.begin(); it != selectedItems.end(); ++it)
+ {
+ viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*it)->getViewModelItem());
+
+ if(viewModel && viewModel->getUUID().notNull())
+ {
+ //Will remove the item offer notification
+ LLDoNotDisturbNotificationStorage::instance().removeNotification(LLDoNotDisturbNotificationStorage::offerName, viewModel->getUUID());
+ }
+ }
+ }
+}
+
void LLInventoryAction::onItemsRemovalConfirmation( const LLSD& notification, const LLSD& response, LLFolderView* root )
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
+ //Need to remove item from DND before item is removed from root folder view
+ //because once removed from root folder view the item is no longer a selected item
+ removeItemFromDND(root);
root->removeSelectedItems();
}
}