From f8823a426383949fb1609fa82b5ebb98ef2c295b Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 8 Jun 2023 23:25:12 +0300 Subject: SL-19845 show delete confirmation at least once per session --- indra/newview/llinventoryfunctions.cpp | 6 +++--- indra/newview/llinventoryfunctions.h | 2 +- indra/newview/llinventorygallerymenu.cpp | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index a259dad08a..0b024536ae 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -96,6 +96,7 @@ BOOL LLInventoryState::sWearNewClothing = FALSE; LLUUID LLInventoryState::sWearNewClothingTransactionID; std::list LLInventoryAction::sMarketplaceFolders; +bool LLInventoryAction::sDeleteConfirmationDisplayed = false; // Helper function : callback to update a folder after inventory action happened in the background void update_folder_cb(const LLUUID& dest_folder) @@ -2940,7 +2941,6 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root if ("delete" == action) { - static bool sDisplayedAtSession = false; const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS); bool marketplacelistings_item = false; LLAllDescendentsPassedFilter f; @@ -2964,10 +2964,10 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root } else { - if (!sDisplayedAtSession) // ask for the confirmation at least once per session + if (!sDeleteConfirmationDisplayed) // ask for the confirmation at least once per session { LLNotifications::instance().setIgnored("DeleteItems", false); - sDisplayedAtSession = true; + sDeleteConfirmationDisplayed = true; } LLSD args; diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 1b0f598bf5..914d9da620 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -551,7 +551,7 @@ struct LLInventoryAction static void saveMultipleTextures(const std::vector& filenames, std::set selected_items, LLInventoryModel* model); - static const int sConfirmOnDeleteItemsNumber; + static bool sDeleteConfirmationDisplayed; private: static void buildMarketplaceFolders(LLFolderView* root); diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index bc4b28b584..b090434528 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -211,6 +211,12 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata, const LLU } else if ("delete" == action) { + if (!LLInventoryAction::sDeleteConfirmationDisplayed) // ask for the confirmation at least once per session + { + LLNotifications::instance().setIgnored("DeleteItems", false); + LLInventoryAction::sDeleteConfirmationDisplayed = true; + } + LLSD args; args["QUESTION"] = LLTrans::getString("DeleteItem"); LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLInventoryGalleryContextMenu::onDelete, _1, _2, selected_id)); -- cgit v1.2.3