diff options
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 35 | ||||
-rwxr-xr-x | indra/newview/llinventoryfunctions.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/strings.xml | 4 |
3 files changed, 31 insertions, 12 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 520a840f74..374d09ce98 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -887,7 +887,7 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, { items.push_back(std::string("Marketplace Activate")); items.push_back(std::string("Marketplace Deactivate")); - if (LLMarketplaceData::instance().getActivationState(mUUID)) + if (LLMarketplaceData::instance().isVersionFolder(mUUID)) { disabled_items.push_back(std::string("Marketplace Activate")); } @@ -2039,17 +2039,15 @@ std::string LLFolderBridge::getLabelSuffix() const suffix = " (" + suffix + ")"; if (LLMarketplaceData::instance().getActivationState(getUUID())) { - suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; + suffix += " (" + LLTrans::getString("MarketplaceLive") + ")"; } } // Version folder case else if (LLMarketplaceData::instance().isVersionFolder(getUUID())) { - if (LLMarketplaceData::instance().getActivationState(getUUID())) - { - suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; - } + suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; } + // Add stock amount S32 stock_count = compute_stock_count(getUUID()); if (stock_count == 0) { @@ -2057,7 +2055,14 @@ std::string LLFolderBridge::getLabelSuffix() const } else if (stock_count != -1) { - suffix += " (" + LLTrans::getString("MarketplaceStock") + "=" + llformat("%d", stock_count) + ")"; + if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + suffix += " (" + LLTrans::getString("MarketplaceStock") + "=" + llformat("%d", stock_count) + ")"; + } + else + { + suffix += " (" + LLTrans::getString("MarketplaceMax") + "=" + llformat("%d", stock_count) + ")"; + } } return LLInvFVBridge::getLabelSuffix() + suffix; } @@ -3141,19 +3146,31 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) S32 depth = depth_nesting_in_marketplace(mUUID); if (depth == 2) { + // At the version folder level, "activate" means "set this as the version folder" LLInventoryCategory* category = gInventory.getCategory(mUUID); LLMarketplaceData::instance().setVersionFolderID(category->getParentUUID(), mUUID); - LLMarketplaceData::instance().setActivation(mUUID,true); } else if (depth == 1) { + // At the listing folder level, "activate" means "put it for sale on the marketplace" LLMarketplaceData::instance().setActivation(mUUID,true); } return; } else if ("marketplace_deactivate" == action) { - LLMarketplaceData::instance().setActivation(mUUID,false); + S32 depth = depth_nesting_in_marketplace(mUUID); + if (depth == 2) + { + // At the version folder level, "deactivate" means "zap the version folder" + LLInventoryCategory* category = gInventory.getCategory(mUUID); + LLMarketplaceData::instance().setVersionFolderID(category->getParentUUID(), LLUUID::null); + } + else if (depth == 1) + { + // At the listing folder level, "deactivate" means "take this out of the marketplace" + LLMarketplaceData::instance().setActivation(mUUID,false); + } return; } else if ("marketplace_associate_listing" == action) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 7a16cf5e74..e6f863d46e 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -155,8 +155,8 @@ void update_marketplace_category(const LLUUID& cat_id) const LLUUID marketplace_listings_uuid = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); // No marketplace -> likely called too early... or - // Not a descendent of the marketplace listings root and not part of marketplace -> likely called in error then... - if (marketplace_listings_uuid.isNull() || (!gInventory.isObjectDescendentOf(cat_id, marketplace_listings_uuid) && !LLMarketplaceData::instance().isListed(cat_id) && !LLMarketplaceData::instance().isVersionFolder(cat_id))) + // Not a descendent of the marketplace listings root -> likely called in error then... + if (marketplace_listings_uuid.isNull() || !gInventory.isObjectDescendentOf(cat_id, marketplace_listings_uuid)) { // In those cases, just do the regular category update LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 55272750e7..74c85bcd6b 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2272,7 +2272,9 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors. <string name="Marketplace Error Internal Import">Error: There was a problem with this item. Try again later.</string> <string name="MarketplaceNoID">no Mkt ID</string> - <string name="MarketplaceActive">live</string> + <string name="MarketplaceLive">live</string> + <string name="MarketplaceActive">active</string> + <string name="MarketplaceMax">max</string> <string name="MarketplaceStock">stock</string> <string name="MarketplaceNoStock">out of stock</string> |