SL-19109 Decouple object profiles from inventory

Potentially this won't stay as sidepanels, but such rework is planned for SL-19134, for now just making it possible to open multiple instances of item profiles
master
Andrey Kleshchev 2023-02-03 23:56:35 +02:00
parent 2f4902967a
commit c9ba8f1fce
7 changed files with 58 additions and 15 deletions

View File

@ -41,6 +41,7 @@
#include "llnotificationmanager.h"
#include "llnotificationsutil.h"
#include "llsidepaneliteminfo.h"
#include "llsidepaneltaskinfo.h"
#include "lltextbox.h"
#include "lltrans.h"
@ -955,17 +956,34 @@ LLFloaterItemProperties::~LLFloaterItemProperties()
BOOL LLFloaterItemProperties::postBuild()
{
// On the standalone properties floater, we have no need for a back button...
LLSidepanelItemInfo* panel = getChild<LLSidepanelItemInfo>("item_panel");
LLButton* back_btn = panel->getChild<LLButton>("back_btn");
back_btn->setVisible(FALSE);
LLSidepanelInventorySubpanel* panel = findChild<LLSidepanelInventorySubpanel>("sidepanel");
if (panel)
{
LLButton* back_btn = panel->getChild<LLButton>("back_btn");
back_btn->setVisible(FALSE);
}
return LLFloater::postBuild();
}
void LLFloaterItemProperties::onOpen(const LLSD& key)
{
// Tell the panel which item it needs to visualize
LLSidepanelItemInfo* panel = getChild<LLSidepanelItemInfo>("item_panel");
panel->setItemID(key["id"].asUUID());
LLSidepanelInventorySubpanel* panel = findChild<LLSidepanelInventorySubpanel>("sidepanel");
LLSidepanelItemInfo* item_panel = dynamic_cast<LLSidepanelItemInfo*>(panel);
if (item_panel)
{
item_panel->setItemID(key["id"].asUUID());
if (key.has("object"))
{
item_panel->setObjectID(key["object"].asUUID());
}
}
LLSidepanelTaskInfo* task_panel = dynamic_cast<LLSidepanelTaskInfo*>(panel);
if (task_panel)
{
task_panel->setObjectSelection(LLSelectMgr::getInstance()->getSelection());
}
}

View File

@ -662,9 +662,7 @@ void LLInspectObject::onClickOpen()
void LLInspectObject::onClickMoreInfo()
{
LLSD key;
key["task"] = "task";
LLFloaterSidePanelContainer::showPanel("inventory", key);
LLFloaterReg::showInstance("task_properties");
closeFloater();
}

View File

@ -765,13 +765,17 @@ BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id)
void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id)
{
LLFloaterSidePanelContainer::showPanel("inventory", LLSD().with("id", item_uuid).with("object", object_id));
LLSD params;
params["id"] = item_uuid;
params["object"] = object_id;
LLFloaterReg::showInstance("item_properties", params);
}
void show_item_profile(const LLUUID& item_uuid)
{
LLUUID linked_uuid = gInventory.getLinkedItemID(item_uuid);
LLFloaterSidePanelContainer::showPanel("inventory", LLSD().with("id", linked_uuid));
LLFloaterReg::showInstance("item_properties", LLSD().with("id", linked_uuid));
}
void show_item_original(const LLUUID& item_uuid)

View File

@ -371,6 +371,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("inventory", "floater_my_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInspect>);
LLFloaterReg::add("item_properties", "floater_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterItemProperties>);
LLFloaterReg::add("task_properties", "floater_task_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterItemProperties>);
LLInspectAvatarUtil::registerFloater();
LLInspectGroupUtil::registerFloater();
LLInspectObjectUtil::registerFloater();

View File

@ -3042,9 +3042,7 @@ void handle_object_inspect()
LLViewerObject* selected_objectp = selection->getFirstRootObject();
if (selected_objectp)
{
LLSD key;
key["task"] = "task";
LLFloaterSidePanelContainer::showPanel("inventory", key);
LLFloaterReg::showInstance("task_properties");
}
/*

View File

@ -13,7 +13,7 @@
left="0"
class="sidepanel_item_info"
filename="sidepanel_item_info.xml"
name="item_panel"
name="sidepanel"
top="20"
label=""
height="570"

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
legacy_header_height="18"
height="570"
layout="topleft"
name="Task Properties"
help_topic="item+properties"
title="ITEM PROPERTIES"
single_instance="true"
width="330">
<panel
follows="all"
layout="topleft"
left="0"
class="sidepanel_task_info"
filename="sidepanel_task_info.xml"
name="sidepanel"
top="20"
label=""
height="550"
visible="true"
width="330">
</panel>
</floater>