From b3a2bd0d4d2ab633d2f8d73df5435677bcc1f5eb Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 6 Sep 2011 12:44:03 -0700 Subject: EXP-1194 FIX -- Update New tag behavior to update Newness timestamp when Received Items panel is open and do not auto open Received Items panel * The inbox no longer auto-expands under any condition. * Changed new-ness timestamp from "LastInventoryInboxCollapse" to "LastInventoryInboxExpansion" to eschew obfuscation. * "LastInventoryInboxExpansion" now saved out when user opens the panel. --- .../newview/app_settings/settings_per_account.xml | 4 ++-- indra/newview/llpanelmarketplaceinbox.cpp | 4 ---- indra/newview/llpanelmarketplaceinboxinventory.cpp | 9 +++---- indra/newview/llsidepanelinventory.cpp | 28 +++++++++++++--------- 4 files changed, 22 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 9064d6894d..49f8a11e3e 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -33,10 +33,10 @@ Value - LastInventoryInboxCollapse + LastInventoryInboxExpansion Comment - The last time the received items inbox was collapsed. + The last time the received items inbox was expanded for view. Persist 1 Type diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index a73742b68f..9f17c34dfb 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -53,10 +53,6 @@ LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() { - if (isInVisibleChain() && getChild("inbox_btn")->getToggleState()) - { - gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); - } } // virtual diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index e5fe2d0504..e5b0db92f3 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -200,16 +200,13 @@ BOOL LLInboxFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderVi void LLInboxFolderViewFolder::updateFlag() const { - const std::string& last_collapse = gSavedPerAccountSettings.getString("LastInventoryInboxCollapse"); + const std::string& last_expansion = gSavedPerAccountSettings.getString("LastInventoryInboxExpansion"); - if (!last_collapse.empty()) + if (!last_expansion.empty()) { - LLDate saved_freshness_date = LLDate(last_collapse); - //llinfos << "Saved freshness: " << saved_freshness_date.secondsSinceEpoch() << llendl; + LLDate saved_freshness_date = LLDate(last_expansion); mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch()); - - //llinfos << " Creation date: " << mCreationDate << " -- fresh -- " << mFresh << " -- this -- " << (void*)&*(this) << llendl; } } diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index a8a9f4948b..d958109927 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -64,6 +64,9 @@ static LLRegisterPanelClassWrapper t_inventory("sidepanel_ // Constants // +// No longer want the inbox panel to auto-expand since it creates issues with the "new" tag time stamp +#define AUTO_EXPAND_INBOX 0 + static const char * const INBOX_BUTTON_NAME = "inbox_btn"; static const char * const OUTBOX_BUTTON_NAME = "outbox_btn"; @@ -447,6 +450,7 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) // Trigger a load of the entire inbox so we always know the contents and their creation dates for sorting LLInventoryModelBackgroundFetch::instance().start(inbox_id); +#if AUTO_EXPAND_INBOX // If the outbox is expanded, don't auto-expand the inbox if (mOutboxEnabled) { @@ -455,13 +459,14 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) return; } } - + // Expand the inbox since we have fresh items and the outbox is not expanded if (mInboxEnabled) { getChild(INBOX_BUTTON_NAME)->setToggleState(true); onToggleInboxBtn(); - } + } +#endif } void LLSidepanelInventory::onOutboxChanged(const LLUUID& outbox_id) @@ -525,11 +530,11 @@ void LLSidepanelInventory::onToggleInboxBtn() LLButton* outboxButton = getChild(OUTBOX_BUTTON_NAME); LLLayoutPanel* outboxPanel = getChild(OUTBOX_LAYOUT_PANEL_NAME); - bool inbox_expanded = manageInboxOutboxPanels(inboxButton, inboxPanel, outboxButton, outboxPanel); + const bool inbox_expanded = manageInboxOutboxPanels(inboxButton, inboxPanel, outboxButton, outboxPanel); - if (!inbox_expanded && inboxPanel->isInVisibleChain()) + if (inbox_expanded && inboxPanel->isInVisibleChain()) { - gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); + gSavedPerAccountSettings.setString("LastInventoryInboxExpansion", LLDate::now().asString()); } } @@ -540,19 +545,14 @@ void LLSidepanelInventory::onToggleOutboxBtn() LLButton* outboxButton = getChild(OUTBOX_BUTTON_NAME); LLLayoutPanel* outboxPanel = getChild(OUTBOX_LAYOUT_PANEL_NAME); - bool inbox_was_expanded = inboxButton->getToggleState(); manageInboxOutboxPanels(outboxButton, outboxPanel, inboxButton, inboxPanel); - - if (inbox_was_expanded && inboxPanel->isInVisibleChain()) - { - gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); - } } void LLSidepanelInventory::onOpen(const LLSD& key) { LLFirstUse::newInventory(false); +#if AUTO_EXPAND_INBOX // Expand the inbox if we have fresh items LLPanelMarketplaceInbox * inbox = findChild(MARKETPLACE_INBOX_PANEL); if (inbox && (inbox->getFreshItemCount() > 0)) @@ -560,6 +560,12 @@ void LLSidepanelInventory::onOpen(const LLSD& key) getChild(INBOX_BUTTON_NAME)->setToggleState(true); onToggleInboxBtn(); } +#else + if (mInboxEnabled && getChild(INBOX_BUTTON_NAME)->getToggleState()) + { + gSavedPerAccountSettings.setString("LastInventoryInboxExpansion", LLDate::now().asString()); + } +#endif if(key.size() == 0) return; -- cgit v1.2.3