diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-08-28 16:26:30 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-08-28 16:26:30 +0300 |
commit | 9527199b0a0ca6b1089a05eef13674ebab5e8637 (patch) | |
tree | 2d83e0e628185b3a4e0b82068053f47e43723eb3 /indra | |
parent | f3fbb042ccef2fdb1d3f38ec48c7724706e732d7 (diff) |
SL-13877 'Classified' accordion does not disappear after deleting all Classifieds
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelpicks.cpp | 45 | ||||
-rw-r--r-- | indra/newview/llpanelpicks.h | 1 |
2 files changed, 33 insertions, 13 deletions
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index c39df3fe8b..8bb776bda6 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -472,19 +472,7 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) mNoClassifieds = !mClassifiedsList->size(); } - bool no_data = mNoPicks && mNoClassifieds; - mNoItemsLabel->setVisible(no_data); - if (no_data) - { - if(getAvatarId() == gAgentID) - { - mNoItemsLabel->setValue(LLTrans::getString("NoPicksClassifiedsText")); - } - else - { - mNoItemsLabel->setValue(LLTrans::getString("NoAvatarPicksClassifiedsText")); - } - } + updateNoItemsLabel(); } LLPickItem* LLPanelPicks::getSelectedPickItem() @@ -713,6 +701,13 @@ bool LLPanelPicks::callbackDeletePick(const LLSD& notification, const LLSD& resp { LLAvatarPropertiesProcessor::instance().sendPickDelete(pick_value[PICK_ID]); mPicksList->removeItemByValue(pick_value); + + mNoPicks = !mPicksList->size(); + if (mNoPicks) + { + showAccordion("tab_picks", false); + } + updateNoItemsLabel(); } updateButtons(); return false; @@ -727,6 +722,13 @@ bool LLPanelPicks::callbackDeleteClassified(const LLSD& notification, const LLSD { LLAvatarPropertiesProcessor::instance().sendClassifiedDelete(value[CLASSIFIED_ID]); mClassifiedsList->removeItemByValue(value); + + mNoClassifieds = !mClassifiedsList->size(); + if (mNoClassifieds) + { + showAccordion("tab_classifieds", false); + } + updateNoItemsLabel(); } updateButtons(); return false; @@ -840,6 +842,23 @@ void LLPanelPicks::updateButtons() } } +void LLPanelPicks::updateNoItemsLabel() +{ + bool no_data = mNoPicks && mNoClassifieds; + mNoItemsLabel->setVisible(no_data); + if (no_data) + { + if (getAvatarId() == gAgentID) + { + mNoItemsLabel->setValue(LLTrans::getString("NoPicksClassifiedsText")); + } + else + { + mNoItemsLabel->setValue(LLTrans::getString("NoAvatarPicksClassifiedsText")); + } + } +} + void LLPanelPicks::setProfilePanel(LLPanelProfile* profile_panel) { mProfilePanel = profile_panel; diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 3bb7413ac3..fd7688b99d 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -87,6 +87,7 @@ public: protected: /*virtual*/void updateButtons(); + void updateNoItemsLabel(); private: void onClickDelete(); |