diff options
| author | Merov Linden <merov@lindenlab.com> | 2015-03-17 12:59:37 -0700 |
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2015-03-17 12:59:37 -0700 |
| commit | c7f24a69cfa0e87160d98325431c3098dcd8295b (patch) | |
| tree | f0a0034dce9e665cd4005cba4422f6b348413876 /indra/newview/llinventoryfunctions.cpp | |
| parent | 9ba10bf1f2ee16eb082f4cb29b0b9f7172e7ce8e (diff) | |
DD-362 : WIP : Check stock folder count limit
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
| -rwxr-xr-x | indra/newview/llinventoryfunctions.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 3939281d0a..229644bdf9 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1267,6 +1267,19 @@ bool can_move_item_to_marketplace(const LLInventoryCategory* root_folder, LLInve tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects", args); accept = false; } + + if (move_in_stock) + { + int stock_size = bundle_size + count_descendants_items(dest_folder->getUUID()); + if (stock_size > gSavedSettings.getU32("InventoryOutboxMaxStockItemCount")) + { + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxStockItemCount"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyStockItems", args); + accept = false; + } + } } return accept; @@ -1803,6 +1816,15 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_ std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Error Subfolder In Stock"); cb(message,depth,LLError::LEVEL_ERROR); } + else if ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (item_array->size() > gSavedSettings.getU32("InventoryOutboxMaxStockItemCount"))) + { + // Report if a stock folder has too many items + result = false; + LLStringUtil::format_map_t args; + args["[AMOUNT]"] = llformat("%d",gSavedSettings.getU32("InventoryOutboxMaxStockItemCount")); + std::string message = indent + cat->getName() + LLTrans::getString("TooltipOutboxTooManyStockItems", args); + cb(message,depth,LLError::LEVEL_ERROR); + } else { // Simply print the folder name |
