From dcd1b45d2e25a68c2e3f2d199d204b669891244d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 28 Apr 2017 15:39:04 +0300 Subject: MAINT-7354 Trash alert should display trash, not prompt to purge it all --- indra/newview/llinventorymodel.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 855f7c750e..8a605ff574 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -41,6 +41,7 @@ #include "llinventoryfunctions.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" +#include "llfloaterpreviewtrash.h" #include "llnotificationsutil.h" #include "llmarketplacefunctions.h" #include "llwindow.h" @@ -3299,9 +3300,7 @@ void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**) } //---------------------------------------------------------------------------- - // Trash: LLFolderType::FT_TRASH, "ConfirmEmptyTrash" -// Trash: LLFolderType::FT_TRASH, "TrashIsFull" when trash exceeds maximum capacity // Lost&Found: LLFolderType::FT_LOST_AND_FOUND, "ConfirmEmptyLostAndFound" bool LLInventoryModel::callbackEmptyFolderType(const LLSD& notification, const LLSD& response, LLFolderType::EType preferred_type) @@ -3415,13 +3414,24 @@ void LLInventoryModel::removeObject(const LLUUID& object_id) } } +bool callback_preview_trash_folder(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + LLFloaterPreviewTrash::show(); + } + return false; +} + void LLInventoryModel::checkTrashOverflow() { static const U32 trash_max_capacity = gSavedSettings.getU32("InventoryTrashMaxCapacity"); const LLUUID trash_id = findCategoryUUIDForType(LLFolderType::FT_TRASH); if (getDescendentsCountRecursive(trash_id, trash_max_capacity) >= trash_max_capacity) { - gInventory.emptyFolderType("TrashIsFull", LLFolderType::FT_TRASH); + LLNotificationsUtil::add("TrashIsFull", LLSD(), LLSD(), + boost::bind(callback_preview_trash_folder, _1, _2)); } } -- cgit v1.2.3 From 00529b31b722d64699615241d95ea492134bc9bf Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 4 May 2017 15:00:33 +0300 Subject: MAINT-7383 Revise notification for Empty Trash / Purge trash action to include number of items being deleted. --- indra/newview/llinventorymodel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 8a605ff574..0fe03583f5 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3318,7 +3318,14 @@ void LLInventoryModel::emptyFolderType(const std::string notification, LLFolderT { if (!notification.empty()) { - LLNotificationsUtil::add(notification, LLSD(), LLSD(), + LLSD args; + if(LLFolderType::FT_TRASH == preferred_type) + { + static const U32 trash_max_capacity = gSavedSettings.getU32("InventoryTrashMaxCapacity"); + const LLUUID trash_id = findCategoryUUIDForType(preferred_type); + args["COUNT"] = (S32)getDescendentsCountRecursive(trash_id, trash_max_capacity); + } + LLNotificationsUtil::add(notification, args, LLSD(), boost::bind(&LLInventoryModel::callbackEmptyFolderType, this, _1, _2, preferred_type)); } else -- cgit v1.2.3 From fb7be87bebd785a7a3e7a7b59103bc952d98dc83 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 8 May 2017 18:05:10 +0300 Subject: MAINT-7354 correction to misbehaving 'purge' and notification spam. --- indra/newview/llinventorymodel.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 0fe03583f5..e5fd126d53 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3437,8 +3437,16 @@ void LLInventoryModel::checkTrashOverflow() const LLUUID trash_id = findCategoryUUIDForType(LLFolderType::FT_TRASH); if (getDescendentsCountRecursive(trash_id, trash_max_capacity) >= trash_max_capacity) { - LLNotificationsUtil::add("TrashIsFull", LLSD(), LLSD(), - boost::bind(callback_preview_trash_folder, _1, _2)); + if (LLFloaterPreviewTrash::isVisible()) + { + // bring to front + LLFloaterPreviewTrash::show(); + } + else + { + LLNotificationsUtil::add("TrashIsFull", LLSD(), LLSD(), + boost::bind(callback_preview_trash_folder, _1, _2)); + } } } -- cgit v1.2.3