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. --- indra/newview/llsidepanelinventory.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'indra/newview/llsidepanelinventory.cpp') 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