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 3a9c5ba698..7ce96a6ac1 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"
@@ -2208,13 +2209,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()
@@ -2255,58 +2250,14 @@ 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");
- default:
- return LLUI::getUIImage("Inv_SysClosed");
- }
+ return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, FALSE));
}
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));
}
@@ -3176,7 +3127,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()
@@ -3328,7 +3279,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)
@@ -3520,7 +3471,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
@@ -3959,7 +3910,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
@@ -4426,7 +4377,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
@@ -4851,7 +4802,7 @@ LLUIImagePtr LLLinkFolderBridge::getIcon() const
}
}
}
- return LLFolderBridge::getIcon(folder_type, TRUE);
+ return LLFolderBridge::getIcon(folder_type);
}
void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)