SL-19845 show delete confirmation at least once per session

master
Maxim Nikolenko 2023-06-08 23:25:12 +03:00
parent 53fc42fe03
commit f8823a4263
3 changed files with 10 additions and 4 deletions

View File

@ -96,6 +96,7 @@
BOOL LLInventoryState::sWearNewClothing = FALSE;
LLUUID LLInventoryState::sWearNewClothingTransactionID;
std::list<LLUUID> 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;

View File

@ -551,7 +551,7 @@ struct LLInventoryAction
static void saveMultipleTextures(const std::vector<std::string>& filenames, std::set<LLFolderViewItem*> selected_items, LLInventoryModel* model);
static const int sConfirmOnDeleteItemsNumber;
static bool sDeleteConfirmationDisplayed;
private:
static void buildMarketplaceFolders(LLFolderView* root);

View File

@ -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));