summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-08-14 23:05:01 -0700
committerMerov Linden <merov@lindenlab.com>2014-08-14 23:05:01 -0700
commit906927a99ff15a1441b629c58fd3f5a150820c47 (patch)
tree20aaa7c5377031b77607ab838e71a80185a25ce0 /indra/newview
parent349497ce56e6338a18e515c30c1af5aca84c448d (diff)
DD-112 : Disable the add folder button if the tab doesn't support drop on root
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloatermarketplacelistings.cpp10
-rwxr-xr-xindra/newview/llfloatermarketplacelistings.h1
-rwxr-xr-xindra/newview/llinventorypanel.h1
3 files changed, 12 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);
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<LLFolderViewItem*>& 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<LLFolderViewItem*> &items, BOOL user_action);