summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-05-21 16:40:23 -0700
committerMerov Linden <merov@lindenlab.com>2014-05-21 16:40:23 -0700
commit2a6ce118882b7ac4ce533dcd3c74f582e01bdb29 (patch)
tree41408690c4ffbd0532e7d9f8dbfc958dab944f1e /indra/newview/llinventoryfunctions.cpp
parent8193caa7939643d1080ceb9463b3e3978b0f516a (diff)
DD-91, DD-84 : WIP : Verify restrictions when moving things to marketplace, provide clear alert for errors, parametrize alerts and tooltips correctly
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index a31edfe183..8652c94407 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -914,14 +914,17 @@ S32 compute_stock_count(LLUUID cat_uuid)
return curr_count;
}
-void move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_folder, bool copy)
+bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_folder, bool copy)
{
// Get the marketplace listings depth of the destination folder, exit with error if not under marketplace
S32 depth = depth_nesting_in_marketplace(dest_folder);
if (depth < 0)
{
llinfos << "Merov : Marketplace error : There is no marketplace listings folder -> move aborted!" << llendl;
- return;
+ LLSD subs;
+ subs["[ERROR_CODE]"] = LLTrans::getString("Marketplace Error Not Merchant");
+ LLNotificationsUtil::add("MerchantPasteFailed", subs);
+ return false;
}
// We will collapse links into items/folders
@@ -931,7 +934,7 @@ void move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol
if (linked_category != NULL)
{
// Move the linked folder directly
- move_folder_to_marketplacelistings(linked_category, dest_folder, copy);
+ return move_folder_to_marketplacelistings(linked_category, dest_folder, copy);
}
else
{
@@ -970,7 +973,10 @@ void move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol
if (!dest_cat->acceptItem(viewer_inv_item))
{
llinfos << "Merov : Marketplace error : Cannot move item in that folder -> move aborted!" << llendl;
- return;
+ LLSD subs;
+ subs["[ERROR_CODE]"] = LLTrans::getString("Marketplace Error Not Accepted");
+ LLNotificationsUtil::add("MerchantPasteFailed", subs);
+ return false;
}
// Get the parent folder of the moved item : we may have to update it
@@ -1001,13 +1007,17 @@ void move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol
}
else
{
- // *TODO : signal an error to the user (UI for this TBD)
llinfos << "Merov : Marketplace error : User doesn't have the correct permission to put this item on sale -> move aborted!" << llendl;
+ LLSD subs;
+ subs["[ERROR_CODE]"] = LLTrans::getString("Marketplace Error Unsellable Item");
+ LLNotificationsUtil::add("MerchantPasteFailed", subs);
+ return false;
}
}
+ return true;
}
-void move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, bool copy)
+bool move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, bool copy)
{
// Check that we have adequate permission on all items being moved. Proceed if we do.
if (has_correct_permissions_for_sale(inv_cat))
@@ -1019,7 +1029,10 @@ void move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUU
if (dest_cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK)
{
llinfos << "Merov : Marketplace error : Cannot move folder in stock folder -> move aborted!" << llendl;
- return;
+ LLSD subs;
+ subs["[ERROR_CODE]"] = LLTrans::getString("Marketplace Error Not Accepted");
+ LLNotificationsUtil::add("MerchantPasteFailed", subs);
+ return false;
}
// Get the parent folder of the moved item : we may have to update it
@@ -1045,6 +1058,7 @@ void move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUU
update_marketplace_category(dest_folder);
gInventory.notifyObservers();
}
+ return true;
}
// Returns true if all items within the argument folder are fit for sale, false otherwise