diff options
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 855f7c750e..e5fd126d53 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) @@ -3319,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 @@ -3415,13 +3421,32 @@ 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); + if (LLFloaterPreviewTrash::isVisible()) + { + // bring to front + LLFloaterPreviewTrash::show(); + } + else + { + LLNotificationsUtil::add("TrashIsFull", LLSD(), LLSD(), + boost::bind(callback_preview_trash_folder, _1, _2)); + } } } |