diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-04-25 17:29:46 +0300 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-04-25 17:29:46 +0300 |
commit | 7c3452fe44eb6a1a0b7a8b927d0b9620142e88d1 (patch) | |
tree | 651ba0074985a0f22a4c3bd82535f38e9d60fa18 | |
parent | c1a3c7b239dcde347403c818d4ad1eeedf45d280 (diff) |
SL-19409 FIXED Received items panel in multiple inventory windows does not sync New tag status between windows
-rw-r--r-- | indra/newview/llpanelmarketplaceinboxinventory.cpp | 34 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceinboxinventory.h | 11 |
2 files changed, 43 insertions, 2 deletions
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 7a6631448b..e13bd0412d 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -62,10 +62,13 @@ LLInboxInventoryPanel::LLInboxInventoryPanel(const LLInboxInventoryPanel::Params : LLInventoryPanel(p) { LLInboxNewItemsStorage::getInstance()->load(); + LLInboxNewItemsStorage::getInstance()->addInboxPanel(this); } LLInboxInventoryPanel::~LLInboxInventoryPanel() -{} +{ + LLInboxNewItemsStorage::getInstance()->removeInboxPanel(this); +} void LLInboxInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { @@ -108,6 +111,21 @@ LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * b return LLUICtrlFactory::create<LLInboxFolderViewItem>(params); } +void LLInboxInventoryPanel::onRemoveItemFreshness(const LLUUID& item_id) +{ + LLInboxFolderViewFolder* inbox_folder_view = dynamic_cast<LLInboxFolderViewFolder*>(getFolderByID(item_id)); + if(inbox_folder_view) + { + inbox_folder_view->setFresh(false); + } + + LLInboxFolderViewItem* inbox_item_view = dynamic_cast<LLInboxFolderViewItem*>(getItemByID(item_id)); + if(inbox_item_view) + { + inbox_item_view->setFresh(false); + } +} + // // LLInboxFolderViewFolder Implementation // @@ -340,4 +358,18 @@ void LLInboxNewItemsStorage::load() } } } + +void LLInboxNewItemsStorage::removeItem(const LLUUID& id) +{ + mNewItemsIDs.erase(id); + + //notify inbox panels + for (auto inbox : mInboxPanels) + { + if(inbox) + { + inbox->onRemoveItemFreshness(id); + } + } +} // eof diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 3e508e801b..9eef5f209c 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -49,6 +49,8 @@ public: void initFromParams(const LLInventoryPanel::Params&); LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop); LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge); + + void onRemoveItemFreshness(const LLUUID& item_id); }; @@ -77,6 +79,7 @@ public: void deFreshify(); bool isFresh() const { return mFresh; } + void setFresh(bool is_fresh) { mFresh = is_fresh; } protected: bool mFresh; @@ -108,6 +111,7 @@ public: void deFreshify(); bool isFresh() const { return mFresh; } + void setFresh(bool is_fresh) { mFresh = is_fresh; } protected: bool mFresh; @@ -125,11 +129,16 @@ public: void load(); void addFreshItem(const LLUUID& id) { mNewItemsIDs.insert(id); } - void removeItem(const LLUUID& id) { mNewItemsIDs.erase(id); } + void removeItem(const LLUUID& id); bool isItemFresh(const LLUUID& id) { return (mNewItemsIDs.find(id) != mNewItemsIDs.end()); } + void addInboxPanel(LLInboxInventoryPanel* inbox) { mInboxPanels.insert(inbox); } + void removeInboxPanel(LLInboxInventoryPanel* inbox) { mInboxPanels.erase(inbox); } + private: std::set<LLUUID> mNewItemsIDs; + + std::set<LLInboxInventoryPanel*> mInboxPanels; }; #endif //LL_INBOXINVENTORYPANEL_H |