diff options
author | Merov Linden <merov@lindenlab.com> | 2014-04-12 17:37:50 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-04-12 17:37:50 -0700 |
commit | 22c8ed2f80a2a6645f3148362566aa2f46ae38fd (patch) | |
tree | 29068c2d87eb1e19d66e4cd265aa2312ee441d74 | |
parent | dd070683e8aedac36919144ca13a7c9a405d653a (diff) |
DD-64 : Add New Folder to right click menu on marketplace
-rwxr-xr-x | indra/newview/llfloatermarketplacelistings.cpp | 11 | ||||
-rwxr-xr-x | indra/newview/llfloatermarketplacelistings.h | 1 | ||||
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 48 |
3 files changed, 36 insertions, 24 deletions
diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index dcf27baae7..59e3e8442e 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -65,20 +65,24 @@ BOOL LLPanelMarketplaceListings::postBuild() LLInventoryPanel* panel = getChild<LLInventoryPanel>("All Items"); panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); panel->getFilter().markDefault(); - + panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); + // Set filters on the 3 prefiltered panels panel = getChild<LLInventoryPanel>("Active Items"); panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); panel->getFilter().setFilterMarketplaceActiveFolders(); panel->getFilter().markDefault(); + panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); panel = getChild<LLInventoryPanel>("Inactive Items"); panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); panel->getFilter().setFilterMarketplaceInactiveFolders(); panel->getFilter().markDefault(); + panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); panel = getChild<LLInventoryPanel>("Unassociated Items"); panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); panel->getFilter().setFilterMarketplaceUnassociatedFolders(); panel->getFilter().markDefault(); + panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); return LLPanel::postBuild(); } @@ -88,6 +92,11 @@ void LLPanelMarketplaceListings::draw() LLPanel::draw(); } +void LLPanelMarketplaceListings::onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action) +{ + panel->onSelectionChange(items, user_action); +} + void LLPanelMarketplaceListings::onAddButtonClicked() { LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, true); diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index 03c4fa6818..c9fe68a70c 100755 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -55,6 +55,7 @@ private: void onViewSortMenuItemClicked(const LLSD& userdata); bool onViewSortMenuItemCheck(const LLSD& userdata); void onAddButtonClicked(); + void onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action); LLInventoryPanel* mAllPanel; LLInventoryFilter::ESortOrderType mSortOrder; 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)) { |