From c1636911c84f948e542f445d3c7495e6df185912 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 1 Feb 2012 19:09:29 -0800 Subject: EXP-1862 : Make LLClipboard an LLSingleton and clean up the internals (set up for toolbar and never used) --- indra/newview/llfloatergesture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloatergesture.cpp') diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index d495f20a9a..e025d6edb5 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -534,7 +534,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command) } else if ("copy_uuid" == command_name) { - gClipboard.copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID()); + LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID()); } } -- cgit v1.2.3 From db824cff75696c42fff80ba29dbb60f12d10a1da Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 3 Feb 2012 18:38:03 -0800 Subject: EXP-1862 : Suppress LLInventoryClipboard, move its functions to the unified LLClipboard and use this only --- indra/newview/llfloatergesture.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'indra/newview/llfloatergesture.cpp') diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index e025d6edb5..281cafa90d 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -32,7 +32,7 @@ #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" -#include "llinventoryclipboard.h" +#include "llclipboard.h" #include "llagent.h" #include "llappearancemgr.h" @@ -391,11 +391,11 @@ bool LLFloaterGesture::isActionEnabled(const LLSD& command) std::string command_name = command.asString(); if("paste" == command_name) { - if(!LLInventoryClipboard::instance().hasContents()) + if(!LLClipboard::getInstance()->hasContents()) return false; LLDynamicArray ids; - LLInventoryClipboard::instance().retrieve(ids); + LLClipboard::getInstance()->retrieve(ids); for(LLDynamicArray::iterator it = ids.begin(); it != ids.end(); it++) { LLInventoryItem* item = gInventory.getItem(*it); @@ -496,21 +496,20 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command) uuid_vec_t ids; getSelectedIds(ids); // make sure that clopboard is empty - LLInventoryClipboard::instance().reset(); + LLClipboard::getInstance()->reset(); for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++) { LLInventoryItem* item = gInventory.getItem(*it); if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE) { - LLInventoryClipboard::instance().add(item->getUUID()); + LLClipboard::getInstance()->add(item->getUUID()); } } } else if ("paste" == command_name) { - LLInventoryClipboard& clipbord = LLInventoryClipboard::instance(); LLDynamicArray ids; - clipbord.retrieve(ids); + LLClipboard::getInstance()->retrieve(ids); if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID)) return; LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID); @@ -530,7 +529,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command) gesture_dir->getUUID(), getString("copy_name", string_args), cb); } } - clipbord.reset(); + LLClipboard::getInstance()->reset(); } else if ("copy_uuid" == command_name) { -- cgit v1.2.3 From 9761375ac244af36635899c73e99efc46b68b589 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 6 Feb 2012 15:43:53 -0800 Subject: EXP-1841 : Refactoring of LLClipboard, simplify the API and make it behave like a normal clipboard. --- indra/newview/llfloatergesture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloatergesture.cpp') diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 281cafa90d..3c647284f6 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -533,7 +533,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command) } else if ("copy_uuid" == command_name) { - LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID()); + LLClipboard::getInstance()->copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE); } } -- cgit v1.2.3 From ee3c3c15b714f8f68e98a2d4064afaec665bd64a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 7 Feb 2012 22:46:04 -0800 Subject: EXP-1841 : Final deep scrub on LLClipboard API, clean up the use of copy and cut everywhere. --- indra/newview/llfloatergesture.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloatergesture.cpp') diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 3c647284f6..d449c4ff1b 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -395,7 +395,7 @@ bool LLFloaterGesture::isActionEnabled(const LLSD& command) return false; LLDynamicArray ids; - LLClipboard::getInstance()->retrieve(ids); + LLClipboard::getInstance()->pasteFromClipboard(ids); for(LLDynamicArray::iterator it = ids.begin(); it != ids.end(); it++) { LLInventoryItem* item = gInventory.getItem(*it); @@ -490,26 +490,26 @@ void LLFloaterGesture::onActivateBtnClick() void LLFloaterGesture::onCopyPasteAction(const LLSD& command) { std::string command_name = command.asString(); - // since we select this comman inventory item had already arrived . + // Since we select this command, the inventory items must have already arrived if("copy_gesture" == command_name) { uuid_vec_t ids; getSelectedIds(ids); - // make sure that clopboard is empty + // Make sure the clipboard is empty LLClipboard::getInstance()->reset(); for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++) { LLInventoryItem* item = gInventory.getItem(*it); if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE) { - LLClipboard::getInstance()->add(item->getUUID()); + LLClipboard::getInstance()->addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE); } } } else if ("paste" == command_name) { LLDynamicArray ids; - LLClipboard::getInstance()->retrieve(ids); + LLClipboard::getInstance()->pasteFromClipboard(ids); if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID)) return; LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID); -- cgit v1.2.3 From d60ef2f3352404ce37d22ca346af47f8e4c93d79 Mon Sep 17 00:00:00 2001 From: paulgproductengine Date: Thu, 23 Feb 2012 20:07:44 +0200 Subject: EXP-1909 FIXED (Pasted gesture displayed twice) - Refreshing gesture list after an item was copied --- indra/newview/llfloatergesture.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llfloatergesture.cpp') diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index d495f20a9a..9ed9d10c75 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -90,6 +90,12 @@ public: if(mFloater) { mFloater->addGesture(inv_item,NULL,mFloater->getChild("gesture_list")); + + // EXP-1909 (Pasted gesture displayed twice) + // The problem is that addGesture is called here for the second time for the same item (which is copied) + // First time addGesture is called from LLFloaterGestureObserver::changed(), which is a callback for inventory + // change. So we need to refresh the gesture list to avoid duplicates. + mFloater->refreshAll(); } } }; -- cgit v1.2.3 From f0a1b43f2270cb8424409babf5ae88233cdd8f6c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 1 Mar 2012 21:35:05 -0800 Subject: EXP-1841 : Use instance instead of getInstance on LLClipboard singleton. --- indra/newview/llfloatergesture.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloatergesture.cpp') diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 7791d4688b..56051ff684 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -397,11 +397,11 @@ bool LLFloaterGesture::isActionEnabled(const LLSD& command) std::string command_name = command.asString(); if("paste" == command_name) { - if(!LLClipboard::getInstance()->hasContents()) + if(!LLClipboard::instance().hasContents()) return false; LLDynamicArray ids; - LLClipboard::getInstance()->pasteFromClipboard(ids); + LLClipboard::instance().pasteFromClipboard(ids); for(LLDynamicArray::iterator it = ids.begin(); it != ids.end(); it++) { LLInventoryItem* item = gInventory.getItem(*it); @@ -502,20 +502,20 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command) uuid_vec_t ids; getSelectedIds(ids); // Make sure the clipboard is empty - LLClipboard::getInstance()->reset(); + LLClipboard::instance().reset(); for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++) { LLInventoryItem* item = gInventory.getItem(*it); if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE) { - LLClipboard::getInstance()->addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE); + LLClipboard::instance().addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE); } } } else if ("paste" == command_name) { LLDynamicArray ids; - LLClipboard::getInstance()->pasteFromClipboard(ids); + LLClipboard::instance().pasteFromClipboard(ids); if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID)) return; LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID); @@ -535,11 +535,11 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command) gesture_dir->getUUID(), getString("copy_name", string_args), cb); } } - LLClipboard::getInstance()->reset(); + LLClipboard::instance().reset(); } else if ("copy_uuid" == command_name) { - LLClipboard::getInstance()->copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE); + LLClipboard::instance().copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE); } } -- cgit v1.2.3