summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2009-12-03 09:17:51 -0800
committerNat Goodspeed <nat@lindenlab.com>2009-12-03 09:17:51 -0800
commit5fd2938da8d6709a6596833088fd83c60d591507 (patch)
tree9186f79b996eb60a9bb1f5cefada86c0596ac850 /indra/newview/llinventorybridge.cpp
parent97f97f286ccca1f736c575f516a61c6a32787807 (diff)
parent57b68d9bfe25fc7b9efe41a9fa30935c156acb34 (diff)
Merge with recent viewer-2-0
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index d216872363..ac6aa307f2 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1313,6 +1313,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 |
// +=================================================+
@@ -2387,6 +2397,8 @@ void LLFolderBridge::folderOptionsMenu()
if (is_sidepanel)
{
mItems.clear();
+ mItems.push_back("Rename");
+ mItems.push_back("Delete");
}
// Only enable calling-card related options for non-default folders.
@@ -3671,7 +3683,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);
@@ -3683,7 +3695,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);
@@ -3868,7 +3880,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;
@@ -3891,7 +3903,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)
@@ -4384,7 +4396,7 @@ LLUIImagePtr LLWearableBridge::getIcon() const
// virtual
void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action)
{
- if ("wear" == action)
+ if (isAddAction(action))
{
wearOnAvatar();
}
@@ -4397,7 +4409,7 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod
editOnAvatar();
return;
}
- else if ("take_off" == action)
+ else if (isRemoveAction(action))
{
if(gAgentWearables.isWearingItem(mUUID))
{