From ba9b49f49e455a6f6ff2519e4e0c0de1be8d5dd0 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 15 Jan 2018 11:29:20 +0100 Subject: [PATCH] Fix inbox panel randomly shown on secondary inventory window and other inbox panel quirks --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llsidepanelinventory.cpp | 17 ++++++++++++----- indra/newview/llsidepanelinventory.h | 2 ++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index deef3fbb9a..0f2c8f92ec 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6842,7 +6842,7 @@ InventoryDisplayInbox Comment - Override received items inventory inbox display + UNUSED - Controlled via FSShowInboxFolder and FSAlwaysShowInboxButton: Override received items inventory inbox display Persist 0 Type diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 5f683bcd8c..e88bf24edc 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -79,6 +79,8 @@ static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; +bool LLSidepanelInventory::sInboxInitalized = false; // Inbox panel randomly shown on secondary inventory windows + // // Helpers // @@ -231,6 +233,7 @@ BOOL LLSidepanelInventory::postBuild() } // Received items inbox setup + if (!sInboxInitalized) // Inbox panel randomly shown on secondary inventory window { // FIRE-17603: Received Items button sometimes vanishing //LLLayoutStack* inv_stack = getChild(INVENTORY_LAYOUT_STACK_NAME); @@ -256,20 +259,24 @@ BOOL LLSidepanelInventory::postBuild() } // Set the inbox visible based on debug settings (final setting comes from http request below) - enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); // FIRE-17603: Received Items button sometimes vanishing + //enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); + enableInbox(!gSavedSettings.getBOOL("FSShowInboxFolder") || gSavedSettings.getBOOL("FSAlwaysShowInboxButton")); } // // Trigger callback for after login so we can setup to track inbox changes after initial inventory load LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::updateInbox, this)); + + // Optional hiding of Received Items folder aka Inbox + gSavedSettings.getControl("FSShowInboxFolder")->getSignal()->connect(boost::bind(&LLSidepanelInventory::refreshInboxVisibility, this)); + gSavedSettings.getControl("FSAlwaysShowInboxButton")->getSignal()->connect(boost::bind(&LLSidepanelInventory::refreshInboxVisibility, this)); + + sInboxInitalized = true; // Inbox panel randomly shown on secondary inventory window } - gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged)); - // Optional hiding of Received Items folder aka Inbox - gSavedSettings.getControl("FSShowInboxFolder")->getSignal()->connect(boost::bind(&LLSidepanelInventory::refreshInboxVisibility, this)); - gSavedSettings.getControl("FSAlwaysShowInboxButton")->getSignal()->connect(boost::bind(&LLSidepanelInventory::refreshInboxVisibility, this)); + //gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged)); // Update the verbs buttons state. updateVerbs(); diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 13362d2b2f..013a382ac7 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -134,6 +134,8 @@ private: LLInventoryCategoriesObserver* mCategoriesObserver; LLInboxAddedObserver* mInboxAddedObserver; + + static bool sInboxInitalized; // Inbox panel randomly shown on secondary inventory windows }; #endif //LL_LLSIDEPANELINVENTORY_H