diff options
author | Merov Linden <merov@lindenlab.com> | 2014-08-14 23:05:01 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-08-14 23:05:01 -0700 |
commit | 906927a99ff15a1441b629c58fd3f5a150820c47 (patch) | |
tree | 20aaa7c5377031b77607ab838e71a80185a25ce0 /indra/newview/llfloatermarketplacelistings.cpp | |
parent | 349497ce56e6338a18e515c30c1af5aca84c448d (diff) |
DD-112 : Disable the add folder button if the tab doesn't support drop on root
Diffstat (limited to 'indra/newview/llfloatermarketplacelistings.cpp')
-rwxr-xr-x | indra/newview/llfloatermarketplacelistings.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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<LLTabContainer>("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<LLTabContainer>("marketplace_filter_tabs"); + LLInventoryPanel* panel = static_cast<LLInventoryPanel*>(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<LLButton>("add_btn"); + add_btn->setEnabled(panel->getAllowDropOnRoot()); +} + void LLPanelMarketplaceListings::onAddButtonClicked() { LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); |