summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmarketplaceinbox.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <none@none>2017-11-16 00:24:54 +0200
committerMnikolenko Productengine <none@none>2017-11-16 00:24:54 +0200
commitab7c9526450e54a379edf60db5fc8f28b3acbca6 (patch)
tree4d2f9968ecf30f6dba76643b0343a088d303c159 /indra/newview/llpanelmarketplaceinbox.cpp
parent6464016c117693d391f8e5cdbc14816e298ec265 (diff)
MAINT-7988 Received Items should be searchable via inventory
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("");