diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2011-06-06 16:30:22 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2011-06-06 16:30:22 -0700 |
commit | 0c0f7558782edccda375609777967184b8440441 (patch) | |
tree | cb6d5343df2b7245807f2e42f9b543552aff48ca /indra/newview | |
parent | 4b43c8b18a82d9aa8af6798706867c4a5ebc4334 (diff) |
fixing drag and drop for inbox, adding inbox text and cleaning up context menus
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.h | 1 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceinbox.cpp | 38 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceinbox.h | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/sidepanel_inventory.xml | 25 |
5 files changed, 79 insertions, 9 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index bdb9f6167a..20a187c302 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -572,7 +572,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } // Don't allow items to be pasted directly into the COF. - if (!isCOFFolder()) + if (!isCOFFolder() && !isInboxFolder()) { items.push_back(std::string("Paste")); } @@ -781,6 +781,11 @@ BOOL LLInvFVBridge::isCOFFolder() const return LLAppearanceMgr::instance().getIsInCOF(mUUID); } +BOOL LLInvFVBridge::isInboxFolder() const +{ + return gInventory.isObjectDescendentOf(mUUID, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX)); +} + BOOL LLInvFVBridge::isItemPermissive() const { return FALSE; @@ -2601,7 +2606,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLViewerInventoryCategory *cat = getCategory(); // BAP removed protected check to re-enable standard ops in untyped folders. // Not sure what the right thing is to do here. - if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) + if (!isCOFFolder() && !isInboxFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) { // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat)) @@ -2627,7 +2632,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { // Want some but not all of the items from getClipboardEntries for outfits. - if (cat && (cat->getPreferredType() == LLFolderType::FT_OUTFIT)) + if (cat && (cat->getPreferredType() == LLFolderType::FT_OUTFIT) || (cat->getPreferredType() == LLFolderType::FT_INBOX)) { mItems.push_back(std::string("Rename")); @@ -4298,7 +4303,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Detach From Yourself")); } - else if (!isItemInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing() && !isCOFFolder()) + else if (!isItemInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing() && !isCOFFolder() && !isInboxFolder()) { items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Wearable And Object Wear")); @@ -4650,7 +4655,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) disabled_items.push_back(std::string("Wearable Edit")); } // Don't allow items to be worn if their baseobj is in the trash. - if (isLinkedObjectInTrash() || isLinkedObjectMissing() || isCOFFolder()) + if (isLinkedObjectInTrash() || isLinkedObjectMissing() || isCOFFolder() || isInboxFolder()) { disabled_items.push_back(std::string("Wearable And Object Wear")); disabled_items.push_back(std::string("Wearable Add")); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 5ac328dcef..f268f36f3b 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -138,6 +138,7 @@ protected: BOOL isAgentInventory() const; // false if lost or in the inventory library BOOL isCOFFolder() const; // true if COF or descendent of + BOOL isInboxFolder() const; // true if COF or descendent of marketplace inbox virtual BOOL isItemPermissive() const; static void changeItemParent(LLInventoryModel* model, LLViewerInventoryItem* item, 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(); +} diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 519b213081..504659b1ef 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -29,6 +29,8 @@ #include "llpanel.h" +class LLInventoryPanel; + class LLPanelMarketplaceInbox : public LLPanel { public: @@ -39,6 +41,13 @@ public: ~LLPanelMarketplaceInbox(); /*virtual*/ BOOL postBuild(); + + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); + + /*virtual*/ void draw(); + +private: + LLInventoryPanel* mInventoryPanel; }; diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 49c45233d8..91de3047e6 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -9,7 +9,7 @@ min_width="240" name="objects panel" width="333"> - <panel + <panel follows="all" layout="topleft" left="0" @@ -66,6 +66,8 @@ label="" height="125" width="330"> + <string name="InboxLabelWithArg">MARKETPLACE INBOX ([NUM])</string> + <string name="InboxLabelNoArg">MARKETPLACE INBOX</string> <button label="MARKETPLACE INBOX" name="inbox_btn" @@ -84,9 +86,24 @@ follows="all" left="10" height="90" - width="330" + width="308" top="35" + bg_opaque_color="InventoryBackgroundColor" + background_visible="true" + background_opaque="true" > + <text + type="string" + length="1" + follows="top|left|right" + font="SansSerifSmall" + use_ellipses="true" + name="move_items_text" + top="10" + left="4" + height="20" + width="304" + >Move items to your inventory to manage and use them.</text> <inventory_panel bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" @@ -95,14 +112,14 @@ border="false" bevel_style="none" follows="all" - height="90" + height="70" start_folder="Inbox" layout="topleft" left="0" name="inventory_inbox" sort_order_setting="InventorySortOrder" show_item_link_overlays="true" - top="0" + top_pad="0" width="308" /> </panel> </panel> |