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 | |
parent | 9ba10bf1f2ee16eb082f4cb29b0b9f7172e7ce8e (diff) |
DD-362 : WIP : Check stock folder count limit
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 11 | ||||
-rwxr-xr-x | indra/newview/llinventoryfunctions.cpp | 22 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/strings.xml | 1 |
3 files changed, 34 insertions, 0 deletions
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 @@ <key>Value</key> <integer>200</integer> </map> + <key>InventoryOutboxMaxStockItemCount</key> + <map> + <key>Comment</key> + <string>Maximum number of items allowed in a stock folder.</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>200</integer> + </map> <key>InventorySortOrder</key> <map> <key>Comment</key> 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.</string> <string name="TooltipOutboxFolderLevels">Depth of nested folders exceeds [AMOUNT]. Decrease the depth of folders-within-folders; box items if necessary.</string> <string name="TooltipOutboxTooManyFolders">Subfolder count exceeds [AMOUNT]. Decrease the number of folders in your listing; box items if necessary.</string> <string name="TooltipOutboxTooManyObjects">Item count exceeds [AMOUNT]. In order to sell more than [AMOUNT] items in one listing, you must box some of them.</string> + <string name="TooltipOutboxTooManyStockItems">Stock folder count exceeds [AMOUNT].</string> <string name="TooltipOutboxCannotDropOnRoot">You can only drop items or folders in the ALL tab. Please select that tab and move your item(s) or folder(s) again.</string> <string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred</string> <string name="TooltipOutboxNotInInventory">You can only put items from your inventory on the marketplace</string> |