summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp71
1 files changed, 11 insertions, 60 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 37d2c50493..7859c2b30d 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -65,6 +65,7 @@
#include "llsidetray.h"
#include "lltrans.h"
#include "llviewerassettype.h"
+#include "llviewerfoldertype.h"
#include "llviewermenu.h"
#include "llviewermessage.h"
#include "llviewerobjectlist.h"
@@ -2218,13 +2219,7 @@ void LLFolderBridge::determineFolderType()
BOOL LLFolderBridge::isItemRenameable() const
{
- LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)getCategory();
- if(cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType())
- && (cat->getOwnerID() == gAgent.getID()))
- {
- return TRUE;
- }
- return FALSE;
+ return get_is_category_renameable(getInventoryModel(), mUUID);
}
void LLFolderBridge::restoreItem()
@@ -2265,61 +2260,17 @@ LLUIImagePtr LLFolderBridge::getIcon() const
}
// static
-LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type, BOOL is_link)
+LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type)
{
- // Bypassing LLViewerFolderType::lookup() since
- // we aren't using different system folder icons
- if (is_link)
- {
- if (preferred_type == LLFolderType::FT_OUTFIT)
- return LLUI::getUIImage("Inv_LookFolderClosed_Link");
- else
- return LLUI::getUIImage("Inv_FolderClosed_Link");
- }
-
- switch (preferred_type)
- {
- case LLFolderType::FT_OUTFIT:
- return LLUI::getUIImage("Inv_LookFolderClosed");
- case LLFolderType::FT_LOST_AND_FOUND:
- return LLUI::getUIImage("Inv_LostClosed");
- case LLFolderType::FT_TRASH:
- return LLUI::getUIImage("Inv_TrashClosed");
- case LLFolderType::FT_NONE:
- return LLUI::getUIImage("Inv_FolderClosed");
+ return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, FALSE));
/*case LLAssetType::AT_MESH:
control = "inv_folder_mesh.tga";
break;*/
- default:
- return LLUI::getUIImage("Inv_SysClosed");
- }
}
LLUIImagePtr LLFolderBridge::getOpenIcon() const
{
- // Bypassing LLViewerFolderType::lookup() since
- // we aren't using different system folder icons
- if (isLink())
- {
- if (getPreferredType() == LLFolderType::FT_OUTFIT)
- return LLUI::getUIImage("Inv_LookFolderOpen_Link");
- else
- return LLUI::getUIImage("Inv_FolderOpen_Link");
- }
-
- switch (getPreferredType())
- {
- case LLFolderType::FT_OUTFIT:
- return LLUI::getUIImage("Inv_LookFolderOpen");
- case LLFolderType::FT_LOST_AND_FOUND:
- return LLUI::getUIImage("Inv_LostOpen");
- case LLFolderType::FT_TRASH:
- return LLUI::getUIImage("Inv_TrashOpen");
- case LLFolderType::FT_NONE:
- return LLUI::getUIImage("Inv_FolderOpen");
- default:
- return LLUI::getUIImage("Inv_SysOpen");
- }
+ return LLUI::getUIImage(LLViewerFolderType::lookupIconName(getPreferredType(), TRUE));
}
@@ -3192,7 +3143,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
LLUIImagePtr LLTextureBridge::getIcon() const
{
- return LLInventoryIcon::getIcon(LLAssetType::AT_TEXTURE, mInvType, mIsLink);
+ return LLInventoryIcon::getIcon(LLAssetType::AT_TEXTURE, mInvType);
}
void LLTextureBridge::openItem()
@@ -3344,7 +3295,7 @@ LLLandmarkBridge::LLLandmarkBridge(LLInventoryPanel* inventory,
LLUIImagePtr LLLandmarkBridge::getIcon() const
{
- return LLInventoryIcon::getIcon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mIsLink, mVisited, FALSE);
+ return LLInventoryIcon::getIcon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mVisited, FALSE);
}
void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
@@ -3536,7 +3487,7 @@ LLUIImagePtr LLCallingCardBridge::getIcon() const
{
online = LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID());
}
- return LLInventoryIcon::getIcon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, mIsLink, online, FALSE);
+ return LLInventoryIcon::getIcon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, online, FALSE);
}
std::string LLCallingCardBridge::getLabelSuffix() const
@@ -3978,7 +3929,7 @@ LLObjectBridge::LLObjectBridge(LLInventoryPanel* inventory,
LLUIImagePtr LLObjectBridge::getIcon() const
{
- return LLInventoryIcon::getIcon(LLAssetType::AT_OBJECT, mInvType, mIsLink, mAttachPt, mIsMultiObject);
+ return LLInventoryIcon::getIcon(LLAssetType::AT_OBJECT, mInvType, mAttachPt, mIsMultiObject);
}
LLInventoryObject* LLObjectBridge::getObject() const
@@ -4445,7 +4396,7 @@ std::string LLWearableBridge::getLabelSuffix() const
LLUIImagePtr LLWearableBridge::getIcon() const
{
- return LLInventoryIcon::getIcon(mAssetType, mInvType, mIsLink, mWearableType, FALSE);
+ return LLInventoryIcon::getIcon(mAssetType, mInvType, mWearableType, FALSE);
}
// virtual
@@ -4930,7 +4881,7 @@ LLUIImagePtr LLLinkFolderBridge::getIcon() const
}
}
}
- return LLFolderBridge::getIcon(folder_type, TRUE);
+ return LLFolderBridge::getIcon(folder_type);
}
void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)