From f04992676d5ab17cc34b310e06ce7d838c5232b9 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 19 Mar 2025 00:50:18 +0200 Subject: #3685 add test floater for new slapps --- indra/newview/CMakeLists.txt | 2 + indra/newview/app_settings/settings.xml | 11 ++ indra/newview/llfloaterslapptest.cpp | 51 +++++++++ indra/newview/llfloaterslapptest.h | 42 +++++++ indra/newview/llinventorybridge.cpp | 15 +++ indra/newview/llviewerfloaterreg.cpp | 5 +- .../skins/default/xui/en/floater_test_slapp.xml | 123 +++++++++++++++++++++ .../skins/default/xui/en/menu_inventory.xml | 8 ++ indra/newview/skins/default/xui/en/menu_viewer.xml | 7 ++ 9 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 indra/newview/llfloaterslapptest.cpp create mode 100644 indra/newview/llfloaterslapptest.h create mode 100644 indra/newview/skins/default/xui/en/floater_test_slapp.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 3210b76649..ed29911a43 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -291,6 +291,7 @@ set(viewer_SOURCE_FILES llfloatersettingscolor.cpp llfloatersettingsdebug.cpp llfloatersidepanelcontainer.cpp + llfloaterslapptest.cpp llfloatersnapshot.cpp llfloatersounddevices.cpp llfloaterspellchecksettings.cpp @@ -962,6 +963,7 @@ set(viewer_HEADER_FILES llfloatersettingscolor.h llfloatersettingsdebug.h llfloatersidepanelcontainer.h + llfloaterslapptest.h llfloatersnapshot.h llfloatersounddevices.h llfloaterspellchecksettings.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0c83355a81..4ce7e0f729 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3676,6 +3676,17 @@ Value 5000 + InventoryExposeFolderID + + Comment + Allows copying folder id from context menu + Persist + 0 + Type + Boolean + Value + 0 + MarketplaceListingsSortOrder Comment diff --git a/indra/newview/llfloaterslapptest.cpp b/indra/newview/llfloaterslapptest.cpp new file mode 100644 index 0000000000..0075379529 --- /dev/null +++ b/indra/newview/llfloaterslapptest.cpp @@ -0,0 +1,51 @@ +/** + * @file llfloaterslapptest.cpp + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterslapptest.h" +#include "lluictrlfactory.h" + +#include "lllineeditor.h" +#include "lltextbox.h" + +LLFloaterSLappTest::LLFloaterSLappTest(const LLSD& key) + : LLFloater("floater_test_slapp") +{ +} + +LLFloaterSLappTest::~LLFloaterSLappTest() +{} + +bool LLFloaterSLappTest::postBuild() +{ + getChild("remove_folder_id")->setKeystrokeCallback([this](LLLineEditor* editor, void*) + { + std::string slapp(getString("remove_folder_slapp")); + getChild("remove_folder_txt")->setValue(slapp + editor->getValue().asString()); + }, NULL); + + return true; +} diff --git a/indra/newview/llfloaterslapptest.h b/indra/newview/llfloaterslapptest.h new file mode 100644 index 0000000000..ec727cb629 --- /dev/null +++ b/indra/newview/llfloaterslapptest.h @@ -0,0 +1,42 @@ +/** + * @file llfloaterslapptest.h + * + * $LicenseInfo:firstyear=2025&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2025, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERSLAPPTEST_H +#define LL_LLFLOATERSLAPPTEST_H + +#include "llfloater.h" + +class LLFloaterSLappTest: + public LLFloater +{ + friend class LLFloaterReg; + virtual bool postBuild() override; + +private: + LLFloaterSLappTest(const LLSD& key); + ~LLFloaterSLappTest(); +}; + +#endif diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 479b7c19ac..ce91f9a1f3 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3599,6 +3599,13 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS); move_folder_to_marketplacelistings(cat, marketplacelistings_id, ("move_to_marketplace_listings" != action), (("copy_or_move_to_marketplace_listings" == action))); } + else if ("copy_folder_uuid" == action) + { + LLInventoryCategory* cat = gInventory.getCategory(mUUID); + if (!cat) return; + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(mUUID.asString())); + return; + } } void LLFolderBridge::gatherMessage(std::string& message, S32 depth, LLError::ELevel log_level) @@ -4466,6 +4473,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { disabled_items.push_back(std::string("Delete System Folder")); } + else + { + static LLCachedControl show_copy_id(gSavedSettings, "InventoryExposeFolderID", false); + if (show_copy_id()) + { + items.push_back(std::string("Copy UUID")); + } + } if (isAgentInventory() && !isMarketplaceListingsFolder()) { diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index ef68609182..95c2a77ba8 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -137,6 +137,7 @@ #include "llfloatersettingscolor.h" #include "llfloatersettingsdebug.h" #include "llfloatersidepanelcontainer.h" +#include "llfloaterslapptest.h" #include "llfloatersnapshot.h" #include "llfloatersounddevices.h" #include "llfloaterspellchecksettings.h" @@ -278,7 +279,8 @@ public: "upload_model", "upload_script", "upload_sound", - "bulk_upload" + "bulk_upload", + "slapp_test" }; return std::find(blacklist_untrusted.begin(), blacklist_untrusted.end(), fl_name) == blacklist_untrusted.end(); } @@ -499,6 +501,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("profile", "floater_profile.xml",(LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("guidebook", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("slapp_test", "floater_test_slapp.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("big_preview", "floater_big_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/xui/en/floater_test_slapp.xml b/indra/newview/skins/default/xui/en/floater_test_slapp.xml new file mode 100644 index 0000000000..dd2720816a --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_slapp.xml @@ -0,0 +1,123 @@ + + + + secondlife://app/remove_folder/?folder_id= + + + Trusted source + + + /wear_folder + + + secondlife://app/wear_folder/?folder_name=Daisy + + + /add_folder + + + secondlife://app/add_folder/?folder_name=Cardboard%20Boxbot + + + secondlife://app/add_folder/?folder_id=59219db2-c260-87d3-213d-bb3bc298a3d8 + + + /remove_folder + + + Folder ID: + + + + secondlife://app/remove_folder/?folder_id= + + diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index d8aac71dd5..e57e3b0750 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -370,6 +370,14 @@ function="Inventory.DoToSelected" parameter="copy_uuid" /> + + + + + + -- cgit v1.2.3