diff options
Diffstat (limited to 'indra/newview/llpanelmarketplaceinbox.cpp')
-rw-r--r-- | indra/newview/llpanelmarketplaceinbox.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index b3afaea20e..b401087345 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -28,6 +28,9 @@ #include "llpanelmarketplaceinbox.h" +#include "llbutton.h" +#include "llinventorypanel.h" + static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox"); // protected @@ -43,5 +46,40 @@ LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() // virtual BOOL LLPanelMarketplaceInbox::postBuild() { + mInventoryPanel = getChild<LLInventoryPanel>("inventory_inbox"); + + mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + + return TRUE; +} + +BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) +{ + *accept = ACCEPT_NO; return TRUE; } + +void LLPanelMarketplaceInbox::draw() +{ + LLInventoryModel* model = mInventoryPanel->getModel(); + + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + model->getDirectDescendentsOf(model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false), cats, items); + + S32 item_count = cats->size() + items->size(); + + if (item_count) + { + LLStringUtil::format_map_t args; + args["[NUM]"] = llformat ("%d", item_count); + getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); + } + else + { + getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg")); + } + + LLPanel::draw(); +} |