From ccdffd9794229b59b7d022760540ce5f8d8ea133 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 17 Apr 2014 11:44:04 -0700 Subject: DD-70 : Use List/Delist for listing folders and Activate/Deactivate for version folders. Also create test SLM ID when creating listing. --- indra/newview/llinventorybridge.cpp | 58 +++++++++++----------- indra/newview/llmarketplacefunctions.cpp | 7 +++ indra/newview/llmarketplacefunctions.h | 5 ++ .../skins/default/xui/en/menu_inventory.xml | 32 +++++++++--- .../default/xui/en/panel_marketplace_listings.xml | 18 +++---- indra/newview/skins/default/xui/en/strings.xml | 2 +- 6 files changed, 76 insertions(+), 46 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 128f0e1b91..749fcd7a71 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -854,29 +854,29 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, if (depth == 1) { // Options available at the Listing Folder level + items.push_back(std::string("Marketplace Create Listing")); items.push_back(std::string("Marketplace Associate Listing")); - items.push_back(std::string("Marketplace Attach Listing")); items.push_back(std::string("Marketplace Disassociate Listing")); - items.push_back(std::string("Marketplace Activate")); - items.push_back(std::string("Marketplace Deactivate")); + items.push_back(std::string("Marketplace List")); + items.push_back(std::string("Marketplace Unlist")); if (LLMarketplaceData::instance().isListed(mUUID)) { + disabled_items.push_back(std::string("Marketplace Create Listing")); disabled_items.push_back(std::string("Marketplace Associate Listing")); - disabled_items.push_back(std::string("Marketplace Attach Listing")); if (LLMarketplaceData::instance().getActivationState(mUUID)) { - disabled_items.push_back(std::string("Marketplace Activate")); + disabled_items.push_back(std::string("Marketplace List")); } else { - disabled_items.push_back(std::string("Marketplace Deactivate")); + disabled_items.push_back(std::string("Marketplace Unlist")); } } else { disabled_items.push_back(std::string("Marketplace Disassociate Listing")); - disabled_items.push_back(std::string("Marketplace Activate")); - disabled_items.push_back(std::string("Marketplace Deactivate")); + disabled_items.push_back(std::string("Marketplace List")); + disabled_items.push_back(std::string("Marketplace Unlist")); } } if (depth == 2) @@ -898,11 +898,11 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, } } // Options available at all levels on items and categories - items.push_back(std::string("Marketplace Show Listing")); + items.push_back(std::string("Marketplace Edit Listing")); LLUUID listing_folder_id = nested_parent_id(mUUID,depth); if (!LLMarketplaceData::instance().isListed(listing_folder_id)) { - disabled_items.push_back(std::string("Marketplace Show Listing")); + disabled_items.push_back(std::string("Marketplace Edit Listing")); } // Separator items.push_back(std::string("Marketplace Listings Separator")); @@ -1546,7 +1546,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) { doActionOnCurSelectedLandmark(boost::bind(&LLItemBridge::doShowOnMap, this, _1)); } - else if ("marketplace_show_listing" == action) + else if ("marketplace_edit_listing" == action) { std::string url = LLMarketplaceData::instance().getListingURL(mUUID); LLUrlAction::openURL(url); @@ -3146,39 +3146,41 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) restoreItem(); return; } + else if ("marketplace_list" == action) + { + if (depth_nesting_in_marketplace(mUUID) == 1) + { + LLMarketplaceData::instance().setActivation(mUUID,true); + } + return; + } else if ("marketplace_activate" == action) { - S32 depth = depth_nesting_in_marketplace(mUUID); - if (depth == 2) + if (depth_nesting_in_marketplace(mUUID) == 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); } - else if (depth == 1) + return; + } + else if ("marketplace_unlist" == action) + { + if (depth_nesting_in_marketplace(mUUID) == 1) { - // At the listing folder level, "activate" means "put it for sale on the marketplace" - LLMarketplaceData::instance().setActivation(mUUID,true); + LLMarketplaceData::instance().setActivation(mUUID,false); } return; } else if ("marketplace_deactivate" == action) { - S32 depth = depth_nesting_in_marketplace(mUUID); - if (depth == 2) + if (depth_nesting_in_marketplace(mUUID) == 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) + else if ("marketplace_create_listing" == action) { LLMarketplaceData::instance().addListing(mUUID); return; @@ -3188,13 +3190,13 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) LLMarketplaceData::instance().deleteListing(mUUID); return; } - else if ("marketplace_attach_listing" == action) + else if ("marketplace_associate_listing" == action) { // *TODO : Get a list of listing IDs and let the user choose one, delist the old one and relist the new one LLMarketplaceData::instance().addListing(mUUID); return; } - else if ("marketplace_show_listing" == action) + else if ("marketplace_edit_listing" == action) { std::string url = LLMarketplaceData::instance().getListingURL(mUUID); LLUrlAction::openURL(url); diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 4a3abe5f22..4a6914ee9c 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -562,6 +562,7 @@ LLMarketplaceTuple::LLMarketplaceTuple(const LLUUID& folder_id, std::string list // Data map LLMarketplaceData::LLMarketplaceData() { + mTestCurrentMarketplaceID = 1234567; } // Creation / Deletion @@ -573,6 +574,12 @@ bool LLMarketplaceData::addListing(const LLUUID& folder_id) return false; } mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id); + + // *TODO : Create the listing on SLM and get the ID (blocking?) + // For the moment, we use that wonky test ID generator... + std::string listing_id = llformat ("%d", LLMarketplaceData::instance().getTestMarketplaceID()); + + setListingID(folder_id,listing_id); update_marketplace_category(folder_id); return true; } diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h index 68f5dafbbd..2b90dd678f 100755 --- a/indra/newview/llmarketplacefunctions.h +++ b/indra/newview/llmarketplacefunctions.h @@ -167,8 +167,13 @@ public: bool setVersionFolderID(const LLUUID& folder_id, const LLUUID& version_id); bool setActivation(const LLUUID& folder_id, bool activate); + // Merov : Test method while waiting for SLM API + S32 getTestMarketplaceID() { return mTestCurrentMarketplaceID++; } + private: marketplace_items_list_t mMarketplaceItems; + // Merov : This is for test only, waiting for SLM API + S32 mTestCurrentMarketplaceID; }; diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 78418909e8..b621d53a6c 100755 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -5,20 +5,20 @@ name="Popup" visible="false"> + name="Marketplace Create Listing"> + parameter="marketplace_create_listing" /> + name="Marketplace Associate Listing"> + parameter="marketplace_associate_listing" /> + name="Marketplace Edit Listing"> + + + + + + + parameter="marketplace_unlist" /> + height="440"> + height="400"> Error: There was a problem with this item. Try again later. no Mkt ID - live + listed active max stock -- cgit v1.2.3