From ab7c9526450e54a379edf60db5fc8f28b3acbca6 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 16 Nov 2017 00:24:54 +0200 Subject: MAINT-7988 Received Items should be searchable via inventory --- indra/newview/llpanelmarketplaceinbox.cpp | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'indra/newview/llpanelmarketplaceinbox.cpp') 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(""); -- cgit v1.2.3