diff options
author | Merov Linden <merov@lindenlab.com> | 2014-03-10 18:49:40 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-03-10 18:49:40 -0700 |
commit | 9de02b0cd3ac05ce172e12dbc2d288a5deccba11 (patch) | |
tree | 4292a9d91d3f3ad87573ae044c91fd8fd4da5a29 /indra | |
parent | 00fe1b7fbe605ddcb6fb56e0a3d20b1208fbd5fd (diff) |
DD-17 : WIP : some work on the suffix for Listing folders
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llfloateroutbox.cpp | 22 | ||||
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 44 | ||||
-rwxr-xr-x | indra/newview/llinventorybridge.h | 3 |
3 files changed, 57 insertions, 12 deletions
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 86387c548a..8f4daa83f9 100755 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -732,23 +732,13 @@ void LLFloaterMerchantItems::onOpen(const LLSD& key) setup(); } - // - // Update the floater view - // - updateView(); - - // - // Trigger fetch of the contents - // - fetchContents(); - // Merov : Debug : Create fake Marketplace data if none is present if (LLMarketplaceData::instance().isEmpty() && (getFolderCount() > 0)) { LLInventoryModel::cat_array_t* cats; LLInventoryModel::item_array_t* items; gInventory.getDirectDescendentsOf(mRootFolderId, cats, items); - + int index = 0; for (LLInventoryModel::cat_array_t::iterator iter = cats->begin(); iter != cats->end(); iter++, index++) { @@ -761,6 +751,16 @@ void LLFloaterMerchantItems::onOpen(const LLSD& key) LLMarketplaceData::instance().setActivation(category->getUUID(),(index%3 == 0)); } } + + // + // Update the floater view + // + updateView(); + + // + // Trigger fetch of the contents + // + fetchContents(); } void LLFloaterMerchantItems::onFocusReceived() 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() { diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index bc875e8f37..199a46d275 100755 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -160,6 +160,7 @@ protected: BOOL isInboxFolder() const; // true if COF or descendant of marketplace inbox BOOL isOutboxFolder() const; // true if COF or descendant of marketplace outbox BOOL isOutboxFolderDirectParent() const; + BOOL isMerchantItemsFolder() const; // true if descendant of Merchant items folder const LLUUID getOutboxFolder() const; virtual BOOL isItemPermissive() const; @@ -274,7 +275,7 @@ public: virtual LLUIImagePtr getIcon() const; virtual LLUIImagePtr getIconOpen() const; virtual LLUIImagePtr getIconOverlay() const; - + virtual std::string getLabelSuffix() const; static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); virtual BOOL renameItem(const std::string& new_name); |