summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-05-30 12:20:07 -0700
committerMerov Linden <merov@lindenlab.com>2014-05-30 12:20:07 -0700
commita1afe50feb1c42cc21c7f89b4187a8f7abe0c9fc (patch)
treeae7d4bc10a00586fd6440c3685cede7be9420563
parentb9407199462c0b56a7d49c2e19657e87ec149d8c (diff)
DD-84 : Prompt the user for active listing edits (Cut, Paste and Delete).
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp36
-rwxr-xr-xindra/newview/llinventoryfunctions.h3
2 files changed, 35 insertions, 4 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index b56383e48f..7a7d910a23 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -1912,13 +1912,45 @@ void LLOpenFoldersWithSelection::doFolder(LLFolderViewFolder* folder)
}
}
-void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action)
+// Callback for doToSelected if DAMA required...
+void LLInventoryAction::callback_doToSelected(const LLSD& notification, const LLSD& response, class LLInventoryModel* model, class LLFolderView* root, const std::string& action)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option == 0) // YES
+ {
+ doToSelected(model, root, action, FALSE);
+ }
+}
+
+void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action, BOOL user_confirm)
{
if ("rename" == action)
{
root->startRenamingSelectedItem();
return;
}
+
+ std::set<LLFolderViewItem*> selected_items = root->getSelectionList();
+
+ // Prompt the user for some marketplace active listing edits
+ if (user_confirm && (("paste" == action) || ("cut" == action) || ("delete" == action)))
+ {
+ std::set<LLFolderViewItem*>::iterator set_iter = selected_items.begin();
+ for (; set_iter != selected_items.end(); ++set_iter)
+ {
+ LLFolderViewModelItemInventory * viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*set_iter)->getViewModelItem());
+ if (viewModel && LLMarketplaceData::instance().isInActiveFolder(viewModel->getUUID()))
+ {
+ break;
+ }
+ }
+ if (set_iter != selected_items.end())
+ {
+ LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLInventoryAction::callback_doToSelected, _1, _2, model, root, action));
+ return;
+ }
+ }
+
if ("delete" == action)
{
LLSD args;
@@ -1945,8 +1977,6 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
}
- std::set<LLFolderViewItem*> selected_items = root->getSelectionList();
-
LLMultiPreview* multi_previewp = NULL;
LLMultiProperties* multi_propertiesp = NULL;
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index ae99eb0ad4..5dd317e218 100755
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -445,7 +445,8 @@ public:
struct LLInventoryAction
{
- static void doToSelected(class LLInventoryModel* model, class LLFolderView* root, const std::string& action);
+ static void doToSelected(class LLInventoryModel* model, class LLFolderView* root, const std::string& action, BOOL user_confirm = TRUE);
+ static void callback_doToSelected(const LLSD& notification, const LLSD& response, class LLInventoryModel* model, class LLFolderView* root, const std::string& action);
static void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLFolderView* root);
static void removeItemFromDND(LLFolderView* root);