diff options
author | Logan Dethrow <log@lindenlab.com> | 2012-12-13 18:35:07 -0500 |
---|---|---|
committer | Logan Dethrow <log@lindenlab.com> | 2012-12-13 18:35:07 -0500 |
commit | 9015344f8e1d246726a8dc4fbfcefb7e74525e6a (patch) | |
tree | ef17d2dbcc573a3126049e9bc444b78b7507ebc2 /indra/newview/llfloatergesture.cpp | |
parent | 3565f6f36db90e1a9a5918d8087f9dc0ab61eb69 (diff) | |
parent | 18ff702a9965ba8b9a17326b391f8edab01242f6 (diff) |
Merged SH-3339 work with sunshine-internal. Still a WIP.
Diffstat (limited to 'indra/newview/llfloatergesture.cpp')
-rw-r--r-- | indra/newview/llfloatergesture.cpp | 45 |
1 files changed, 16 insertions, 29 deletions
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 56051ff684..4054eba1aa 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -65,40 +65,27 @@ private: LLFloaterGesture* mFloater; }; //----------------------------- -// GestureCallback +// gesture callback funcs //----------------------------- -class GestureShowCallback : public LLInventoryCallback +void gesture_show_cb(const LLUUID &inv_item) { -public: - void fire(const LLUUID &inv_item) - { - LLPreviewGesture::show(inv_item, LLUUID::null); - } -}; + LLPreviewGesture::show(inv_item, LLUUID::null); +} -class GestureCopiedCallback : public LLInventoryCallback +void gesture_copied_cb(const LLUUID &inv_item, LLFloaterGesture* floater) { -private: - LLFloaterGesture* mFloater; - -public: - GestureCopiedCallback(LLFloaterGesture* floater): mFloater(floater) - {} - void fire(const LLUUID &inv_item) + if(floater) { - if(mFloater) - { - mFloater->addGesture(inv_item,NULL,mFloater->getChild<LLScrollListCtrl>("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(); - } + floater->addGesture(inv_item,NULL,floater->getChild<LLScrollListCtrl>("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. + floater->refreshAll(); } -}; +} //--------------------------------------------------------------------------- // LLFloaterGesture @@ -448,7 +435,7 @@ void LLFloaterGesture::onClickPlay() void LLFloaterGesture::onClickNew() { - LLPointer<LLInventoryCallback> cb = new GestureShowCallback(); + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(gesture_show_cb); create_inventory_item(gAgent.getID(), gAgent.getSessionID(), LLUUID::null, LLTransactionID::tnull, "New Gesture", "", LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, NOT_WEARABLE, PERM_MOVE | PERM_TRANSFER, cb); @@ -520,7 +507,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command) return; LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID); llassert(gesture_dir); - LLPointer<GestureCopiedCallback> cb = new GestureCopiedCallback(this); + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(gesture_copied_cb, _1, this)); for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++) { |