From 873fcd3a0ba50bb06f8fc74dc516da6426280856 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 19 Apr 2023 22:06:00 +0300 Subject: SL-19621 Right click>New folder in List View should change root folder before creating new folder --- indra/newview/llinventorypanel.cpp | 13 +++++++++++++ indra/newview/llinventorypanel.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 4b525b09d1..2c7c6d2056 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -2080,6 +2080,7 @@ LLInventorySingleFolderPanel::LLInventorySingleFolderPanel(const Params& params) getFilter().setDefaultEmptyLookupMessage("InventorySingleFolderEmpty"); mCommitCallbackRegistrar.add("Inventory.OpenSelectedFolder", boost::bind(&LLInventorySingleFolderPanel::openInCurrentWindow, this, _2)); + mCommitCallbackRegistrar.replace("Inventory.DoCreate", boost::bind(&LLInventorySingleFolderPanel::doCreate, this, _2)); } LLInventorySingleFolderPanel::~LLInventorySingleFolderPanel() @@ -2225,6 +2226,18 @@ bool LLInventorySingleFolderPanel::hasVisibleItems() { return mFolderRoot.get()->hasVisibleChildren(); } + +void LLInventorySingleFolderPanel::doCreate(const LLSD& userdata) +{ + std::string type_name = userdata.asString(); + LLUUID dest_id = LLFolderBridge::sSelf.get()->getUUID(); + if (("category" == type_name) || ("outfit" == type_name)) + { + changeFolderRoot(dest_id); + } + reset_inventory_filter(); + menu_create_inventory_item(this, dest_id, userdata); +} /************************************************************************/ /* Asset Pre-Filtered Inventory Panel related class */ /************************************************************************/ diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index abd5b4f20b..fb2419ada7 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -402,6 +402,8 @@ public: void clearNavigationHistory(); LLUUID getSingleFolderRoot() { return mFolderID; } + void doCreate(const LLSD& userdata); + bool isBackwardAvailable(); bool isForwardAvailable(); -- cgit v1.2.3