From 75495116fcb9e2c4a9687154134bd1cdc25554a1 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 1 Sep 2015 14:40:45 +0300 Subject: MAINT-5556 FIXED Active listing folder stays listed, with empty Version folder --- indra/newview/llinventorybridge.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 36a3204391..a20540306b 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -295,7 +295,11 @@ BOOL LLInvFVBridge::callback_cutToClipboard(const LLSD& notification, const LLSD S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) // YES { - return perform_cutToClipboard(); + const LLInventoryObject* obj = gInventory.getObject(mUUID); + LLUUID parent_uuid = obj->getParentUUID(); + BOOL result = perform_cutToClipboard(); + gInventory.addChangedMask(LLInventoryObserver::STRUCTURE, parent_uuid); + return result; } return FALSE; } -- cgit v1.2.3 From 219d6820829d1ed164e6ed96c22b9eec0f69ae91 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 13 Nov 2015 19:05:17 +0200 Subject: MAINT-5495 FIXED Drag and Drop no copy items from object contents to inventory creates multiple pop ups --- indra/newview/llinventorybridge.cpp | 43 +++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index adc0fced5a..2f392933a9 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -80,6 +80,8 @@ #include "lllandmarkactions.h" #include "llpanellandmarks.h" +#include + void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); typedef std::pair two_uuids_t; @@ -99,7 +101,7 @@ struct LLMoveInv using namespace LLOldEvents; // Function declarations -bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*); +bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, boost::shared_ptr); bool confirm_attachment_rez(const LLSD& notification, const LLSD& response); void teleport_via_landmark(const LLUUID& asset_id); static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit); @@ -2793,7 +2795,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, return accept; } -void warn_move_inventory(LLViewerObject* object, LLMoveInv* move_inv) +void warn_move_inventory(LLViewerObject* object, boost::shared_ptr move_inv) { const char* dialog = NULL; if (object->flagScripted()) @@ -2804,7 +2806,34 @@ void warn_move_inventory(LLViewerObject* object, LLMoveInv* move_inv) { dialog = "MoveInventoryFromObject"; } - LLNotificationsUtil::add(dialog, LLSD(), LLSD(), boost::bind(move_task_inventory_callback, _1, _2, move_inv)); + + static LLNotificationPtr notification_ptr = NULL; + static boost::shared_ptr inv_ptr; + + // Notification blocks user from interacting with inventories so everything that comes after first message + // is part of this message - don'r show it again + // Note: workaround for MAINT-5495 untill proper refactoring and warning system for Drag&Drop can be made. + if (notification_ptr == NULL + || !notification_ptr->isActive() + || LLNotificationsUtil::find(notification_ptr->getID()) == NULL + || inv_ptr->mCategoryID != move_inv->mCategoryID + || inv_ptr->mObjectID != move_inv->mObjectID) + { + notification_ptr = LLNotificationsUtil::add(dialog, LLSD(), LLSD(), boost::bind(move_task_inventory_callback, _1, _2, move_inv)); + inv_ptr = move_inv; + } + else + { + // Notification is alive and not responded, operating inv_ptr should be safe so attach new data + two_uuids_list_t::iterator move_it; + for (move_it = move_inv->mMoveList.begin(); + move_it != move_inv->mMoveList.end(); + ++move_it) + { + inv_ptr->mMoveList.push_back(*move_it); + } + move_inv.reset(); + } } // Move/copy all inventory items from the Contents folder of an in-world @@ -2892,7 +2921,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id, if(drop && accept) { it = inventory_objects.begin(); - LLMoveInv* move_inv = new LLMoveInv; + boost::shared_ptr move_inv(new LLMoveInv); move_inv->mObjectID = object_id; move_inv->mCategoryID = category_id; move_inv->mCallback = callback; @@ -4408,7 +4437,7 @@ LLFontGL::StyleFlags LLMarketplaceFolderBridge::getLabelStyle() const // helper stuff -bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv* move_inv) +bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, boost::shared_ptr move_inv) { LLFloaterOpenObject::LLCatAndWear* cat_and_wear = (LLFloaterOpenObject::LLCatAndWear* )move_inv->mUserData; LLViewerObject* object = gObjectList.findObject(move_inv->mObjectID); @@ -4444,7 +4473,7 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response move_inv->mCallback(option, move_inv->mUserData); } - delete move_inv; + move_inv.reset(); //since notification will persist return false; } @@ -4860,7 +4889,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (accept && drop) { - LLMoveInv* move_inv = new LLMoveInv; + boost::shared_ptr move_inv (new LLMoveInv()); move_inv->mObjectID = inv_item->getParentUUID(); two_uuids_t item_pair(mUUID, inv_item->getUUID()); move_inv->mMoveList.push_back(item_pair); -- cgit v1.2.3 From fd742bca7a33364ffdee549e4dc949214f6720e4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 17 Nov 2015 20:47:08 +0200 Subject: MAINT-5495 linux build fix --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 2f392933a9..9782c792c9 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2807,7 +2807,7 @@ void warn_move_inventory(LLViewerObject* object, boost::shared_ptr mo dialog = "MoveInventoryFromObject"; } - static LLNotificationPtr notification_ptr = NULL; + static LLNotificationPtr notification_ptr; static boost::shared_ptr inv_ptr; // Notification blocks user from interacting with inventories so everything that comes after first message -- cgit v1.2.3