summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmarketplaceinbox.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-03-07 11:27:43 -0800
committerRider Linden <rider@lindenlab.com>2018-03-07 11:27:43 -0800
commit7b56db31f91545102744885b4f70c93278e837bd (patch)
tree97bd880e3aeb1f60d667344e6693b46c8ba120eb /indra/newview/llpanelmarketplaceinbox.cpp
parent4235231b5adbb7f064cab732f761dd359ef4b648 (diff)
parentf8c76535a35aaf245e261357a59e977bac5b2501 (diff)
Merge
Diffstat (limited to 'indra/newview/llpanelmarketplaceinbox.cpp')
-rw-r--r--indra/newview/llpanelmarketplaceinbox.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp
index 79e079f6bd..8a86f4f63d 100644
--- a/indra/newview/llpanelmarketplaceinbox.cpp
+++ b/indra/newview/llpanelmarketplaceinbox.cpp
@@ -51,11 +51,15 @@ LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p)
, mFreshCountCtrl(NULL)
, mInboxButton(NULL)
, mInventoryPanel(NULL)
+ , mSavedFolderState(NULL)
{
+ mSavedFolderState = new LLSaveFolderState();
+ mSavedFolderState->setApply(FALSE);
}
LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
{
+ delete mSavedFolderState;
}
// virtual
@@ -96,6 +100,7 @@ LLInventoryPanel * LLPanelMarketplaceInbox::setupInventoryPanel()
// Set the sort order newest to oldest
mInventoryPanel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_DATE);
mInventoryPanel->getFilter().markDefault();
+ mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
// Set selection callback for proper update of inventory status buttons
mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this));
@@ -193,6 +198,38 @@ U32 LLPanelMarketplaceInbox::getTotalItemCount() const
return item_count;
}
+void LLPanelMarketplaceInbox::onClearSearch()
+{
+ if (mInventoryPanel)
+ {
+ mInventoryPanel->setFilterSubString(LLStringUtil::null);
+ mSavedFolderState->setApply(TRUE);
+ mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
+ LLOpenFoldersWithSelection opener;
+ mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener);
+ mInventoryPanel->getRootFolder()->scrollToShowSelection();
+ }
+}
+
+void LLPanelMarketplaceInbox::onFilterEdit(const std::string& search_string)
+{
+ if (mInventoryPanel)
+ {
+
+ if (search_string == "")
+ {
+ onClearSearch();
+ }
+
+ if (!mInventoryPanel->getFilter().isNotDefault())
+ {
+ mSavedFolderState->setApply(FALSE);
+ mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
+ }
+ mInventoryPanel->setFilterSubString(search_string);
+ }
+}
+
std::string LLPanelMarketplaceInbox::getBadgeString() const
{
std::string item_count_str("");