From c9ba8f1fce4665f19ec9485c5ceb5bfa7f290321 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 3 Feb 2023 23:56:35 +0200 Subject: 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 --- indra/newview/llfloatermarketplacelistings.cpp | 30 +++++++++++++++++----- indra/newview/llinspectobject.cpp | 4 +-- indra/newview/llinventoryfunctions.cpp | 8 ++++-- indra/newview/llviewerfloaterreg.cpp | 1 + indra/newview/llviewermenu.cpp | 4 +-- .../default/xui/en/floater_item_properties.xml | 2 +- .../default/xui/en/floater_task_properties.xml | 24 +++++++++++++++++ 7 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/floater_task_properties.xml (limited to 'indra') diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index e755e9924c..478b6a9a50 100644 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -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("item_panel"); - LLButton* back_btn = panel->getChild("back_btn"); - back_btn->setVisible(FALSE); - + LLSidepanelInventorySubpanel* panel = findChild("sidepanel"); + if (panel) + { + LLButton* back_btn = panel->getChild("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("item_panel"); - panel->setItemID(key["id"].asUUID()); + LLSidepanelInventorySubpanel* panel = findChild("sidepanel"); + + LLSidepanelItemInfo* item_panel = dynamic_cast(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(panel); + if (task_panel) + { + task_panel->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); + } } diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index 5329f10612..c52d0be213 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -662,9 +662,7 @@ void LLInspectObject::onClickOpen() void LLInspectObject::onClickMoreInfo() { - LLSD key; - key["task"] = "task"; - LLFloaterSidePanelContainer::showPanel("inventory", key); + LLFloaterReg::showInstance("task_properties"); closeFloater(); } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 73df764893..21430a6507 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -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) diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 469df37f8e..2c57b56a3d 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -371,6 +371,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("inventory", "floater_my_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("item_properties", "floater_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("task_properties", "floater_task_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLInspectAvatarUtil::registerFloater(); LLInspectGroupUtil::registerFloater(); LLInspectObjectUtil::registerFloater(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a0223a5dbb..015a887e9f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -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"); } /* diff --git a/indra/newview/skins/default/xui/en/floater_item_properties.xml b/indra/newview/skins/default/xui/en/floater_item_properties.xml index 0fc54a9c8b..336bb902ca 100644 --- a/indra/newview/skins/default/xui/en/floater_item_properties.xml +++ b/indra/newview/skins/default/xui/en/floater_item_properties.xml @@ -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" diff --git a/indra/newview/skins/default/xui/en/floater_task_properties.xml b/indra/newview/skins/default/xui/en/floater_task_properties.xml new file mode 100644 index 0000000000..4b5c207577 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_task_properties.xml @@ -0,0 +1,24 @@ + + + + + -- cgit v1.2.3