From ea94cda5f5bb9a426782ee7c7aebb1095ba444c1 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 7 Mar 2023 19:30:30 +0200 Subject: =?UTF-8?q?SL-19356=20bring=20SFV=20to=20the=20top=20instead=20of?= =?UTF-8?q?=20opening=20a=20new=20window=20if=20there=E2=80=99s=20already?= =?UTF-8?q?=20one=20open=20for=20that=20folder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llpanelmaininventory.cpp | 30 ++++++++++++++++++++++++++++++ indra/newview/llpanelmaininventory.h | 1 + 2 files changed, 31 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 6b9e04840d..a3ac64aee8 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -415,8 +415,33 @@ void LLPanelMainInventory::newWindow() } } +//static void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_select) { + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end();) + { + LLFloaterSidePanelContainer* inventory_container = dynamic_cast(*iter++); + if (inventory_container) + { + LLSidepanelInventory* sidepanel_inventory = dynamic_cast(inventory_container->findChild("main_panel", true)); + if (sidepanel_inventory) + { + LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); + if (main_inventory && main_inventory->isSingleFolderMode() + && (main_inventory->getSingleFolderViewRoot() == folder_id)) + { + main_inventory->setFocus(true); + if(item_to_select.notNull()) + { + sidepanel_inventory->getActivePanel()->setSelection(item_to_select, TAKE_FOCUS_YES); + } + return; + } + } + } + } + S32 instance_num = get_instance_num(); LLFloaterSidePanelContainer* inventory_container = LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); @@ -1346,6 +1371,11 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool } } +LLUUID LLPanelMainInventory::getSingleFolderViewRoot() +{ + return mSingleFolderPanelInventory->getSingleFolderRoot(); +} + void LLPanelMainInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) { if (menu) diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 7edaf7db96..b0f520ac5e 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -104,6 +104,7 @@ public: void onBackFolderClicked(); void onForwardFolderClicked(); void setSingleFolderViewRoot(const LLUUID& folder_id, bool clear_nav_history = true); + LLUUID getSingleFolderViewRoot(); bool isSingleFolderMode() { return mSingleFolderMode; } protected: -- cgit v1.2.3