summaryrefslogtreecommitdiff
path: root/indra/newview
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
parent6464016c117693d391f8e5cdbc14816e298ec265 (diff)
MAINT-7988 Received Items should be searchable via inventory
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorybridge.cpp20
-rw-r--r--indra/newview/llpanelmaininventory.cpp24
-rw-r--r--indra/newview/llpanelmarketplaceinbox.cpp37
-rw-r--r--indra/newview/llpanelmarketplaceinbox.h6
-rw-r--r--indra/newview/llpanelmarketplaceinboxinventory.cpp6
-rw-r--r--indra/newview/llpanelmarketplaceinboxinventory.h1
6 files changed, 88 insertions, 6 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 904bc29929..4d1a6451e5 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -43,6 +43,7 @@
#include "llfloatermarketplacelistings.h"
#include "llfloateroutfitphotopreview.h"
#include "llfloatersidepanelcontainer.h"
+#include "llsidepanelinventory.h"
#include "llfloaterworldmap.h"
#include "llfolderview.h"
#include "llfriendcard.h"
@@ -1828,11 +1829,24 @@ void LLItemBridge::gotoItem()
LLInventoryObject *obj = getInventoryObject();
if (obj && obj->getIsLinkType())
{
- LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
- if (active_panel)
+ const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX);
+ if (gInventory.isObjectDescendentOf(obj->getLinkedUUID(), inbox_id))
{
- active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
+ LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
+ if (sidepanel_inventory && sidepanel_inventory->getInboxPanel())
+ {
+ sidepanel_inventory->getInboxPanel()->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
+ }
+ }
+ else
+ {
+ LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
+ if (active_panel)
+ {
+ active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
+ }
}
+
}
}
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index ec80ff8de7..bf59d89b80 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -44,6 +44,7 @@
#include "llfloaterreg.h"
#include "llmenubutton.h"
#include "lloutfitobserver.h"
+#include "llpanelmarketplaceinbox.h"
#include "llpreviewtexture.h"
#include "llresmgr.h"
#include "llscrollcontainer.h"
@@ -483,7 +484,7 @@ void LLPanelMainInventory::onClearSearch()
if (mActivePanel && (getActivePanel() != mWornItemsPanel))
{
initially_active = mActivePanel->getFilter().isNotDefault();
- mActivePanel->setFilterSubString(LLStringUtil::null);
+ setFilterSubString(LLStringUtil::null);
mActivePanel->setFilterTypes(0xffffffffffffffffULL);
mActivePanel->setFilterLinks(LLInventoryFilter::FILTERLINK_INCLUDE_LINKS);
}
@@ -503,6 +504,16 @@ void LLPanelMainInventory::onClearSearch()
mActivePanel->getRootFolder()->scrollToShowSelection();
}
mFilterSubString = "";
+
+ LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
+ if (sidepanel_inventory)
+ {
+ LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild<LLPanelMarketplaceInbox>("marketplace_inbox");
+ if (inbox_panel)
+ {
+ inbox_panel->onClearSearch();
+ }
+ }
}
void LLPanelMainInventory::onFilterEdit(const std::string& search_string )
@@ -534,6 +545,16 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string )
// set new filter string
setFilterSubString(mFilterSubString);
+
+ LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
+ if (sidepanel_inventory)
+ {
+ LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild<LLPanelMarketplaceInbox>("marketplace_inbox");
+ if (inbox_panel)
+ {
+ inbox_panel->onFilterEdit(search_string);
+ }
+ }
}
@@ -848,7 +869,6 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()
// Get data needed for filter display
U32 filter_types = mFilter->getFilterObjectTypes();
- std::string filter_string = mFilter->getFilterSubString();
LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState();
U32 hours = mFilter->getHoursAgo();
U32 date_search_direction = mFilter->getDateSearchDirection();
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("");
diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h
index 9eb74581a2..952e3a333a 100644
--- a/indra/newview/llpanelmarketplaceinbox.h
+++ b/indra/newview/llpanelmarketplaceinbox.h
@@ -28,7 +28,7 @@
#define LL_LLPANELMARKETPLACEINBOX_H
#include "llpanel.h"
-
+#include "llfolderview.h"
class LLButton;
class LLInventoryPanel;
class LLUICtrl;
@@ -56,6 +56,9 @@ public:
LLInventoryPanel * setupInventoryPanel();
+ void onClearSearch();
+ void onFilterEdit(const std::string& search_string);
+
U32 getFreshItemCount() const;
U32 getTotalItemCount() const;
@@ -71,6 +74,7 @@ private:
LLUICtrl * mFreshCountCtrl;
LLButton * mInboxButton;
LLInventoryPanel * mInventoryPanel;
+ LLSaveFolderState* mSavedFolderState;
};
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp
index c5fda3c136..e08670eff3 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp
@@ -62,6 +62,12 @@ LLInboxInventoryPanel::LLInboxInventoryPanel(const LLInboxInventoryPanel::Params
LLInboxInventoryPanel::~LLInboxInventoryPanel()
{}
+void LLInboxInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
+{
+ LLInventoryPanel::initFromParams(params);
+ getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX));
+}
+
LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop)
{
LLUIColor item_color = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h
index 66aafe83d1..b1335e2d71 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.h
+++ b/indra/newview/llpanelmarketplaceinboxinventory.h
@@ -46,6 +46,7 @@ public:
~LLInboxInventoryPanel();
// virtual
+ void initFromParams(const LLInventoryPanel::Params&);
LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop);
LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge);
};