From 906927a99ff15a1441b629c58fd3f5a150820c47 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 14 Aug 2014 23:05:01 -0700 Subject: DD-112 : Disable the add folder button if the tab doesn't support drop on root --- indra/newview/llfloatermarketplacelistings.cpp | 10 ++++++++++ indra/newview/llfloatermarketplacelistings.h | 1 + indra/newview/llinventorypanel.h | 1 + 3 files changed, 12 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index 8d12c98da8..6ed7ae91b3 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -83,6 +83,7 @@ void LLPanelMarketplaceListings::buildAllPanels() panel->getFilter().markDefault(); LLTabContainer* tabs_panel = getChild("marketplace_filter_tabs"); + tabs_panel->setCommitCallback(boost::bind(&LLPanelMarketplaceListings::onTabChange, this)); tabs_panel->selectTabPanel(mAllPanel); } @@ -120,6 +121,15 @@ void LLPanelMarketplaceListings::onSelectionChange(LLInventoryPanel *panel, cons panel->onSelectionChange(items, user_action); } +void LLPanelMarketplaceListings::onTabChange() +{ + LLTabContainer* tabs_panel = getChild("marketplace_filter_tabs"); + LLInventoryPanel* panel = static_cast(tabs_panel->getCurrentPanel()); + // If the panel doesn't allow drop on root, it doesn't allow the creation of new folder on root either + LLButton* add_btn = getChild("add_btn"); + add_btn->setEnabled(panel->getAllowDropOnRoot()); +} + void LLPanelMarketplaceListings::onAddButtonClicked() { LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index c472bfa4c5..1c46220267 100755 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -65,6 +65,7 @@ private: void onAddButtonClicked(); void onAuditButtonClicked(); void onSelectionChange(LLInventoryPanel *panel, const std::deque& items, BOOL user_action); + void onTabChange(); LLInventoryPanel* mAllPanel; LLInventoryFilter::ESortOrderType mSortOrder; diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 2665ffb0bd..481289286f 100755 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -187,6 +187,7 @@ public: LLFolderView* getRootFolder() { return mFolderRoot.get(); } LLUUID getRootFolderID(); LLScrollContainer* getScrollableContainer() { return mScroller; } + bool getAllowDropOnRoot() { return mParams.allow_drop_on_root; } void onSelectionChange(const std::deque &items, BOOL user_action); -- cgit v1.2.3