From c7f24a69cfa0e87160d98325431c3098dcd8295b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 17 Mar 2015 12:59:37 -0700 Subject: DD-362 : WIP : Check stock folder count limit --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llinventoryfunctions.cpp | 22 ++++++++++++++++++++++ indra/newview/skins/default/xui/en/strings.xml | 1 + 3 files changed, 34 insertions(+) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4a106c08e4..731f64e70e 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4742,6 +4742,17 @@ Value 200 + InventoryOutboxMaxStockItemCount + + Comment + Maximum number of items allowed in a stock folder. + Persist + 0 + Type + U32 + Value + 200 + InventorySortOrder Comment 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 diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 76f4de1400..49630adb93 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -241,6 +241,7 @@ Please try logging in again in a minute. Depth of nested folders exceeds [AMOUNT]. Decrease the depth of folders-within-folders; box items if necessary. Subfolder count exceeds [AMOUNT]. Decrease the number of folders in your listing; box items if necessary. Item count exceeds [AMOUNT]. In order to sell more than [AMOUNT] items in one listing, you must box some of them. + Stock folder count exceeds [AMOUNT]. You can only drop items or folders in the ALL tab. Please select that tab and move your item(s) or folder(s) again. One or more of these objects cannot be sold or transferred You can only put items from your inventory on the marketplace -- cgit v1.2.3