summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermarketplacelistings.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-09-07 22:54:50 -0700
committerMerov Linden <merov@lindenlab.com>2014-09-07 22:54:50 -0700
commit9fd904220bb304a7827d255dc4c03c35ffdc945e (patch)
tree3bc77948881db9bc8d5ff4d83bb56d2abaccb801 /indra/newview/llfloatermarketplacelistings.cpp
parent8f119c04d484546d73fa906e8f6bd4018e2e6162 (diff)
DD-195 : Add text filtering to the marketplace listings floater
Diffstat (limited to 'indra/newview/llfloatermarketplacelistings.cpp')
-rwxr-xr-xindra/newview/llfloatermarketplacelistings.cpp33
1 files changed, 28 insertions, 5 deletions
diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp
index 5bdd5bc8f8..fb6e92165b 100755
--- a/indra/newview/llfloatermarketplacelistings.cpp
+++ b/indra/newview/llfloatermarketplacelistings.cpp
@@ -30,6 +30,7 @@
#include "llfloatermarketplacelistings.h"
#include "llfloaterreg.h"
+#include "llfiltereditor.h"
#include "llfolderview.h"
#include "llinventorybridge.h"
#include "llinventorymodelbackgroundfetch.h"
@@ -63,6 +64,9 @@ BOOL LLPanelMarketplaceListings::postBuild()
childSetAction("add_btn", boost::bind(&LLPanelMarketplaceListings::onAddButtonClicked, this));
childSetAction("audit_btn", boost::bind(&LLPanelMarketplaceListings::onAuditButtonClicked, this));
+ mFilterEditor = getChild<LLFilterEditor>("filter_editor");
+ mFilterEditor->setCommitCallback(boost::bind(&LLPanelMarketplaceListings::onFilterEdit, this, _2));
+
return LLPanel::postBuild();
}
@@ -107,6 +111,19 @@ LLInventoryPanel* LLPanelMarketplaceListings::buildInventoryPanel(const std::str
return panel;
}
+void LLPanelMarketplaceListings::onFilterEdit(const std::string& search_string)
+{
+ // Find active panel
+ LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
+ if (panel)
+ {
+ // Save filter string (needed when switching tabs)
+ mFilterSubString = search_string;
+ // Set filter string on active panel
+ panel->setFilterSubString(mFilterSubString);
+ }
+}
+
void LLPanelMarketplaceListings::draw()
{
if (LLMarketplaceData::instance().checkDirtyCount())
@@ -123,11 +140,17 @@ void LLPanelMarketplaceListings::onSelectionChange(LLInventoryPanel *panel, cons
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());
+ // Find active panel
+ LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
+ if (panel)
+ {
+ // 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());
+
+ // Set filter string on active panel
+ panel->setFilterSubString(mFilterSubString);
+ }
}
void LLPanelMarketplaceListings::onAddButtonClicked()