summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatergesture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatergesture.cpp')
-rw-r--r--indra/newview/llfloatergesture.cpp45
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++)
{