summaryrefslogtreecommitdiff
path: root/indra/newview/llfloateropenobject.cpp
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2014-08-29 12:00:11 +0300
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2014-08-29 12:00:11 +0300
commit3656d80cf873a8e2852b262d6b5ed88608fdc49b (patch)
tree0eb0137697daf7601fdd4cb56b76ad2efb97cf01 /indra/newview/llfloateropenobject.cpp
parentaf6e0afac80477dedab75415bba379d2b577b9d8 (diff)
MAINT-4239 FIXED Buttons are added to Object contents floater
Diffstat (limited to 'indra/newview/llfloateropenobject.cpp')
-rwxr-xr-xindra/newview/llfloateropenobject.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp
index 9986bdbd7f..ef746d308d 100755
--- a/indra/newview/llfloateropenobject.cpp
+++ b/indra/newview/llfloateropenobject.cpp
@@ -58,6 +58,8 @@ LLFloaterOpenObject::LLFloaterOpenObject(const LLSD& key)
{
mCommitCallbackRegistrar.add("OpenObject.MoveToInventory", boost::bind(&LLFloaterOpenObject::onClickMoveToInventory, this));
mCommitCallbackRegistrar.add("OpenObject.MoveAndWear", boost::bind(&LLFloaterOpenObject::onClickMoveAndWear, this));
+ mCommitCallbackRegistrar.add("OpenObject.ReplaceOutfit", boost::bind(&LLFloaterOpenObject::onClickReplace, this));
+ mCommitCallbackRegistrar.add("OpenObject.Cancel", boost::bind(&LLFloaterOpenObject::onClickCancel, this));
}
LLFloaterOpenObject::~LLFloaterOpenObject()
@@ -115,6 +117,7 @@ void LLFloaterOpenObject::refresh()
getChild<LLUICtrl>("object_name")->setTextArg("[DESC]", name);
getChildView("copy_to_inventory_button")->setEnabled(enabled);
getChildView("copy_and_wear_button")->setEnabled(enabled);
+ getChildView("copy_and_replace_button")->setEnabled(enabled);
}
@@ -135,7 +138,7 @@ void LLFloaterOpenObject::dirty()
-void LLFloaterOpenObject::moveToInventory(bool wear)
+void LLFloaterOpenObject::moveToInventory(bool wear, bool replace)
{
if (mObjectSelection->getRootObjectCount() != 1)
{
@@ -163,7 +166,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
parent_category_id = gInventory.getRootFolderID();
}
- inventory_func_type func = boost::bind(LLFloaterOpenObject::callbackCreateInventoryCategory,_1,object_id,wear);
+ inventory_func_type func = boost::bind(LLFloaterOpenObject::callbackCreateInventoryCategory,_1,object_id,wear,replace);
LLUUID category_id = gInventory.createNewCategory(parent_category_id,
LLFolderType::FT_NONE,
name,
@@ -177,6 +180,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
data->mCatID = category_id;
data->mWear = wear;
data->mFolderResponded = false;
+ data->mReplace = replace;
// Copy and/or move the items into the newly created folder.
// Ignore any "you're going to break this item" messages.
@@ -194,13 +198,14 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
}
// static
-void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear)
+void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear, bool replace)
{
LLCatAndWear* wear_data = new LLCatAndWear;
wear_data->mCatID = category_id;
wear_data->mWear = wear;
wear_data->mFolderResponded = true;
+ wear_data->mReplace = replace;
// Copy and/or move the items into the newly created folder.
// Ignore any "you're going to break this item" messages.
@@ -241,7 +246,17 @@ void LLFloaterOpenObject::onClickMoveToInventory()
void LLFloaterOpenObject::onClickMoveAndWear()
{
- moveToInventory(true);
+ moveToInventory(true, false);
closeFloater();
}
+void LLFloaterOpenObject::onClickReplace()
+{
+ moveToInventory(true, true);
+ closeFloater();
+}
+
+void LLFloaterOpenObject::onClickCancel()
+{
+ closeFloater();
+}