summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
authorCallum Prentice <callum@gmail.com>2017-06-08 15:36:42 -0700
committerCallum Prentice <callum@gmail.com>2017-06-08 15:36:42 -0700
commit07185d300d7879fc4d8d268210fa2c440efe02f4 (patch)
tree761fcb3e968339bc04882ea591f56af2fb175187 /indra/newview/llinventorymodel.cpp
parent8d36da00c885f31739ce6bf6dbc162a6ef3a15a1 (diff)
parentcf5865c6e2b27918b526431ccc4309bfc702534e (diff)
Automated merge with head of lindenlab/viewer64
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));
+ }
}
}