From a030b30d34ef3152791b123c4f52d4086f3eb549 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 6 Mar 2014 18:15:51 -0800 Subject: DD-4, DD-5, DD-6, DD-7, DD-8: WIP : Add Merchant Items panel and make it somewhat work, in a clunky sort of way --- indra/newview/llinventorypanel.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 81ee7ac07e..c1607fbbc0 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -288,6 +288,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_OUTBOX)); + getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_MERCHANT_ITEMS)); } // set the filter for the empty folder if the debug setting is on @@ -1489,5 +1490,6 @@ namespace LLInitParam declare(LLFolderType::lookup(LLFolderType::FT_INBOX) , LLFolderType::FT_INBOX); declare(LLFolderType::lookup(LLFolderType::FT_OUTBOX) , LLFolderType::FT_OUTBOX); declare(LLFolderType::lookup(LLFolderType::FT_BASIC_ROOT) , LLFolderType::FT_BASIC_ROOT); + declare(LLFolderType::lookup(LLFolderType::FT_MERCHANT_ITEMS) , LLFolderType::FT_MERCHANT_ITEMS); } } -- cgit v1.3 From 705d4182c8a84728e7f00cf48110c8f9720e4c29 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 13 Mar 2014 16:45:52 -0700 Subject: DD-42 : Rename merchant items to marketplace listings to be consistent with spec --- indra/llcommon/llfoldertype.cpp | 2 +- indra/llcommon/llfoldertype.h | 2 +- indra/newview/llfloateroutbox.cpp | 114 +++++++++---------- indra/newview/llfloateroutbox.h | 12 +- indra/newview/llinventorybridge.cpp | 6 +- indra/newview/llinventorybridge.h | 2 +- indra/newview/llinventorypanel.cpp | 4 +- indra/newview/llviewerfloaterreg.cpp | 2 +- indra/newview/llviewerfoldertype.cpp | 2 +- .../xui/en/floater_marketplace_listings.xml | 121 +++++++++++++++++++++ .../default/xui/en/floater_merchant_items.xml | 121 --------------------- indra/newview/skins/default/xui/en/menu_viewer.xml | 6 +- .../en/panel_marketplace_listings_inventory.xml | 32 ++++++ .../xui/en/panel_merchant_items_inventory.xml | 32 ------ indra/newview/skins/default/xui/en/strings.xml | 6 +- 15 files changed, 232 insertions(+), 232 deletions(-) create mode 100755 indra/newview/skins/default/xui/en/floater_marketplace_listings.xml delete mode 100755 indra/newview/skins/default/xui/en/floater_merchant_items.xml create mode 100755 indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml delete mode 100755 indra/newview/skins/default/xui/en/panel_merchant_items_inventory.xml (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index 64bc17c422..5b80189d2a 100755 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -97,7 +97,7 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_rt", TRUE)); - addEntry(LLFolderType::FT_MERCHANT_ITEMS, new FolderEntry("merchant", FALSE)); + addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new FolderEntry("merchant", FALSE)); addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE)); }; diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index 81f9c0b678..91dc1da543 100644 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -87,7 +87,7 @@ public: FT_BASIC_ROOT = 52, - FT_MERCHANT_ITEMS = 53, + FT_MARKETPLACE_LISTINGS = 53, FT_COUNT, diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 8f4daa83f9..2ed4605e0c 100755 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -1,8 +1,8 @@ /** * @file llfloateroutbox.cpp - * @brief Implementation of the merchant outbox window and of the merchant items window + * @brief Implementation of the merchant outbox window and of the marketplace listings window * - * *TODO : Eventually, take out all the merchant outbox stuff and rename that file to llfloatermerchantitems + * *TODO : Eventually, take out all the merchant outbox stuff and rename that file to llfloatermarketplacelistings * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code @@ -107,15 +107,15 @@ private: }; ///---------------------------------------------------------------------------- -/// LLMerchantItemsAddedObserver helper class +/// LLMarketplaceListingsAddedObserver helper class ///---------------------------------------------------------------------------- -class LLMerchantItemsAddedObserver : public LLInventoryCategoryAddedObserver +class LLMarketplaceListingsAddedObserver : public LLInventoryCategoryAddedObserver { public: - LLMerchantItemsAddedObserver(LLFloaterMerchantItems * merchant_items_floater) + LLMarketplaceListingsAddedObserver(LLFloaterMarketplaceListings * marketplace_listings_floater) : LLInventoryCategoryAddedObserver() - , mMerchantItemsFloater(merchant_items_floater) + , mMarketplaceListingsFloater(marketplace_listings_floater) { } @@ -127,15 +127,15 @@ public: LLFolderType::EType added_category_type = added_category->getPreferredType(); - if (added_category_type == LLFolderType::FT_MERCHANT_ITEMS) + if (added_category_type == LLFolderType::FT_MARKETPLACE_LISTINGS) { - mMerchantItemsFloater->initializeMarketPlace(); + mMarketplaceListingsFloater->initializeMarketPlace(); } } } private: - LLFloaterMerchantItems * mMerchantItemsFloater; + LLFloaterMarketplaceListings * mMarketplaceListingsFloater; }; @@ -653,10 +653,10 @@ void LLFloaterOutbox::showNotification(const LLNotificationPtr& notification) } ///---------------------------------------------------------------------------- -/// LLFloaterMerchantItems +/// LLFloaterMarketplaceListings ///---------------------------------------------------------------------------- -LLFloaterMerchantItems::LLFloaterMerchantItems(const LLSD& key) +LLFloaterMarketplaceListings::LLFloaterMarketplaceListings(const LLSD& key) : LLFloater(key) , mCategoriesObserver(NULL) , mCategoryAddedObserver(NULL) @@ -668,7 +668,7 @@ LLFloaterMerchantItems::LLFloaterMerchantItems(const LLSD& key) { } -LLFloaterMerchantItems::~LLFloaterMerchantItems() +LLFloaterMarketplaceListings::~LLFloaterMarketplaceListings() { if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) { @@ -683,18 +683,18 @@ LLFloaterMerchantItems::~LLFloaterMerchantItems() delete mCategoryAddedObserver; } -BOOL LLFloaterMerchantItems::postBuild() +BOOL LLFloaterMarketplaceListings::postBuild() { - mInventoryPlaceholder = getChild("merchant_items_inventory_placeholder_panel"); - mInventoryText = mInventoryPlaceholder->getChild("merchant_items_inventory_placeholder_text"); - mInventoryTitle = mInventoryPlaceholder->getChild("merchant_items_inventory_placeholder_title"); + mInventoryPlaceholder = getChild("marketplace_listings_inventory_placeholder_panel"); + mInventoryText = mInventoryPlaceholder->getChild("marketplace_listings_inventory_placeholder_text"); + mInventoryTitle = mInventoryPlaceholder->getChild("marketplace_listings_inventory_placeholder_title"); - mTopLevelDropZone = getChild("merchant_items_generic_drag_target"); + mTopLevelDropZone = getChild("marketplace_listings_generic_drag_target"); - LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterMerchantItems::onFocusReceived, this)); + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterMarketplaceListings::onFocusReceived, this)); - // Observe category creation to catch merchant items creation (moot if already existing) - mCategoryAddedObserver = new LLMerchantItemsAddedObserver(this); + // Observe category creation to catch marketplace listings creation (moot if already existing) + mCategoryAddedObserver = new LLMarketplaceListingsAddedObserver(this); gInventory.addObserver(mCategoryAddedObserver); // Merov : Debug : fetch aggressively so we can create test data right onOpen() @@ -704,7 +704,7 @@ BOOL LLFloaterMerchantItems::postBuild() return TRUE; } -void LLFloaterMerchantItems::clean() +void LLFloaterMarketplaceListings::clean() { // Note: we cannot delete the mOutboxInventoryPanel as that point // as this is called through callback observers of the panel itself. @@ -714,11 +714,11 @@ void LLFloaterMerchantItems::clean() mRootFolderId.setNull(); } -void LLFloaterMerchantItems::onClose(bool app_quitting) +void LLFloaterMarketplaceListings::onClose(bool app_quitting) { } -void LLFloaterMerchantItems::onOpen(const LLSD& key) +void LLFloaterMarketplaceListings::onOpen(const LLSD& key) { // // Initialize the Market Place or go update the outbox @@ -763,12 +763,12 @@ void LLFloaterMerchantItems::onOpen(const LLSD& key) fetchContents(); } -void LLFloaterMerchantItems::onFocusReceived() +void LLFloaterMarketplaceListings::onFocusReceived() { fetchContents(); } -void LLFloaterMerchantItems::fetchContents() +void LLFloaterMarketplaceListings::fetchContents() { if (mRootFolderId.notNull()) { @@ -776,7 +776,7 @@ void LLFloaterMerchantItems::fetchContents() } } -void LLFloaterMerchantItems::setup() +void LLFloaterMarketplaceListings::setup() { if (LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) { @@ -784,24 +784,24 @@ void LLFloaterMerchantItems::setup() return; } - // We are a merchant. Get the Merchant items folder, create it if needs be. - LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MERCHANT_ITEMS, true); + // We are a merchant. Get the Marketplace listings folder, create it if needs be. + LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, true); if (outbox_id.isNull()) { // We should never get there unless the inventory fails badly - llinfos << "Merov : Inventory problem: failure to create the merchant items folder for a merchant!" << llendl; - llerrs << "Inventory problem: failure to create the merchant items folder for a merchant!" << llendl; + llinfos << "Merov : Inventory problem: failure to create the marketplace listings folder for a merchant!" << llendl; + llerrs << "Inventory problem: failure to create the marketplace listings folder for a merchant!" << llendl; return; } - // Consolidate Merchant items + // Consolidate Marketplace listings // We shouldn't have to do that but with a client/server system relying on a "well known folder" convention, things get messy and conventions get broken down eventually - gInventory.consolidateForType(outbox_id, LLFolderType::FT_MERCHANT_ITEMS); + gInventory.consolidateForType(outbox_id, LLFolderType::FT_MARKETPLACE_LISTINGS); if (outbox_id == mRootFolderId) { - llinfos << "Merov : Inventory warning: Merchant items folder already set" << llendl; - llwarns << "Inventory warning: Merchant items folder already set" << llendl; + llinfos << "Merov : Inventory warning: Marketplace listings folder already set" << llendl; + llwarns << "Inventory warning: Marketplace listings folder already set" << llendl; return; } mRootFolderId = outbox_id; @@ -815,7 +815,7 @@ void LLFloaterMerchantItems::setup() } llassert(!mCategoryAddedObserver); - // Create observer for merchant items modifications : clear the old one and create a new one + // Create observer for marketplace listings modifications : clear the old one and create a new one if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) { gInventory.removeObserver(mCategoriesObserver); @@ -823,16 +823,16 @@ void LLFloaterMerchantItems::setup() } mCategoriesObserver = new LLInventoryCategoriesObserver(); gInventory.addObserver(mCategoriesObserver); - mCategoriesObserver->addCategory(mRootFolderId, boost::bind(&LLFloaterMerchantItems::onChanged, this)); + mCategoriesObserver->addCategory(mRootFolderId, boost::bind(&LLFloaterMarketplaceListings::onChanged, this)); llassert(mCategoriesObserver); - // Set up the merchant items inventory view + // Set up the marketplace listings inventory view LLInventoryPanel* inventory_panel = mInventoryPanel.get(); if (inventory_panel) { delete inventory_panel; } - inventory_panel = LLUICtrlFactory::createFromFile("panel_merchant_items_inventory.xml", mInventoryPlaceholder->getParent(), LLInventoryPanel::child_registry_t::instance()); + inventory_panel = LLUICtrlFactory::createFromFile("panel_marketplace_listings_inventory.xml", mInventoryPlaceholder->getParent(), LLInventoryPanel::child_registry_t::instance()); mInventoryPanel = inventory_panel->getInventoryPanelHandle(); llassert(mInventoryPanel.get() != NULL); @@ -844,11 +844,11 @@ void LLFloaterMerchantItems::setup() inventory_panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); inventory_panel->getFilter().markDefault(); - // Get the content of the merchant items folder + // Get the content of the marketplace listings folder fetchContents(); } -void LLFloaterMerchantItems::initializeMarketPlace() +void LLFloaterMarketplaceListings::initializeMarketPlace() { // // Initialize the marketplace import API @@ -857,14 +857,14 @@ void LLFloaterMerchantItems::initializeMarketPlace() if (!importer.isInitialized()) { - importer.setInitializationErrorCallback(boost::bind(&LLFloaterMerchantItems::initializationReportError, this, _1, _2)); - importer.setStatusChangedCallback(boost::bind(&LLFloaterMerchantItems::importStatusChanged, this, _1)); - importer.setStatusReportCallback(boost::bind(&LLFloaterMerchantItems::importReportResults, this, _1, _2)); + importer.setInitializationErrorCallback(boost::bind(&LLFloaterMarketplaceListings::initializationReportError, this, _1, _2)); + importer.setStatusChangedCallback(boost::bind(&LLFloaterMarketplaceListings::importStatusChanged, this, _1)); + importer.setStatusReportCallback(boost::bind(&LLFloaterMarketplaceListings::importReportResults, this, _1, _2)); importer.initialize(); } } -S32 LLFloaterMerchantItems::getFolderCount() +S32 LLFloaterMarketplaceListings::getFolderCount() { if (mInventoryPanel.get() && mRootFolderId.notNull()) { @@ -880,7 +880,7 @@ S32 LLFloaterMerchantItems::getFolderCount() } } -void LLFloaterMerchantItems::updateView() +void LLFloaterMarketplaceListings::updateView() { LLInventoryPanel* panel = mInventoryPanel.get(); @@ -915,10 +915,10 @@ void LLFloaterMerchantItems::updateView() { setup(); } - // "Merchant items is empty!" message strings - text = LLTrans::getString("InventoryMerchantItemsNoItems", subs); - title = LLTrans::getString("InventoryMerchantItemsNoItemsTitle"); - tooltip = LLTrans::getString("InventoryMerchantItemsNoItemsTooltip"); + // "Marketplace listings is empty!" message strings + text = LLTrans::getString("InventoryMarketplaceListingsNoItems", subs); + title = LLTrans::getString("InventoryMarketplaceListingsNoItemsTitle"); + tooltip = LLTrans::getString("InventoryMarketplaceListingsNoItemsTooltip"); } else if (mkt_status <= MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING) { @@ -948,14 +948,14 @@ void LLFloaterMerchantItems::updateView() } } -bool LLFloaterMerchantItems::isAccepted(EAcceptance accept) +bool LLFloaterMarketplaceListings::isAccepted(EAcceptance accept) { // *TODO : Need a bit more test on what we accept: depends of what and where... return (accept >= ACCEPT_YES_COPY_SINGLE); } -BOOL LLFloaterMerchantItems::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, +BOOL LLFloaterMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, @@ -1006,21 +1006,21 @@ BOOL LLFloaterMerchantItems::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL dro return handled; } -BOOL LLFloaterMerchantItems::handleHover(S32 x, S32 y, MASK mask) +BOOL LLFloaterMarketplaceListings::handleHover(S32 x, S32 y, MASK mask) { mTopLevelDropZone->setBackgroundVisible(FALSE); return LLFloater::handleHover(x, y, mask); } -void LLFloaterMerchantItems::onMouseLeave(S32 x, S32 y, MASK mask) +void LLFloaterMarketplaceListings::onMouseLeave(S32 x, S32 y, MASK mask) { mTopLevelDropZone->setBackgroundVisible(FALSE); LLFloater::onMouseLeave(x, y, mask); } -void LLFloaterMerchantItems::onChanged() +void LLFloaterMarketplaceListings::onChanged() { LLViewerInventoryCategory* category = gInventory.getCategory(mRootFolderId); if (mRootFolderId.notNull() && category) @@ -1034,12 +1034,12 @@ void LLFloaterMerchantItems::onChanged() } } -void LLFloaterMerchantItems::initializationReportError(U32 status, const LLSD& content) +void LLFloaterMarketplaceListings::initializationReportError(U32 status, const LLSD& content) { updateView(); } -void LLFloaterMerchantItems::importStatusChanged(bool inProgress) +void LLFloaterMarketplaceListings::importStatusChanged(bool inProgress) { if (mRootFolderId.isNull() && (LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus() == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT)) { @@ -1071,7 +1071,7 @@ void LLFloaterMerchantItems::importStatusChanged(bool inProgress) updateView(); } -void LLFloaterMerchantItems::importReportResults(U32 status, const LLSD& content) +void LLFloaterMarketplaceListings::importReportResults(U32 status, const LLSD& content) { updateView(); } diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h index 1b1e1e0439..e28fb320ea 100755 --- a/indra/newview/llfloateroutbox.h +++ b/indra/newview/llfloateroutbox.h @@ -1,8 +1,8 @@ /** * @file llfloateroutbox.h - * @brief Implementation of the merchant outbox window and of the merchant items window + * @brief Implementation of the merchant outbox window and of the marketplace listings window * - * *TODO : Eventually, take out all the merchant outbox stuff and rename that file to llfloatermerchantitems + * *TODO : Eventually, take out all the merchant outbox stuff and rename that file to llfloatermarketplacelistings * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code @@ -115,14 +115,14 @@ private: }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLFloaterMerchantItems +// Class LLFloaterMarketplaceListings //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLFloaterMerchantItems : public LLFloater +class LLFloaterMarketplaceListings : public LLFloater { public: - LLFloaterMerchantItems(const LLSD& key); - ~LLFloaterMerchantItems(); + LLFloaterMarketplaceListings(const LLSD& key); + ~LLFloaterMarketplaceListings(); void initializeMarketPlace(); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c2f6ce8fb1..9d9279ce90 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -959,9 +959,9 @@ BOOL LLInvFVBridge::isInboxFolder() const return gInventory.isObjectDescendentOf(mUUID, inbox_id); } -BOOL LLInvFVBridge::isMerchantItemsFolder() const +BOOL LLInvFVBridge::isMarketplaceListingsFolder() const { - const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MERCHANT_ITEMS, false); + const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); if (folder_id.isNull()) { @@ -1954,7 +1954,7 @@ std::string LLFolderBridge::getLabelSuffix() const accessories = (parent_folder_id == gInventory.getLibraryRootFolderID()); } */ - if (isMerchantItemsFolder()) + if (isMarketplaceListingsFolder()) { if (LLMarketplaceData::instance().isListed(getUUID())) { diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 199a46d275..d9533b537c 100755 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -160,7 +160,7 @@ protected: BOOL isInboxFolder() const; // true if COF or descendant of marketplace inbox BOOL isOutboxFolder() const; // true if COF or descendant of marketplace outbox BOOL isOutboxFolderDirectParent() const; - BOOL isMerchantItemsFolder() const; // true if descendant of Merchant items folder + BOOL isMarketplaceListingsFolder() const; // true if descendant of Marketplace listings folder const LLUUID getOutboxFolder() const; virtual BOOL isItemPermissive() const; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c1607fbbc0..bf8f7819ef 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -288,7 +288,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_OUTBOX)); - getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_MERCHANT_ITEMS)); + getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_MARKETPLACE_LISTINGS)); } // set the filter for the empty folder if the debug setting is on @@ -1490,6 +1490,6 @@ namespace LLInitParam declare(LLFolderType::lookup(LLFolderType::FT_INBOX) , LLFolderType::FT_INBOX); declare(LLFolderType::lookup(LLFolderType::FT_OUTBOX) , LLFolderType::FT_OUTBOX); declare(LLFolderType::lookup(LLFolderType::FT_BASIC_ROOT) , LLFolderType::FT_BASIC_ROOT); - declare(LLFolderType::lookup(LLFolderType::FT_MERCHANT_ITEMS) , LLFolderType::FT_MERCHANT_ITEMS); + declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_LISTINGS) , LLFolderType::FT_MARKETPLACE_LISTINGS); } } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index f55de790d8..853d98693b 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -243,7 +243,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("tex_fetch_debugger", "floater_texture_fetch_debugger.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); } LLFloaterReg::add("media_settings", "floater_media_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("merchant_items", "floater_merchant_items.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("marketplace_listings", "floater_marketplace_listings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("message_critical", "floater_critical.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("message_tos", "floater_tos.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("moveview", "floater_moveview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 413814cec0..ee8f85782f 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -141,7 +141,7 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_BASIC_ROOT, new ViewerFolderEntry("Basic Root", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); - addEntry(LLFolderType::FT_MERCHANT_ITEMS, new ViewerFolderEntry("Merchant items", "Inv_SysOpen", "Inv_SysClosed", FALSE, boxes_invisible)); + addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new ViewerFolderEntry("Marketplace listings", "Inv_SysOpen", "Inv_SysClosed", FALSE, boxes_invisible)); addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false, "default")); diff --git a/indra/newview/skins/default/xui/en/floater_marketplace_listings.xml b/indra/newview/skins/default/xui/en/floater_marketplace_listings.xml new file mode 100755 index 0000000000..94a9466c16 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_marketplace_listings.xml @@ -0,0 +1,121 @@ + + + + + + + Loading... + + + + + + + + Drag items you want to sell + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/floater_merchant_items.xml b/indra/newview/skins/default/xui/en/floater_merchant_items.xml deleted file mode 100755 index 2e54ed2ce3..0000000000 --- a/indra/newview/skins/default/xui/en/floater_merchant_items.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - Loading... - - - - - - - - Drag items you want to sell - - - - - - - - - - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 2dc974eff1..a8e02a9d02 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -182,11 +182,11 @@ parameter="outbox" /> + label="Marketplace listings..." + name="MarketplaceListings"> + parameter="marketplace_listings" /> + + + + diff --git a/indra/newview/skins/default/xui/en/panel_merchant_items_inventory.xml b/indra/newview/skins/default/xui/en/panel_merchant_items_inventory.xml deleted file mode 100755 index a013516267..0000000000 --- a/indra/newview/skins/default/xui/en/panel_merchant_items_inventory.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 515e912ee5..387ad138d9 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2219,9 +2219,9 @@ We are accessing your account on the [[MARKETPLACE_CREATE_STORE_URL] Marketplace The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors. - Your Merchant Items folder is empty. - - + Your Marketplace Listings folder is empty. + + Drag folders to this area to list them for sale on the [[MARKETPLACE_DASHBOARD_URL] Marketplace]. -- cgit v1.3 From 0ec8fbec6deaa24506391ef239c50009eebe1eef Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 28 Mar 2014 15:54:36 -0700 Subject: DD-24 : Add FT_MARKETPLACE_STOCK as a new type for folders, implement the promotion code for Drag and Drop, display of stock folders and embryonic marketplace validation --- indra/llcommon/llfoldertype.cpp | 1 + indra/llcommon/llfoldertype.h | 1 + indra/newview/llinventorybridge.cpp | 56 ++++++++-- indra/newview/llinventoryfunctions.cpp | 149 +++++++++++++++++++++++++ indra/newview/llinventoryfunctions.h | 6 +- indra/newview/llinventorymodel.cpp | 4 +- indra/newview/llinventorypanel.cpp | 1 + indra/newview/llviewerfoldertype.cpp | 3 +- indra/newview/skins/default/xui/en/strings.xml | 1 + 9 files changed, 210 insertions(+), 12 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index 5b80189d2a..afa9e59832 100755 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -98,6 +98,7 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_rt", TRUE)); addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new FolderEntry("merchant", FALSE)); + addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new FolderEntry("stock", FALSE)); addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE)); }; diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index 91dc1da543..20925eede0 100644 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -88,6 +88,7 @@ public: FT_BASIC_ROOT = 52, FT_MARKETPLACE_LISTINGS = 53, + FT_MARKETPLACE_STOCK = 54, FT_COUNT, diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3d418105e3..d0abe6db29 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1958,7 +1958,7 @@ std::string LLFolderBridge::getLabelSuffix() const { if (LLMarketplaceData::instance().isListed(getUUID())) { - llinfos << "Merov : in merchant folder and listed : id = " << getUUID() << llendl; + //llinfos << "Merov : in merchant folder and listed : id = " << getUUID() << llendl; std::string suffix = LLMarketplaceData::instance().getListingID(getUUID()); if (suffix.empty()) { @@ -1971,9 +1971,15 @@ std::string LLFolderBridge::getLabelSuffix() const } return LLInvFVBridge::getLabelSuffix() + suffix; } + else if (getCategory()->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + //llinfos << "Merov : in merchant folder and is a stock folder : id = " << getUUID() << llendl; + std::string suffix = " (" + LLTrans::getString("MarketplaceStock") + ")"; + return LLInvFVBridge::getLabelSuffix() + suffix; + } else { - llinfos << "Merov : in merchant folder but not listed : id = " << getUUID() << llendl; + //llinfos << "Merov : in merchant folder but not listed : id = " << getUUID() << llendl; return LLInvFVBridge::getLabelSuffix(); } } @@ -2316,10 +2322,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const LLUUID &cat_id = inv_cat->getUUID(); const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); const BOOL move_is_from_outbox = model->isObjectDescendentOf(cat_id, outbox_id); + const BOOL move_is_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); + const BOOL move_is_from_marketplacelistings = model->isObjectDescendentOf(cat_id, marketplacelistings_id); // check to make sure source is agent inventory, and is represented there. LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); @@ -2499,6 +2508,12 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } + if (is_movable && move_is_into_marketplacelistings) + { + // *TODO : Merov : Add here the logic to prevent huge nesting in marketplace listings + // For the moment, we just take in anything + is_movable = TRUE; + } if (is_movable) { @@ -2601,6 +2616,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, { copy_folder_to_outbox(inv_cat, mUUID, cat_id, LLToolDragAndDrop::getOperationId()); } + else if (move_is_into_marketplacelistings && !move_is_from_marketplacelistings) + { + move_folder_to_marketplacelistings(inv_cat, mUUID); + } else { if (model->isObjectDescendentOf(cat_id, model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false))) @@ -2620,7 +2639,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else if (LLToolDragAndDrop::SOURCE_WORLD == source) { - if (move_is_into_outbox) + if (move_is_into_outbox || move_is_into_marketplacelistings) { tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; @@ -2632,7 +2651,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else if (LLToolDragAndDrop::SOURCE_LIBRARY == source) { - if (move_is_into_outbox) + if (move_is_into_outbox || move_is_into_marketplacelistings) { tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; @@ -3248,6 +3267,9 @@ void LLFolderBridge::pasteFromClipboard() const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); + // *TODO : Add marketplace listings case + //const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + //const BOOL move_is_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); LLDynamicArray objects; LLClipboard::instance().pasteFromClipboard(objects); @@ -3372,12 +3394,14 @@ void LLFolderBridge::pasteLinkFromClipboard() { const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); + const BOOL move_is_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); - if (move_is_into_outbox) + if (move_is_into_outbox || move_is_into_marketplacelistings) { // Notify user of failure somehow -- play error sound? modal dialog? return; @@ -4047,6 +4071,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false); const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); const BOOL move_is_into_favorites = (mUUID == favorites_id); @@ -4054,6 +4079,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id); const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); const BOOL move_is_from_outbox = model->isObjectDescendentOf(inv_item->getUUID(), outbox_id); + const BOOL move_is_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); BOOL accept = FALSE; @@ -4150,6 +4176,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } } } + else if (move_is_into_marketplacelistings) + { + // *TODO : Add here any logic that may prevent an item to be copied into the marketplace listings + // For the moment, we let anything go + accept = TRUE; + } LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); @@ -4208,6 +4240,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { dropToOutfit(inv_item, move_is_into_current_outfit); } + // MERCHANT OUTBOX folder + // Move the item else if (move_is_into_outbox) { if (move_is_from_outbox) @@ -4219,6 +4253,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, copy_item_to_outbox(inv_item, mUUID, LLUUID::null, LLToolDragAndDrop::getOperationId()); } } + // MARKETPLACE LISTINGS folder + // Move the item + else if (move_is_into_marketplacelistings) + { + move_item_to_marketplacelistings(inv_item, mUUID); + } // NORMAL or TRASH folder // (move the item, restamp if into trash) else @@ -4285,7 +4325,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = FALSE; } - else if (move_is_into_outbox) + else if (move_is_into_outbox || move_is_into_marketplacelistings) { tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; @@ -4323,7 +4363,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } else if(LLToolDragAndDrop::SOURCE_NOTECARD == source) { - if (move_is_into_outbox) + if (move_is_into_outbox || move_is_into_marketplacelistings) { tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; @@ -4357,7 +4397,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = TRUE; - if (move_is_into_outbox) + if (move_is_into_outbox || move_is_into_marketplacelistings) { tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 203eb4ec4e..fe55f8955f 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -686,6 +686,155 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold open_outbox(); } +void move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_folder) +{ + // Collapse links into items/folders + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; + LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory(); + + if (linked_category != NULL) + { + // Move the linked folder directly + move_folder_to_marketplacelistings(linked_category, dest_folder); + } + else + { + // Grab the linked item if any + LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); + viewer_inv_item = (linked_item != NULL ? linked_item : viewer_inv_item); + + // Check that the agent has copy permission on the item: this is required as a resident cannot + // put on sale items she has no right about. Proceed with move if we have permission. + // *TODO : Check that this is adequate (copied from the Merchant Outbox permission check so should be OK...) + if (viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + // When moving an isolated item directly under the marketplace listings root, we create a new folder with that name + if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false)) + { + // *TODO : This method is not specific to the outbox folder so make it more generic + dest_folder = create_folder_in_outbox_for_item(inv_item, dest_folder, 0); + } + + // Reparent the item + gInventory.changeItemParent(viewer_inv_item, dest_folder, false); + + // Check the item for no copy permission and promote the destination folder if necessary + if (!(viewer_inv_item->getPermissions().getMaskEveryone() & PERM_COPY)) + { + llinfos << "Merov : item is no copy -> change the destination folder type!" << llendl; + LLViewerInventoryCategory * viewer_cat = (LLViewerInventoryCategory *) (gInventory.getCategory(dest_folder)); + viewer_cat->changeType(LLFolderType::FT_MARKETPLACE_STOCK); + } + } + else + { + // *TODO : signal an error to the user (UI for this TBD) + llinfos << "Merov : user doesn't have the correct permission to put this item on sale -> move aborted!" << llendl; + } + } +} + +void move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUUID& dest_folder) +{ + // Check that we have adequate permission on all items being moved. Proceed if we do. + if (has_correct_permissions_for_sale(inv_cat)) + { + + // Reparent the folder + LLViewerInventoryCategory * viewer_inv_cat = (LLViewerInventoryCategory *) inv_cat; + gInventory.changeCategoryParent(viewer_inv_cat, dest_folder, false); + + // Check the destination folder recursively for no copy items and promote the including folders if any + validate_marketplacelistings(inv_cat); + } +} + +// Returns true if all items within the argument folder are fit for sale, false otherwise +bool has_correct_permissions_for_sale(LLInventoryCategory* cat) +{ + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array); + + LLInventoryModel::item_array_t item_array_copy = *item_array; + + for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) + { + LLInventoryItem* item = *iter; + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) item; + LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory(); + LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); + // Linked items and folders cannot be put for sale + if (linked_category || linked_item) + { + llinfos << "Merov : linked items in this folder -> not allowed to sell!" << llendl; + return false; + } + // *TODO : Check that this is adequate (copied from the Merchant Outbox permission check so should be OK...) + if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + llinfos << "Merov : wrong permissions on items in this folder -> not allowed to sell!" << llendl; + return false; + } + } + + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLInventoryCategory* category = *iter; + if (!has_correct_permissions_for_sale(category)) + { + return false; + } + } + return true; +} + +// Make all relevant business logic checks on the marketplace listings starting with the folder as argument +// This function does no deletion or move but a mere audit and raises issues to the user +// The only thing that's done is to modify the type of folders containing no-copy items to stock folders +// *TODO : Signal the errors to the user somewhat (UI still TBD) +// *TODO : Add the rest of the SLM/AIS business logic (limit of nesting depth, stock folder consistency, overall limit on listings, etc...) +void validate_marketplacelistings(LLInventoryCategory* cat) +{ + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array); + + LLInventoryModel::item_array_t item_array_copy = *item_array; + + for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) + { + LLInventoryItem* item = *iter; + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) item; + LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory(); + LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); + if (linked_category || linked_item) + { + llinfos << "Merov : Validation error: there are linked items in this listing!" << llendl; + } + if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + llinfos << "Merov : Validation error: there are items with incorrect permissions in this listing!" << llendl; + } + if (!(viewer_inv_item->getPermissions().getMaskEveryone() & PERM_COPY)) + { + llinfos << "Merov : Validation warning : item is no copy -> change the folder type to stock!" << llendl; + LLViewerInventoryCategory * viewer_cat = (LLViewerInventoryCategory *) (cat); + viewer_cat->changeType(LLFolderType::FT_MARKETPLACE_STOCK); + } + } + + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLInventoryCategory* category = *iter; + validate_marketplacelistings(category); + } +} + ///---------------------------------------------------------------------------- /// LLInventoryCollectFunctor implementations ///---------------------------------------------------------------------------- diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 1443c186cf..006cc3de68 100755 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -70,9 +70,13 @@ void append_path(const LLUUID& id, std::string& path); void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id); void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, S32 operation_id); - void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder, S32 operation_id); +void move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_folder); +void move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUUID& dest_folder); +bool has_correct_permissions_for_sale(LLInventoryCategory* cat); +void validate_marketplacelistings(LLInventoryCategory* inv_cat); + /** Miscellaneous global functions ** ** *******************************************************************************/ diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index ed7fd3cd34..37e11123c6 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2160,12 +2160,12 @@ void LLInventoryModel::buildParentChildMap() // implement it, we would need a set or map of uuid pairs // which would be (folder_id, new_parent_id) to be sent up // to the server. - llinfos << "Lost categroy: " << cat->getUUID() << " - " + llinfos << "Lost category: " << cat->getUUID() << " - " << cat->getName() << llendl; ++lost; // plop it into the lost & found. LLFolderType::EType pref = cat->getPreferredType(); - if(LLFolderType::FT_NONE == pref) + if ((LLFolderType::FT_NONE == pref) || (LLFolderType::FT_MARKETPLACE_STOCK == pref)) { cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index bf8f7819ef..6305275a08 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1491,5 +1491,6 @@ namespace LLInitParam declare(LLFolderType::lookup(LLFolderType::FT_OUTBOX) , LLFolderType::FT_OUTBOX); declare(LLFolderType::lookup(LLFolderType::FT_BASIC_ROOT) , LLFolderType::FT_BASIC_ROOT); declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_LISTINGS) , LLFolderType::FT_MARKETPLACE_LISTINGS); + declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_STOCK), LLFolderType::FT_MARKETPLACE_STOCK); } } diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index ee8f85782f..b82f954e91 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -142,7 +142,8 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_BASIC_ROOT, new ViewerFolderEntry("Basic Root", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new ViewerFolderEntry("Marketplace listings", "Inv_SysOpen", "Inv_SysClosed", FALSE, boxes_invisible)); - + addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new ViewerFolderEntry("New Stock", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false, "default")); + addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false, "default")); #if SUPPORT_ENSEMBLES diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 80b520622a..ce9bbbc8d2 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2273,6 +2273,7 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors. no Mkt ID live + stock Open landmarks -- cgit v1.3 From 39659f3c034c5cb335e185d1411e808d272f8065 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 3 Apr 2014 15:17:31 -0700 Subject: DD-20 : Handle edge cases a bit more cleanly --- indra/newview/llfloatermarketplacelistings.cpp | 2 +- indra/newview/llinventorybridge.cpp | 3 +-- indra/newview/llinventorymodel.cpp | 1 - indra/newview/llinventorypanel.cpp | 3 ++- 4 files changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index 814f1b218a..e8257e52c4 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -466,7 +466,7 @@ BOOL LLFloaterMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BO BOOL handled = (handled_view != NULL); // Pass all drag and drop for this floater to the marketplace listings inventory control - if (!handled || !isAccepted(*accept)) + if (!handled && isAccepted(*accept) && !mPanelListings->getVisible() && mRootFolderId.notNull()) { LLFolderView* root_folder = mPanelListings->getRootFolder(); handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 68418063e7..09fd0527b9 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2345,7 +2345,6 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); const BOOL move_is_from_outbox = model->isObjectDescendentOf(cat_id, outbox_id); const BOOL move_is_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); - const BOOL move_is_from_marketplacelistings = model->isObjectDescendentOf(cat_id, marketplacelistings_id); // check to make sure source is agent inventory, and is represented there. LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); @@ -2633,7 +2632,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, { copy_folder_to_outbox(inv_cat, mUUID, cat_id, LLToolDragAndDrop::getOperationId()); } - else if (move_is_into_marketplacelistings && !move_is_from_marketplacelistings) + else if (move_is_into_marketplacelistings) { move_folder_to_marketplacelistings(inv_cat, mUUID); } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 269542d383..96a2db5afb 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1058,7 +1058,6 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) { mask |= LLInventoryObserver::LABEL; } - llinfos << "Merov : updateCategory : " << cat->getName() << llendl; old_cat->copyViewerCategory(cat); addChangedMask(mask, cat->getUUID()); } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 6305275a08..7d774110bd 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -568,7 +568,8 @@ void LLInventoryPanel::modelChanged(U32 mask) else if (!model_item && view_item && viewmodel_item) { // Remove the item's UI. - removeItemID(viewmodel_item->getUUID()); + const LLUUID& idp = viewmodel_item->getUUID(); + removeItemID(idp); view_item->destroyView(); } } -- cgit v1.3 From 250f05861eeec06b864e57c1fda6a996b6a94029 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 21 Apr 2014 11:27:52 -0700 Subject: DD-66 : Use new icons for version folders and stock folder --- indra/llcommon/llfoldertype.cpp | 1 + indra/llcommon/llfoldertype.h | 1 + indra/newview/llinventorybridge.cpp | 15 +++++++++++++-- indra/newview/llinventorypanel.cpp | 1 + indra/newview/llviewerfoldertype.cpp | 3 ++- .../default/textures/icons/Inv_StockFolderClosed.png | Bin 1063 -> 1143 bytes .../default/textures/icons/Inv_StockFolderOpen.png | Bin 361 -> 1319 bytes .../textures/icons/Inv_VersionFolderClosed.png | Bin 0 -> 1132 bytes .../default/textures/icons/Inv_VersionFolderOpen.png | Bin 0 -> 1521 bytes indra/newview/skins/default/textures/textures.xml | 2 ++ 10 files changed, 20 insertions(+), 3 deletions(-) mode change 100755 => 100644 indra/newview/skins/default/textures/icons/Inv_StockFolderOpen.png create mode 100644 indra/newview/skins/default/textures/icons/Inv_VersionFolderClosed.png create mode 100644 indra/newview/skins/default/textures/icons/Inv_VersionFolderOpen.png (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index afa9e59832..965e4d9734 100755 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -99,6 +99,7 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new FolderEntry("merchant", FALSE)); addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new FolderEntry("stock", FALSE)); + addEntry(LLFolderType::FT_MARKETPLACE_VERSION, new FolderEntry("version", FALSE)); addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE)); }; diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index 20925eede0..515bb05a3f 100644 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -89,6 +89,7 @@ public: FT_MARKETPLACE_LISTINGS = 53, FT_MARKETPLACE_STOCK = 54, + FT_MARKETPLACE_VERSION = 55, // Note: We actually *never* create folders with that type. This is used for icon override only. FT_COUNT, diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1eb647b1b2..3f2a5501bd 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3317,10 +3317,15 @@ LLUIImagePtr LLFolderBridge::getIcon() const { LLFolderType::EType preferred_type = LLFolderType::FT_NONE; LLViewerInventoryCategory* cat = getCategory(); - if(cat) + if (cat) { preferred_type = cat->getPreferredType(); } + if ((preferred_type == LLFolderType::FT_NONE) && (depth_nesting_in_marketplace(mUUID) == 2)) + { + // We override the type when in the marketplace listings folder and only for version folder + preferred_type = LLFolderType::FT_MARKETPLACE_VERSION; + } return getIcon(preferred_type); } @@ -3332,7 +3337,13 @@ LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type) LLUIImagePtr LLFolderBridge::getIconOpen() const { - return LLUI::getUIImage(LLViewerFolderType::lookupIconName(getPreferredType(), TRUE)); + LLFolderType::EType preferred_type = getPreferredType(); + if ((preferred_type == LLFolderType::FT_NONE) && (depth_nesting_in_marketplace(mUUID) == 2)) + { + // We override the type when in the marketplace listings folder and only for version folder + preferred_type = LLFolderType::FT_MARKETPLACE_VERSION; + } + return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, TRUE)); } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 7d774110bd..b0163b5996 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1493,5 +1493,6 @@ namespace LLInitParam declare(LLFolderType::lookup(LLFolderType::FT_BASIC_ROOT) , LLFolderType::FT_BASIC_ROOT); declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_LISTINGS) , LLFolderType::FT_MARKETPLACE_LISTINGS); declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_STOCK), LLFolderType::FT_MARKETPLACE_STOCK); + declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_VERSION), LLFolderType::FT_MARKETPLACE_VERSION); } } diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 7fb6331061..1e9d0791c0 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -142,7 +142,8 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_BASIC_ROOT, new ViewerFolderEntry("Basic Root", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new ViewerFolderEntry("Marketplace listings", "Inv_SysOpen", "Inv_SysClosed", FALSE, boxes_invisible)); - addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new ViewerFolderEntry("New Stock", "Inv_StockFolderOpen", "Inv_StockFolderClosed", FALSE, false, "default")); + addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new ViewerFolderEntry("New Stock", "Inv_StockFolderOpen", "Inv_StockFolderClosed", FALSE, false, "default")); + addEntry(LLFolderType::FT_MARKETPLACE_VERSION, new ViewerFolderEntry("New Version", "Inv_VersionFolderOpen","Inv_VersionFolderClosed", FALSE, false, "default")); addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false, "default")); diff --git a/indra/newview/skins/default/textures/icons/Inv_StockFolderClosed.png b/indra/newview/skins/default/textures/icons/Inv_StockFolderClosed.png index 4ad25840da..4dc484dc22 100644 Binary files a/indra/newview/skins/default/textures/icons/Inv_StockFolderClosed.png and b/indra/newview/skins/default/textures/icons/Inv_StockFolderClosed.png differ diff --git a/indra/newview/skins/default/textures/icons/Inv_StockFolderOpen.png b/indra/newview/skins/default/textures/icons/Inv_StockFolderOpen.png old mode 100755 new mode 100644 index 0507c2cbaf..0d140b56a7 Binary files a/indra/newview/skins/default/textures/icons/Inv_StockFolderOpen.png and b/indra/newview/skins/default/textures/icons/Inv_StockFolderOpen.png differ diff --git a/indra/newview/skins/default/textures/icons/Inv_VersionFolderClosed.png b/indra/newview/skins/default/textures/icons/Inv_VersionFolderClosed.png new file mode 100644 index 0000000000..e89a4d7f31 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Inv_VersionFolderClosed.png differ diff --git a/indra/newview/skins/default/textures/icons/Inv_VersionFolderOpen.png b/indra/newview/skins/default/textures/icons/Inv_VersionFolderOpen.png new file mode 100644 index 0000000000..659d7d392f Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Inv_VersionFolderOpen.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index c172afd419..9c81271308 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -313,6 +313,8 @@ with the same filename but different name + + -- cgit v1.3 From c182a8b79737a67794c032a6b60b038c9b905f57 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 29 Jul 2014 18:20:05 -0700 Subject: DD-69 : Fixed! Added an xml parameter to optionally allow the visualization of the root folder on an inventory panel. Used only for marketplace floater so far. --- indra/newview/llinventorypanel.cpp | 12 ++++++++++++ indra/newview/llinventorypanel.h | 4 +++- .../skins/default/xui/en/panel_marketplace_listings.xml | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index b386daa77b..4bfac96a11 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -787,6 +787,18 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) const LLUUID &parent_id = objectp->getParentUUID(); LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)getItemByID(parent_id); + // Force the creation of an extra root level folder item if required by the inventory panel (default is "false") + if (mParams.show_root_folder) + { + LLUUID root_id = getRootFolderID(); + if (root_id == id) + { + // We insert an extra level that's seen by the UI but has no influence on the model + parent_folder = dynamic_cast(folder_view_item); + folder_view_item = NULL; + } + } + if (!folder_view_item && parent_folder) { if (objectp->getType() <= LLAssetType::AT_NONE || diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 91c3efd8f0..e0b39caa6e 100755 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -96,6 +96,7 @@ public: Optional start_folder; Optional use_label_suffix; Optional show_empty_message; + Optional show_root_folder; Optional scroll; Optional accepts_drag_and_drop; Optional folder_view; @@ -110,7 +111,8 @@ public: filter("filter"), start_folder("start_folder"), use_label_suffix("use_label_suffix", true), - show_empty_message("show_empty_message", true), + show_empty_message("show_empty_message", true), + show_root_folder("show_root_folder", false), scroll("scroll"), accepts_drag_and_drop("accepts_drag_and_drop"), folder_view("folder_view"), diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml index 18baa91acb..3d75ad4488 100755 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml @@ -87,6 +87,7 @@ start_folder.name="Marketplace listings" show_empty_message="false" show_load_status="false" + show_root_folder="true" start_folder.type="merchant" tool_tip="Drag and drop items here to sell them" bg_opaque_color="DkGray2" @@ -109,6 +110,7 @@ start_folder.name="Marketplace listings" show_empty_message="false" show_load_status="false" + show_root_folder="true" start_folder.type="merchant" bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" @@ -130,6 +132,7 @@ start_folder.name="Marketplace listings" show_empty_message="false" show_load_status="false" + show_root_folder="true" start_folder.type="merchant" bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" @@ -151,6 +154,7 @@ start_folder.name="Marketplace listings" show_empty_message="false" show_load_status="false" + show_root_folder="true" start_folder.type="merchant" bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" -- cgit v1.3 From d37c294bd38bf4cae251c33f863e4e6e66ef44db Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 30 Jul 2014 20:51:18 -0700 Subject: DD-75 : Prevent dropping on filtered tabs root. Adding an allow_drop option to inventory tab and folder view folders so that case can be taken into account. --- indra/llui/llfolderviewitem.cpp | 15 ++++++++++++--- indra/llui/llfolderviewitem.h | 2 ++ indra/newview/llinventorypanel.cpp | 10 +++++++--- indra/newview/llinventorypanel.h | 4 +++- indra/newview/llmarketplacefunctions.cpp | 2 +- .../skins/default/xui/en/panel_marketplace_listings.xml | 2 ++ indra/newview/skins/default/xui/en/strings.xml | 1 + 7 files changed, 28 insertions(+), 8 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 42116251fb..942dd76af9 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -104,7 +104,8 @@ LLFolderViewItem::Params::Params() item_height("item_height"), item_top_pad("item_top_pad"), creation_date(), - allow_wear("allow_wear", true), + allow_wear("allow_wear", true), + allow_drop("allow_drop", true), font_color("font_color"), font_highlight_color("font_highlight_color"), left_pad("left_pad", 0), @@ -138,6 +139,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mViewModelItem(p.listener), mIsMouseOverTitle(false), mAllowWear(p.allow_wear), + mAllowDrop(p.allow_drop), mFontColor(p.font_color), mFontHighlightColor(p.font_highlight_color), mLeftPad(p.left_pad), @@ -1782,9 +1784,16 @@ BOOL LLFolderViewFolder::handleDragAndDropToThisFolder(MASK mask, EAcceptance* accept, std::string& tooltip_msg) { + if (!mAllowDrop) + { + *accept = ACCEPT_NO; + tooltip_msg = LLTrans::getString("TooltipOutboxCannotDropOnRoot"); + return TRUE; + } + BOOL accepted = getViewModelItem()->dragOrDrop(mask,drop,cargo_type,cargo_data, tooltip_msg); - - if (accepted) + + if (accepted) { mDragAndDropTarget = TRUE; *accept = ACCEPT_YES_MULTI; diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 12fba4f9b1..ffeaf0d1b7 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -60,6 +60,7 @@ public: Optional creation_date; Optional allow_wear; + Optional allow_drop; Optional font_color; Optional font_highlight_color; @@ -118,6 +119,7 @@ protected: mDragAndDropTarget, mIsMouseOverTitle, mAllowWear, + mAllowDrop, mSelectPending; LLUIColor mFontColor; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 4bfac96a11..3b18b86f57 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -191,6 +191,7 @@ LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) p.show_empty_message = mShowEmptyMessage; p.show_item_link_overlays = mShowItemLinkOverlays; p.root = NULL; + p.allow_drop = mParams.allow_drop_on_root; p.options_menu = "menu_inventory.xml"; return LLUICtrlFactory::create(p); @@ -744,7 +745,7 @@ void LLInventoryPanel::initializeViews() } -LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) +LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop) { LLFolderViewFolder::Params params(mParams.folder); @@ -752,6 +753,7 @@ LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * br params.root = mFolderRoot.get(); params.listener = bridge; params.tool_tip = params.name; + params.allow_drop = allow_drop; params.font_color = (bridge->isLibraryItem() ? sLibraryColor : (bridge->isLink() ? sLinkColor : sDefaultColor)); params.font_highlight_color = (bridge->isLibraryItem() ? sLibraryColor : (bridge->isLink() ? sLinkColor : sDefaultHighlightColor)); @@ -788,6 +790,7 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)getItemByID(parent_id); // Force the creation of an extra root level folder item if required by the inventory panel (default is "false") + bool allow_drop = true; if (mParams.show_root_folder) { LLUUID root_id = getRootFolderID(); @@ -796,6 +799,7 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) // We insert an extra level that's seen by the UI but has no influence on the model parent_folder = dynamic_cast(folder_view_item); folder_view_item = NULL; + allow_drop = mParams.allow_drop_on_root; } } @@ -822,7 +826,7 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) objectp->getUUID()); if (new_listener) { - folder_view_item = createFolderViewFolder(new_listener); + folder_view_item = createFolderViewFolder(new_listener,allow_drop); } } else @@ -958,7 +962,7 @@ BOOL LLInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, // If folder view is empty the (x, y) point won't be in its rect // so the handler must be called explicitly. // but only if was not handled before. See EXT-6746. - if (!handled && !mFolderRoot.get()->hasVisibleChildren()) + if (!handled && mParams.allow_drop_on_root && !mFolderRoot.get()->hasVisibleChildren()) { handled = mFolderRoot.get()->handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index e0b39caa6e..b8dab65b2d 100755 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -97,6 +97,7 @@ public: Optional use_label_suffix; Optional show_empty_message; Optional show_root_folder; + Optional allow_drop_on_root; Optional scroll; Optional accepts_drag_and_drop; Optional folder_view; @@ -113,6 +114,7 @@ public: use_label_suffix("use_label_suffix", true), show_empty_message("show_empty_message", true), show_root_folder("show_root_folder", false), + allow_drop_on_root("allow_drop_on_root", true), scroll("scroll"), accepts_drag_and_drop("accepts_drag_and_drop"), folder_view("folder_view"), @@ -292,7 +294,7 @@ protected: BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; virtual LLFolderView * createFolderRoot(LLUUID root_id ); - virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge); + virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop = true); virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge); private: bool mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild() diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index b37ae30021..c2b4f34ac2 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -124,7 +124,7 @@ void log_SLM_infos(const std::string& request, const std::string& url, const std // Merov: This is a temporary hack used by dev while secondlife-staging is down... // *TODO : Suppress that before shipping! -static bool sBypassMerchant = false; +static bool sBypassMerchant = true; class LLSLMGetMerchantResponder : public LLHTTPClient::Responder { diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml index 3d75ad4488..4a2d9f27e0 100755 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml @@ -111,6 +111,7 @@ show_empty_message="false" show_load_status="false" show_root_folder="true" + allow_drop_on_root="false" start_folder.type="merchant" bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" @@ -133,6 +134,7 @@ show_empty_message="false" show_load_status="false" show_root_folder="true" + allow_drop_on_root="false" start_folder.type="merchant" bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index aa66fc4718..21c82b6290 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -245,6 +245,7 @@ Please try logging in again in a minute. Subfolders count exceeds [AMOUNT] Items count exceeds [AMOUNT] You can't move an active listed listing + You can't drop items on filtered tabs root You can't move a folder into its child You can't move a folder into itself -- cgit v1.3 From 02978ddea555da1cc33403bba94ada5f54318c16 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 2 Aug 2014 14:42:42 -0700 Subject: DD-160 : Open the root folder widget on creation in inventory panels that requires one --- indra/newview/llinventorypanel.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 3b18b86f57..443d243816 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -791,6 +791,7 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) // Force the creation of an extra root level folder item if required by the inventory panel (default is "false") bool allow_drop = true; + bool create_root = false; if (mParams.show_root_folder) { LLUUID root_id = getRootFolderID(); @@ -800,6 +801,7 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) parent_folder = dynamic_cast(folder_view_item); folder_view_item = NULL; allow_drop = mParams.allow_drop_on_root; + create_root = true; } } @@ -849,11 +851,16 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) } if (folder_view_item) - { + { llassert(parent_folder != NULL); folder_view_item->addToFolder(parent_folder); addItemID(id, folder_view_item); - } + // In the case of the root folder been shown, open that folder by default once the widget is created + if (create_root) + { + folder_view_item->setOpen(TRUE); + } + } } // If this is a folder, add the children of the folder and recursively add any -- cgit v1.3 From 7b282512593460d94af47d1a52294cd14fc7f630 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 7 Aug 2014 15:12:02 -0700 Subject: DD-100 : WIP : Setting up inventory panel code in marketplace listing so that panels can be deleted and rebuilt with new root --- indra/newview/llfloatermarketplacelistings.cpp | 37 +++++++++++++++++++++- indra/newview/llinventorypanel.cpp | 2 ++ .../en/panel_marketplace_listings_inventory.xml | 26 +++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100755 indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index ec551aca06..f4e6b3d1ea 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -267,6 +267,7 @@ void LLFloaterMarketplaceListings::setup() { if (LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) { + //llinfos << "Merov D&D : setup failed: we're not a merchant" << llendl; // If we are *not* a merchant or we have no market place connection established yet, do nothing return; } @@ -276,16 +277,20 @@ void LLFloaterMarketplaceListings::setup() if (marketplacelistings_id.isNull()) { // We should never get there unless the inventory fails badly + //llinfos << "Merov D&D : setup failed: couldn't get to the marketplace listings folder" << llendl; LL_ERRS("SLM") << "Inventory problem: failure to create the marketplace listings folder for a merchant!" << LL_ENDL; return; } - + + //llinfos << "Merov D&D : setup : marketplace listings folder = " << marketplacelistings_id << llendl; + // Consolidate Marketplace listings // We shouldn't have to do that but with a client/server system relying on a "well known folder" convention, things get messy and conventions get broken down eventually gInventory.consolidateForType(marketplacelistings_id, LLFolderType::FT_MARKETPLACE_LISTINGS); if (marketplacelistings_id == mRootFolderId) { + //llinfos << "Merov D&D : setup failed: Marketplace listings folder already set" << llendl; LL_WARNS("SLM") << "Inventory warning: Marketplace listings folder already set" << LL_ENDL; return; } @@ -299,6 +304,32 @@ void LLFloaterMarketplaceListings::setup() mCategoryAddedObserver = NULL; } llassert(!mCategoryAddedObserver); + + // Merov : Hack... + /* + LLInventoryPanel* inventory_panel = mPanelListings->mAllPanel; + LLTabContainer* tabs_panel = getChild("marketplace_filter_tabs"); + if (inventory_panel) + { + tabs_panel->removeTabPanel(inventory_panel); + delete inventory_panel; + } + inventory_panel = LLUICtrlFactory::createFromFile("panel_marketplace_listings_inventory.xml", tabs_panel, LLInventoryPanel::child_registry_t::instance()); + llassert(inventory_panel != NULL); + + // Reshape to the proper size + //LLRect tabs_panel_rect = tabs_panel->getRect(); + //inventory_panel->setShape(tabs_panel_rect); + + // Set sort order and callbacks + LLInventoryPanel* panel = getChild("All Items"); + //panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); + //panel->getFilter().markDefault(); + //panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); + + mPanelListings->mAllPanel = panel; + */ + // Merov : end hack... // Create observer for marketplace listings modifications : clear the old one and create a new one if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) @@ -348,6 +379,7 @@ void LLFloaterMarketplaceListings::updateView() // Get or create the root folder if we are a merchant and it hasn't been done already if (mRootFolderId.isNull() && (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT)) { + //llinfos << "Merov D&D : setup from updateView because root folder is null" << llendl; setup(); } @@ -371,6 +403,9 @@ void LLFloaterMarketplaceListings::updateView() } else { + // Merov : Hack... + //mPanelListings->setVisible(TRUE); + //mInventoryPlaceholder->setVisible(FALSE); mPanelListings->setVisible(FALSE); mInventoryPlaceholder->setVisible(TRUE); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 443d243816..2b542a58b1 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -240,6 +240,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { // Determine the root folder in case specified, and // build the views starting with that folder. + //llinfos << "Merov : panel = " << getName() << ", create folder root id = " << root_id << llendl; LLFolderView* folder_view = createFolderRoot(root_id); mFolderRoot = folder_view->getHandle(); @@ -271,6 +272,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) // otherwise wait for idle callback. if (mInventory->isInventoryUsable() && !mViewsInitialized) { + //llinfos << "Merov : panel = " << getName() << ", initializeViews" << llendl; initializeViews(); } diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml new file mode 100755 index 0000000000..944a42d01c --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml @@ -0,0 +1,26 @@ + + + + -- cgit v1.3 From 231572cfed6d178658bc3333eb97aff34746cb81 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 9 Aug 2014 20:34:55 -0700 Subject: DD-100 : Fixed! Had to create the inventory panels after we get the marketplace listings root id --- indra/newview/llfloatermarketplacelistings.cpp | 135 ++++++++++----------- indra/newview/llfloatermarketplacelistings.h | 9 +- indra/newview/llinventorypanel.cpp | 19 +-- .../default/xui/en/panel_marketplace_listings.xml | 92 -------------- .../en/panel_marketplace_listings_inventory.xml | 15 ++- .../xui/en/panel_marketplace_listings_listed.xml | 24 ++++ .../en/panel_marketplace_listings_unassociated.xml | 23 ++++ .../xui/en/panel_marketplace_listings_unlisted.xml | 24 ++++ 8 files changed, 157 insertions(+), 184 deletions(-) create mode 100755 indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml create mode 100755 indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml create mode 100755 indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index f4e6b3d1ea..8d12c98da8 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -60,34 +60,50 @@ LLPanelMarketplaceListings::LLPanelMarketplaceListings() BOOL LLPanelMarketplaceListings::postBuild() { - mAllPanel = getChild("All Items"); childSetAction("add_btn", boost::bind(&LLPanelMarketplaceListings::onAddButtonClicked, this)); childSetAction("audit_btn", boost::bind(&LLPanelMarketplaceListings::onAuditButtonClicked, this)); - // Set the sort order newest to oldest - LLInventoryPanel* panel = getChild("All Items"); - panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); - panel->getFilter().markDefault(); - panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); + return LLPanel::postBuild(); +} - // Set filters on the 3 prefiltered panels - panel = getChild("Active Items"); - panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); +void LLPanelMarketplaceListings::buildAllPanels() +{ + LLInventoryPanel* panel; + panel = buildInventoryPanel("All Items", "panel_marketplace_listings_inventory.xml"); + panel->getFilter().markDefault(); + mAllPanel = panel; + panel = buildInventoryPanel("Active Items", "panel_marketplace_listings_listed.xml"); panel->getFilter().setFilterMarketplaceActiveFolders(); panel->getFilter().markDefault(); - panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); - panel = getChild("Inactive Items"); - panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); + panel = buildInventoryPanel("Inactive Items", "panel_marketplace_listings_unlisted.xml"); panel->getFilter().setFilterMarketplaceInactiveFolders(); panel->getFilter().markDefault(); - panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); - panel = getChild("Unassociated Items"); - panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); + panel = buildInventoryPanel("Unassociated Items", "panel_marketplace_listings_unassociated.xml"); panel->getFilter().setFilterMarketplaceUnassociatedFolders(); panel->getFilter().markDefault(); - panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); + + LLTabContainer* tabs_panel = getChild("marketplace_filter_tabs"); + tabs_panel->selectTabPanel(mAllPanel); +} + +LLInventoryPanel* LLPanelMarketplaceListings::buildInventoryPanel(const std::string& childname, const std::string& filename) +{ + LLTabContainer* tabs_panel = getChild("marketplace_filter_tabs"); + LLInventoryPanel* panel = getChild(childname); + if (panel) + { + tabs_panel->removeTabPanel(panel); + delete panel; + } + panel = LLUICtrlFactory::createFromFile(filename, tabs_panel, LLInventoryPanel::child_registry_t::instance()); + llassert(panel != NULL); - return LLPanel::postBuild(); + // Set sort order and callbacks + panel = getChild(childname); + panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); + panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); + + return panel; } void LLPanelMarketplaceListings::draw() @@ -189,6 +205,7 @@ LLFloaterMarketplaceListings::LLFloaterMarketplaceListings(const LLSD& key) , mInventoryText(NULL) , mInventoryTitle(NULL) , mPanelListings(NULL) +, mFirstViewListings(true) { } @@ -267,7 +284,6 @@ void LLFloaterMarketplaceListings::setup() { if (LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) { - //llinfos << "Merov D&D : setup failed: we're not a merchant" << llendl; // If we are *not* a merchant or we have no market place connection established yet, do nothing return; } @@ -277,25 +293,10 @@ void LLFloaterMarketplaceListings::setup() if (marketplacelistings_id.isNull()) { // We should never get there unless the inventory fails badly - //llinfos << "Merov D&D : setup failed: couldn't get to the marketplace listings folder" << llendl; LL_ERRS("SLM") << "Inventory problem: failure to create the marketplace listings folder for a merchant!" << LL_ENDL; return; } - //llinfos << "Merov D&D : setup : marketplace listings folder = " << marketplacelistings_id << llendl; - - // Consolidate Marketplace listings - // We shouldn't have to do that but with a client/server system relying on a "well known folder" convention, things get messy and conventions get broken down eventually - gInventory.consolidateForType(marketplacelistings_id, LLFolderType::FT_MARKETPLACE_LISTINGS); - - if (marketplacelistings_id == mRootFolderId) - { - //llinfos << "Merov D&D : setup failed: Marketplace listings folder already set" << llendl; - LL_WARNS("SLM") << "Inventory warning: Marketplace listings folder already set" << LL_ENDL; - return; - } - mRootFolderId = marketplacelistings_id; - // No longer need to observe new category creation if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver)) { @@ -305,42 +306,29 @@ void LLFloaterMarketplaceListings::setup() } llassert(!mCategoryAddedObserver); - // Merov : Hack... - /* - LLInventoryPanel* inventory_panel = mPanelListings->mAllPanel; - LLTabContainer* tabs_panel = getChild("marketplace_filter_tabs"); - if (inventory_panel) + if (marketplacelistings_id == mRootFolderId) { - tabs_panel->removeTabPanel(inventory_panel); - delete inventory_panel; + LL_WARNS("SLM") << "Inventory warning: Marketplace listings folder already set" << LL_ENDL; + return; } - inventory_panel = LLUICtrlFactory::createFromFile("panel_marketplace_listings_inventory.xml", tabs_panel, LLInventoryPanel::child_registry_t::instance()); - llassert(inventory_panel != NULL); - - // Reshape to the proper size - //LLRect tabs_panel_rect = tabs_panel->getRect(); - //inventory_panel->setShape(tabs_panel_rect); + mRootFolderId = marketplacelistings_id; - // Set sort order and callbacks - LLInventoryPanel* panel = getChild("All Items"); - //panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); - //panel->getFilter().markDefault(); - //panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); - - mPanelListings->mAllPanel = panel; - */ - // Merov : end hack... + // Consolidate Marketplace listings + // We shouldn't have to do that but with a client/server system relying on a "well known folder" convention, + // things get messy and conventions get broken down eventually + gInventory.consolidateForType(marketplacelistings_id, LLFolderType::FT_MARKETPLACE_LISTINGS); + + // Now that we do have a non NULL root, we can build the inventory panels + mPanelListings->buildAllPanels(); - // Create observer for marketplace listings modifications : clear the old one and create a new one - if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) - { - gInventory.removeObserver(mCategoriesObserver); - delete mCategoriesObserver; - } - mCategoriesObserver = new LLInventoryCategoriesObserver(); - gInventory.addObserver(mCategoriesObserver); - mCategoriesObserver->addCategory(mRootFolderId, boost::bind(&LLFloaterMarketplaceListings::onChanged, this)); - llassert(mCategoriesObserver); + // Create observer for marketplace listings modifications + if (!mCategoriesObserver && mRootFolderId.notNull()) + { + mCategoriesObserver = new LLInventoryCategoriesObserver(); + llassert(mCategoriesObserver); + gInventory.addObserver(mCategoriesObserver); + mCategoriesObserver->addCategory(mRootFolderId, boost::bind(&LLFloaterMarketplaceListings::onChanged, this)); + } // Get the content of the marketplace listings folder fetchContents(); @@ -379,7 +367,6 @@ void LLFloaterMarketplaceListings::updateView() // Get or create the root folder if we are a merchant and it hasn't been done already if (mRootFolderId.isNull() && (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT)) { - //llinfos << "Merov D&D : setup from updateView because root folder is null" << llendl; setup(); } @@ -398,14 +385,19 @@ void LLFloaterMarketplaceListings::updateView() // Update the middle portion : tabs or messages if (getFolderCount() > 0) { + if (mFirstViewListings) + { + // We need to rebuild the tabs cleanly the first time we make them visible + // setup() does it if the root is nixed first + mRootFolderId.setNull(); + setup(); + mFirstViewListings = false; + } mPanelListings->setVisible(TRUE); mInventoryPlaceholder->setVisible(FALSE); } else { - // Merov : Hack... - //mPanelListings->setVisible(TRUE); - //mInventoryPlaceholder->setVisible(FALSE); mPanelListings->setVisible(FALSE); mInventoryPlaceholder->setVisible(TRUE); @@ -419,11 +411,6 @@ void LLFloaterMarketplaceListings::updateView() // *TODO : check those messages and create better appropriate ones in strings.xml if (mRootFolderId.notNull()) { - // Does the marketplace listings folder needs recreation? - if (!mPanelListings || !gInventory.getCategory(mRootFolderId)) - { - setup(); - } // "Marketplace listings is empty!" message strings text = LLTrans::getString("InventoryMarketplaceListingsNoItems", subs); title = LLTrans::getString("InventoryMarketplaceListingsNoItemsTitle"); diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index b1de8d09d9..c472bfa4c5 100755 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -40,6 +40,8 @@ class LLInventoryCategoryAddedObserver; class LLTextBox; class LLView; +class LLFloaterMarketplaceListings; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLPanelMarketplaceListings //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -52,7 +54,11 @@ public: void draw(); LLFolderView* getRootFolder() { return mAllPanel->getRootFolder(); } // *TODO : Suppress and get DnD in here instead... + void buildAllPanels(); + private: + LLInventoryPanel* buildInventoryPanel(const std::string& childname, const std::string& filename); + // UI callbacks void onViewSortMenuItemClicked(const LLSD& userdata); bool onViewSortMenuItemCheck(const LLSD& userdata); @@ -117,8 +123,9 @@ private: LLTextBox * mInventoryText; LLTextBox * mInventoryTitle; - LLUUID mRootFolderId; + LLUUID mRootFolderId; LLPanelMarketplaceListings * mPanelListings; + bool mFirstViewListings; }; //----------------------------------------------------------------------------- diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 2b542a58b1..c0fdb80a42 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -240,7 +240,6 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { // Determine the root folder in case specified, and // build the views starting with that folder. - //llinfos << "Merov : panel = " << getName() << ", create folder root id = " << root_id << llendl; LLFolderView* folder_view = createFolderRoot(root_id); mFolderRoot = folder_view->getHandle(); @@ -272,7 +271,6 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) // otherwise wait for idle callback. if (mInventory->isInventoryUsable() && !mViewsInitialized) { - //llinfos << "Merov : panel = " << getName() << ", initializeViews" << llendl; initializeViews(); } @@ -590,13 +588,13 @@ void LLInventoryPanel::modelChanged(U32 mask) LLUUID LLInventoryPanel::getRootFolderID() { + LLUUID root_id; if (mFolderRoot.get() && mFolderRoot.get()->getViewModelItem()) { - return static_cast(mFolderRoot.get()->getViewModelItem())->getUUID(); + root_id = static_cast(mFolderRoot.get()->getViewModelItem())->getUUID(); } else { - LLUUID root_id; if (mParams.start_folder.id.isChosen()) { root_id = mParams.start_folder.id; @@ -624,8 +622,8 @@ LLUUID LLInventoryPanel::getRootFolderID() } } } - return root_id; } + return root_id; } // static @@ -784,11 +782,14 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) { LLInventoryObject const* objectp = gInventory.getObject(id); - if (!objectp) return NULL; + if (!objectp) + { + return NULL; + } LLFolderViewItem* folder_view_item = getItemByID(id); - const LLUUID &parent_id = objectp->getParentUUID(); + const LLUUID &parent_id = objectp->getParentUUID(); LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)getItemByID(parent_id); // Force the creation of an extra root level folder item if required by the inventory panel (default is "false") @@ -813,8 +814,8 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) objectp->getType() >= LLAssetType::AT_COUNT) { LL_WARNS() << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " - << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() - << LL_ENDL; + << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() + << LL_ENDL; return NULL; } diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml index 4a2d9f27e0..fd5c9ed422 100755 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml @@ -74,98 +74,6 @@ tab_group="1" tab_position="top" tab_min_width="50"> - - - - - - - - - - - - \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml index 944a42d01c..dc2d4c27b6 100755 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml @@ -3,24 +3,23 @@ label="ALL" name="All Items" help_topic="marketplace_tab" + layout="topleft" + follows="all" + width="308" + height="370" + top="16" + left="0" start_folder.name="Marketplace listings" show_empty_message="false" show_load_status="false" show_root_folder="true" start_folder.type="merchant" - follows="all" - layout="topleft" - top="16" - left="0" - height="370" - width="308" - top_pad="0" + tool_tip="Drag and drop items here to sell them" bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" background_visible="true" border="false" bevel_style="none" - tool_tip="Drag and drop items here to sell them" show_item_link_overlays="true"> diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml new file mode 100755 index 0000000000..211d21a063 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml @@ -0,0 +1,24 @@ + + + + diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml new file mode 100755 index 0000000000..498e22ffbe --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml @@ -0,0 +1,23 @@ + + + + diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml new file mode 100755 index 0000000000..aad7e836e4 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml @@ -0,0 +1,24 @@ + + + + -- cgit v1.3 From 27a6e55319017c93fbc8cd73e184019d120d6589 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 23 Aug 2014 18:02:04 -0700 Subject: DD-176 : Show marketplace listing root even if InventoryOutboxMakeVisible is false. --- indra/newview/llinventorypanel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c0fdb80a42..4a25656090 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -290,9 +290,13 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_OUTBOX)); - getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_MARKETPLACE_LISTINGS)); } - + // hide marketplace listing box, unless we want to show it (note: hacky as show_root_folder is only used for marketplace...) + if (!gSavedSettings.getBOOL("InventoryOutboxMakeVisible") && !mParams.show_root_folder) + { + getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_MARKETPLACE_LISTINGS)); + } + // set the filter for the empty folder if the debug setting is on if (gSavedSettings.getBOOL("DebugHideEmptySystemFolders")) { -- cgit v1.3 From 618e13a2d6c5bd632892865fc3b88051c13a7658 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 2 Jan 2015 17:35:50 -0800 Subject: DD-297 : Performance on login : Refactored the code so that we have a new LLMarketplaceFolderBridge class in the bridge model. Only the panels with the use_marketplace_folders param flag will use that one. --- indra/llcommon/llassettype.h | 3 + indra/newview/llinventorybridge.cpp | 170 ++++++++++++--------- indra/newview/llinventorybridge.h | 25 ++- indra/newview/llinventorypanel.cpp | 8 +- indra/newview/llinventorypanel.h | 2 + .../en/panel_marketplace_listings_inventory.xml | 1 + .../xui/en/panel_marketplace_listings_listed.xml | 1 + .../en/panel_marketplace_listings_unassociated.xml | 1 + .../xui/en/panel_marketplace_listings_unlisted.xml | 1 + 9 files changed, 139 insertions(+), 73 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index 5a95a58d93..3a4b5dad18 100755 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -107,6 +107,9 @@ public: AT_LINK_FOLDER = 25, // Inventory folder link + AT_MARKETPLACE_FOLDER = 26, + // Marketplace folder. Same as an AT_CATEGORY but different display methods. + AT_WIDGET = 40, // UI Widget: this is *not* an inventory asset type, only a viewer side asset (e.g. button, other ui items...) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4e3895ea9d..2dafbccd96 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1274,11 +1274,18 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, case LLAssetType::AT_CATEGORY: if (actual_asset_type == LLAssetType::AT_LINK_FOLDER) { - // Create a link folder handler instead. + // Create a link folder handler instead new_listener = new LLLinkFolderBridge(inventory, root, uuid); - break; } - new_listener = new LLFolderBridge(inventory, root, uuid); + else if (actual_asset_type == LLAssetType::AT_MARKETPLACE_FOLDER) + { + // Create a marketplace folder handler + new_listener = new LLMarketplaceFolderBridge(inventory, root, uuid); + } + else + { + new_listener = new LLFolderBridge(inventory, root, uuid); + } break; case LLAssetType::AT_LINK: case LLAssetType::AT_LINK_FOLDER: @@ -2090,71 +2097,14 @@ std::string LLFolderBridge::getLabelSuffix() const return llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str()); } - if (isMarketplaceListingsFolder()) - { - std::string suffix = ""; - // Listing folder case - if (LLMarketplaceData::instance().isListed(getUUID())) - { - suffix = llformat("%d",LLMarketplaceData::instance().getListingID(getUUID())); - if (suffix.empty()) - { - suffix = LLTrans::getString("MarketplaceNoID"); - } - suffix = " (" + suffix + ")"; - if (LLMarketplaceData::instance().getActivationState(getUUID())) - { - suffix += " (" + LLTrans::getString("MarketplaceLive") + ")"; - } - } - // Version folder case - else if (LLMarketplaceData::instance().isVersionFolder(getUUID())) - { - suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; - } - // Add stock amount - S32 stock_count = compute_stock_count(getUUID()); - if (stock_count == 0) - { - suffix += " (" + LLTrans::getString("MarketplaceNoStock") + ")"; - } - else if (stock_count != -1) - { - if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) - { - suffix += " (" + LLTrans::getString("MarketplaceStock") + "=" + llformat("%d", stock_count) + ")"; - } - else - { - suffix += " (" + LLTrans::getString("MarketplaceMax") + "=" + llformat("%d", stock_count) + ")"; - } - } - // Add updating suffix - if (LLMarketplaceData::instance().isUpdating(getUUID())) - { - suffix += " (" + LLTrans::getString("MarketplaceUpdating") + ")"; - } - return LLInvFVBridge::getLabelSuffix() + suffix; - } - else - { - return LLInvFVBridge::getLabelSuffix(); - } + return LLInvFVBridge::getLabelSuffix(); } LLFontGL::StyleFlags LLFolderBridge::getLabelStyle() const { - if (isMarketplaceListingsFolder() && LLMarketplaceData::instance().getActivationState(getUUID())) - { - return LLFontGL::BOLD; - } - else - { - return LLFontGL::NORMAL; - } + return LLFontGL::NORMAL; } - void LLFolderBridge::update() { // we know we have children but haven't fetched them (doesn't obey filter) @@ -3283,12 +3233,6 @@ LLUIImagePtr LLFolderBridge::getIconOpen() const LLUIImagePtr LLFolderBridge::getFolderIcon(BOOL is_open) const { LLFolderType::EType preferred_type = getPreferredType(); - S32 depth = depth_nesting_in_marketplace(mUUID); - if ((preferred_type == LLFolderType::FT_NONE) && (depth == 2)) - { - // We override the type when in the marketplace listings folder and only for version folder - preferred_type = LLFolderType::FT_MARKETPLACE_VERSION; - } return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, is_open)); } @@ -4184,6 +4128,96 @@ void LLFolderBridge::modifyOutfit(BOOL append) LLAppearanceMgr::instance().wearInventoryCategory( cat, FALSE, append ); } +// +=================================================+ +// | LLMarketplaceFolderBridge | +// +=================================================+ + +// LLMarketplaceFolderBridge is a specialized LLFolderBridge for use in Marketplace Inventory panels + +LLUIImagePtr LLMarketplaceFolderBridge::getIcon() const +{ + return getMarketplaceFolderIcon(FALSE); +} + +LLUIImagePtr LLMarketplaceFolderBridge::getIconOpen() const +{ + return getMarketplaceFolderIcon(TRUE); +} + +LLUIImagePtr LLMarketplaceFolderBridge::getMarketplaceFolderIcon(BOOL is_open) const +{ + LLFolderType::EType preferred_type = getPreferredType(); + S32 depth = depth_nesting_in_marketplace(mUUID); + if ((preferred_type == LLFolderType::FT_NONE) && (depth == 2)) + { + // We override the type when in the marketplace listings folder and only for version folder + preferred_type = LLFolderType::FT_MARKETPLACE_VERSION; + } + return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, is_open)); +} + +std::string LLMarketplaceFolderBridge::getLabelSuffix() const +{ + static LLCachedControl folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime", 0.5f); + + if (mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= folder_loading_message_delay()) + { + return llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str()); + } + + std::string suffix = ""; + // Listing folder case + if (LLMarketplaceData::instance().isListed(getUUID())) + { + suffix = llformat("%d",LLMarketplaceData::instance().getListingID(getUUID())); + if (suffix.empty()) + { + suffix = LLTrans::getString("MarketplaceNoID"); + } + suffix = " (" + suffix + ")"; + if (LLMarketplaceData::instance().getActivationState(getUUID())) + { + suffix += " (" + LLTrans::getString("MarketplaceLive") + ")"; + } + } + // Version folder case + else if (LLMarketplaceData::instance().isVersionFolder(getUUID())) + { + suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; + } + // Add stock amount + S32 stock_count = compute_stock_count(getUUID()); + if (stock_count == 0) + { + suffix += " (" + LLTrans::getString("MarketplaceNoStock") + ")"; + } + else if (stock_count != -1) + { + if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + suffix += " (" + LLTrans::getString("MarketplaceStock") + "=" + llformat("%d", stock_count) + ")"; + } + else + { + suffix += " (" + LLTrans::getString("MarketplaceMax") + "=" + llformat("%d", stock_count) + ")"; + } + } + // Add updating suffix + if (LLMarketplaceData::instance().isUpdating(getUUID())) + { + suffix += " (" + LLTrans::getString("MarketplaceUpdating") + ")"; + } + return LLInvFVBridge::getLabelSuffix() + suffix; +} + +LLFontGL::StyleFlags LLMarketplaceFolderBridge::getLabelStyle() const +{ + return (LLMarketplaceData::instance().getActivationState(getUUID()) ? LLFontGL::BOLD : LLFontGL::NORMAL); +} + + + + // helper stuff bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv* move_inv) { diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 2757f5c884..641d30040b 100755 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -362,7 +362,7 @@ public: static LLHandle sSelf; static void staticFolderOptionsMenu(); -private: +protected: void callback_pasteFromClipboard(const LLSD& notification, const LLSD& response); void perform_pasteFromClipboard(); void gatherMessage(std::string& message, LLError::ELevel log_level); @@ -683,6 +683,29 @@ public: U32 flags = 0x00) const; }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Marketplace Inventory Panel related classes +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLMarketplaceFolderBridge : public LLFolderBridge +{ +public: + // Overloads some display related methods specific to folders in a marketplace floater context + LLMarketplaceFolderBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid) : + LLFolderBridge(inventory, root, uuid) { } + + virtual LLUIImagePtr getIcon() const; + virtual LLUIImagePtr getIconOpen() const; + virtual std::string getLabelSuffix() const; + virtual LLFontGL::StyleFlags getLabelStyle() const; + +private: + LLUIImagePtr getMarketplaceFolderIcon(BOOL is_open) const; +}; + + void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace = false); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 86ff1aed1b..a2e5e1e5d8 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -839,16 +839,16 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) if ((objectp->getType() == LLAssetType::AT_CATEGORY) && (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) { - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), - objectp->getType(), + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + (mParams.use_marketplace_folders ? LLAssetType::AT_MARKETPLACE_FOLDER : LLAssetType::AT_CATEGORY), LLInventoryType::IT_CATEGORY, this, - &mInventoryViewModel, + &mInventoryViewModel, mFolderRoot.get(), objectp->getUUID()); if (new_listener) { - folder_view_item = createFolderViewFolder(new_listener,allow_drop); + folder_view_item = createFolderViewFolder(new_listener,allow_drop); } } else diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 822c7c2fe7..5edb244af6 100755 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -98,6 +98,7 @@ public: Optional show_empty_message; Optional show_root_folder; Optional allow_drop_on_root; + Optional use_marketplace_folders; Optional scroll; Optional accepts_drag_and_drop; Optional folder_view; @@ -115,6 +116,7 @@ public: show_empty_message("show_empty_message", true), show_root_folder("show_root_folder", false), allow_drop_on_root("allow_drop_on_root", true), + use_marketplace_folders("use_marketplace_folders", false), scroll("scroll"), accepts_drag_and_drop("accepts_drag_and_drop"), folder_view("folder_view"), diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml index 67988f3153..567e5e2724 100755 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml @@ -12,6 +12,7 @@ start_folder.name="Marketplace listings" show_empty_message="true" show_root_folder="true" + use_marketplace_folders="true" start_folder.type="merchant" tool_tip="Drag and drop items here to list them" bg_opaque_color="DkGray2" diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml index 181eee70e2..668be27bdc 100755 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml @@ -11,6 +11,7 @@ start_folder.name="Marketplace listings" show_empty_message="true" show_root_folder="true" + use_marketplace_folders="true" allow_drop_on_root="false" start_folder.type="merchant" bg_opaque_color="DkGray2" diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml index 6ea4784c4c..0015c85aa2 100755 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml @@ -11,6 +11,7 @@ start_folder.name="Marketplace listings" show_empty_message="true" show_root_folder="true" + use_marketplace_folders="true" start_folder.type="merchant" bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml index 0d19d09918..ec9c176811 100755 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml @@ -11,6 +11,7 @@ start_folder.name="Marketplace listings" show_empty_message="true" show_root_folder="true" + use_marketplace_folders="true" allow_drop_on_root="false" start_folder.type="merchant" bg_opaque_color="DkGray2" -- cgit v1.3 From 36d85815e7c009419777488b937b8d415209c89d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 4 Feb 2015 07:49:44 -0800 Subject: DD-301 : Never filter the marketplace listings folder within the marketplace panels --- indra/newview/llinventorypanel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index a2e5e1e5d8..19aa1bf6e7 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -291,8 +291,8 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_OUTBOX)); } - // hide marketplace listing box, unless we want to show it (note: hacky as show_root_folder is only used for marketplace...) - if (!gSavedSettings.getBOOL("InventoryOutboxMakeVisible") && !mParams.show_root_folder) + // hide marketplace listing box, unless we are a marketplace panel + if (!gSavedSettings.getBOOL("InventoryOutboxMakeVisible") && !mParams.use_marketplace_folders) { getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_MARKETPLACE_LISTINGS)); } -- cgit v1.3 From 1d257ab53fa031db7d7adb2f4eda61c37b68b82a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 5 Jun 2015 14:51:30 -0700 Subject: DD-290 : Add an option to filter out marketplace, use it in Recent tab --- indra/newview/llinventoryfilter.cpp | 16 +++++++++++++++- indra/newview/llinventoryfilter.h | 4 +++- indra/newview/llinventorypanel.cpp | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 0f393de79c..3ed876af87 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -147,11 +147,20 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const // Marketplace folder filtering const U32 filterTypes = mFilterOps.mFilterTypes; const U32 marketplace_filter = FILTERTYPE_MARKETPLACE_ACTIVE | FILTERTYPE_MARKETPLACE_INACTIVE | - FILTERTYPE_MARKETPLACE_UNASSOCIATED | FILTERTYPE_MARKETPLACE_LISTING_FOLDER; + FILTERTYPE_MARKETPLACE_UNASSOCIATED | FILTERTYPE_MARKETPLACE_LISTING_FOLDER | + FILTERTYPE_NO_MARKETPLACE_ITEMS; if (filterTypes & marketplace_filter) { S32 depth = depth_nesting_in_marketplace(folder_id); + if (filterTypes & FILTERTYPE_NO_MARKETPLACE_ITEMS) + { + if (depth >= 0) + { + return false; + } + } + if (filterTypes & FILTERTYPE_MARKETPLACE_LISTING_FOLDER) { if (depth > 1) @@ -575,6 +584,11 @@ void LLInventoryFilter::setFilterMarketplaceListingFolders(bool select_only_list } } +void LLInventoryFilter::setFilterNoMarketplaceFolder() +{ + mFilterOps.mFilterTypes |= FILTERTYPE_NO_MARKETPLACE_ITEMS; +} + void LLInventoryFilter::setFilterUUID(const LLUUID& object_id) { if (mFilterOps.mFilterUUID == LLUUID::null) diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 90fa444cf2..abc4ae347c 100755 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -56,7 +56,8 @@ public: FILTERTYPE_MARKETPLACE_ACTIVE = 0x1 << 6, // pass if folder is a marketplace active folder FILTERTYPE_MARKETPLACE_INACTIVE = 0x1 << 7, // pass if folder is a marketplace inactive folder FILTERTYPE_MARKETPLACE_UNASSOCIATED = 0x1 << 8, // pass if folder is a marketplace non associated (no market ID) folder - FILTERTYPE_MARKETPLACE_LISTING_FOLDER = 0x1 << 9 // pass iff folder is a listing folder + FILTERTYPE_MARKETPLACE_LISTING_FOLDER = 0x1 << 9, // pass iff folder is a listing folder + FILTERTYPE_NO_MARKETPLACE_ITEMS = 0x1 << 10 // pass iff folder is not under the marketplace }; enum EFilterDateDirection @@ -179,6 +180,7 @@ public: void setFilterMarketplaceInactiveFolders(); void setFilterMarketplaceUnassociatedFolders(); void setFilterMarketplaceListingFolders(bool select_only_listing_folders); + void setFilterNoMarketplaceFolder(); void updateFilterTypes(U64 types, U64& current_types); void setFilterSubString(const std::string& string); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 53cbad6301..5194cba891 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1513,6 +1513,8 @@ public: LLInventoryPanel::initFromParams(p); // turn on inbox for recent items getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX)); + // turn off marketplace for recent items + getFilter().setFilterNoMarketplaceFolder(); } protected: -- cgit v1.3