From 9de02b0cd3ac05ce172e12dbc2d288a5deccba11 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 10 Mar 2014 18:49:40 -0700 Subject: DD-17 : WIP : some work on the suffix for Listing folders --- indra/newview/llinventorybridge.cpp | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 44943d8722..c2f6ce8fb1 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -959,6 +959,18 @@ BOOL LLInvFVBridge::isInboxFolder() const return gInventory.isObjectDescendentOf(mUUID, inbox_id); } +BOOL LLInvFVBridge::isMerchantItemsFolder() const +{ + const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MERCHANT_ITEMS, false); + + if (folder_id.isNull()) + { + return FALSE; + } + + return gInventory.isObjectDescendentOf(mUUID, folder_id); +} + BOOL LLInvFVBridge::isOutboxFolder() const { const LLUUID outbox_id = getOutboxFolder(); @@ -1931,6 +1943,38 @@ void LLFolderBridge::buildDisplayName() const } } +std::string LLFolderBridge::getLabelSuffix() const +{ + /* + + LLInventoryCategory* cat = gInventory.getCategory(getUUID()); + if(cat) + { + const LLUUID& parent_folder_id = cat->getParentUUID(); + accessories = (parent_folder_id == gInventory.getLibraryRootFolderID()); + } + */ + if (isMerchantItemsFolder()) + { + if (LLMarketplaceData::instance().isListed(getUUID())) + { + llinfos << "Merov : in merchant folder and listed : id = " << getUUID() << llendl; + std::string suffix = " (" + LLMarketplaceData::instance().getListingID(getUUID()) + ")"; + return LLInvFVBridge::getLabelSuffix() + suffix; + } + else + { + llinfos << "Merov : in merchant folder but not listed : id = " << getUUID() << llendl; + return LLInvFVBridge::getLabelSuffix(); + } + } + else + { + llinfos << "Merov : not in merchant folder : id = " << getUUID() << llendl; + return LLInvFVBridge::getLabelSuffix(); + } +} + void LLFolderBridge::update() { -- cgit v1.2.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/newview/llinventorybridge.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') 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())) { -- cgit v1.2.3 From 68dbb5692f11eed39175ebf3313d96b5430231f9 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 14 Mar 2014 17:34:15 -0700 Subject: DD-17 : WIP : Add live status to active listing folders, clean up getLabelSuffix() code a bit --- indra/newview/llinventorybridge.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 9d9279ce90..38dcb24477 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1959,7 +1959,16 @@ std::string LLFolderBridge::getLabelSuffix() const if (LLMarketplaceData::instance().isListed(getUUID())) { llinfos << "Merov : in merchant folder and listed : id = " << getUUID() << llendl; - std::string suffix = " (" + LLMarketplaceData::instance().getListingID(getUUID()) + ")"; + std::string suffix = LLMarketplaceData::instance().getListingID(getUUID()); + if (suffix.empty()) + { + suffix = LLTrans::getString("MarketplaceNoID"); + } + suffix = " (" + suffix + ")"; + if (LLMarketplaceData::instance().getActivationState(getUUID())) + { + suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; + } return LLInvFVBridge::getLabelSuffix() + suffix; } else @@ -1970,7 +1979,6 @@ std::string LLFolderBridge::getLabelSuffix() const } else { - llinfos << "Merov : not in merchant folder : id = " << getUUID() << llendl; return LLInvFVBridge::getLabelSuffix(); } } -- cgit v1.2.3 From 28fe8352549c0fd99da0c3f0119d96386e52a703 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 18 Mar 2014 13:03:04 -0700 Subject: DD-17, DD-40 : Style active listings in bold, implement a working initialization indicator --- indra/newview/llinventorybridge.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 38dcb24477..3d418105e3 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1945,8 +1945,8 @@ void LLFolderBridge::buildDisplayName() const std::string LLFolderBridge::getLabelSuffix() const { + // *TODO : We need to display some suffix also for the version folder! /* - LLInventoryCategory* cat = gInventory.getCategory(getUUID()); if(cat) { @@ -1983,6 +1983,18 @@ std::string LLFolderBridge::getLabelSuffix() const } } +LLFontGL::StyleFlags LLFolderBridge::getLabelStyle() const +{ + if (isMarketplaceListingsFolder() && LLMarketplaceData::instance().getActivationState(getUUID())) + { + return LLFontGL::BOLD; + } + else + { + return LLFontGL::NORMAL; + } +} + void LLFolderBridge::update() { -- cgit v1.2.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/newview/llinventorybridge.cpp | 56 +++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 8 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') 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; -- cgit v1.2.3 From ec290cd059d80519ff6891149306586819ac008d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 31 Mar 2014 16:17:10 -0700 Subject: DD-18 : WIP : Implement stock folder counting but no propagation so far, also update is not working --- indra/newview/llinventorybridge.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d0abe6db29..bf56be320f 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1973,8 +1973,9 @@ std::string LLFolderBridge::getLabelSuffix() const } 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") + ")"; + llinfos << "Merov : in merchant folder and is a stock folder : name = " << getCategory()->getName() << ", stock = " << getCategory()->getDescendentCount() << llendl; + std::string stock = llformat("%d", getCategory()->getDescendentCount()); + std::string suffix = " (" + LLTrans::getString("MarketplaceStock") + ") (" + stock + ")"; return LLInvFVBridge::getLabelSuffix() + suffix; } else -- cgit v1.2.3 From f66de28a7cf735df15d167df270943547bdbde81 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 1 Apr 2014 21:41:18 -0700 Subject: DD-20 : WIP : Implemented the cut and paste code for marketplace. Stock update still not working as expected. --- indra/newview/llinventorybridge.cpp | 90 +++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 29 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index bf56be320f..5462b2bef4 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3264,13 +3264,12 @@ void LLFolderBridge::pasteFromClipboard() { 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); - // *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); + const BOOL move_is_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); LLDynamicArray objects; LLClipboard::instance().pasteFromClipboard(objects); @@ -3342,21 +3341,35 @@ void LLFolderBridge::pasteFromClipboard() LLViewerInventoryCategory* vicat = (LLViewerInventoryCategory *) model->getCategory(item_id); llassert(vicat); if (vicat) - { - //changeCategoryParent() implicity calls dirtyFilter - changeCategoryParent(model, vicat, parent_id, FALSE); + { + if (move_is_into_marketplacelistings) + { + move_folder_to_marketplacelistings(vicat, parent_id); + } + else + { + //changeCategoryParent() implicity calls dirtyFilter + changeCategoryParent(model, vicat, parent_id, FALSE); + } } } else - { - LLViewerInventoryItem* viitem = dynamic_cast(item); - llassert(viitem); - if (viitem) - { - //changeItemParent() implicity calls dirtyFilter - changeItemParent(model, viitem, parent_id, FALSE); - } - } + { + LLViewerInventoryItem* viitem = dynamic_cast(item); + llassert(viitem); + if (viitem) + { + if (move_is_into_marketplacelistings) + { + move_item_to_marketplacelistings(viitem, parent_id); + } + else + { + //changeItemParent() implicity calls dirtyFilter + changeItemParent(model, viitem, parent_id, FALSE); + } + } + } } else { @@ -3367,22 +3380,41 @@ void LLFolderBridge::pasteFromClipboard() llassert(vicat); if (vicat) { - copy_inventory_category(model, vicat, parent_id); + if (move_is_into_marketplacelistings) + { + move_folder_to_marketplacelistings(vicat, parent_id, true); + } + else + { + copy_inventory_category(model, vicat, parent_id); + } } } - else - { - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - parent_id, - std::string(), - LLPointer(NULL)); - } - } - } - } + else + { + LLViewerInventoryItem* viitem = dynamic_cast(item); + llassert(viitem); + if (viitem) + { + if (move_is_into_marketplacelistings) + { + move_item_to_marketplacelistings(viitem, parent_id, true); + } + else + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + parent_id, + std::string(), + LLPointer(NULL)); + } + } + } + } + } + } // Change mode to paste for next paste LLClipboard::instance().setCutMode(false); } -- cgit v1.2.3 From a98346b0c3b90e75858f6ef98985c1246ad30418 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 2 Apr 2014 18:06:22 -0700 Subject: DD-20 : WIP : Improve Cut and Paste for marketplace. Still some use cases that are not working well --- indra/newview/llinventorybridge.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5462b2bef4..68418063e7 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1186,6 +1186,22 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) } } +void LLInvFVBridge::removeObject(LLInventoryModel *model, const LLUUID &uuid) +{ + // Keep track of the parent + LLInventoryItem* itemp = model->getItem(uuid); + LLUUID parent_id = (itemp ? itemp->getParentUUID() : LLUUID::null); + // Remove the object + model->removeObject(uuid); + // Get the parent updated + if (parent_id.notNull()) + { + LLViewerInventoryCategory* parent_cat = model->getCategory(parent_id); + model->updateCategory(parent_cat); + model->notifyObservers(); + } +} + bool LLInvFVBridge::canShare() const { bool can_share = false; @@ -1406,7 +1422,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) else if ("cut" == action) { cutToClipboard(); - gInventory.removeObject(mUUID); + removeObject(model, mUUID); return; } else if ("copy" == action) @@ -1973,7 +1989,7 @@ std::string LLFolderBridge::getLabelSuffix() const } else if (getCategory()->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) { - llinfos << "Merov : in merchant folder and is a stock folder : name = " << getCategory()->getName() << ", stock = " << getCategory()->getDescendentCount() << llendl; + //llinfos << "Merov : getLabelSuffix : stock folder : name = " << getCategory()->getName() << ", stock = " << getCategory()->getDescendentCount() << llendl; std::string stock = llformat("%d", getCategory()->getDescendentCount()); std::string suffix = " (" + LLTrans::getString("MarketplaceStock") + ") (" + stock + ")"; return LLInvFVBridge::getLabelSuffix() + suffix; @@ -3026,7 +3042,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) else if ("cut" == action) { cutToClipboard(); - gInventory.removeObject(mUUID); + removeObject(model, mUUID); return; } else if ("copy" == action) -- cgit v1.2.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/llinventorybridge.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') 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); } -- cgit v1.2.3 From 6263a4fe6f38bd860e583f3819fb38c5c1d37efd Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 4 Apr 2014 12:33:40 -0700 Subject: DD-45 : Add Activate right click menu item to marketplace listings folders --- indra/newview/llinventorybridge.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 09fd0527b9..ceb54b3dcd 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -744,6 +744,10 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { addOutboxContextMenuOptions(flags, items, disabled_items); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else { items.push_back(std::string("Share")); @@ -845,6 +849,15 @@ void LLInvFVBridge::addOutboxContextMenuOptions(U32 flags, #endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU } +void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, + menuentry_vec_t &items, + menuentry_vec_t &disabled_items) +{ + items.push_back(std::string("Marketplace Separator")); + items.push_back(std::string("Marketplace Activate")); +} + + // *TODO: remove this BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const { @@ -3069,6 +3082,15 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) restoreItem(); return; } + else if ("marketplace_activate" == action) + { + if (!LLMarketplaceData::instance().isListed(mUUID)) + { + LLMarketplaceData::instance().addTestItem(mUUID); + } + LLMarketplaceData::instance().setActivation(mUUID,true); + return; + } #ifndef LL_RELEASE_FOR_DOWNLOAD else if ("delete_system_folder" == action) { @@ -3563,6 +3585,10 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { addOutboxContextMenuOptions(flags, items, disabled_items); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else if(isAgentInventory()) // do not allow creating in library { LLViewerInventoryCategory *cat = getCategory(); -- cgit v1.2.3 From e1d2f71d348bafe0be783dcb3dfbeb56bc877c12 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 4 Apr 2014 16:56:17 -0700 Subject: DD-14 : Add all right click menu items for marketplace. Make Add, Activate and Deactivate work. Right click fails on non folder items though in marketplace --- indra/newview/llinventorybridge.cpp | 113 ++++++++++++++++++++++++++++++++---- 1 file changed, 103 insertions(+), 10 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ceb54b3dcd..cd3e51a0ea 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -744,10 +744,6 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { addOutboxContextMenuOptions(flags, items, disabled_items); } - else if (isMarketplaceListingsFolder()) - { - addMarketplaceContextMenuOptions(flags, items, disabled_items); - } else { items.push_back(std::string("Share")); @@ -853,8 +849,49 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, menuentry_vec_t &items, menuentry_vec_t &disabled_items) { - items.push_back(std::string("Marketplace Separator")); - items.push_back(std::string("Marketplace Activate")); + S32 depth = depth_nesting_in_marketplace(mUUID); + llinfos << "Merov : adding marketplace menu at depth = " << depth << llendl; + if (depth <= 1) + { + // Options available at the Listing Folder level only + items.push_back(std::string("Marketplace Add Listing")); + items.push_back(std::string("Marketplace Attach Listing")); + if (LLMarketplaceData::instance().isListed(mUUID)) + { + disabled_items.push_back(std::string("Marketplace Add Listing")); + disabled_items.push_back(std::string("Marketplace Attach Listing")); + } + } + if (depth <= 2) + { + // Options available at the Listing Folder and Version Folder levels + items.push_back(std::string("Marketplace Activate")); + items.push_back(std::string("Marketplace Deactivate")); + if (LLMarketplaceData::instance().isListed(mUUID)) + { + if (LLMarketplaceData::instance().getActivationState(mUUID)) + { + disabled_items.push_back(std::string("Marketplace Activate")); + } + else + { + disabled_items.push_back(std::string("Marketplace Deactivate")); + } + } + else + { + disabled_items.push_back(std::string("Marketplace Activate")); + disabled_items.push_back(std::string("Marketplace Deactivate")); + } + } + // Options available at all levels on all items + items.push_back(std::string("Marketplace Show Listing")); + if (!LLMarketplaceData::instance().isListed(mUUID)) + { + disabled_items.push_back(std::string("Marketplace Show Listing")); + } + // Separator + items.push_back(std::string("Marketplace Listings Separator")); } @@ -3084,13 +3121,33 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_activate" == action) { - if (!LLMarketplaceData::instance().isListed(mUUID)) - { - LLMarketplaceData::instance().addTestItem(mUUID); - } LLMarketplaceData::instance().setActivation(mUUID,true); return; } + else if ("marketplace_deactivate" == action) + { + LLMarketplaceData::instance().setActivation(mUUID,false); + return; + } + else if ("marketplace_add_listing" == action) + { + // *TODO : Do something a bit smarter... + LLMarketplaceData::instance().addTestItem(mUUID); + return; + } + else if ("marketplace_attach_listing" == action) + { + // *TODO : Get a list of listing IDs and let the user choose one, delist the old one and relist the new one + LLMarketplaceData::instance().addTestItem(mUUID); + return; + } + else if ("marketplace_show_listing" == action) + { + // *TODO : Need to show a browser window with the info for the listing + // Get the listing id (i.e. go up the hierarchy to find the listing folder + // Show the listing folder in a browser window + return; + } #ifndef LL_RELEASE_FOR_DOWNLOAD else if ("delete_system_folder" == action) { @@ -4644,6 +4701,10 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { addOutboxContextMenuOptions(flags, items, disabled_items); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else { items.push_back(std::string("Share")); @@ -4711,6 +4772,10 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { addOutboxContextMenuOptions(flags, items, disabled_items); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else { if (isItemInTrash()) @@ -4769,6 +4834,10 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { addOutboxContextMenuOptions(flags, items, disabled_items); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else { if(isItemInTrash()) @@ -5019,6 +5088,10 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Delete")); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else { items.push_back(std::string("Share")); @@ -5286,6 +5359,10 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Delete")); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else { items.push_back(std::string("Share")); @@ -5340,6 +5417,10 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Delete")); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else { if(isItemInTrash()) @@ -5619,6 +5700,10 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Delete")); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else { items.push_back(std::string("Share")); @@ -5841,6 +5926,10 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Delete")); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else { // FWIW, it looks like SUPPRESS_OPEN_ITEM is not set anywhere BOOL can_open = ((flags & SUPPRESS_OPEN_ITEM) != SUPPRESS_OPEN_ITEM); @@ -6141,6 +6230,10 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { addOutboxContextMenuOptions(flags, items, disabled_items); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } else { items.push_back(std::string("Properties")); -- cgit v1.2.3 From a38bc63da24994b51cfd3487d4011c8e608cd41d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 6 Apr 2014 22:03:58 -0700 Subject: DD-15 : Allow version folder to be made active/inactive, add new methods to marketplace to make all that a bit more clear and clean --- indra/newview/llinventorybridge.cpp | 74 ++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 25 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index cd3e51a0ea..9c9f195875 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -851,24 +851,17 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, { S32 depth = depth_nesting_in_marketplace(mUUID); llinfos << "Merov : adding marketplace menu at depth = " << depth << llendl; - if (depth <= 1) + if (depth == 1) { - // Options available at the Listing Folder level only + // Options available at the Listing Folder level items.push_back(std::string("Marketplace Add Listing")); items.push_back(std::string("Marketplace Attach Listing")); - if (LLMarketplaceData::instance().isListed(mUUID)) - { - disabled_items.push_back(std::string("Marketplace Add Listing")); - disabled_items.push_back(std::string("Marketplace Attach Listing")); - } - } - if (depth <= 2) - { - // Options available at the Listing Folder and Version Folder levels items.push_back(std::string("Marketplace Activate")); items.push_back(std::string("Marketplace Deactivate")); if (LLMarketplaceData::instance().isListed(mUUID)) { + disabled_items.push_back(std::string("Marketplace Add Listing")); + disabled_items.push_back(std::string("Marketplace Attach Listing")); if (LLMarketplaceData::instance().getActivationState(mUUID)) { disabled_items.push_back(std::string("Marketplace Activate")); @@ -884,9 +877,28 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, disabled_items.push_back(std::string("Marketplace Deactivate")); } } + if (depth == 2) + { + // Options available at the Version Folder levels + LLInventoryObject* object = gInventory.getObject(mUUID); + if (LLMarketplaceData::instance().isListed(object->getParentUUID())) + { + items.push_back(std::string("Marketplace Activate")); + items.push_back(std::string("Marketplace Deactivate")); + if (LLMarketplaceData::instance().getActivationState(mUUID)) + { + disabled_items.push_back(std::string("Marketplace Activate")); + } + else + { + disabled_items.push_back(std::string("Marketplace Deactivate")); + } + } + } // Options available at all levels on all items items.push_back(std::string("Marketplace Show Listing")); - if (!LLMarketplaceData::instance().isListed(mUUID)) + LLUUID listing_folder_id = nested_parent_id(mUUID,depth); + if (!LLMarketplaceData::instance().isListed(listing_folder_id)) { disabled_items.push_back(std::string("Marketplace Show Listing")); } @@ -2011,17 +2023,9 @@ void LLFolderBridge::buildDisplayName() const std::string LLFolderBridge::getLabelSuffix() const { - // *TODO : We need to display some suffix also for the version folder! - /* - LLInventoryCategory* cat = gInventory.getCategory(getUUID()); - if(cat) - { - const LLUUID& parent_folder_id = cat->getParentUUID(); - accessories = (parent_folder_id == gInventory.getLibraryRootFolderID()); - } - */ if (isMarketplaceListingsFolder()) { + // Listing folder case if (LLMarketplaceData::instance().isListed(getUUID())) { //llinfos << "Merov : in merchant folder and listed : id = " << getUUID() << llendl; @@ -2037,6 +2041,17 @@ std::string LLFolderBridge::getLabelSuffix() const } return LLInvFVBridge::getLabelSuffix() + suffix; } + // Version folder case + else if (LLMarketplaceData::instance().isVersionFolder(getUUID())) + { + std::string suffix; + if (LLMarketplaceData::instance().getActivationState(getUUID())) + { + suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; + } + return LLInvFVBridge::getLabelSuffix() + suffix; + } + // Stock folder case else if (getCategory()->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) { //llinfos << "Merov : getLabelSuffix : stock folder : name = " << getCategory()->getName() << ", stock = " << getCategory()->getDescendentCount() << llendl; @@ -3121,7 +3136,17 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_activate" == action) { - LLMarketplaceData::instance().setActivation(mUUID,true); + S32 depth = depth_nesting_in_marketplace(mUUID); + if (depth == 2) + { + LLInventoryCategory* category = gInventory.getCategory(mUUID); + LLMarketplaceData::instance().setVersionFolderID(category->getParentUUID(), mUUID); + LLMarketplaceData::instance().setActivation(mUUID,true); + } + else if (depth == 1) + { + LLMarketplaceData::instance().setActivation(mUUID,true); + } return; } else if ("marketplace_deactivate" == action) @@ -3131,14 +3156,13 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_add_listing" == action) { - // *TODO : Do something a bit smarter... - LLMarketplaceData::instance().addTestItem(mUUID); + LLMarketplaceData::instance().addListing(mUUID); return; } else if ("marketplace_attach_listing" == action) { // *TODO : Get a list of listing IDs and let the user choose one, delist the old one and relist the new one - LLMarketplaceData::instance().addTestItem(mUUID); + LLMarketplaceData::instance().addListing(mUUID); return; } else if ("marketplace_show_listing" == action) -- cgit v1.2.3 From 8d20027ff904a29c9fb573372f89839bcab5a0c0 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 7 Apr 2014 14:54:34 -0700 Subject: DD-41 : Clean up and add back into contextual menu the clipboard options, as well as Rename and Properties --- indra/newview/llinventorybridge.cpp | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 9c9f195875..8d87b40e4e 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -650,8 +650,9 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, if (!isInboxFolder()) { items.push_back(std::string("Rename")); - if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0) + if (!isItemRenameable() || ((flags & FIRST_SELECTED_ITEM) == 0)) { + llinfos << "Merov : rename disable, renameable = " << isItemRenameable() << ", flags = " << flags << llendl; disabled_items.push_back(std::string("Rename")); } } @@ -688,7 +689,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Cut")); } - if (canListOnMarketplace()) + if (canListOnMarketplace() && !isMarketplaceListingsFolder()) { items.push_back(std::string("Marketplace Separator")); @@ -879,9 +880,9 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, } if (depth == 2) { - // Options available at the Version Folder levels - LLInventoryObject* object = gInventory.getObject(mUUID); - if (LLMarketplaceData::instance().isListed(object->getParentUUID())) + // Options available at the Version Folder levels and only for folders + LLInventoryCategory* cat = gInventory.getCategory(mUUID); + if (cat && LLMarketplaceData::instance().isListed(cat->getParentUUID())) { items.push_back(std::string("Marketplace Activate")); items.push_back(std::string("Marketplace Deactivate")); @@ -3669,6 +3670,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items else if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + getClipboardEntries(false, items, disabled_items, flags); } else if(isAgentInventory()) // do not allow creating in library { @@ -3747,7 +3749,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Delete System Folder")); } - if (!isOutboxFolder()) + if (!isOutboxFolder() && !isMarketplaceListingsFolder()) { items.push_back(std::string("Share")); if (!canShare()) @@ -3757,7 +3759,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } // Add menu items that are dependent on the contents of the folder. LLViewerInventoryCategory* category = (LLViewerInventoryCategory *) model->getCategory(mUUID); - if (category) + if (category && !isMarketplaceListingsFolder()) { uuid_vec_t folders; folders.push_back(category->getUUID()); @@ -4728,6 +4730,8 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); } else { @@ -4799,6 +4803,8 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); } else { @@ -4861,6 +4867,8 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); } else { @@ -5115,6 +5123,8 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); } else { @@ -5386,6 +5396,8 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); } else { @@ -5444,6 +5456,8 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); } else { @@ -5727,6 +5741,8 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); } else { @@ -5953,6 +5969,8 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); } else { // FWIW, it looks like SUPPRESS_OPEN_ITEM is not set anywhere @@ -6257,6 +6275,8 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); } else { -- cgit v1.2.3 From fc4e9d2572635903449ade6ebf2a45aa9e971023 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 8 Apr 2014 18:12:48 -0700 Subject: DD-18 : Compute stock for all levels, get folders to update more consistently on all actions in the marketplace --- indra/newview/llinventorybridge.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 8d87b40e4e..7ff0a445e8 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -652,7 +652,6 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, items.push_back(std::string("Rename")); if (!isItemRenameable() || ((flags & FIRST_SELECTED_ITEM) == 0)) { - llinfos << "Merov : rename disable, renameable = " << isItemRenameable() << ", flags = " << flags << llendl; disabled_items.push_back(std::string("Rename")); } } @@ -851,7 +850,6 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, menuentry_vec_t &disabled_items) { S32 depth = depth_nesting_in_marketplace(mUUID); - llinfos << "Merov : adding marketplace menu at depth = " << depth << llendl; if (depth == 1) { // Options available at the Listing Folder level @@ -2026,11 +2024,11 @@ std::string LLFolderBridge::getLabelSuffix() const { if (isMarketplaceListingsFolder()) { + std::string suffix = ""; // Listing folder case if (LLMarketplaceData::instance().isListed(getUUID())) { - //llinfos << "Merov : in merchant folder and listed : id = " << getUUID() << llendl; - std::string suffix = LLMarketplaceData::instance().getListingID(getUUID()); + suffix = LLMarketplaceData::instance().getListingID(getUUID()); if (suffix.empty()) { suffix = LLTrans::getString("MarketplaceNoID"); @@ -2040,31 +2038,25 @@ std::string LLFolderBridge::getLabelSuffix() const { suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; } - return LLInvFVBridge::getLabelSuffix() + suffix; } // Version folder case else if (LLMarketplaceData::instance().isVersionFolder(getUUID())) { - std::string suffix; if (LLMarketplaceData::instance().getActivationState(getUUID())) { suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; } - return LLInvFVBridge::getLabelSuffix() + suffix; } - // Stock folder case - else if (getCategory()->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + S32 stock_count = compute_stock_count(getUUID()); + if (stock_count == 0) { - //llinfos << "Merov : getLabelSuffix : stock folder : name = " << getCategory()->getName() << ", stock = " << getCategory()->getDescendentCount() << llendl; - std::string stock = llformat("%d", getCategory()->getDescendentCount()); - std::string suffix = " (" + LLTrans::getString("MarketplaceStock") + ") (" + stock + ")"; - return LLInvFVBridge::getLabelSuffix() + suffix; + suffix += " (" + LLTrans::getString("MarketplaceNoStock") + ")"; } - else + else if (stock_count != -1) { - //llinfos << "Merov : in merchant folder but not listed : id = " << getUUID() << llendl; - return LLInvFVBridge::getLabelSuffix(); + suffix += " (" + LLTrans::getString("MarketplaceStock") + "=" + llformat("%d", stock_count) + ")"; } + return LLInvFVBridge::getLabelSuffix() + suffix; } else { -- cgit v1.2.3 From 748bbeaf982c456b120d4b3f4d33aa6dce576908 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 9 Apr 2014 14:19:38 -0700 Subject: DD-13 : Clean up Associate/Disassociate listing. Also clarify the update folder code in marketplace --- indra/newview/llinventorybridge.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 7ff0a445e8..3af734ba27 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -65,6 +65,7 @@ #include "llsidepanelappearance.h" #include "lltooldraganddrop.h" #include "lltrans.h" +#include "llurlaction.h" #include "llviewerassettype.h" #include "llviewerfoldertype.h" #include "llviewermenu.h" @@ -853,13 +854,14 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, if (depth == 1) { // Options available at the Listing Folder level - items.push_back(std::string("Marketplace Add Listing")); + items.push_back(std::string("Marketplace Associate Listing")); items.push_back(std::string("Marketplace Attach Listing")); + items.push_back(std::string("Marketplace Disassociate Listing")); items.push_back(std::string("Marketplace Activate")); items.push_back(std::string("Marketplace Deactivate")); if (LLMarketplaceData::instance().isListed(mUUID)) { - disabled_items.push_back(std::string("Marketplace Add Listing")); + disabled_items.push_back(std::string("Marketplace Associate Listing")); disabled_items.push_back(std::string("Marketplace Attach Listing")); if (LLMarketplaceData::instance().getActivationState(mUUID)) { @@ -872,6 +874,7 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, } else { + disabled_items.push_back(std::string("Marketplace Disassociate Listing")); disabled_items.push_back(std::string("Marketplace Activate")); disabled_items.push_back(std::string("Marketplace Deactivate")); } @@ -3147,11 +3150,16 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) LLMarketplaceData::instance().setActivation(mUUID,false); return; } - else if ("marketplace_add_listing" == action) + else if ("marketplace_associate_listing" == action) { LLMarketplaceData::instance().addListing(mUUID); return; } + else if ("marketplace_disassociate_listing" == action) + { + LLMarketplaceData::instance().deleteListing(mUUID); + return; + } else if ("marketplace_attach_listing" == action) { // *TODO : Get a list of listing IDs and let the user choose one, delist the old one and relist the new one @@ -3163,6 +3171,11 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) // *TODO : Need to show a browser window with the info for the listing // Get the listing id (i.e. go up the hierarchy to find the listing folder // Show the listing folder in a browser window + // https://marketplace.secondlife.com/p/Nounours/4438852 + // https://marketplace.secondlife.com/p/Un-autre-nounours/4447997?preview=true + // https://marketplace.secondlife.com/p//?preview=true + std::string url("https://marketplace.secondlife.com/p/Un-autre-nounours/4447997?preview=true"); + LLUrlAction::openURL(url); return; } #ifndef LL_RELEASE_FOR_DOWNLOAD -- cgit v1.2.3 From 45ec0833c2f11b7c59b6e250fd63f55fb2317cb5 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 11 Apr 2014 14:13:33 -0700 Subject: DD-57 : Update stock folder count when item moved back to inventory --- indra/newview/llinventorybridge.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3af734ba27..d38f6cffca 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2401,11 +2401,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, 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 LLUUID from_folder_uuid = inv_cat->getParentUUID(); 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(); @@ -2712,6 +2714,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, mUUID, move_is_into_trash); } + if (move_is_from_marketplacelistings) + { + update_marketplace_category(from_folder_uuid); + } } } else if (LLToolDragAndDrop::SOURCE_WORLD == source) @@ -4234,6 +4240,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, 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 LLUUID from_folder_uuid = inv_item->getParentUUID(); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); const BOOL move_is_into_favorites = (mUUID == favorites_id); @@ -4242,6 +4249,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, 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); + const BOOL move_is_from_marketplacelistings = model->isObjectDescendentOf(inv_item->getUUID(), marketplacelistings_id); LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); BOOL accept = FALSE; @@ -4384,7 +4392,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLFolderViewItem* itemp = destination_panel->getRootFolder()->getDraggingOverItem(); if (itemp) { - LLUUID srcItemId = inv_item->getUUID(); + LLUUID srcItemId = inv_item->getUUID(); LLUUID destItemId = static_cast(itemp->getViewModelItem())->getUUID(); LLFavoritesOrderStorage::instance().rearrangeFavoriteLandmarks(srcItemId, destItemId); } @@ -4437,8 +4445,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, mUUID, move_is_into_trash); } + + if (move_is_from_marketplacelistings) + { + update_marketplace_category(from_folder_uuid); + } - // + // //-------------------------------------------------------------------------------- } } -- cgit v1.2.3 From 22c8ed2f80a2a6645f3148362566aa2f46ae38fd Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 12 Apr 2014 17:37:50 -0700 Subject: DD-64 : Add New Folder to right click menu on marketplace --- indra/newview/llinventorybridge.cpp | 48 +++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d38f6cffca..4283643c76 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -897,7 +897,7 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, } } } - // Options available at all levels on all items + // Options available at all levels on items and categories items.push_back(std::string("Marketplace Show Listing")); LLUUID listing_folder_id = nested_parent_id(mUUID,depth); if (!LLMarketplaceData::instance().isListed(listing_folder_id)) @@ -3663,6 +3663,10 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { disabled_items.push_back(std::string("New Folder")); } + if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + } if(trash_id == mUUID) { // This is the trash. @@ -3678,11 +3682,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { addOutboxContextMenuOptions(flags, items, disabled_items); } - else if (isMarketplaceListingsFolder()) - { - addMarketplaceContextMenuOptions(flags, items, disabled_items); - getClipboardEntries(false, items, disabled_items, flags); - } else if(isAgentInventory()) // do not allow creating in library { LLViewerInventoryCategory *cat = getCategory(); @@ -3697,12 +3696,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { items.push_back(std::string("New Folder")); } - - items.push_back(std::string("New Script")); - items.push_back(std::string("New Note")); - items.push_back(std::string("New Gesture")); - items.push_back(std::string("New Clothes")); - items.push_back(std::string("New Body Parts")); + if (!isMarketplaceListingsFolder()) + { + items.push_back(std::string("New Script")); + items.push_back(std::string("New Note")); + items.push_back(std::string("New Gesture")); + items.push_back(std::string("New Clothes")); + items.push_back(std::string("New Body Parts")); + } } #if SUPPORT_ENSEMBLES // Changing folder types is an unfinished unsupported feature @@ -3746,9 +3747,9 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items LLIsType is_object( LLAssetType::AT_OBJECT ); LLIsType is_gesture( LLAssetType::AT_GESTURE ); - if (checkFolderForContentsOfType(model, is_wearable) || - checkFolderForContentsOfType(model, is_object) || - checkFolderForContentsOfType(model, is_gesture) ) + if (checkFolderForContentsOfType(model, is_wearable) || + checkFolderForContentsOfType(model, is_object) || + checkFolderForContentsOfType(model, is_gesture) ) { mWearables=TRUE; } @@ -3770,7 +3771,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } // Add menu items that are dependent on the contents of the folder. LLViewerInventoryCategory* category = (LLViewerInventoryCategory *) model->getCategory(mUUID); - if (category && !isMarketplaceListingsFolder()) + if (category) { uuid_vec_t folders; folders.push_back(category->getUUID()); @@ -3789,8 +3790,8 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { // it's all on its way - add an observer, and the inventory will call done for us when everything is here. gInventory.addObserver(fetch); - } -} + } + } } void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& items, menuentry_vec_t& disabled_items) @@ -3807,6 +3808,12 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& if (isItemInTrash()) return; if (!isAgentInventory()) return; if (isOutboxFolder()) return; + + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Delete")); + } + if (isMarketplaceListingsFolder()) return; LLFolderType::EType type = category->getPreferredType(); const bool is_system_folder = LLFolderType::lookupIsProtectedType(type); @@ -3826,11 +3833,6 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& } } - if (!isItemRemovable()) - { - disabled_items.push_back(std::string("Delete")); - } - #ifndef LL_RELEASE_FOR_DOWNLOAD if (LLFolderType::lookupIsProtectedType(type)) { -- cgit v1.2.3 From 65e53b70f276ff765fdd38b511563508459d0768 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 14 Apr 2014 16:58:41 -0700 Subject: DD-20 : Prevent dropping incompatible items in stock folders --- indra/newview/llinventorybridge.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4283643c76..e740a16d49 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2589,9 +2589,9 @@ 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; + // One cannot move a folder into a stock folder + is_movable = (getPreferredType() != LLFolderType::FT_MARKETPLACE_STOCK); + // *TODO : Merov : Add case if (nesting depth source + depth destination) > marketplace limit -> FALSE } if (is_movable) @@ -4350,9 +4350,23 @@ 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; + // If destination folder type is stock, check perm and type of item, if not compatible -> FALSE + if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + // If the item is copyable (i.e. non stock) do not accept the drop in a stock folder + if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + accept = FALSE; + } + else + { + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(mUUID,cat_array,item_array); + // Destination stock folder must be empty OR types must be identical + accept = (!item_array->count() || (item_array->get(0)->getInventoryType() == inv_item->getInventoryType())); + } + } } LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); -- cgit v1.2.3 From 545b408618388c0484b16d7dff22b9aeb6421530 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 14 Apr 2014 22:58:14 -0700 Subject: DD-20 : Prevent pasting incompatible items in stock folders --- indra/newview/llinventorybridge.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e740a16d49..520a840f74 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4350,23 +4350,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } else if (move_is_into_marketplacelistings) { - // If destination folder type is stock, check perm and type of item, if not compatible -> FALSE - if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) - { - // If the item is copyable (i.e. non stock) do not accept the drop in a stock folder - if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) - { - accept = FALSE; - } - else - { - LLInventoryModel::cat_array_t* cat_array; - LLInventoryModel::item_array_t* item_array; - gInventory.getDirectDescendentsOf(mUUID,cat_array,item_array); - // Destination stock folder must be empty OR types must be identical - accept = (!item_array->count() || (item_array->get(0)->getInventoryType() == inv_item->getInventoryType())); - } - } + accept = (getCategory() && getCategory()->acceptItem(inv_item)); } LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); -- cgit v1.2.3 From 851912b9f8a5fc9f604adf8c43941b7fe27aae09 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 15 Apr 2014 12:12:10 -0700 Subject: DD-65, DD-55: Treat activation/deactivation separately for listing and version folders. Also use max instead of stock for suffix for non stock folders. --- indra/newview/llinventorybridge.cpp | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 520a840f74..374d09ce98 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -887,7 +887,7 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, { items.push_back(std::string("Marketplace Activate")); items.push_back(std::string("Marketplace Deactivate")); - if (LLMarketplaceData::instance().getActivationState(mUUID)) + if (LLMarketplaceData::instance().isVersionFolder(mUUID)) { disabled_items.push_back(std::string("Marketplace Activate")); } @@ -2039,17 +2039,15 @@ std::string LLFolderBridge::getLabelSuffix() const suffix = " (" + suffix + ")"; if (LLMarketplaceData::instance().getActivationState(getUUID())) { - suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; + suffix += " (" + LLTrans::getString("MarketplaceLive") + ")"; } } // Version folder case else if (LLMarketplaceData::instance().isVersionFolder(getUUID())) { - if (LLMarketplaceData::instance().getActivationState(getUUID())) - { - suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; - } + suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; } + // Add stock amount S32 stock_count = compute_stock_count(getUUID()); if (stock_count == 0) { @@ -2057,7 +2055,14 @@ std::string LLFolderBridge::getLabelSuffix() const } else if (stock_count != -1) { - suffix += " (" + LLTrans::getString("MarketplaceStock") + "=" + llformat("%d", stock_count) + ")"; + if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + suffix += " (" + LLTrans::getString("MarketplaceStock") + "=" + llformat("%d", stock_count) + ")"; + } + else + { + suffix += " (" + LLTrans::getString("MarketplaceMax") + "=" + llformat("%d", stock_count) + ")"; + } } return LLInvFVBridge::getLabelSuffix() + suffix; } @@ -3141,19 +3146,31 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) S32 depth = depth_nesting_in_marketplace(mUUID); if (depth == 2) { + // At the version folder level, "activate" means "set this as the version folder" LLInventoryCategory* category = gInventory.getCategory(mUUID); LLMarketplaceData::instance().setVersionFolderID(category->getParentUUID(), mUUID); - LLMarketplaceData::instance().setActivation(mUUID,true); } else if (depth == 1) { + // At the listing folder level, "activate" means "put it for sale on the marketplace" LLMarketplaceData::instance().setActivation(mUUID,true); } return; } else if ("marketplace_deactivate" == action) { - LLMarketplaceData::instance().setActivation(mUUID,false); + S32 depth = depth_nesting_in_marketplace(mUUID); + if (depth == 2) + { + // At the version folder level, "deactivate" means "zap the version folder" + LLInventoryCategory* category = gInventory.getCategory(mUUID); + LLMarketplaceData::instance().setVersionFolderID(category->getParentUUID(), LLUUID::null); + } + else if (depth == 1) + { + // At the listing folder level, "deactivate" means "take this out of the marketplace" + LLMarketplaceData::instance().setActivation(mUUID,false); + } return; } else if ("marketplace_associate_listing" == action) -- cgit v1.2.3 From a4f6fc8ee1a4231d2b81d28035b21b8f8b3fd8fd Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 16 Apr 2014 16:56:01 -0700 Subject: DD-11 : Implement getListingURL() and parametrize it correctly. Change Show Listing to Edit Listing. --- indra/newview/llinventorybridge.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 374d09ce98..128f0e1b91 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1546,6 +1546,11 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) { doActionOnCurSelectedLandmark(boost::bind(&LLItemBridge::doShowOnMap, this, _1)); } + else if ("marketplace_show_listing" == action) + { + std::string url = LLMarketplaceData::instance().getListingURL(mUUID); + LLUrlAction::openURL(url); + } } void LLItemBridge::doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb) @@ -3191,13 +3196,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_show_listing" == action) { - // *TODO : Need to show a browser window with the info for the listing - // Get the listing id (i.e. go up the hierarchy to find the listing folder - // Show the listing folder in a browser window - // https://marketplace.secondlife.com/p/Nounours/4438852 - // https://marketplace.secondlife.com/p/Un-autre-nounours/4447997?preview=true - // https://marketplace.secondlife.com/p//?preview=true - std::string url("https://marketplace.secondlife.com/p/Un-autre-nounours/4447997?preview=true"); + std::string url = LLMarketplaceData::instance().getListingURL(mUUID); LLUrlAction::openURL(url); return; } -- cgit v1.2.3 From ccdffd9794229b59b7d022760540ce5f8d8ea133 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 17 Apr 2014 11:44:04 -0700 Subject: DD-70 : Use List/Delist for listing folders and Activate/Deactivate for version folders. Also create test SLM ID when creating listing. --- indra/newview/llinventorybridge.cpp | 58 +++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 28 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 128f0e1b91..749fcd7a71 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -854,29 +854,29 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, if (depth == 1) { // Options available at the Listing Folder level + items.push_back(std::string("Marketplace Create Listing")); items.push_back(std::string("Marketplace Associate Listing")); - items.push_back(std::string("Marketplace Attach Listing")); items.push_back(std::string("Marketplace Disassociate Listing")); - items.push_back(std::string("Marketplace Activate")); - items.push_back(std::string("Marketplace Deactivate")); + items.push_back(std::string("Marketplace List")); + items.push_back(std::string("Marketplace Unlist")); if (LLMarketplaceData::instance().isListed(mUUID)) { + disabled_items.push_back(std::string("Marketplace Create Listing")); disabled_items.push_back(std::string("Marketplace Associate Listing")); - disabled_items.push_back(std::string("Marketplace Attach Listing")); if (LLMarketplaceData::instance().getActivationState(mUUID)) { - disabled_items.push_back(std::string("Marketplace Activate")); + disabled_items.push_back(std::string("Marketplace List")); } else { - disabled_items.push_back(std::string("Marketplace Deactivate")); + disabled_items.push_back(std::string("Marketplace Unlist")); } } else { disabled_items.push_back(std::string("Marketplace Disassociate Listing")); - disabled_items.push_back(std::string("Marketplace Activate")); - disabled_items.push_back(std::string("Marketplace Deactivate")); + disabled_items.push_back(std::string("Marketplace List")); + disabled_items.push_back(std::string("Marketplace Unlist")); } } if (depth == 2) @@ -898,11 +898,11 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, } } // Options available at all levels on items and categories - items.push_back(std::string("Marketplace Show Listing")); + items.push_back(std::string("Marketplace Edit Listing")); LLUUID listing_folder_id = nested_parent_id(mUUID,depth); if (!LLMarketplaceData::instance().isListed(listing_folder_id)) { - disabled_items.push_back(std::string("Marketplace Show Listing")); + disabled_items.push_back(std::string("Marketplace Edit Listing")); } // Separator items.push_back(std::string("Marketplace Listings Separator")); @@ -1546,7 +1546,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) { doActionOnCurSelectedLandmark(boost::bind(&LLItemBridge::doShowOnMap, this, _1)); } - else if ("marketplace_show_listing" == action) + else if ("marketplace_edit_listing" == action) { std::string url = LLMarketplaceData::instance().getListingURL(mUUID); LLUrlAction::openURL(url); @@ -3146,39 +3146,41 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) restoreItem(); return; } + else if ("marketplace_list" == action) + { + if (depth_nesting_in_marketplace(mUUID) == 1) + { + LLMarketplaceData::instance().setActivation(mUUID,true); + } + return; + } else if ("marketplace_activate" == action) { - S32 depth = depth_nesting_in_marketplace(mUUID); - if (depth == 2) + if (depth_nesting_in_marketplace(mUUID) == 2) { - // At the version folder level, "activate" means "set this as the version folder" LLInventoryCategory* category = gInventory.getCategory(mUUID); LLMarketplaceData::instance().setVersionFolderID(category->getParentUUID(), mUUID); } - else if (depth == 1) + return; + } + else if ("marketplace_unlist" == action) + { + if (depth_nesting_in_marketplace(mUUID) == 1) { - // At the listing folder level, "activate" means "put it for sale on the marketplace" - LLMarketplaceData::instance().setActivation(mUUID,true); + LLMarketplaceData::instance().setActivation(mUUID,false); } return; } else if ("marketplace_deactivate" == action) { - S32 depth = depth_nesting_in_marketplace(mUUID); - if (depth == 2) + if (depth_nesting_in_marketplace(mUUID) == 2) { - // At the version folder level, "deactivate" means "zap the version folder" LLInventoryCategory* category = gInventory.getCategory(mUUID); LLMarketplaceData::instance().setVersionFolderID(category->getParentUUID(), LLUUID::null); - } - else if (depth == 1) - { - // At the listing folder level, "deactivate" means "take this out of the marketplace" - LLMarketplaceData::instance().setActivation(mUUID,false); } return; } - else if ("marketplace_associate_listing" == action) + else if ("marketplace_create_listing" == action) { LLMarketplaceData::instance().addListing(mUUID); return; @@ -3188,13 +3190,13 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) LLMarketplaceData::instance().deleteListing(mUUID); return; } - else if ("marketplace_attach_listing" == action) + else if ("marketplace_associate_listing" == action) { // *TODO : Get a list of listing IDs and let the user choose one, delist the old one and relist the new one LLMarketplaceData::instance().addListing(mUUID); return; } - else if ("marketplace_show_listing" == action) + else if ("marketplace_edit_listing" == action) { std::string url = LLMarketplaceData::instance().getListingURL(mUUID); LLUrlAction::openURL(url); -- cgit v1.2.3 From 8ceed54eea0d91598479356a33fc5a4263338cce Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 17 Apr 2014 18:09:31 -0700 Subject: DD-54 : Prevent right click actions to destroy live listings or list things without version folders --- indra/newview/llinventorybridge.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 749fcd7a71..6dd181501a 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -863,13 +863,21 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, { disabled_items.push_back(std::string("Marketplace Create Listing")); disabled_items.push_back(std::string("Marketplace Associate Listing")); - if (LLMarketplaceData::instance().getActivationState(mUUID)) + if (LLMarketplaceData::instance().getVersionFolderID(mUUID).isNull()) { disabled_items.push_back(std::string("Marketplace List")); + disabled_items.push_back(std::string("Marketplace Unlist")); } else { - disabled_items.push_back(std::string("Marketplace Unlist")); + if (LLMarketplaceData::instance().getActivationState(mUUID)) + { + disabled_items.push_back(std::string("Marketplace List")); + } + else + { + disabled_items.push_back(std::string("Marketplace Unlist")); + } } } else @@ -890,6 +898,10 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, if (LLMarketplaceData::instance().isVersionFolder(mUUID)) { disabled_items.push_back(std::string("Marketplace Activate")); + if (LLMarketplaceData::instance().getActivationState(mUUID)) + { + disabled_items.push_back(std::string("Marketplace Deactivate")); + } } else { @@ -2175,6 +2187,11 @@ BOOL LLFolderBridge::isItemRemovable() const return FALSE; } } + + if (isMarketplaceListingsFolder() && LLMarketplaceData::instance().getActivationState(mUUID)) + { + return FALSE; + } return TRUE; } -- cgit v1.2.3 From a99e2475443bebb6b9c9d2c8998300ce50f254a8 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 18 Apr 2014 14:41:32 -0700 Subject: DD-58 : Implement associate listing UI and primitive --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6dd181501a..1eb647b1b2 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -40,6 +40,7 @@ #include "llfavoritesbar.h" // management of favorites folder #include "llfloateropenobject.h" #include "llfloaterreg.h" +#include "llfloatermarketplacelistings.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" #include "llfolderview.h" @@ -3209,8 +3210,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_associate_listing" == action) { - // *TODO : Get a list of listing IDs and let the user choose one, delist the old one and relist the new one - LLMarketplaceData::instance().addListing(mUUID); + LLFloaterAssociateListing::show(mUUID); return; } else if ("marketplace_edit_listing" == action) -- cgit v1.2.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/newview/llinventorybridge.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') 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)); } -- cgit v1.2.3 From cda6ac9e9b0dc9c75746440d98a98d3556ec9b4e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 21 Apr 2014 15:26:14 -0700 Subject: DD-71 : Implement a new item properties floater, calls the same code as the sidepanel in the inventory but with the back button hidden --- indra/newview/llinventorybridge.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3f2a5501bd..a9d5768854 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -290,7 +290,15 @@ BOOL LLInvFVBridge::copyToClipboard() const // *TODO: make sure this does the right thing void LLInvFVBridge::showProperties() { - show_item_profile(mUUID); + LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, true); + if (gInventory.isObjectDescendentOf(mUUID, marketplacelistings_id)) + { + LLFloaterReg::showInstance("item_properties", LLSD().with("id",mUUID)); + } + else + { + show_item_profile(mUUID); + } // Disable old properties floater; this is replaced by the sidepanel. /* -- cgit v1.2.3 From 97f76ab882de2088c96b386eba8f222e3b911689 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 22 Apr 2014 19:06:44 -0700 Subject: DD-68 : Suppress the listing if a listing folder is dragged outside the marketplace back into the inventory --- indra/newview/llinventorybridge.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a9d5768854..d43de30c84 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2753,6 +2753,8 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if (move_is_from_marketplacelistings) { update_marketplace_category(from_folder_uuid); + // Clear the folder from the marketplace in case it was a listing folder (moot if not listed) + LLMarketplaceData::instance().deleteListing(cat_id); } } } -- cgit v1.2.3 From 277539e5624f9a71186568d4a2d506033f76e312 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 22 Apr 2014 19:32:10 -0700 Subject: DD-68 : Suppress the listing if a listing folder is cut when associated but not listed --- indra/newview/llinventorybridge.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d43de30c84..d02ea949a8 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3528,6 +3528,8 @@ void LLFolderBridge::pasteFromClipboard() llassert(vicat); if (vicat) { + // Clear the cut folder from the marketplace if it was a listing folder (moot if not listed) + LLMarketplaceData::instance().deleteListing(item_id); if (move_is_into_marketplacelistings) { move_folder_to_marketplacelistings(vicat, parent_id); -- cgit v1.2.3 From d22944da00a5ade5eb97aa109bac624967ead94c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 22 Apr 2014 20:57:49 -0700 Subject: DD-58 : Forced listing ID to be an integer throughout. Verify we get an integer when using the associate UI. --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d02ea949a8..e6ecd4e96e 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2057,7 +2057,7 @@ std::string LLFolderBridge::getLabelSuffix() const // Listing folder case if (LLMarketplaceData::instance().isListed(getUUID())) { - suffix = LLMarketplaceData::instance().getListingID(getUUID()); + suffix = llformat("%d",LLMarketplaceData::instance().getListingID(getUUID())); if (suffix.empty()) { suffix = LLTrans::getString("MarketplaceNoID"); -- cgit v1.2.3 From 4deb9f54c64d114bfd2aba76e51eaa01908b6610 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 29 Apr 2014 12:03:03 -0700 Subject: DD-76 : Do not allow Calling Cards in Marketplace Listings --- indra/newview/llinventorybridge.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e6ecd4e96e..97646dc949 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4408,7 +4408,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } else if (move_is_into_marketplacelistings) { + // Check stock folder type matches item type accept = (getCategory() && getCategory()->acceptItem(inv_item)); + // Do not accept calling cards in marketplace listings + accept &= (LLAssetType::AT_CALLINGCARD != inv_item->getType()); } LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); -- cgit v1.2.3 From 1a837c5719fa8dded91561a97839d2ed28e87553 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 5 May 2014 15:13:48 -0700 Subject: DD-22 : WIP : Completed GET and POST listings routes. Refactored the marketplace data code a bit as a result --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 97646dc949..e9abe6a466 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3210,7 +3210,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_create_listing" == action) { - LLMarketplaceData::instance().addListing(mUUID); + LLMarketplaceData::instance().createListing(mUUID); return; } else if ("marketplace_disassociate_listing" == action) -- cgit v1.2.3 From e916b47f12ba0e84ee6b1faed687b920e49633f8 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 6 May 2014 21:24:06 -0700 Subject: DD-22 : WIP : Implement the modify listing route. Made the code more readable and cleared old debug code --- indra/newview/llinventorybridge.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e9abe6a466..f68d69b1c3 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3178,7 +3178,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) { if (depth_nesting_in_marketplace(mUUID) == 1) { - LLMarketplaceData::instance().setActivation(mUUID,true); + LLMarketplaceData::instance().activateListing(mUUID,true); } return; } @@ -3187,7 +3187,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) if (depth_nesting_in_marketplace(mUUID) == 2) { LLInventoryCategory* category = gInventory.getCategory(mUUID); - LLMarketplaceData::instance().setVersionFolderID(category->getParentUUID(), mUUID); + LLMarketplaceData::instance().setVersionFolder(category->getParentUUID(), mUUID); } return; } @@ -3195,7 +3195,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) { if (depth_nesting_in_marketplace(mUUID) == 1) { - LLMarketplaceData::instance().setActivation(mUUID,false); + LLMarketplaceData::instance().activateListing(mUUID,false); } return; } @@ -3204,7 +3204,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) if (depth_nesting_in_marketplace(mUUID) == 2) { LLInventoryCategory* category = gInventory.getCategory(mUUID); - LLMarketplaceData::instance().setVersionFolderID(category->getParentUUID(), LLUUID::null); + LLMarketplaceData::instance().setVersionFolder(category->getParentUUID(), LLUUID::null); } return; } -- cgit v1.2.3 From 00c1094c7d230fdf0670a7e8c2218bb6b1a677ca Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 7 May 2014 16:44:14 -0700 Subject: DD-22 : WIP : Completed the associate_listing route, take edit_url into account and rewrite getListingURL() --- indra/newview/llinventorybridge.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f68d69b1c3..11ae3b6189 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3226,7 +3226,10 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) else if ("marketplace_edit_listing" == action) { std::string url = LLMarketplaceData::instance().getListingURL(mUUID); - LLUrlAction::openURL(url); + if (!url.empty()) + { + LLUrlAction::openURL(url); + } return; } #ifndef LL_RELEASE_FOR_DOWNLOAD -- cgit v1.2.3 From 4d14e1ca9600d7ca7023edbd3827fbff994c8110 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 8 May 2014 15:56:38 -0700 Subject: DD-22 : WIP : Cleanep up the class definition, seting methods private and better isolate calls leading to HTTP requests --- indra/newview/llinventorybridge.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 11ae3b6189..759716f024 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2754,7 +2754,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, { update_marketplace_category(from_folder_uuid); // Clear the folder from the marketplace in case it was a listing folder (moot if not listed) - LLMarketplaceData::instance().deleteListing(cat_id); + LLMarketplaceData::instance().clearListing(cat_id); } } } @@ -3215,7 +3215,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_disassociate_listing" == action) { - LLMarketplaceData::instance().deleteListing(mUUID); + LLMarketplaceData::instance().clearListing(mUUID); return; } else if ("marketplace_associate_listing" == action) @@ -3532,7 +3532,7 @@ void LLFolderBridge::pasteFromClipboard() if (vicat) { // Clear the cut folder from the marketplace if it was a listing folder (moot if not listed) - LLMarketplaceData::instance().deleteListing(item_id); + LLMarketplaceData::instance().clearListing(item_id); if (move_is_into_marketplacelistings) { move_folder_to_marketplacelistings(vicat, parent_id); -- cgit v1.2.3 From b4ddacaa5a3a6a46c38e13a52254c16956e9ed5a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 8 May 2014 21:26:07 -0700 Subject: DD-22 : WIP : More clean up of marketplace classes, rationalize methods naming --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 759716f024..6bb93633d4 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -872,7 +872,7 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, { disabled_items.push_back(std::string("Marketplace Create Listing")); disabled_items.push_back(std::string("Marketplace Associate Listing")); - if (LLMarketplaceData::instance().getVersionFolderID(mUUID).isNull()) + if (LLMarketplaceData::instance().getVersionFolder(mUUID).isNull()) { disabled_items.push_back(std::string("Marketplace List")); disabled_items.push_back(std::string("Marketplace Unlist")); -- cgit v1.2.3 From 03679c227e0715d51229250c006f9c407bd9d923 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 12 May 2014 13:41:38 -0700 Subject: DD-22 : WIP : Implement the GET /listing/:listing route to complete the SLM API coverage. Will be used only in test. --- indra/newview/llinventorybridge.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6bb93633d4..05e6427dc1 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -866,6 +866,7 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, items.push_back(std::string("Marketplace Create Listing")); items.push_back(std::string("Marketplace Associate Listing")); items.push_back(std::string("Marketplace Disassociate Listing")); + items.push_back(std::string("Marketplace Get Listing")); items.push_back(std::string("Marketplace List")); items.push_back(std::string("Marketplace Unlist")); if (LLMarketplaceData::instance().isListed(mUUID)) @@ -892,6 +893,7 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, else { disabled_items.push_back(std::string("Marketplace Disassociate Listing")); + disabled_items.push_back(std::string("Marketplace Get Listing")); disabled_items.push_back(std::string("Marketplace List")); disabled_items.push_back(std::string("Marketplace Unlist")); } @@ -3217,6 +3219,12 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) { LLMarketplaceData::instance().clearListing(mUUID); return; + } + else if ("marketplace_get_listing" == action) + { + // This is used only to exercise the SLM API but won't be shown to end users + LLMarketplaceData::instance().getListing(mUUID); + return; } else if ("marketplace_associate_listing" == action) { -- cgit v1.2.3 From acdd70688bf2c53f50cb39781179bbffcb2a400d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 12 May 2014 14:58:17 -0700 Subject: DD-89 : Add a MarketplaceListingsLogging setting to get SLM API logs. DD-22 : Fixed the delete /listing route --- indra/newview/llinventorybridge.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 05e6427dc1..f04724ace1 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -866,9 +866,12 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, items.push_back(std::string("Marketplace Create Listing")); items.push_back(std::string("Marketplace Associate Listing")); items.push_back(std::string("Marketplace Disassociate Listing")); - items.push_back(std::string("Marketplace Get Listing")); items.push_back(std::string("Marketplace List")); items.push_back(std::string("Marketplace Unlist")); + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + items.push_back(std::string("Marketplace Get Listing")); + } if (LLMarketplaceData::instance().isListed(mUUID)) { disabled_items.push_back(std::string("Marketplace Create Listing")); @@ -893,9 +896,12 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, else { disabled_items.push_back(std::string("Marketplace Disassociate Listing")); - disabled_items.push_back(std::string("Marketplace Get Listing")); disabled_items.push_back(std::string("Marketplace List")); disabled_items.push_back(std::string("Marketplace Unlist")); + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + disabled_items.push_back(std::string("Marketplace Get Listing")); + } } } if (depth == 2) -- cgit v1.2.3 From 10591cce8e36e4c27c4a68c68c0502eaa24d8964 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 14 May 2014 15:57:17 -0700 Subject: DD-76, DD-77, DD-90 : recycled can_move_to_outbox() into can_move_to_marketplace() so we have now the same logic for both marketplace and merchant outbox --- indra/newview/llinventorybridge.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f04724ace1..c9efb92acc 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2344,7 +2344,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const } -static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_msg) +static BOOL can_move_to_marketplace(LLInventoryItem* inv_item, std::string& tooltip_msg) { // Collapse links directly to items/folders LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; @@ -2622,7 +2622,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, for (S32 i=0; i < descendent_items.count(); ++i) { LLInventoryItem* item = descendent_items[i]; - if (!can_move_to_outbox(item, tooltip_msg)) + if (!can_move_to_marketplace(item, tooltip_msg)) { is_movable = FALSE; break; @@ -2636,6 +2636,18 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // One cannot move a folder into a stock folder is_movable = (getPreferredType() != LLFolderType::FT_MARKETPLACE_STOCK); // *TODO : Merov : Add case if (nesting depth source + depth destination) > marketplace limit -> FALSE + if (is_movable) + { + for (S32 i = 0; i < descendent_items.count(); ++i) + { + LLInventoryItem* item = descendent_items[i]; + if (!can_move_to_marketplace(item, tooltip_msg)) + { + is_movable = FALSE; + break; + } + } + } } if (is_movable) @@ -4398,7 +4410,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } else if (move_is_into_outbox) { - accept = can_move_to_outbox(inv_item, tooltip_msg); + accept = can_move_to_marketplace(inv_item, tooltip_msg); if (accept) { @@ -4427,8 +4439,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { // Check stock folder type matches item type accept = (getCategory() && getCategory()->acceptItem(inv_item)); - // Do not accept calling cards in marketplace listings - accept &= (LLAssetType::AT_CALLINGCARD != inv_item->getType()); + // Check that the object can move into marketplace listings + accept &= can_move_to_marketplace(inv_item, tooltip_msg); } LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); -- cgit v1.2.3 From 8193caa7939643d1080ceb9463b3e3978b0f516a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 20 May 2014 21:40:48 -0700 Subject: DD-88 : Make Drag and Drop tooltips for Merchant Outbox and Marketplace restrictions identical --- indra/newview/llinventorybridge.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c9efb92acc..83403c53f5 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -83,7 +83,6 @@ void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); // Marketplace outbox current disabled #define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 #define ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU 0 -#define BLOCK_WORN_ITEMS_IN_OUTBOX 1 typedef std::pair two_uuids_t; typedef std::list two_uuids_list_t; @@ -2361,14 +2360,12 @@ static BOOL can_move_to_marketplace(LLInventoryItem* inv_item, std::string& tool return false; } -#if BLOCK_WORN_ITEMS_IN_OUTBOX bool worn = get_is_item_worn(inv_item->getUUID()); if (worn) { tooltip_msg = LLTrans::getString("TooltipOutboxWorn"); return false; } -#endif bool calling_card = (LLAssetType::AT_CALLINGCARD == inv_item->getType()); if (calling_card) -- cgit v1.2.3 From 2a6ce118882b7ac4ce533dcd3c74f582e01bdb29 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 21 May 2014 16:40:23 -0700 Subject: DD-91, DD-84 : WIP : Verify restrictions when moving things to marketplace, provide clear alert for errors, parametrize alerts and tooltips correctly --- indra/newview/llinventorybridge.cpp | 113 ++++++++++++------------------------ 1 file changed, 38 insertions(+), 75 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 83403c53f5..bbd3f383eb 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -80,10 +80,6 @@ void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); -// Marketplace outbox current disabled -#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 -#define ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU 0 - typedef std::pair two_uuids_t; typedef std::list two_uuids_list_t; @@ -839,19 +835,6 @@ void LLInvFVBridge::addOutboxContextMenuOptions(U32 flags, { disabled_items.push_back(std::string("Rename")); } - -#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU - if (isOutboxFolderDirectParent()) - { - items.push_back(std::string("Marketplace Separator")); - items.push_back(std::string("Marketplace Send")); - - if ((flags & FIRST_SELECTED_ITEM) == 0) - { - disabled_items.push_back(std::string("Marketplace Send")); - } - } -#endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU } void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, @@ -1324,8 +1307,6 @@ bool LLInvFVBridge::canShare() const bool LLInvFVBridge::canListOnMarketplace() const { -#if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU - LLInventoryModel * model = getInventoryModel(); const LLViewerInventoryCategory * cat = model->getCategory(mUUID); @@ -1364,16 +1345,10 @@ bool LLInvFVBridge::canListOnMarketplace() const } return true; - -#else - return false; -#endif } bool LLInvFVBridge::canListOnMarketplaceNow() const { -#if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU - bool can_list = true; // Do not allow listing while import is in progress @@ -1419,10 +1394,6 @@ bool LLInvFVBridge::canListOnMarketplaceNow() const } return can_list; - -#else - return false; -#endif } LLToolDragAndDrop::ESource LLInvFVBridge::getDragSource() const @@ -2540,13 +2511,21 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } - if (is_movable && move_is_into_outbox) + if (is_movable && move_is_into_marketplacelistings) + { + // One cannot move a folder into a stock folder + is_movable = (getPreferredType() != LLFolderType::FT_MARKETPLACE_STOCK); + } + if (is_movable && (move_is_into_outbox || move_is_into_marketplacelistings)) { - const int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat); + const int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat); if (nested_folder_levels > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) { - tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels"); + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels", args); is_movable = FALSE; } else @@ -2605,12 +2584,18 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if (nested_folder_count > gSavedSettings.getU32("InventoryOutboxMaxFolderCount")) { - tooltip_msg = LLTrans::getString("TooltipOutboxTooManyFolders"); + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxFolderCount"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyFolders", args); is_movable = FALSE; } else if (nested_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount")) { - tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects"); + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxItemCount"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects", args); is_movable = FALSE; } @@ -2628,24 +2613,6 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } - if (is_movable && move_is_into_marketplacelistings) - { - // One cannot move a folder into a stock folder - is_movable = (getPreferredType() != LLFolderType::FT_MARKETPLACE_STOCK); - // *TODO : Merov : Add case if (nesting depth source + depth destination) > marketplace limit -> FALSE - if (is_movable) - { - for (S32 i = 0; i < descendent_items.count(); ++i) - { - LLInventoryItem* item = descendent_items[i]; - if (!can_move_to_marketplace(item, tooltip_msg)) - { - is_movable = FALSE; - break; - } - } - } - } if (is_movable) { @@ -3271,17 +3238,6 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); copy_folder_to_outbox(cat, outbox_id, cat->getUUID(), LLToolDragAndDrop::getOperationId()); } -#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU - else if (isMarketplaceSendAction(action)) - { - llinfos << "Send to marketplace action!" << llendl; - - LLInventoryCategory * cat = gInventory.getCategory(mUUID); - if (!cat) return; - - send_to_marketplace(cat); - } -#endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU } void LLFolderBridge::openItem() @@ -3575,7 +3531,11 @@ void LLFolderBridge::pasteFromClipboard() { if (move_is_into_marketplacelistings) { - move_item_to_marketplacelistings(viitem, parent_id); + if (!move_item_to_marketplacelistings(viitem, parent_id)) + { + // Stop pasting into the marketplace as soon as we get an error + break; + } } else { @@ -3612,7 +3572,11 @@ void LLFolderBridge::pasteFromClipboard() { if (move_is_into_marketplacelistings) { - move_item_to_marketplacelistings(viitem, parent_id, true); + if (!move_item_to_marketplacelistings(viitem, parent_id, true)) + { + // Stop pasting into the marketplace as soon as we get an error + break; + } } else { @@ -4405,9 +4369,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = can_move_to_landmarks(inv_item); } - else if (move_is_into_outbox) + else if (move_is_into_outbox || move_is_into_marketplacelistings) { - accept = can_move_to_marketplace(inv_item, tooltip_msg); + // Check stock folder type matches item type in marketplace listings + accept = (!move_is_into_marketplacelistings || (getCategory() && getCategory()->acceptItem(inv_item))); + + accept &= can_move_to_marketplace(inv_item, tooltip_msg); if (accept) { @@ -4427,18 +4394,14 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (existing_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount")) { - tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects"); + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxItemCount"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects", args); accept = FALSE; } } } - else if (move_is_into_marketplacelistings) - { - // Check stock folder type matches item type - accept = (getCategory() && getCategory()->acceptItem(inv_item)); - // Check that the object can move into marketplace listings - accept &= can_move_to_marketplace(inv_item, tooltip_msg); - } LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); -- cgit v1.2.3 From 78e13085eb0d95d98e2602779b34952bf4495e2f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 21 May 2014 19:13:38 -0700 Subject: DD-91 : WIP : Fix taking the correct root folder (merchant outbox or marketplace listings) into account --- indra/newview/llinventorybridge.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index bbd3f383eb..3715865a69 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2518,7 +2518,8 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } if (is_movable && (move_is_into_outbox || move_is_into_marketplacelistings)) { - const int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat); + int nested_folder_levels = get_folder_levels(inv_cat); + nested_folder_levels += (move_is_into_outbox ? get_folder_path_length(outbox_id, mUUID) : get_folder_path_length(marketplacelistings_id, mUUID)); if (nested_folder_levels > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) { @@ -2534,7 +2535,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, int existing_item_count = 0; int existing_folder_count = 0; - const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); + const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); if (master_folder != NULL) { @@ -4378,7 +4379,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (accept) { - const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); + const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); int existing_item_count = LLToolDragAndDrop::instance().getCargoCount(); -- cgit v1.2.3 From aa518ce8f112a7717d025cf7bdf710635999c6a2 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 22 May 2014 14:26:44 -0700 Subject: DD-103 : Use the same logic than Drag and Drop for Paste operations. Prompt with dialog instead of tooltip though. --- indra/newview/llinventorybridge.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3715865a69..07b4eee90d 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3443,22 +3443,20 @@ void LLFolderBridge::pasteFromClipboard() LLDynamicArray objects; LLClipboard::instance().pasteFromClipboard(objects); - if (move_is_into_outbox) + // Use "dragOrDrop" to go through the same accept logic + if (move_is_into_outbox || move_is_into_marketplacelistings) { - LLFolderViewItem * outbox_itemp = mInventoryPanel.get()->getItemByID(mUUID); + LLFolderViewFolder* outbox_itemp = (move_is_into_outbox ? mInventoryPanel.get()->getFolderByID(outbox_id) : mInventoryPanel.get()->getFolderByID(marketplacelistings_id)); if (outbox_itemp) { LLToolDragAndDrop::instance().setCargoCount(objects.size()); - BOOL can_list = TRUE; - - for (LLDynamicArray::const_iterator iter = objects.begin(); - (iter != objects.end()) && (can_list == TRUE); - ++iter) + std::string error_msg; + for (LLDynamicArray::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) { const LLUUID& item_id = (*iter); - LLInventoryItem *item = model->getItem(item_id); + LLInventoryObject *item = model->getObject(item_id); if (item) { @@ -3466,17 +3464,20 @@ void LLFolderBridge::pasteFromClipboard() BOOL drop = FALSE; EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(item->getActualType()); void * cargo_data = (void *) item; - std::string tooltip_msg; - - can_list = outbox_itemp->getViewModelItem()->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg); + if (!outbox_itemp->getViewModelItem()->dragOrDrop(mask, drop, cargo_type, cargo_data, error_msg)) + { + break; + } } } LLToolDragAndDrop::instance().resetCargoCount(); - if (can_list == FALSE) + if (!error_msg.empty()) { - // Notify user of failure somehow -- play error sound? modal dialog? + LLSD subs; + subs["[ERROR_CODE]"] = error_msg; + LLNotificationsUtil::add("MerchantPasteFailed", subs); return; } } -- cgit v1.2.3 From d06d4a36e702604368c70244114c58c5df730fb9 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 23 May 2014 17:19:03 -0700 Subject: DD-91 : WIP : Refactor code testing the validity of a drag, drop or paste of a folder or item in the marketplace --- indra/newview/llinventorybridge.cpp | 267 +++++------------------------------- 1 file changed, 31 insertions(+), 236 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 07b4eee90d..4da8fd4b86 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2314,82 +2314,6 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const } -static BOOL can_move_to_marketplace(LLInventoryItem* inv_item, std::string& tooltip_msg) -{ - // Collapse links directly to items/folders - LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; - LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); - if (linked_item != NULL) - { - inv_item = linked_item; - } - - bool allow_transfer = inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); - if (!allow_transfer) - { - tooltip_msg = LLTrans::getString("TooltipOutboxNoTransfer"); - return false; - } - - bool worn = get_is_item_worn(inv_item->getUUID()); - if (worn) - { - tooltip_msg = LLTrans::getString("TooltipOutboxWorn"); - return false; - } - - bool calling_card = (LLAssetType::AT_CALLINGCARD == inv_item->getType()); - if (calling_card) - { - tooltip_msg = LLTrans::getString("TooltipOutboxCallingCard"); - return false; - } - - return true; -} - - -int get_folder_levels(LLInventoryCategory* inv_cat) -{ - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - gInventory.getDirectDescendentsOf(inv_cat->getUUID(), cats, items); - - int max_child_levels = 0; - - for (S32 i=0; i < cats->count(); ++i) - { - LLInventoryCategory* category = cats->get(i); - max_child_levels = llmax(max_child_levels, get_folder_levels(category)); - } - - return 1 + max_child_levels; -} - -int get_folder_path_length(const LLUUID& ancestor_id, const LLUUID& descendant_id) -{ - int depth = 0; - - if (ancestor_id == descendant_id) return depth; - - const LLInventoryCategory* category = gInventory.getCategory(descendant_id); - - while(category) - { - LLUUID parent_id = category->getParentUUID(); - - if (parent_id.isNull()) break; - - depth++; - - if (parent_id == ancestor_id) return depth; - - category = gInventory.getCategory(parent_id); - } - - llwarns << "get_folder_path_length() couldn't trace a path from the descendant to the ancestor" << llendl; - return -1; -} BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, BOOL drop, @@ -2518,101 +2442,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } if (is_movable && (move_is_into_outbox || move_is_into_marketplacelistings)) { - int nested_folder_levels = get_folder_levels(inv_cat); - nested_folder_levels += (move_is_into_outbox ? get_folder_path_length(outbox_id, mUUID) : get_folder_path_length(marketplacelistings_id, mUUID)); - - if (nested_folder_levels > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) - { - LLStringUtil::format_map_t args; - U32 amount = gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"); - args["[AMOUNT]"] = llformat("%d",amount); - tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels", args); - is_movable = FALSE; - } - else - { - int dragged_folder_count = descendent_categories.count(); - int existing_item_count = 0; - int existing_folder_count = 0; - - const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); - - if (master_folder != NULL) - { - if (model->isObjectDescendentOf(cat_id, master_folder->getUUID())) - { - // Don't use count because we're already inside the same category anyway - dragged_folder_count = 0; - } - else - { - existing_folder_count = 1; // Include the master folder in the count! - - // If we're in the drop operation as opposed to the drag without drop, we are doing a - // single category at a time so don't block based on the total amount of cargo data items - if (drop) - { - dragged_folder_count += 1; - } - else - { - // NOTE: The cargo id's count is a total of categories AND items but we err on the side of - // prevention rather than letting too many folders into the hierarchy of the outbox, - // when we're dragging the item to a new parent - dragged_folder_count += LLToolDragAndDrop::instance().getCargoCount(); - } - } - - // Tally the total number of categories and items inside the master folder - - LLInventoryModel::cat_array_t existing_categories; - LLInventoryModel::item_array_t existing_items; - - model->collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); - - existing_folder_count += existing_categories.count(); - existing_item_count += existing_items.count(); - } - else - { - // Assume a single category is being dragged to the outbox since we evaluate one at a time - // when not putting them under a parent item. - dragged_folder_count += 1; - } - - const int nested_folder_count = existing_folder_count + dragged_folder_count; - const int nested_item_count = existing_item_count + descendent_items.count(); - - if (nested_folder_count > gSavedSettings.getU32("InventoryOutboxMaxFolderCount")) - { - LLStringUtil::format_map_t args; - U32 amount = gSavedSettings.getU32("InventoryOutboxMaxFolderCount"); - args["[AMOUNT]"] = llformat("%d",amount); - tooltip_msg = LLTrans::getString("TooltipOutboxTooManyFolders", args); - is_movable = FALSE; - } - else if (nested_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount")) - { - LLStringUtil::format_map_t args; - U32 amount = gSavedSettings.getU32("InventoryOutboxMaxItemCount"); - args["[AMOUNT]"] = llformat("%d",amount); - tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects", args); - is_movable = FALSE; - } - - if (is_movable == TRUE) - { - for (S32 i=0; i < descendent_items.count(); ++i) - { - LLInventoryItem* item = descendent_items[i]; - if (!can_move_to_marketplace(item, tooltip_msg)) - { - is_movable = FALSE; - break; - } - } - } - } + const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); + LLViewerInventoryCategory * dest_folder = getCategory(); + S32 bundle_size = (drop ? 1 : LLToolDragAndDrop::instance().getCargoCount()); + is_movable = can_move_folder_to_marketplace(master_folder, dest_folder, inv_cat, tooltip_msg, bundle_size); } if (is_movable) @@ -3443,44 +3276,33 @@ void LLFolderBridge::pasteFromClipboard() LLDynamicArray objects; LLClipboard::instance().pasteFromClipboard(objects); - // Use "dragOrDrop" to go through the same accept logic if (move_is_into_outbox || move_is_into_marketplacelistings) { - LLFolderViewFolder* outbox_itemp = (move_is_into_outbox ? mInventoryPanel.get()->getFolderByID(outbox_id) : mInventoryPanel.get()->getFolderByID(marketplacelistings_id)); - - if (outbox_itemp) - { - LLToolDragAndDrop::instance().setCargoCount(objects.size()); - - std::string error_msg; - for (LLDynamicArray::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) - { - const LLUUID& item_id = (*iter); - LLInventoryObject *item = model->getObject(item_id); - - if (item) - { - MASK mask = 0x0; - BOOL drop = FALSE; - EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(item->getActualType()); - void * cargo_data = (void *) item; - if (!outbox_itemp->getViewModelItem()->dragOrDrop(mask, drop, cargo_type, cargo_data, error_msg)) - { - break; - } - } - } - - LLToolDragAndDrop::instance().resetCargoCount(); - - if (!error_msg.empty()) - { - LLSD subs; - subs["[ERROR_CODE]"] = error_msg; - LLNotificationsUtil::add("MerchantPasteFailed", subs); - return; - } + std::string error_msg; + const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); + LLViewerInventoryCategory * dest_folder = getCategory(); + for (LLDynamicArray::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) + { + const LLUUID& item_id = (*iter); + LLInventoryItem *item = model->getItem(item_id); + LLInventoryCategory *cat = model->getCategory(item_id); + + if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg)) + { + break; + } + if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg)) + { + break; + } } + if (!error_msg.empty()) + { + LLSD subs; + subs["[ERROR_CODE]"] = error_msg; + LLNotificationsUtil::add("MerchantPasteFailed", subs); + return; + } } const LLUUID parent_id(mUUID); @@ -4373,36 +4195,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } else if (move_is_into_outbox || move_is_into_marketplacelistings) { - // Check stock folder type matches item type in marketplace listings - accept = (!move_is_into_marketplacelistings || (getCategory() && getCategory()->acceptItem(inv_item))); - - accept &= can_move_to_marketplace(inv_item, tooltip_msg); - - if (accept) - { - const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); - - int existing_item_count = LLToolDragAndDrop::instance().getCargoCount(); - - if (master_folder != NULL) - { - LLInventoryModel::cat_array_t existing_categories; - LLInventoryModel::item_array_t existing_items; - - gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); - - existing_item_count += existing_items.count(); - } - - if (existing_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount")) - { - LLStringUtil::format_map_t args; - U32 amount = gSavedSettings.getU32("InventoryOutboxMaxItemCount"); - args["[AMOUNT]"] = llformat("%d",amount); - tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects", args); - accept = FALSE; - } - } + const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); + LLViewerInventoryCategory * dest_folder = getCategory(); + accept = can_move_item_to_marketplace(master_folder, dest_folder, inv_item, tooltip_msg, LLToolDragAndDrop::instance().getCargoCount()); } LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); -- cgit v1.2.3 From b9407199462c0b56a7d49c2e19657e87ec149d8c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 29 May 2014 16:56:15 -0700 Subject: DD-84 : WIP : Get DAMA to display for drag and drop. Note that, because of current SLM issues, it works on version folders, active or not. --- indra/newview/llinventorybridge.cpp | 62 +++++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4da8fd4b86..29432c26e0 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2317,7 +2317,8 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, BOOL drop, - std::string& tooltip_msg) + std::string& tooltip_msg, + BOOL user_confirm) { LLInventoryModel* model = getInventoryModel(); @@ -2488,6 +2489,16 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if (accept && drop) { + // Dropping in or out of marketplace needs (sometimes) confirmation + if (user_confirm && (move_is_from_marketplacelistings || move_is_into_marketplacelistings)) + { + if ((move_is_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(cat_id)) || + (move_is_into_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID))) + { + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + return true; + } + } // Look for any gestures and deactivate them if (move_is_into_trash) { @@ -2571,8 +2582,11 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if (move_is_from_marketplacelistings) { update_marketplace_category(from_folder_uuid); - // Clear the folder from the marketplace in case it was a listing folder (moot if not listed) - LLMarketplaceData::instance().clearListing(cat_id); + // Clear the folder from the marketplace in case it is a listing folder + if (LLMarketplaceData::instance().isListed(cat_id)) + { + LLMarketplaceData::instance().clearListing(cat_id); + } } } } @@ -3334,8 +3348,11 @@ void LLFolderBridge::pasteFromClipboard() llassert(vicat); if (vicat) { - // Clear the cut folder from the marketplace if it was a listing folder (moot if not listed) - LLMarketplaceData::instance().clearListing(item_id); + // Clear the cut folder from the marketplace if it is a listing folder + if (LLMarketplaceData::instance().isListed(item_id)) + { + LLMarketplaceData::instance().clearListing(item_id); + } if (move_is_into_marketplacelistings) { move_folder_to_marketplacelistings(vicat, parent_id); @@ -4090,12 +4107,35 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c } } +// Callback for drop item if DAMA required... +void LLFolderBridge::callback_dropItemIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryItem* inv_item) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + std::string tooltip_msg; + dragItemIntoFolder(inv_item, TRUE, tooltip_msg, FALSE); + } +} + +// Callback for drop category if DAMA required... +void LLFolderBridge::callback_dropCategoryIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryCategory* inv_category) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + std::string tooltip_msg; + dragCategoryIntoFolder(inv_category, TRUE, tooltip_msg, FALSE); + } +} + // This is used both for testing whether an item can be dropped // into the folder, as well as performing the actual drop, depending // if drop == TRUE. BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop, - std::string& tooltip_msg) + std::string& tooltip_msg, + BOOL user_confirm) { LLInventoryModel* model = getInventoryModel(); @@ -4227,6 +4267,16 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { active_panel->unSelectAll(); } + // Dropping in or out of marketplace needs (sometimes) confirmation + if (user_confirm && (move_is_from_marketplacelistings || move_is_into_marketplacelistings)) + { + if ((move_is_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(inv_item->getUUID())) || + (move_is_into_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID))) + { + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropItemIntoFolder, this, _1, _2, inv_item)); + return true; + } + } //-------------------------------------------------------------------------------- // Destination folder logic -- cgit v1.2.3 From 86d75052f65149da6bbe1ade5ea28b6f01aaba17 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 3 Jun 2014 19:46:33 -0700 Subject: DD-84 : Fix all active listing modification actions. Add specific message when listing will unlist. Make update skip consistency check when called from internal level (not public API). --- indra/newview/llinventorybridge.cpp | 119 ++++++++++++++++++++++++++++++------ 1 file changed, 99 insertions(+), 20 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 47b47bf705..b471b0ca15 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -263,13 +263,50 @@ BOOL LLInvFVBridge::isLibraryItem() const /** * @brief Adds this item into clipboard storage */ -BOOL LLInvFVBridge::cutToClipboard() const +BOOL LLInvFVBridge::cutToClipboard() +{ + const LLInventoryObject* obj = gInventory.getObject(mUUID); + if (obj && isItemMovable() && isItemRemovable()) + { + const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + const BOOL cut_from_marketplacelistings = gInventory.isObjectDescendentOf(mUUID, marketplacelistings_id); + + if (cut_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID)) + { + // Prompt the user if cutting from marketplace active listing + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLInvFVBridge::callback_cutToClipboard, this, _1, _2)); + } + else + { + // Otherwise just do the cut + return perform_cutToClipboard(); + } + } + return FALSE; +} + +// Callback for cutToClipboard if DAMA required... +BOOL LLInvFVBridge::callback_cutToClipboard(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + return perform_cutToClipboard(); + } + return FALSE; +} + +BOOL LLInvFVBridge::perform_cutToClipboard() { const LLInventoryObject* obj = gInventory.getObject(mUUID); if (obj && isItemMovable() && isItemRemovable()) { LLClipboard::instance().setCutMode(true); - return LLClipboard::instance().addToClipboard(mUUID); + if (LLClipboard::instance().addToClipboard(mUUID)) + { + removeObject(&gInventory, mUUID); + return TRUE; + } } return FALSE; } @@ -1480,7 +1517,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) else if ("cut" == action) { cutToClipboard(); - removeObject(model, mUUID); + //removeObject(model, mUUID); return; } else if ("copy" == action) @@ -2455,7 +2492,16 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if ((move_is_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(cat_id)) || (move_is_into_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID))) { - LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + if (move_is_from_marketplacelistings && (LLMarketplaceData::instance().isListed(cat_id) || LLMarketplaceData::instance().isVersionFolder(cat_id))) + { + // Move the active version folder or listing folder itself outside marketplace listings will unlist the listing so ask that question specifically + LLNotificationsUtil::add("ConfirmMerchantUnlist", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + } + else + { + // Any other case will simply modify but not unlist a listing + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + } return true; } } @@ -2891,7 +2937,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) else if ("cut" == action) { cutToClipboard(); - removeObject(model, mUUID); + //removeObject(model, mUUID); return; } else if ("copy" == action) @@ -3192,20 +3238,53 @@ void LLFolderBridge::updateHierarchyCreationDate(time_t date) void LLFolderBridge::pasteFromClipboard() { LLInventoryModel* model = getInventoryModel(); - if(model && isClipboardPasteable()) + if (model && isClipboardPasteable()) { - 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 paste_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); + + if (paste_into_marketplacelistings && !LLMarketplaceData::instance().isListed(mUUID) && LLMarketplaceData::instance().isInActiveFolder(mUUID)) + { + // Prompt the user if pasting in marketplace active version listing (note that pasting right in the listing folder doesn't need a prompt) + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_pasteFromClipboard, this, _1, _2)); + } + else + { + // Otherwise just do the paste + perform_pasteFromClipboard(); + } + } +} +// Callback for pasteFromClipboard if DAMA required... +void LLFolderBridge::callback_pasteFromClipboard(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + perform_pasteFromClipboard(); + } +} + +void LLFolderBridge::perform_pasteFromClipboard() +{ + LLInventoryModel* model = getInventoryModel(); + if (model && isClipboardPasteable()) + { + + + 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); - - std::vector objects; + + std::vector objects; LLClipboard::instance().pasteFromClipboard(objects); - + if (move_is_into_outbox || move_is_into_marketplacelistings) { std::string error_msg; @@ -3234,15 +3313,15 @@ void LLFolderBridge::pasteFromClipboard() return; } } - + const LLUUID parent_id(mUUID); - + for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) { const LLUUID& item_id = (*iter); - + LLInventoryItem *item = model->getItem(item_id); LLInventoryObject *obj = model->getObject(item_id); if (obj) @@ -3338,12 +3417,12 @@ void LLFolderBridge::pasteFromClipboard() else { copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - parent_id, - std::string(), - LLPointer(NULL)); + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + parent_id, + std::string(), + LLPointer(NULL)); } } } -- cgit v1.2.3 From 252ad06b7bcc33a48b6c23917f6156a436df4b00 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 4 Jun 2014 09:58:11 -0700 Subject: DD-84 : Final clean up for this fix --- indra/newview/llinventorybridge.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b471b0ca15..0f62c8555d 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -273,12 +273,12 @@ BOOL LLInvFVBridge::cutToClipboard() if (cut_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID)) { - // Prompt the user if cutting from marketplace active listing + // Prompt the user if cutting from a marketplace active listing LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLInvFVBridge::callback_cutToClipboard, this, _1, _2)); } else { - // Otherwise just do the cut + // Otherwise just perform the cut return perform_cutToClipboard(); } } @@ -302,11 +302,9 @@ BOOL LLInvFVBridge::perform_cutToClipboard() if (obj && isItemMovable() && isItemRemovable()) { LLClipboard::instance().setCutMode(true); - if (LLClipboard::instance().addToClipboard(mUUID)) - { - removeObject(&gInventory, mUUID); - return TRUE; - } + BOOL added_to_clipboard = LLClipboard::instance().addToClipboard(mUUID); + removeObject(&gInventory, mUUID); // Always perform the remove even if the object couldn't make it to the clipboard + return added_to_clipboard; } return FALSE; } @@ -1517,7 +1515,6 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) else if ("cut" == action) { cutToClipboard(); - //removeObject(model, mUUID); return; } else if ("copy" == action) @@ -2937,7 +2934,6 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) else if ("cut" == action) { cutToClipboard(); - //removeObject(model, mUUID); return; } else if ("copy" == action) @@ -3245,7 +3241,7 @@ void LLFolderBridge::pasteFromClipboard() if (paste_into_marketplacelistings && !LLMarketplaceData::instance().isListed(mUUID) && LLMarketplaceData::instance().isInActiveFolder(mUUID)) { - // Prompt the user if pasting in marketplace active version listing (note that pasting right in the listing folder doesn't need a prompt) + // Prompt the user if pasting in a marketplace active version listing (note that pasting right under the listing folder root doesn't need a prompt) LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_pasteFromClipboard, this, _1, _2)); } else @@ -3271,8 +3267,6 @@ void LLFolderBridge::perform_pasteFromClipboard() LLInventoryModel* model = getInventoryModel(); if (model && isClipboardPasteable()) { - - 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); -- cgit v1.2.3 From 7911e32d4bd9f86bdde5771dcaa14203befa5f7d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 5 Jun 2014 18:02:28 -0700 Subject: DD-114, DD-115, DD-116: Fixed counts on folder, folder depth and items on operations on marketplace listings --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0f62c8555d..c50f3f8041 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3290,11 +3290,11 @@ void LLFolderBridge::perform_pasteFromClipboard() LLInventoryItem *item = model->getItem(item_id); LLInventoryCategory *cat = model->getCategory(item_id); - if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg)) + if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg, objects.size())) { break; } - if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg)) + if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg, objects.size())) { break; } -- cgit v1.2.3 From 824c21ef6e092464d1a6c7a46625adc53499bc5b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 9 Jun 2014 14:10:01 -0700 Subject: DD-107, DD-111 : Fixed! Do not allow active listing and version folders to be moved or cut or deleted (must unlist first). --- indra/newview/llinventorybridge.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c50f3f8041..cd5da96e24 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2435,6 +2435,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // One cannot move a folder into a stock folder is_movable = (getPreferredType() != LLFolderType::FT_MARKETPLACE_STOCK); } + + if (is_movable && move_is_from_marketplacelistings) + { + // If the incoming folder is listed and active (and is therefore either the listing or the version folder), then moving is *not* allowed + is_movable = !LLMarketplaceData::instance().getActivationState(cat_id); + } + if (is_movable && (move_is_into_outbox || move_is_into_marketplacelistings)) { const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); -- cgit v1.2.3 From ae2f24d0c10a9a91090aa040f8367e8691fcbbd1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 10 Jun 2014 14:04:53 -0700 Subject: DD : Clean up marketplace listings folder creation so we create it in only one place --- indra/newview/llinventorybridge.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index cd5da96e24..84cf62f910 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -319,11 +319,9 @@ BOOL LLInvFVBridge::copyToClipboard() const return FALSE; } -// *TODO: make sure this does the right thing void LLInvFVBridge::showProperties() { - LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, true); - if (gInventory.isObjectDescendentOf(mUUID, marketplacelistings_id)) + if (isMarketplaceListingsFolder()) { LLFloaterReg::showInstance("item_properties", LLSD().with("id",mUUID)); } @@ -331,11 +329,6 @@ void LLInvFVBridge::showProperties() { show_item_profile(mUUID); } - - // Disable old properties floater; this is replaced by the sidepanel. - /* - LLFloaterReg::showInstance("properties", mUUID); - */ } void LLInvFVBridge::removeBatch(std::vector& batch) -- cgit v1.2.3 From dfe8416ca6fcdcb8863cd838fd6eb2ef42ef9c0f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 10 Jun 2014 20:58:59 -0700 Subject: DD-107, DD-111 : Add a tooltip to indicate why you can't move an active listing --- indra/newview/llinventorybridge.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 84cf62f910..5e9079775a 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2354,6 +2354,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, BOOL is_movable = TRUE; + if (is_movable && move_is_from_marketplacelistings && LLMarketplaceData::instance().getActivationState(cat_id)) + { + // If the incoming folder is listed and active (and is therefore either the listing or the version folder), + // then moving is *not* allowed + is_movable = FALSE; + tooltip_msg = LLTrans::getString("TooltipOutboxDragActive"); + } if (is_movable && (mUUID == cat_id)) { is_movable = FALSE; @@ -2429,12 +2436,6 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, is_movable = (getPreferredType() != LLFolderType::FT_MARKETPLACE_STOCK); } - if (is_movable && move_is_from_marketplacelistings) - { - // If the incoming folder is listed and active (and is therefore either the listing or the version folder), then moving is *not* allowed - is_movable = !LLMarketplaceData::instance().getActivationState(cat_id); - } - if (is_movable && (move_is_into_outbox || move_is_into_marketplacelistings)) { const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); -- cgit v1.2.3 From 40e847d6f1d42ac7a97396de31b362a788638959 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 11 Jun 2014 15:15:02 -0700 Subject: DD-126 : Ask for confirmation when moving a version folder in a way that will deactivate it --- indra/newview/llinventorybridge.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5e9079775a..ce8f5a76ce 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2487,21 +2487,32 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // Dropping in or out of marketplace needs (sometimes) confirmation if (user_confirm && (move_is_from_marketplacelistings || move_is_into_marketplacelistings)) { - if ((move_is_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(cat_id)) || - (move_is_into_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID))) + if (move_is_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(cat_id)) { - if (move_is_from_marketplacelistings && (LLMarketplaceData::instance().isListed(cat_id) || LLMarketplaceData::instance().isVersionFolder(cat_id))) + if (LLMarketplaceData::instance().isListed(cat_id) || LLMarketplaceData::instance().isVersionFolder(cat_id)) { // Move the active version folder or listing folder itself outside marketplace listings will unlist the listing so ask that question specifically LLNotificationsUtil::add("ConfirmMerchantUnlist", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); } else { - // Any other case will simply modify but not unlist a listing + // Any other case will simply modify but not unlist an active listed listing LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); } return true; } + if (move_is_from_marketplacelistings && LLMarketplaceData::instance().isVersionFolder(cat_id)) + { + // Moving the version folder from its location will deactivate it. Ask confirmation. + LLNotificationsUtil::add("ConfirmMerchantClearVersion", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + return true; + } + if (move_is_into_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID)) + { + // Moving something in an active listed listing will modify it. Ask confirmation. + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + return true; + } } // Look for any gestures and deactivate them if (move_is_into_trash) -- cgit v1.2.3 From 51e4ad0ed0ba07328ec8415742a3f5c60afc7244 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 26 Jul 2014 14:44:04 -0700 Subject: DD-101 : Do not list or associate listings that do not validate. Present user with relevant error when that happens. --- indra/newview/llinventorybridge.cpp | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ba5374e437..5c5ad1fa30 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2975,7 +2975,15 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_list" == action) { - if (depth_nesting_in_marketplace(mUUID) == 1) + LLViewerInventoryCategory* cat = gInventory.getCategory(mUUID); + mMessage = ""; + if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2))) + { + LLSD subs; + subs["[ERROR_CODE]"] = mMessage; + LLNotificationsUtil::add("MerchantListingFailed", subs); + } + else if (depth_nesting_in_marketplace(mUUID) == 1) { LLMarketplaceData::instance().activateListing(mUUID,true); } @@ -3025,7 +3033,18 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_associate_listing" == action) { - LLFloaterAssociateListing::show(mUUID); + LLViewerInventoryCategory* cat = gInventory.getCategory(mUUID); + mMessage = ""; + if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2))) + { + LLSD subs; + subs["[ERROR_CODE]"] = mMessage; + LLNotificationsUtil::add("MerchantListingFailed", subs); + } + else + { + LLFloaterAssociateListing::show(mUUID); + } return; } else if ("marketplace_edit_listing" == action) @@ -3055,6 +3074,18 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } } +void LLFolderBridge::gatherMessage(std::string& message, LLError::ELevel log_level) +{ + if (log_level >= LLError::LEVEL_ERROR) + { + if (!mMessage.empty()) + { + mMessage += "\n"; + } + mMessage += message; + } +} + void LLFolderBridge::openItem() { LL_DEBUGS() << "LLFolderBridge::openItem()" << LL_ENDL; -- cgit v1.2.3 From 4ad7647e83ed744c74507b97fdb3d10728d83057 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 2 Aug 2014 14:58:26 -0700 Subject: DD-161 : Make marketplace listings root folder not movable and add a special tooltip to that effect --- indra/newview/llinventorybridge.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5c5ad1fa30..0b6fe3dfbc 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2354,6 +2354,11 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, BOOL is_movable = TRUE; + if (is_movable && (marketplacelistings_id == cat_id)) + { + is_movable = FALSE; + tooltip_msg = LLTrans::getString("TooltipOutboxCannotMoveRoot"); + } if (is_movable && move_is_from_marketplacelistings && LLMarketplaceData::instance().getActivationState(cat_id)) { // If the incoming folder is listed and active (and is therefore either the listing or the version folder), -- cgit v1.2.3 From 349497ce56e6338a18e515c30c1af5aca84c448d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 14 Aug 2014 21:39:36 -0700 Subject: DD-118 : Disable Edit Listing menu option if no version folder on a listing --- indra/newview/llinventorybridge.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0b6fe3dfbc..3635a87881 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -941,7 +941,8 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, // Options available at all levels on items and categories items.push_back(std::string("Marketplace Edit Listing")); LLUUID listing_folder_id = nested_parent_id(mUUID,depth); - if (!LLMarketplaceData::instance().isListed(listing_folder_id)) + LLUUID version_folder_id = LLMarketplaceData::instance().getVersionFolder(listing_folder_id); + if (!LLMarketplaceData::instance().isListed(listing_folder_id) || version_folder_id.isNull()) { disabled_items.push_back(std::string("Marketplace Edit Listing")); } -- cgit v1.2.3 From 9e7caa2e1439eb75df30c0c03aab782c414b44bd Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 17 Aug 2014 22:53:13 -0700 Subject: DD-112 : Disable New Folder, Cut and Delete on the Marketplace Listings folder --- indra/newview/llinventorybridge.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3635a87881..ad462648c1 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3551,9 +3551,10 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items LLInventoryModel* model = getInventoryModel(); llassert(model != NULL); - const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); - const LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - const LLUUID favorites = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + const LLUUID &lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); + const LLUUID &favorites = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + const LLUUID &marketplace_listings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); if (lost_and_found_id == mUUID) { @@ -3574,6 +3575,12 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + } + if (marketplace_listings_id == mUUID) + { + disabled_items.push_back(std::string("New Folder")); + disabled_items.push_back(std::string("Cut")); + disabled_items.push_back(std::string("Delete")); } if(trash_id == mUUID) { @@ -3669,7 +3676,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } // Add menu items that are dependent on the contents of the folder. LLViewerInventoryCategory* category = (LLViewerInventoryCategory *) model->getCategory(mUUID); - if (category) + if (category && (marketplace_listings_id != mUUID)) { uuid_vec_t folders; folders.push_back(category->getUUID()); -- cgit v1.2.3 From 51e8b7fae6ff14c58bf32ef740a60386bc15baee Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 19 Aug 2014 22:34:06 -0700 Subject: DD-129 : Prevent DAMA when dropping under the root of a listing, even active. Finer granularity of DAMA for all drop and cut and paste cases. --- indra/newview/llinventorybridge.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ad462648c1..51d1f088e0 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -271,7 +271,8 @@ BOOL LLInvFVBridge::cutToClipboard() const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); const BOOL cut_from_marketplacelistings = gInventory.isObjectDescendentOf(mUUID, marketplacelistings_id); - if (cut_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID)) + if (cut_from_marketplacelistings && (LLMarketplaceData::instance().isInActiveFolder(mUUID) || + LLMarketplaceData::instance().isListedAndActive(mUUID))) { // Prompt the user if cutting from a marketplace active listing LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLInvFVBridge::callback_cutToClipboard, this, _1, _2)); @@ -2493,7 +2494,8 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // Dropping in or out of marketplace needs (sometimes) confirmation if (user_confirm && (move_is_from_marketplacelistings || move_is_into_marketplacelistings)) { - if (move_is_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(cat_id)) + if (move_is_from_marketplacelistings && (LLMarketplaceData::instance().isInActiveFolder(cat_id) || + LLMarketplaceData::instance().isListedAndActive(cat_id))) { if (LLMarketplaceData::instance().isListed(cat_id) || LLMarketplaceData::instance().isVersionFolder(cat_id)) { @@ -4283,7 +4285,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Dropping in or out of marketplace needs (sometimes) confirmation if (user_confirm && (move_is_from_marketplacelistings || move_is_into_marketplacelistings)) { - if ((move_is_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(inv_item->getUUID())) || + if ((move_is_from_marketplacelistings && (LLMarketplaceData::instance().isInActiveFolder(inv_item->getUUID()) + || LLMarketplaceData::instance().isListedAndActive(inv_item->getUUID()))) || (move_is_into_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID))) { LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropItemIntoFolder, this, _1, _2, inv_item)); -- cgit v1.2.3 From 6ab1e773d55b9dbe4a0af161ac194536a5892904 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 22 Aug 2014 00:18:00 -0700 Subject: DD-122 : WIP : Raise error when trying to list something that is empty or has empty stock folders. --- indra/newview/llinventorybridge.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 51d1f088e0..60474dd125 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2983,17 +2983,21 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_list" == action) { - LLViewerInventoryCategory* cat = gInventory.getCategory(mUUID); - mMessage = ""; - if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2))) - { - LLSD subs; - subs["[ERROR_CODE]"] = mMessage; - LLNotificationsUtil::add("MerchantListingFailed", subs); - } - else if (depth_nesting_in_marketplace(mUUID) == 1) + if (depth_nesting_in_marketplace(mUUID) == 1) { - LLMarketplaceData::instance().activateListing(mUUID,true); + LLUUID version_folder_id = LLMarketplaceData::instance().getVersionFolder(mUUID); + LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id); + mMessage = ""; + if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2))) + { + LLSD subs; + subs["[ERROR_CODE]"] = mMessage; + LLNotificationsUtil::add("MerchantListingFailed", subs); + } + else + { + LLMarketplaceData::instance().activateListing(mUUID,true); + } } return; } @@ -3090,7 +3094,10 @@ void LLFolderBridge::gatherMessage(std::string& message, LLError::ELevel log_lev { mMessage += "\n"; } - mMessage += message; + // Take the leading spaces out... + std::string::size_type start = message.find_first_not_of(" "); + // Append the message + mMessage += message.substr(start, message.length() - start); } } -- cgit v1.2.3 From c77575df2f91452ad1a527f2f46ba1191459b259 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 23 Aug 2014 17:31:33 -0700 Subject: DD-122 : Fixed. Unlist if listing doesn't validate after move --- indra/newview/llinventorybridge.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 60474dd125..d6ad9b50a4 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2568,6 +2568,17 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } if (move_is_from_marketplacelistings) { + // If we move from an active (listed) listing, checks that it's still valid, if not, unlist + LLUUID version_folder_id = LLMarketplaceData::instance().getActiveFolder(from_folder_uuid); + if (version_folder_id.notNull()) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id); + if (!validate_marketplacelistings(cat,NULL)) + { + LLMarketplaceData::instance().activateListing(version_folder_id,false); + } + } + // Update the listing we moved from anyway update_marketplace_category(from_folder_uuid); // Clear the folder from the marketplace in case it is a listing folder if (LLMarketplaceData::instance().isListed(cat_id)) @@ -4368,6 +4379,17 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (move_is_from_marketplacelistings) { + // If we move from an active (listed) listing, checks that it's still valid, if not, unlist + LLUUID version_folder_id = LLMarketplaceData::instance().getActiveFolder(from_folder_uuid); + if (version_folder_id.notNull()) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id); + if (!validate_marketplacelistings(cat,NULL)) + { + LLMarketplaceData::instance().activateListing(version_folder_id,false); + } + } + // Update the listing we moved from anyway update_marketplace_category(from_folder_uuid); } -- cgit v1.2.3 From 85ec32c05e3474e55db142489f91e978df319951 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 25 Aug 2014 10:02:13 -0700 Subject: DD-105 : WIP : Adding (updating...) suffix when SLM transaction in progress --- indra/newview/llinventorybridge.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d6ad9b50a4..f6a851e55f 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2087,6 +2087,11 @@ std::string LLFolderBridge::getLabelSuffix() const 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 -- cgit v1.2.3 From c8f6b28c2266caf28787775040be7588f7591e9f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 25 Aug 2014 13:16:38 -0700 Subject: DD-105 : Disable SLM right click menu options when listing is updating --- indra/newview/llinventorybridge.cpp | 73 ++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 26 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f6a851e55f..8316791695 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -881,39 +881,51 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, items.push_back(std::string("Marketplace Disassociate Listing")); items.push_back(std::string("Marketplace List")); items.push_back(std::string("Marketplace Unlist")); - if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) - { - items.push_back(std::string("Marketplace Get Listing")); + if (LLMarketplaceData::instance().isUpdating(mUUID)) + { + // During SLM update, disable all marketplace related options + disabled_items.push_back(std::string("Marketplace Create Listing")); + disabled_items.push_back(std::string("Marketplace Associate Listing")); + disabled_items.push_back(std::string("Marketplace Disassociate Listing")); + disabled_items.push_back(std::string("Marketplace List")); + disabled_items.push_back(std::string("Marketplace Unlist")); } - if (LLMarketplaceData::instance().isListed(mUUID)) + else { - disabled_items.push_back(std::string("Marketplace Create Listing")); - disabled_items.push_back(std::string("Marketplace Associate Listing")); - if (LLMarketplaceData::instance().getVersionFolder(mUUID).isNull()) + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) { - disabled_items.push_back(std::string("Marketplace List")); - disabled_items.push_back(std::string("Marketplace Unlist")); + items.push_back(std::string("Marketplace Get Listing")); } - else + if (LLMarketplaceData::instance().isListed(mUUID)) { - if (LLMarketplaceData::instance().getActivationState(mUUID)) + disabled_items.push_back(std::string("Marketplace Create Listing")); + disabled_items.push_back(std::string("Marketplace Associate Listing")); + if (LLMarketplaceData::instance().getVersionFolder(mUUID).isNull()) { disabled_items.push_back(std::string("Marketplace List")); + disabled_items.push_back(std::string("Marketplace Unlist")); } else { - disabled_items.push_back(std::string("Marketplace Unlist")); + if (LLMarketplaceData::instance().getActivationState(mUUID)) + { + disabled_items.push_back(std::string("Marketplace List")); + } + else + { + disabled_items.push_back(std::string("Marketplace Unlist")); + } } } - } - else - { - disabled_items.push_back(std::string("Marketplace Disassociate Listing")); - disabled_items.push_back(std::string("Marketplace List")); - disabled_items.push_back(std::string("Marketplace Unlist")); - if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + else { - disabled_items.push_back(std::string("Marketplace Get Listing")); + disabled_items.push_back(std::string("Marketplace Disassociate Listing")); + disabled_items.push_back(std::string("Marketplace List")); + disabled_items.push_back(std::string("Marketplace Unlist")); + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + disabled_items.push_back(std::string("Marketplace Get Listing")); + } } } } @@ -925,17 +937,26 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, { items.push_back(std::string("Marketplace Activate")); items.push_back(std::string("Marketplace Deactivate")); - if (LLMarketplaceData::instance().isVersionFolder(mUUID)) + if (LLMarketplaceData::instance().isUpdating(mUUID)) { + // During SLM update, disable all marketplace related options disabled_items.push_back(std::string("Marketplace Activate")); - if (LLMarketplaceData::instance().getActivationState(mUUID)) - { - disabled_items.push_back(std::string("Marketplace Deactivate")); - } + disabled_items.push_back(std::string("Marketplace Deactivate")); } else { - disabled_items.push_back(std::string("Marketplace Deactivate")); + if (LLMarketplaceData::instance().isVersionFolder(mUUID)) + { + disabled_items.push_back(std::string("Marketplace Activate")); + if (LLMarketplaceData::instance().getActivationState(mUUID)) + { + disabled_items.push_back(std::string("Marketplace Deactivate")); + } + } + else + { + disabled_items.push_back(std::string("Marketplace Deactivate")); + } } } } -- cgit v1.2.3 From 884fb1de2d3c05612d5b8256637ddf7cba24e94b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 30 Aug 2014 08:23:08 -0700 Subject: DD-183 : overloaded the buildContextMenu() method for Notecards so that we get the right menu in marketplace --- indra/newview/llinventorybridge.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 8316791695..4df815204b 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5286,6 +5286,25 @@ void LLNotecardBridge::openItem() } } +void LLNotecardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + LL_DEBUGS() << "LLNotecardBridge::buildContextMenu()" << LL_ENDL; + + if (isMarketplaceListingsFolder()) + { + menuentry_vec_t items; + menuentry_vec_t disabled_items; + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + hide_context_entries(menu, items, disabled_items); + } + else + { + LLItemBridge::buildContextMenu(menu, flags); + } +} + // +=================================================+ // | LLGestureBridge | // +=================================================+ -- cgit v1.2.3 From 3188285cb1748b8832c0488923f0e7c79da564e0 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 31 Aug 2014 22:33:43 -0700 Subject: DD-105 : Disable a couple of other right click menu items while updating marketplace --- indra/newview/llinventorybridge.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4df815204b..76cd300181 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3621,6 +3621,15 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items if (isMarketplaceListingsFolder()) { addMarketplaceContextMenuOptions(flags, items, disabled_items); + if (LLMarketplaceData::instance().isUpdating(mUUID)) + { + disabled_items.push_back(std::string("New Folder")); + disabled_items.push_back(std::string("Rename")); + disabled_items.push_back(std::string("Cut")); + disabled_items.push_back(std::string("Copy")); + disabled_items.push_back(std::string("Paste")); + disabled_items.push_back(std::string("Delete")); + } } if (marketplace_listings_id == mUUID) { -- cgit v1.2.3 From a13b266a8ba50d8f7e482d84fc59f79421dba036 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 1 Sep 2014 13:02:20 -0700 Subject: DD-184 : Make sure the Properties panel shows up for items in active listed listings --- indra/newview/llinventorybridge.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 76cd300181..0692d425fc 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -324,7 +324,13 @@ void LLInvFVBridge::showProperties() { if (isMarketplaceListingsFolder()) { - LLFloaterReg::showInstance("item_properties", LLSD().with("id",mUUID)); + LLFloaterReg::showInstance("item_properties", LLSD().with("id",mUUID),TRUE); + // Force it to show on top as this floater has a tendency to hide when confirmation dialog shows up + LLFloater* floater_properties = LLFloaterReg::findInstance("item_properties", LLSD().with("id",mUUID)); + if (floater_properties) + { + floater_properties->setVisibleAndFrontmost(); + } } else { -- cgit v1.2.3 From c4577856ed913ba7070a6bd1ad8e91c454e7bd6c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 8 Sep 2014 22:09:44 -0700 Subject: DD-104 : Use default folder icons for stock folders outside of the marketplace root --- indra/newview/llinventorybridge.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0692d425fc..75883ac002 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3211,36 +3211,36 @@ LLFolderType::EType LLFolderBridge::getPreferredType() const // Icons for folders are based on the preferred type LLUIImagePtr LLFolderBridge::getIcon() const { - LLFolderType::EType preferred_type = LLFolderType::FT_NONE; - LLViewerInventoryCategory* cat = getCategory(); - 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); + return getFolderIcon(FALSE); } -// static -LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type) +LLUIImagePtr LLFolderBridge::getIconOpen() const { - return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, FALSE)); + return getFolderIcon(TRUE); } -LLUIImagePtr LLFolderBridge::getIconOpen() const +LLUIImagePtr LLFolderBridge::getFolderIcon(BOOL is_open) const { LLFolderType::EType preferred_type = getPreferredType(); - if ((preferred_type == LLFolderType::FT_NONE) && (depth_nesting_in_marketplace(mUUID) == 2)) + 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, TRUE)); + else if ((preferred_type == LLFolderType::FT_MARKETPLACE_STOCK) && (depth == -1)) + { + // We override the type when a stock folder is outside of the marketplace listings root + // as we don't want to export that notion outside of marketplace + preferred_type = LLFolderType::FT_NONE; + } + return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, is_open)); +} +// static : use by LLLinkFolderBridge to get the closed type icons +LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type) +{ + return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, FALSE)); } LLUIImagePtr LLFolderBridge::getIconOverlay() const -- cgit v1.2.3 From 4f467d6e1a96d8323eaafb8bac3192cffef4635c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 9 Sep 2014 19:02:28 -0700 Subject: DD-106 : Suppress validation of target folder when associating since we unlist before hand --- indra/newview/llinventorybridge.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 75883ac002..47afd6e78c 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3088,18 +3088,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_associate_listing" == action) { - LLViewerInventoryCategory* cat = gInventory.getCategory(mUUID); - mMessage = ""; - if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2))) - { - LLSD subs; - subs["[ERROR_CODE]"] = mMessage; - LLNotificationsUtil::add("MerchantListingFailed", subs); - } - else - { - LLFloaterAssociateListing::show(mUUID); - } + LLFloaterAssociateListing::show(mUUID); return; } else if ("marketplace_edit_listing" == action) -- cgit v1.2.3 From 60ae15eb8c934115f2353c02a5de26cd0d296ee6 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 14 Sep 2014 21:20:57 -0700 Subject: DD-175 : Prevent Marketplace Listings folder to be renamable --- indra/newview/llinventorybridge.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 47afd6e78c..e691ad34d1 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3629,6 +3629,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items if (marketplace_listings_id == mUUID) { disabled_items.push_back(std::string("New Folder")); + disabled_items.push_back(std::string("Rename")); disabled_items.push_back(std::string("Cut")); disabled_items.push_back(std::string("Delete")); } -- cgit v1.2.3 From 31d5383417000738a29c8f664124e140b1afce5d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 4 Oct 2014 22:15:53 -0700 Subject: DD-213 : Differentiate pasting from moving when verifying if action is legit. Also takes into account moving within the same version folder when moving items --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e77326dbf4..fa49f23364 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3419,11 +3419,11 @@ void LLFolderBridge::perform_pasteFromClipboard() LLInventoryItem *item = model->getItem(item_id); LLInventoryCategory *cat = model->getCategory(item_id); - if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg, objects.size())) + if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg, objects.size(), true)) { break; } - if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg, objects.size())) + if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg, objects.size(), true, true)) { break; } -- cgit v1.2.3 From 69baff7415bf97819134bcf4da948880ac714f91 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 8 Nov 2014 15:09:48 -0800 Subject: DD-259 : Show only one error when failing on listing, user can see all errors in Check for Errors --- indra/newview/llinventorybridge.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index fa49f23364..ec29ec5896 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3159,7 +3159,10 @@ void LLFolderBridge::gatherMessage(std::string& message, LLError::ELevel log_lev { if (!mMessage.empty()) { - mMessage += "\n"; + // Currently, we do not gather all messages as it creates very long alerts + // Users can get to the whole list of errors on a listing using the "Check for Errors" audit button + //mMessage += "\n"; + return; } // Take the leading spaces out... std::string::size_type start = message.find_first_not_of(" "); -- cgit v1.2.3 From 171b60d0685d0e70ac02d3a1833d4bafbcbbe874 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 18 Nov 2014 15:46:21 -0800 Subject: DD-284 : Do not allow the creation of subfolders in stock folders --- indra/newview/llinventorybridge.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ec29ec5896..ec2fa887e0 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3676,6 +3676,10 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Paste")); disabled_items.push_back(std::string("Delete")); } + else if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + disabled_items.push_back(std::string("New Folder")); + } } if (marketplace_listings_id == mUUID) { -- cgit v1.2.3 From 9fb9b087ff5ec8ca981bfd1c8e94d114d4068b58 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 9 Dec 2014 21:59:08 -0800 Subject: DD-286 : WIP : Make stock folders visible in the inventory and behaving like stock folders everywhere --- indra/newview/llinventorybridge.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ec2fa887e0..ae3e7c3db0 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2431,6 +2431,12 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, is_movable = FALSE; // tooltip? } + if (is_movable && (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK)) + { + // One cannot move a folder into a stock folder + is_movable = FALSE; + // tooltip? + } LLInventoryModel::cat_array_t descendent_categories; LLInventoryModel::item_array_t descendent_items; @@ -2498,11 +2504,6 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } - if (is_movable && move_is_into_marketplacelistings) - { - // One cannot move a folder into a stock folder - is_movable = (getPreferredType() != LLFolderType::FT_MARKETPLACE_STOCK); - } if (is_movable && (move_is_into_outbox || move_is_into_marketplacelistings)) { @@ -3254,12 +3255,6 @@ LLUIImagePtr LLFolderBridge::getFolderIcon(BOOL is_open) const { // We override the type when in the marketplace listings folder and only for version folder preferred_type = LLFolderType::FT_MARKETPLACE_VERSION; - } - else if ((preferred_type == LLFolderType::FT_MARKETPLACE_STOCK) && (depth == -1)) - { - // We override the type when a stock folder is outside of the marketplace listings root - // as we don't want to export that notion outside of marketplace - preferred_type = LLFolderType::FT_NONE; } return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, is_open)); } @@ -3676,10 +3671,10 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Paste")); disabled_items.push_back(std::string("Delete")); } - else if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) - { - disabled_items.push_back(std::string("New Folder")); - } + } + if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + disabled_items.push_back(std::string("New Folder")); } if (marketplace_listings_id == mUUID) { @@ -4370,7 +4365,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, accept = TRUE; - if (!is_movable) + if (!is_movable) { accept = FALSE; } @@ -4393,6 +4388,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, accept = can_move_item_to_marketplace(master_folder, dest_folder, inv_item, tooltip_msg, LLToolDragAndDrop::instance().getCargoCount()); } + // Check that the folder can accept this item based on folder/item type compatibility (e.g. stock folder compatibility) + if (accept) + { + LLViewerInventoryCategory * dest_folder = getCategory(); + accept = dest_folder->acceptItem(inv_item); + } + LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); // Check whether the item being dragged from active inventory panel -- cgit v1.2.3 From d0d5a6a15cf3c573c89ce590030c7a150b19dd05 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 18 Dec 2014 22:16:44 -0800 Subject: DD-286 : Made stock folders in inventory do checking on paste and drop. Also prevent creation of items in stock folders --- indra/newview/llinventorybridge.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ae3e7c3db0..9c0c30c167 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3406,11 +3406,11 @@ void LLFolderBridge::perform_pasteFromClipboard() std::vector objects; LLClipboard::instance().pasteFromClipboard(objects); + LLViewerInventoryCategory * dest_folder = getCategory(); if (move_is_into_outbox || move_is_into_marketplacelistings) { std::string error_msg; const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); - LLViewerInventoryCategory * dest_folder = getCategory(); for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) { const LLUUID& item_id = (*iter); @@ -3434,6 +3434,25 @@ void LLFolderBridge::perform_pasteFromClipboard() return; } } + else + { + // Check that all items can be moved into that folder : for the moment, only stock folder mismatch is checked + for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) + { + const LLUUID& item_id = (*iter); + LLInventoryItem *item = model->getItem(item_id); + LLInventoryCategory *cat = model->getCategory(item_id); + + if ((item && !dest_folder->acceptItem(item)) || (cat && (dest_folder->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK))) + { + std::string error_msg = LLTrans::getString("TooltipOutboxMixedStock"); + LLSD subs; + subs["[ERROR_CODE]"] = error_msg; + LLNotificationsUtil::add("StockPasteFailed", subs); + return; + } + } + } const LLUUID parent_id(mUUID); @@ -3675,6 +3694,11 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) { disabled_items.push_back(std::string("New Folder")); + disabled_items.push_back(std::string("New Script")); + disabled_items.push_back(std::string("New Note")); + disabled_items.push_back(std::string("New Gesture")); + disabled_items.push_back(std::string("New Clothes")); + disabled_items.push_back(std::string("New Body Parts")); } if (marketplace_listings_id == mUUID) { -- cgit v1.2.3 From e8ea398e123be29227275e8ca5b1d2d0ce7f1e4f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 22 Dec 2014 16:33:47 -0800 Subject: DD-282 : Suppress Unassociate menu item. Confirm when cutting, deleting or moving a listing --- indra/newview/llinventorybridge.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 62612c1450..1f1017d78e 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -887,7 +887,6 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, // Options available at the Listing Folder level items.push_back(std::string("Marketplace Create Listing")); items.push_back(std::string("Marketplace Associate Listing")); - items.push_back(std::string("Marketplace Disassociate Listing")); items.push_back(std::string("Marketplace List")); items.push_back(std::string("Marketplace Unlist")); if (LLMarketplaceData::instance().isUpdating(mUUID)) @@ -895,7 +894,6 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, // During SLM update, disable all marketplace related options disabled_items.push_back(std::string("Marketplace Create Listing")); disabled_items.push_back(std::string("Marketplace Associate Listing")); - disabled_items.push_back(std::string("Marketplace Disassociate Listing")); disabled_items.push_back(std::string("Marketplace List")); disabled_items.push_back(std::string("Marketplace Unlist")); } @@ -928,7 +926,6 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, } else { - disabled_items.push_back(std::string("Marketplace Disassociate Listing")); disabled_items.push_back(std::string("Marketplace List")); disabled_items.push_back(std::string("Marketplace Unlist")); if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) @@ -2585,6 +2582,12 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); return true; } + if (move_is_from_marketplacelistings && LLMarketplaceData::instance().isListed(cat_id)) + { + // Moving a whole listing folder will result in archival of SLM data. Ask confirmation. + LLNotificationsUtil::add("ConfirmListingCutOrDelete", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + return true; + } } // Look for any gestures and deactivate them if (move_is_into_trash) -- cgit v1.2.3 From ddb9d0eeadd9d73a2719dbec2feb9c9226e2f00e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 26 Dec 2014 10:40:41 -0800 Subject: DD-296 : Added contextual menu items to copy and move to the marketplace. Hide copy to merchant outbox. Message when moving to the marketplace. --- indra/newview/llinventorybridge.cpp | 42 ++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1f1017d78e..4e3895ea9d 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -737,11 +737,19 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, { items.push_back(std::string("Marketplace Separator")); - items.push_back(std::string("Merchant Copy")); - if (!canListOnMarketplaceNow()) - { - disabled_items.push_back(std::string("Merchant Copy")); - } + if (gMenuHolder->getChild("MerchantOutbox")->getVisible()) + { + items.push_back(std::string("Merchant Copy")); + if (!canListOnMarketplaceNow()) + { + disabled_items.push_back(std::string("Merchant Copy")); + } + } + if (gMenuHolder->getChild("MarketplaceListings")->getVisible()) + { + items.push_back(std::string("Marketplace Copy")); + items.push_back(std::string("Marketplace Move")); + } } } } @@ -1577,6 +1585,13 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); copy_item_to_outbox(itemp, outbox_id, LLUUID::null, LLToolDragAndDrop::getOperationId()); } + else if (("move_to_marketplace_listings" == action) || ("copy_to_marketplace_listings" == action)) + { + LLInventoryItem* itemp = model->getItem(mUUID); + if (!itemp) return; + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + move_item_to_marketplacelistings(itemp, marketplacelistings_id, ("copy_to_marketplace_listings" == action)); + } else if ("copy_slurl" == action) { LLViewerInventoryItem* item = static_cast(getItem()); @@ -2588,6 +2603,11 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, LLNotificationsUtil::add("ConfirmListingCutOrDelete", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); return true; } + if (move_is_into_marketplacelistings && !move_is_from_marketplacelistings) + { + LLNotificationsUtil::add("ConfirmMerchantMoveInventory", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + return true; + } } // Look for any gestures and deactivate them if (move_is_into_trash) @@ -3158,6 +3178,13 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); copy_folder_to_outbox(cat, outbox_id, cat->getUUID(), LLToolDragAndDrop::getOperationId()); } + else if (("move_to_marketplace_listings" == action) || ("copy_to_marketplace_listings" == action)) + { + LLInventoryCategory * cat = gInventory.getCategory(mUUID); + if (!cat) return; + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + move_folder_to_marketplacelistings(cat, marketplacelistings_id, ("copy_to_marketplace_listings" == action)); + } } void LLFolderBridge::gatherMessage(std::string& message, LLError::ELevel log_level) @@ -4460,6 +4487,11 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropItemIntoFolder, this, _1, _2, inv_item)); return true; } + if (move_is_into_marketplacelistings && !move_is_from_marketplacelistings) + { + LLNotificationsUtil::add("ConfirmMerchantMoveInventory", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropItemIntoFolder, this, _1, _2, inv_item)); + return true; + } } //-------------------------------------------------------------------------------- -- cgit v1.2.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/newview/llinventorybridge.cpp | 170 +++++++++++++++++++++--------------- 1 file changed, 102 insertions(+), 68 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') 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) { -- cgit v1.2.3 From 95154a75b50c4113641842c1203210f54f038df5 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 10 Jan 2015 20:40:04 -0800 Subject: DD-305 : Do not call update_marketplace_category on the marketplace listings folder itself --- indra/newview/llinventorybridge.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 2dafbccd96..6b5b0df628 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2605,22 +2605,29 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } if (move_is_from_marketplacelistings) { - // If we move from an active (listed) listing, checks that it's still valid, if not, unlist - LLUUID version_folder_id = LLMarketplaceData::instance().getActiveFolder(from_folder_uuid); - if (version_folder_id.notNull()) + // If we are moving a folder at the listing folder level (i.e. its parent is the marketplace listings folder) + if (from_folder_uuid == marketplacelistings_id) { - LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id); - if (!validate_marketplacelistings(cat,NULL)) + // Clear the folder from the marketplace in case it is a listing folder + if (LLMarketplaceData::instance().isListed(cat_id)) { - LLMarketplaceData::instance().activateListing(version_folder_id,false); + LLMarketplaceData::instance().clearListing(cat_id); } } - // Update the listing we moved from anyway - update_marketplace_category(from_folder_uuid); - // Clear the folder from the marketplace in case it is a listing folder - if (LLMarketplaceData::instance().isListed(cat_id)) + else { - LLMarketplaceData::instance().clearListing(cat_id); + // If we move from within an active (listed) listing, checks that it's still valid, if not, unlist + LLUUID version_folder_id = LLMarketplaceData::instance().getActiveFolder(from_folder_uuid); + if (version_folder_id.notNull()) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id); + if (!validate_marketplacelistings(cat,NULL)) + { + LLMarketplaceData::instance().activateListing(version_folder_id,false); + } + } + // In all cases, update the listing we moved from so suffix are updated + update_marketplace_category(from_folder_uuid); } } } -- cgit v1.2.3 From 96172ddfe6325862c690b062592fa6cd4f4d5d6c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 24 Jan 2015 11:48:43 -0800 Subject: DD-306 : WIP : Add Check Listing to menu to audit listings individually --- indra/newview/llinventorybridge.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6b5b0df628..a157460ad5 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -895,6 +895,7 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, // Options available at the Listing Folder level items.push_back(std::string("Marketplace Create Listing")); items.push_back(std::string("Marketplace Associate Listing")); + items.push_back(std::string("Marketplace Check Listing")); items.push_back(std::string("Marketplace List")); items.push_back(std::string("Marketplace Unlist")); if (LLMarketplaceData::instance().isUpdating(mUUID)) @@ -3110,6 +3111,12 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) LLFloaterAssociateListing::show(mUUID); return; } + else if ("marketplace_check_listing" == action) + { + LLSD data(mUUID); + LLFloaterReg::showInstance("marketplace_validation", data); + return; + } else if ("marketplace_edit_listing" == action) { std::string url = LLMarketplaceData::instance().getListingURL(mUUID); -- cgit v1.2.3 From 6cf5912fd0339d09d9ac441d02c2dade824802ac Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 24 Jan 2015 16:50:56 -0800 Subject: DD-306 : Suppress no issue listings from audit listing dump, add no error message when no error, disable some right click menu items in multiselection cases --- indra/newview/llinventorybridge.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a157460ad5..c19ed57f2a 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -898,11 +898,13 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, items.push_back(std::string("Marketplace Check Listing")); items.push_back(std::string("Marketplace List")); items.push_back(std::string("Marketplace Unlist")); - if (LLMarketplaceData::instance().isUpdating(mUUID)) + if (LLMarketplaceData::instance().isUpdating(mUUID) || ((flags & FIRST_SELECTED_ITEM) == 0)) { // During SLM update, disable all marketplace related options + // Also disable all if multiple selected items disabled_items.push_back(std::string("Marketplace Create Listing")); disabled_items.push_back(std::string("Marketplace Associate Listing")); + disabled_items.push_back(std::string("Marketplace Check Listing")); disabled_items.push_back(std::string("Marketplace List")); disabled_items.push_back(std::string("Marketplace Unlist")); } @@ -952,9 +954,10 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, { items.push_back(std::string("Marketplace Activate")); items.push_back(std::string("Marketplace Deactivate")); - if (LLMarketplaceData::instance().isUpdating(mUUID)) + if (LLMarketplaceData::instance().isUpdating(mUUID) || ((flags & FIRST_SELECTED_ITEM) == 0)) { // During SLM update, disable all marketplace related options + // Also disable all if multiple selected items disabled_items.push_back(std::string("Marketplace Activate")); disabled_items.push_back(std::string("Marketplace Deactivate")); } @@ -3051,7 +3054,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) LLUUID version_folder_id = LLMarketplaceData::instance().getVersionFolder(mUUID); LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id); mMessage = ""; - if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2))) + if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2, _3))) { LLSD subs; subs["[ERROR_CODE]"] = mMessage; @@ -3151,14 +3154,14 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } } -void LLFolderBridge::gatherMessage(std::string& message, LLError::ELevel log_level) +void LLFolderBridge::gatherMessage(std::string& message, S32 depth, LLError::ELevel log_level) { if (log_level >= LLError::LEVEL_ERROR) { if (!mMessage.empty()) { // Currently, we do not gather all messages as it creates very long alerts - // Users can get to the whole list of errors on a listing using the "Check for Errors" audit button + // Users can get to the whole list of errors on a listing using the "Check for Errors" audit button or "Check listing" right click menu //mMessage += "\n"; return; } -- cgit v1.2.3 From 4fdaa7fc561e9e05751373160434a61151c2b75e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 25 Jan 2015 17:10:05 -0800 Subject: DD-296 : Disable move and copy to marketplace if limit passed. Improve perf of validate_marketplaceting(). Open marketplace floater on copy or move. String fix. --- indra/newview/llinventorybridge.cpp | 68 +++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 14 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c19ed57f2a..61889d3c5e 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -733,14 +733,14 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Cut")); } - if (canListOnMarketplace() && !isMarketplaceListingsFolder()) + if (canListOnMarketplace() && !isMarketplaceListingsFolder() && !isInboxFolder()) { items.push_back(std::string("Marketplace Separator")); if (gMenuHolder->getChild("MerchantOutbox")->getVisible()) { items.push_back(std::string("Merchant Copy")); - if (!canListOnMarketplaceNow()) + if (!canListOnOutboxNow()) { disabled_items.push_back(std::string("Merchant Copy")); } @@ -749,6 +749,11 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, { items.push_back(std::string("Marketplace Copy")); items.push_back(std::string("Marketplace Move")); + if (!canListOnMarketplaceNow()) + { + disabled_items.push_back(std::string("Marketplace Copy")); + disabled_items.push_back(std::string("Marketplace Move")); + } } } } @@ -1093,6 +1098,7 @@ BOOL LLInvFVBridge::isCOFFolder() const return LLAppearanceMgr::instance().getIsInCOF(mUUID); } +// *TODO : Suppress isInboxFolder() once Merchant Outbox is fully deprecated BOOL LLInvFVBridge::isInboxFolder() const { const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false); @@ -1380,7 +1386,7 @@ bool LLInvFVBridge::canListOnMarketplace() const { LLInventoryModel * model = getInventoryModel(); - const LLViewerInventoryCategory * cat = model->getCategory(mUUID); + LLViewerInventoryCategory * cat = model->getCategory(mUUID); if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType())) { return false; @@ -1391,16 +1397,6 @@ bool LLInvFVBridge::canListOnMarketplace() const return false; } - if (getOutboxFolder().isNull()) - { - return false; - } - - if (isInboxFolder() || isOutboxFolder()) - { - return false; - } - LLViewerInventoryItem * item = model->getItem(mUUID); if (item) { @@ -1418,7 +1414,8 @@ bool LLInvFVBridge::canListOnMarketplace() const return true; } -bool LLInvFVBridge::canListOnMarketplaceNow() const +// *TODO : Suppress canListOnOutboxNow() once we deprecate Merchant Outbox completely +bool LLInvFVBridge::canListOnOutboxNow() const { bool can_list = true; @@ -1467,6 +1464,49 @@ bool LLInvFVBridge::canListOnMarketplaceNow() const return can_list; } +bool LLInvFVBridge::canListOnMarketplaceNow() const +{ + bool can_list = true; + + const LLInventoryObject* obj = getInventoryObject(); + can_list &= (obj != NULL); + + if (can_list) + { + const LLUUID& object_id = obj->getLinkedUUID(); + can_list = object_id.notNull(); + + if (can_list) + { + LLFolderViewFolder * object_folderp = mInventoryPanel.get() ? mInventoryPanel.get()->getFolderByID(object_id) : NULL; + if (object_folderp) + { + can_list = !static_cast(object_folderp->getViewModelItem())->isLoading(); + } + } + + if (can_list) + { + std::string error_msg; + LLInventoryModel* model = getInventoryModel(); + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + LLViewerInventoryCategory * master_folder = model->getCategory(marketplacelistings_id); + LLInventoryCategory *cat = model->getCategory(mUUID); + if (cat) + { + can_list = can_move_folder_to_marketplace(master_folder, master_folder, cat, error_msg); + } + else + { + LLInventoryItem *item = model->getItem(mUUID); + can_list = (item ? can_move_item_to_marketplace(master_folder, master_folder, item, error_msg) : false); + } + } + } + + return can_list; +} + LLToolDragAndDrop::ESource LLInvFVBridge::getDragSource() const { if (gInventory.isObjectDescendentOf(getUUID(), gInventory.getRootFolderID())) -- cgit v1.2.3 From f1c9536401016052bbee84c6ff178fa0d466bc78 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 27 Jan 2015 23:19:51 -0800 Subject: DD-296 : Add options to move or leave behind no copy items when copying a folder to the marketplace --- indra/newview/llinventorybridge.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 61889d3c5e..f5f494c789 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1636,11 +1636,12 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); copy_item_to_outbox(itemp, outbox_id, LLUUID::null, LLToolDragAndDrop::getOperationId()); } - else if (("move_to_marketplace_listings" == action) || ("copy_to_marketplace_listings" == action)) + else if (("move_to_marketplace_listings" == action) || ("copy_to_marketplace_listings" == action) || ("copy_or_move_to_marketplace_listings" == action)) { LLInventoryItem* itemp = model->getItem(mUUID); if (!itemp) return; const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + // Note: For a single item, if it's not a copy, then it's a move move_item_to_marketplacelistings(itemp, marketplacelistings_id, ("copy_to_marketplace_listings" == action)); } else if ("copy_slurl" == action) @@ -3185,12 +3186,12 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); copy_folder_to_outbox(cat, outbox_id, cat->getUUID(), LLToolDragAndDrop::getOperationId()); } - else if (("move_to_marketplace_listings" == action) || ("copy_to_marketplace_listings" == action)) + else if (("move_to_marketplace_listings" == action) || ("copy_to_marketplace_listings" == action) || ("copy_or_move_to_marketplace_listings" == action)) { LLInventoryCategory * cat = gInventory.getCategory(mUUID); if (!cat) return; const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); - move_folder_to_marketplacelistings(cat, marketplacelistings_id, ("copy_to_marketplace_listings" == action)); + move_folder_to_marketplacelistings(cat, marketplacelistings_id, ("move_to_marketplace_listings" != action), (("copy_or_move_to_marketplace_listings" == action))); } } -- cgit v1.2.3 From 1dd5c338d2726cc6c0f717e64d52c051d19b9732 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 18 Mar 2015 10:33:22 -0700 Subject: DD-292 : Decrement cargo count when dropping items one by one in the marketplace listings folder --- indra/newview/llinventorybridge.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f5f494c789..4d9bfa20bb 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3446,20 +3446,22 @@ void LLFolderBridge::perform_pasteFromClipboard() { std::string error_msg; const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); + int index = 0; for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) { const LLUUID& item_id = (*iter); LLInventoryItem *item = model->getItem(item_id); LLInventoryCategory *cat = model->getCategory(item_id); - if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg, objects.size(), true)) + if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg, objects.size() - index, true)) { break; } - if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg, objects.size(), true, true)) + if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg, objects.size() - index, true, true)) { break; } + ++index; } if (!error_msg.empty()) { @@ -4532,7 +4534,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); LLViewerInventoryCategory * dest_folder = getCategory(); - accept = can_move_item_to_marketplace(master_folder, dest_folder, inv_item, tooltip_msg, LLToolDragAndDrop::instance().getCargoCount()); + accept = can_move_item_to_marketplace(master_folder, dest_folder, inv_item, tooltip_msg, LLToolDragAndDrop::instance().getCargoCount() - LLToolDragAndDrop::instance().getCargoIndex()); } // Check that the folder can accept this item based on folder/item type compatibility (e.g. stock folder compatibility) -- cgit v1.2.3 From b4d22741a6118719d45f278ed64f2c4635f0058e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 18 Mar 2015 17:06:18 -0700 Subject: DD-337 : Validate the version folder before setting it and show error dialog if error --- indra/newview/llinventorybridge.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4d9bfa20bb..d7a5594bb1 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3113,7 +3113,17 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) if (depth_nesting_in_marketplace(mUUID) == 2) { LLInventoryCategory* category = gInventory.getCategory(mUUID); - LLMarketplaceData::instance().setVersionFolder(category->getParentUUID(), mUUID); + mMessage = ""; + if (!validate_marketplacelistings(category,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2, _3),false,2)) + { + LLSD subs; + subs["[ERROR_CODE]"] = mMessage; + LLNotificationsUtil::add("MerchantFolderActivationFailed", subs); + } + else + { + LLMarketplaceData::instance().setVersionFolder(category->getParentUUID(), mUUID); + } } return; } -- cgit v1.2.3 From bdb9a769f12754dadf324b3dd395c1ca1519f938 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 21 Mar 2015 20:23:01 -0700 Subject: DD-371 : Do not go through the accept logic when user confirmation is not required (because already given) --- indra/newview/llinventorybridge.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d7a5594bb1..b7b2d1b285 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4520,27 +4520,27 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, //-------------------------------------------------------------------------------- // Determine if item can be moved & dropped - // + // Note: if user_confirm is false, we already went through those accept logic test and can skip them accept = TRUE; - if (!is_movable) + if (user_confirm && !is_movable) { accept = FALSE; } - else if ((mUUID == inv_item->getParentUUID()) && !move_is_into_favorites) + else if (user_confirm && (mUUID == inv_item->getParentUUID()) && !move_is_into_favorites) { accept = FALSE; } - else if (move_is_into_current_outfit || move_is_into_outfit) + else if (user_confirm && (move_is_into_current_outfit || move_is_into_outfit)) { accept = can_move_to_outfit(inv_item, move_is_into_current_outfit); } - else if (move_is_into_favorites || move_is_into_landmarks) + else if (user_confirm && (move_is_into_favorites || move_is_into_landmarks)) { accept = can_move_to_landmarks(inv_item); } - else if (move_is_into_outbox || move_is_into_marketplacelistings) + else if (user_confirm && (move_is_into_outbox || move_is_into_marketplacelistings)) { const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); LLViewerInventoryCategory * dest_folder = getCategory(); @@ -4548,7 +4548,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } // Check that the folder can accept this item based on folder/item type compatibility (e.g. stock folder compatibility) - if (accept) + if (user_confirm && accept) { LLViewerInventoryCategory * dest_folder = getCategory(); accept = dest_folder->acceptItem(inv_item); @@ -4558,7 +4558,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Check whether the item being dragged from active inventory panel // passes the filter of the destination panel. - if (accept && active_panel && use_filter) + if (user_confirm && accept && active_panel && use_filter) { LLFolderViewItem* fv_item = active_panel->getItemByID(inv_item->getUUID()); if (!fv_item) return false; @@ -4578,9 +4578,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // RN: a better solution would be to deselect automatically when an item is moved // and then select any item that is dropped only in the panel that it is dropped in if (active_panel && (destination_panel != active_panel)) - { - active_panel->unSelectAll(); - } + { + active_panel->unSelectAll(); + } // Dropping in or out of marketplace needs (sometimes) confirmation if (user_confirm && (move_is_from_marketplacelistings || move_is_into_marketplacelistings)) { -- cgit v1.2.3 From a9c3681cb5eecc043dab3f5c9dc9d97bc1af1075 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 10 Apr 2015 17:37:11 -0700 Subject: DD-381 : Avoid unecessary SLM updates, suppress some update_marketplace_category() that are picked by dirty bit setup --- indra/newview/llinventorybridge.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b7b2d1b285..df07c06467 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4675,8 +4675,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLMarketplaceData::instance().activateListing(version_folder_id,false); } } - // Update the listing we moved from anyway - update_marketplace_category(from_folder_uuid); } // -- cgit v1.2.3 From 637e096d5718d0a174b5383aa29e3480edd734ea Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 13 Apr 2015 15:29:56 -0700 Subject: DD-388 : More resilient way of reacting to not evaluated stock count throughout marketplace handling --- indra/newview/llinventorybridge.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index df07c06467..6d92a05102 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4261,15 +4261,23 @@ std::string LLMarketplaceFolderBridge::getLabelSuffix() const { suffix += " (" + LLTrans::getString("MarketplaceNoStock") + ")"; } - else if (stock_count != -1) + else if (stock_count != COMPUTE_STOCK_INFINITE) { if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) { - suffix += " (" + LLTrans::getString("MarketplaceStock") + "=" + llformat("%d", stock_count) + ")"; + suffix += " (" + LLTrans::getString("MarketplaceStock"); } else { - suffix += " (" + LLTrans::getString("MarketplaceMax") + "=" + llformat("%d", stock_count) + ")"; + suffix += " (" + LLTrans::getString("MarketplaceMax"); + } + if (stock_count == COMPUTE_STOCK_NOT_EVALUATED) + { + suffix += "=" + LLTrans::getString("MarketplaceUpdating") + ")"; + } + else + { + suffix += "=" + llformat("%d", stock_count) + ")"; } } // Add updating suffix -- cgit v1.2.3 From 7da083e3e64dcd4e851e7ac6539e26e60cf82203 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 2 May 2015 14:16:26 -0700 Subject: DD-394 : Make sure Copy and Move to Marketplace menu items are disabled if the Marketplace listing folder doesn't exist --- indra/newview/llinventorybridge.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index eedaa82c81..3fb047c68a 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1490,16 +1490,23 @@ bool LLInvFVBridge::canListOnMarketplaceNow() const std::string error_msg; LLInventoryModel* model = getInventoryModel(); const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); - LLViewerInventoryCategory * master_folder = model->getCategory(marketplacelistings_id); - LLInventoryCategory *cat = model->getCategory(mUUID); - if (cat) + if (marketplacelistings_id.notNull()) { - can_list = can_move_folder_to_marketplace(master_folder, master_folder, cat, error_msg); + LLViewerInventoryCategory * master_folder = model->getCategory(marketplacelistings_id); + LLInventoryCategory *cat = model->getCategory(mUUID); + if (cat) + { + can_list = can_move_folder_to_marketplace(master_folder, master_folder, cat, error_msg); + } + else + { + LLInventoryItem *item = model->getItem(mUUID); + can_list = (item ? can_move_item_to_marketplace(master_folder, master_folder, item, error_msg) : false); + } } else { - LLInventoryItem *item = model->getItem(mUUID); - can_list = (item ? can_move_item_to_marketplace(master_folder, master_folder, item, error_msg) : false); + can_list = false; } } } -- cgit v1.2.3 From 65833cc0c76965848ff71c33261b246482b55c2b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 6 Jun 2015 08:38:34 -0700 Subject: DD-316 : Disable New Folder under version folder hierarchy of InventoryOutboxMaxFolderCount has been reached --- indra/newview/llinventorybridge.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4dbd0e5154..4a82cb5eac 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1049,14 +1049,30 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, } } } - // Options available at all levels on items and categories + items.push_back(std::string("Marketplace Edit Listing")); LLUUID listing_folder_id = nested_parent_id(mUUID,depth); LLUUID version_folder_id = LLMarketplaceData::instance().getVersionFolder(listing_folder_id); + + if (depth >= 2) + { + // Prevent creation of new folders if the max count has been reached on this version folder (active or not) + LLUUID local_version_folder_id = nested_parent_id(mUUID,depth-1); + LLInventoryModel::cat_array_t categories; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(local_version_folder_id, categories, items, FALSE); + if (categories.size() >= gSavedSettings.getU32("InventoryOutboxMaxFolderCount")) + { + disabled_items.push_back(std::string("New Folder")); + } + } + + // Options available at all levels on items and categories if (!LLMarketplaceData::instance().isListed(listing_folder_id) || version_folder_id.isNull()) { disabled_items.push_back(std::string("Marketplace Edit Listing")); } + // Separator items.push_back(std::string("Marketplace Listings Separator")); } -- cgit v1.2.3 From 2cc3ce72b3f7abf037e554b04850e627a9d8eb5f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 9 Jun 2015 15:41:11 -0700 Subject: DD-359 : Improve performance by caching display data while updating and preventing refreshing the whole marketplace (never useful) --- indra/newview/llinventorybridge.cpp | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4a82cb5eac..521eefe583 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -203,7 +203,6 @@ const std::string& LLInvFVBridge::getDisplayName() const { buildDisplayName(); } - return mDisplayName; } @@ -4292,6 +4291,14 @@ void LLFolderBridge::modifyOutfit(BOOL append) // +=================================================+ // LLMarketplaceFolderBridge is a specialized LLFolderBridge for use in Marketplace Inventory panels +LLMarketplaceFolderBridge::LLMarketplaceFolderBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid) : +LLFolderBridge(inventory, root, uuid) +{ + m_depth = depth_nesting_in_marketplace(mUUID); + m_stockCountCache = COMPUTE_STOCK_NOT_EVALUATED; +} LLUIImagePtr LLMarketplaceFolderBridge::getIcon() const { @@ -4306,8 +4313,12 @@ LLUIImagePtr LLMarketplaceFolderBridge::getIconOpen() const 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)) + if (!LLMarketplaceData::instance().isUpdating(getUUID())) + { + // Skip computation (expensive) if we're waiting for updates. Use the old value in that case. + m_depth = depth_nesting_in_marketplace(mUUID); + } + if ((preferred_type == LLFolderType::FT_NONE) && (m_depth == 2)) { // We override the type when in the marketplace listings folder and only for version folder preferred_type = LLFolderType::FT_MARKETPLACE_VERSION; @@ -4345,12 +4356,16 @@ std::string LLMarketplaceFolderBridge::getLabelSuffix() const suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; } // Add stock amount - S32 stock_count = compute_stock_count(getUUID()); - if (stock_count == 0) + if (!LLMarketplaceData::instance().isUpdating(getUUID())) + { + // Skip computation (expensive) if we're waiting for update anyway. Use the old value in that case. + m_stockCountCache = compute_stock_count(getUUID()); + } + if (m_stockCountCache == 0) { suffix += " (" + LLTrans::getString("MarketplaceNoStock") + ")"; } - else if (stock_count != COMPUTE_STOCK_INFINITE) + else if (m_stockCountCache != COMPUTE_STOCK_INFINITE) { if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) { @@ -4360,13 +4375,13 @@ std::string LLMarketplaceFolderBridge::getLabelSuffix() const { suffix += " (" + LLTrans::getString("MarketplaceMax"); } - if (stock_count == COMPUTE_STOCK_NOT_EVALUATED) + if (m_stockCountCache == COMPUTE_STOCK_NOT_EVALUATED) { suffix += "=" + LLTrans::getString("MarketplaceUpdating") + ")"; } else { - suffix += "=" + llformat("%d", stock_count) + ")"; + suffix += "=" + llformat("%d", m_stockCountCache) + ")"; } } // Add updating suffix -- cgit v1.2.3 From 84a7394ae03608556b5974ca1bdfc280cf5874b7 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 9 Jun 2015 19:44:03 -0700 Subject: DD-412 : WIP : Validate a listing before creating a listing on SLM --- indra/newview/llinventorybridge.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 521eefe583..8b37480830 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3234,7 +3234,29 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) } else if ("marketplace_create_listing" == action) { - LLMarketplaceData::instance().createListing(mUUID); + LLViewerInventoryCategory* cat = gInventory.getCategory(mUUID); + mMessage = ""; + bool validates = true; + if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2, _3))) + { + mMessage = ""; + validates = validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2, _3),true); + if (validates) + { + LLNotificationsUtil::add("MerchantForceValidateListing"); + } + } + + if (!validates) + { + LLSD subs; + subs["[ERROR_CODE]"] = mMessage; + LLNotificationsUtil::add("MerchantListingFailed", subs); + } + else + { + LLMarketplaceData::instance().createListing(mUUID); + } return; } else if ("marketplace_disassociate_listing" == action) -- cgit v1.2.3 From 97fc50e1618b5441d6c7f305506801b85b4caacd Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 9 Jun 2015 23:00:14 -0700 Subject: DD-412 : Fixes the hierarchy before creating a listing and warn the user --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 8b37480830..d8dfe35eb5 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3236,8 +3236,8 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) { LLViewerInventoryCategory* cat = gInventory.getCategory(mUUID); mMessage = ""; - bool validates = true; - if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2, _3))) + bool validates = validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2, _3),false); + if (!validates) { mMessage = ""; validates = validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2, _3),true); -- cgit v1.2.3 From ab73b1af8fad5f012f782632a08740b4a0a1c8fa Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 10 Jun 2015 14:53:12 -0700 Subject: DD-416 : Added DAMA when version folder is empty and unlisted, accelerated some functions avoiding depth computation when we could, fixed cut case --- indra/newview/llinventorybridge.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d8dfe35eb5..48e5602682 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -968,7 +968,7 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, items.push_back(std::string("Marketplace Check Listing")); items.push_back(std::string("Marketplace List")); items.push_back(std::string("Marketplace Unlist")); - if (LLMarketplaceData::instance().isUpdating(mUUID) || ((flags & FIRST_SELECTED_ITEM) == 0)) + if (LLMarketplaceData::instance().isUpdating(mUUID,depth) || ((flags & FIRST_SELECTED_ITEM) == 0)) { // During SLM update, disable all marketplace related options // Also disable all if multiple selected items @@ -1024,7 +1024,7 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, { items.push_back(std::string("Marketplace Activate")); items.push_back(std::string("Marketplace Deactivate")); - if (LLMarketplaceData::instance().isUpdating(mUUID) || ((flags & FIRST_SELECTED_ITEM) == 0)) + if (LLMarketplaceData::instance().isUpdating(mUUID,depth) || ((flags & FIRST_SELECTED_ITEM) == 0)) { // During SLM update, disable all marketplace related options // Also disable all if multiple selected items @@ -3219,7 +3219,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) { if (depth_nesting_in_marketplace(mUUID) == 1) { - LLMarketplaceData::instance().activateListing(mUUID,false); + LLMarketplaceData::instance().activateListing(mUUID,false,1); } return; } @@ -3228,7 +3228,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) if (depth_nesting_in_marketplace(mUUID) == 2) { LLInventoryCategory* category = gInventory.getCategory(mUUID); - LLMarketplaceData::instance().setVersionFolder(category->getParentUUID(), LLUUID::null); + LLMarketplaceData::instance().setVersionFolder(category->getParentUUID(), LLUUID::null, 2); } return; } @@ -4378,7 +4378,8 @@ std::string LLMarketplaceFolderBridge::getLabelSuffix() const suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; } // Add stock amount - if (!LLMarketplaceData::instance().isUpdating(getUUID())) + bool updating = LLMarketplaceData::instance().isUpdating(getUUID()); + if (!updating) { // Skip computation (expensive) if we're waiting for update anyway. Use the old value in that case. m_stockCountCache = compute_stock_count(getUUID()); @@ -4407,7 +4408,7 @@ std::string LLMarketplaceFolderBridge::getLabelSuffix() const } } // Add updating suffix - if (LLMarketplaceData::instance().isUpdating(getUUID())) + if (updating) { suffix += " (" + LLTrans::getString("MarketplaceUpdating") + ")"; } -- cgit v1.2.3 From 396ed2a3407bca1322bdc1f87e2caee8e0b0398e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 11 Jun 2015 12:05:38 -0700 Subject: DD-416 : Fix deactivate listing that I broke in trying to improve speed with the previous DD-416 commit --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 48e5602682..0d76705905 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3228,7 +3228,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) if (depth_nesting_in_marketplace(mUUID) == 2) { LLInventoryCategory* category = gInventory.getCategory(mUUID); - LLMarketplaceData::instance().setVersionFolder(category->getParentUUID(), LLUUID::null, 2); + LLMarketplaceData::instance().setVersionFolder(category->getParentUUID(), LLUUID::null, 1); } return; } -- cgit v1.2.3