summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorEric M. Tulla (BigPapi) <tulla@lindenlab.com>2009-12-03 12:09:16 -0500
committerEric M. Tulla (BigPapi) <tulla@lindenlab.com>2009-12-03 12:09:16 -0500
commitb05ebd89775792762063d3af08f0fe9ae785454a (patch)
treeee364573584ba2dbd2d2699707f985fbad0cbf42 /indra/newview/llinventorybridge.cpp
parent0cfc3af9aceede80230c7f2b36fb7fdcf0fcc179 (diff)
parent67f11add9c2e05e1c86e30c44c94ee1b7d9205d0 (diff)
merge of viewer2 into avp branch
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index a6d47fc835..5bfad0695c 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1323,6 +1323,16 @@ BOOL LLItemBridge::isItemPermissive() const
return FALSE;
}
+bool LLItemBridge::isAddAction(std::string action) const
+{
+ return ("wear" == action || "attach" == action || "activate" == action);
+}
+
+bool LLItemBridge::isRemoveAction(std::string action) const
+{
+ return ("take_off" == action || "detach" == action || "deactivate" == action);
+}
+
// +=================================================+
// | LLFolderBridge |
// +=================================================+
@@ -3683,7 +3693,7 @@ std::string LLGestureBridge::getLabelSuffix() const
// virtual
void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
{
- if ("activate" == action)
+ if (isAddAction(action))
{
LLGestureManager::instance().activateGesture(mUUID);
@@ -3695,7 +3705,7 @@ void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* mode
gInventory.updateItem(item);
gInventory.notifyObservers();
}
- else if ("deactivate" == action)
+ else if (isRemoveAction(action))
{
LLGestureManager::instance().deactivateGesture(mUUID);
@@ -3880,7 +3890,7 @@ LLInventoryObject* LLObjectBridge::getObject() const
// virtual
void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
{
- if ("attach" == action)
+ if (isAddAction(action))
{
LLUUID object_id = mUUID;
LLViewerInventoryItem* item;
@@ -3903,7 +3913,7 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model
}
gFocusMgr.setKeyboardFocus(NULL);
}
- else if ("detach" == action)
+ else if (isRemoveAction(action))
{
LLInventoryItem* item = gInventory.getItem(mUUID);
if(item)
@@ -4396,7 +4406,7 @@ LLUIImagePtr LLWearableBridge::getIcon() const
// virtual
void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
{
- if ("wear" == action)
+ if (isAddAction(action))
{
wearOnAvatar();
}
@@ -4409,7 +4419,7 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod
editOnAvatar();
return;
}
- else if ("take_off" == action)
+ else if (isRemoveAction(action))
{
if(gAgentWearables.isWearingItem(mUUID))
{