summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llfloatermarketplacelistings.cpp33
-rwxr-xr-xindra/newview/llfloatermarketplacelistings.h4
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_marketplace_listings.xml15
3 files changed, 45 insertions, 7 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()
diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h
index 86ddfd9023..4068351b52 100755
--- a/indra/newview/llfloatermarketplacelistings.h
+++ b/indra/newview/llfloatermarketplacelistings.h
@@ -39,6 +39,7 @@ class LLInventoryCategoriesObserver;
class LLInventoryCategoryAddedObserver;
class LLTextBox;
class LLView;
+class LLFilterEditor;
class LLFloaterMarketplaceListings;
@@ -66,8 +67,11 @@ private:
void onAuditButtonClicked();
void onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action);
void onTabChange();
+ void onFilterEdit(const std::string& search_string);
LLInventoryPanel* mAllPanel;
+ LLFilterEditor* mFilterEditor;
+ std::string mFilterSubString;
LLInventoryFilter::ESortOrderType mSortOrder;
LLInventoryFilter::EFilterType mFilterType;
};
diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml
index fd5c9ed422..1953fae72e 100755
--- a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml
+++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml
@@ -60,15 +60,26 @@
default_tab_group="1"
width="308"
height="400">
+ <filter_editor
+ text_pad_left="10"
+ follows="left|top|right"
+ height="23"
+ label="Filter Marketplace Listings"
+ layout="topleft"
+ left="0"
+ max_length_chars="300"
+ name="filter_editor"
+ top="0"
+ width="308" />
<tab_container
name="marketplace_filter_tabs"
follows="all"
layout="topleft"
- top="0"
+ top="30"
left="0"
top_pad="0"
width="308"
- height="400"
+ height="370"
halign="center"
tab_height="30"
tab_group="1"