summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmarketplaceinbox.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2011-06-06 16:30:22 -0700
committerLeyla Farazha <leyla@lindenlab.com>2011-06-06 16:30:22 -0700
commit0c0f7558782edccda375609777967184b8440441 (patch)
treecb6d5343df2b7245807f2e42f9b543552aff48ca /indra/newview/llpanelmarketplaceinbox.cpp
parent4b43c8b18a82d9aa8af6798706867c4a5ebc4334 (diff)
fixing drag and drop for inbox, adding inbox text and cleaning up context menus
Diffstat (limited to 'indra/newview/llpanelmarketplaceinbox.cpp')
-rw-r--r--indra/newview/llpanelmarketplaceinbox.cpp38
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();
+}