diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2018-07-18 08:53:46 +0000 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2018-07-18 08:53:46 +0000 |
commit | 546002d7695bea2e65a77681f0ea540b930cb1b7 (patch) | |
tree | 38752cce5d54a2b9fdd75a3bde183414f39c8dda | |
parent | 04e27dad427807ecef813c7de4f813a18afc36c6 (diff) | |
parent | 7c82588ae3686cf982891a92164e384ff3475cc6 (diff) |
Merged in maxim_productengine/viewer-neko_maint2 (pull request #658)
MAINT-8883 Restore previous selection after updating the list
Approved-by: Andrey Lihatskiy <andreylproductengine@lindenlab.com>
Approved-by: Andrey Kleshchev <andreykproductengine@lindenlab.com>
-rw-r--r-- | indra/newview/llpanelgroupnotices.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llpanelgroupnotices.h | 4 |
2 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index fe49ed0649..ce6834b4b3 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -303,6 +303,8 @@ void LLPanelGroupNotices::activate() { if(mNoticesList) mNoticesList->deleteAllItems(); + + mPrevSelectedNotice = LLUUID(); BOOL can_send = gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_SEND); BOOL can_receive = gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_RECEIVE); @@ -454,12 +456,18 @@ void LLPanelGroupNotices::refreshNotices() } +void LLPanelGroupNotices::clearNoticeList() +{ + mPrevSelectedNotice = mNoticesList->getStringUUIDSelectedItem(); + mNoticesList->deleteAllItems(); +} + void LLPanelGroupNotices::onClickRefreshNotices(void* data) { LL_DEBUGS() << "LLPanelGroupNotices::onClickGetPastNotices" << LL_ENDL; LLPanelGroupNotices* self = (LLPanelGroupNotices*)data; - self->mNoticesList->deleteAllItems(); + self->clearNoticeList(); LLMessageSystem* msg = gMessageSystem; msg->newMessage("GroupNoticesListRequest"); @@ -547,7 +555,6 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) LLSD row; row["id"] = id; - row["columns"][0]["column"] = "icon"; if (has_attachment) { @@ -577,7 +584,10 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) mNoticesList->updateSort(); if (mPanelViewNotice->getVisible()) { - mNoticesList->selectFirstItem(); + if (!mNoticesList->selectByID(mPrevSelectedNotice)) + { + mNoticesList->selectFirstItem(); + } } } diff --git a/indra/newview/llpanelgroupnotices.h b/indra/newview/llpanelgroupnotices.h index 04629b5f6b..46c8c241c6 100644 --- a/indra/newview/llpanelgroupnotices.h +++ b/indra/newview/llpanelgroupnotices.h @@ -65,6 +65,8 @@ public: void refreshNotices(); + void clearNoticeList(); + virtual void setGroupID(const LLUUID& id); private: @@ -113,6 +115,8 @@ private: LLOfferInfo* mInventoryOffer; + LLUUID mPrevSelectedNotice; + static std::map<LLUUID,LLPanelGroupNotices*> sInstances; }; |