diff options
-rw-r--r-- | indra/newview/llpanelmarketplaceinbox.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceinboxinventory.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceinboxinventory.h | 4 | ||||
-rw-r--r-- | indra/newview/llsidepanelinventory.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llsidetray.cpp | 2 |
5 files changed, 31 insertions, 23 deletions
diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 5a835eadf1..a73742b68f 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -53,7 +53,7 @@ LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
{
- if (getVisible() && getChild<LLButton>("inbox_btn")->getToggleState())
+ if (isInVisibleChain() && getChild<LLButton>("inbox_btn")->getToggleState())
{
gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString());
}
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index e2f8af1280..f6a4b6e26b 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -174,19 +174,6 @@ LLInboxFolderViewFolder::~LLInboxFolderViewFolder() } // virtual -time_t LLInboxFolderViewFolder::getCreationDate() const -{ - time_t ret_val = LLFolderViewFolder::getCreationDate(); - - if (!mCreationDate) - { - updateFlag(); - } - - return ret_val; -} - -// virtual void LLInboxFolderViewFolder::draw() { #if SUPPORTING_FRESH_ITEM_COUNT @@ -201,32 +188,53 @@ void LLInboxFolderViewFolder::draw() LLFolderViewFolder::draw(); } +BOOL LLInboxFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) +{ + BOOL retval = LLFolderViewFolder::addToFolder(folder, root); + + // Only mark top-level inbox folders as fresh + mFresh = (mParentFolder == mRoot); + + return retval; +} + void LLInboxFolderViewFolder::updateFlag() const { const std::string& last_collapse = gSavedPerAccountSettings.getString("LastInventoryInboxCollapse"); + if (!last_collapse.empty()) { LLDate saved_freshness_date = LLDate(last_collapse); + //llinfos << "Saved freshness: " << saved_freshness_date.secondsSinceEpoch() << llendl; + mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch()); + + //llinfos << " Creation date: " << mCreationDate << " -- fresh -- " << mFresh << " -- this -- " << (void*)&*(this) << llendl; } } void LLInboxFolderViewFolder::selectItem() { - mFresh = false; LLFolderViewFolder::selectItem(); + + mFresh = false; } void LLInboxFolderViewFolder::toggleOpen() { - mFresh = false; LLFolderViewFolder::toggleOpen(); + + mFresh = false; } void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const { mCreationDate = creation_date_utc; - updateFlag(); + + if (mFresh) + { + updateFlag(); + } } // diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 6cb243dbd5..06706539a0 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -73,10 +73,10 @@ public: LLInboxFolderViewFolder(const Params& p); ~LLInboxFolderViewFolder(); - time_t getCreationDate() const; - void draw(); + BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root); + void updateFlag() const; void selectItem(); void toggleOpen(); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 9290b7ebef..a8a9f4948b 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -500,7 +500,7 @@ bool LLSidepanelInventory::manageInboxOutboxPanels(LLButton * pressedButton, LLL else { // NOTE: This is an attempt to reshape the inventory panel to the proper size but it doesn't seem to propagate - // propery to the child panels. + // properly to the child panels. S32 new_height = inout_panel->getRect().getHeight(); @@ -527,7 +527,7 @@ void LLSidepanelInventory::onToggleInboxBtn() bool inbox_expanded = manageInboxOutboxPanels(inboxButton, inboxPanel, outboxButton, outboxPanel); - if (!inbox_expanded && inboxPanel->getVisible()) + if (!inbox_expanded && inboxPanel->isInVisibleChain()) { gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); } @@ -543,7 +543,7 @@ void LLSidepanelInventory::onToggleOutboxBtn() bool inbox_was_expanded = inboxButton->getToggleState(); manageInboxOutboxPanels(outboxButton, outboxPanel, inboxButton, inboxPanel); - if (inbox_was_expanded && inboxPanel->getVisible()) + if (inbox_was_expanded && inboxPanel->isInVisibleChain()) { gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); } diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 651897a217..363c8543ed 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -1442,7 +1442,7 @@ void LLSideTray::updateSidetrayVisibility() parent->setVisible(new_visibility); // Signal change of visible width. - llinfos << "Visible: " << new_visibility << llendl; + //llinfos << "Visible: " << new_visibility << llendl; mVisibleWidthChangeSignal(this, new_visibility); } } |