summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2017-05-22 21:09:07 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2017-05-22 21:09:07 +0100
commit806fd24704b69e5e51dae108952937cc05840f6c (patch)
tree2047cbf2ad5364b5e803c06b2702216023d2d17d /indra/newview/llinventorymodel.cpp
parent8528a9ae131dff09865eccd672efce621571c5e5 (diff)
parent48af8529a80052e9bc42f81f36896739f8aff861 (diff)
merge
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp33
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));
+ }
}
}