SL-19359 Show Received Items panel in all new Inventory floaters

meow-7.2.2
Mnikolenko Productengine 2023-03-08 02:41:11 +02:00
parent ea94cda5f5
commit 783a802abc
5 changed files with 33 additions and 23 deletions

View File

@ -531,6 +531,15 @@ void LLUICtrl::setControlVariable(LLControlVariable* control)
}
}
void LLUICtrl::removeControlVariable()
{
if (mControlVariable)
{
mControlConnection.disconnect();
mControlVariable = NULL;
}
}
//virtual
void LLUICtrl::setControlName(const std::string& control_name, LLView *context)
{

View File

@ -175,6 +175,7 @@ public:
bool setControlValue(const LLSD& value);
void setControlVariable(LLControlVariable* control);
virtual void setControlName(const std::string& control, LLView *context = NULL);
void removeControlVariable();
LLControlVariable* getControlVariable() { return mControlVariable; }

View File

@ -5001,17 +5001,6 @@
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>InventoryInboxToggleState</key>
<map>
<key>Comment</key>
<string>Stores the open/closed state of inventory Received items panel</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>InventoryLinking</key>
<map>

View File

@ -73,6 +73,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";
static bool sLoginCompleted = false;
//
// Helpers
//
@ -182,22 +184,30 @@ BOOL LLSidepanelInventory::postBuild()
inbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this));
// Get the previous inbox state from "InventoryInboxToggleState" setting.
bool is_inbox_collapsed = !inbox_button->getToggleState();
// For main Inventory floater: Get the previous inbox state from "InventoryInboxToggleState" setting.
// For additional Inventory floaters: Collapsed state is default.
bool is_inbox_collapsed = !inbox_button->getToggleState() || sLoginCompleted;
// Restore the collapsed inbox panel state
mInboxLayoutPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME);
inv_stack->collapsePanel(mInboxLayoutPanel, is_inbox_collapsed);
if (!is_inbox_collapsed)
{
inv_stack->collapsePanel(mInboxLayoutPanel, is_inbox_collapsed);
if (!is_inbox_collapsed)
{
mInboxLayoutPanel->setTargetDim(gSavedPerAccountSettings.getS32("InventoryInboxHeight"));
}
}
// Set the inbox visible based on debug settings (final setting comes from http request below)
enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox"));
// 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));
if (sLoginCompleted)
{
//save the state of Inbox panel only for main Inventory floater
inbox_button->removeControlVariable();
inbox_button->setToggleState(false);
updateInbox();
}
else
{
// 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));
}
}
gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged));
@ -207,6 +217,7 @@ BOOL LLSidepanelInventory::postBuild()
void LLSidepanelInventory::updateInbox()
{
sLoginCompleted = true;
//
// Track inbox folder changes
//

View File

@ -57,7 +57,7 @@
user_resize="true"
follows="left|right|top"
name="inbox_layout_panel"
visible="false"
visible="true"
min_dim="35"
expanded_min_dim="90"
height="235">