summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-08-28 22:58:17 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-08-28 22:58:17 +0000
commit0aa2bc4831674e61edf680887eba9acec9f997ed (patch)
treeedf19fd9b857cf13b9e7ad943b65178954b4811c /indra/newview/llinventorybridge.cpp
parent51500f82e23b7deff9a0e1bc23f5bfa40aec1fb9 (diff)
svn merge -r 1490-1500 https://svn.aws.productengine.com/secondlife/pe/stable-2
Bug Fixes: * EXT-637 EXT-595 Dev work: * EXT-694 QA: * Be sure feature works on other locales Known issues: * If old Calling Card of person who presents in the friend list is removed - "Do you want to remove ..." dialog is shown, if old Calling Card of non-friend is removed it is removed in the old way without any alerts. * It is possible to create 2 deep level subfolders under the Calling Cards/Friends/ subfolders. This should be disabled due to Accordion does not support tree hierarchy. * If friendship is removed when agent is offline, Friend Card is not removed from Inventory.
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp54
1 files changed, 52 insertions, 2 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index efa97de692..789e628b67 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -58,6 +58,7 @@
#include "llfloaterworldmap.h"
#include "llfocusmgr.h"
#include "llfolderview.h"
+#include "llfriendcard.h"
#include "llavataractions.h"
#include "llgesturemgr.h"
#include "lliconctrl.h"
@@ -162,10 +163,26 @@ std::string ICON_NAME[ICON_NAME_COUNT] =
BOOL gAddToOutfit = FALSE;
+
+// +=================================================+
+// | LLInventoryPanelObserver |
+// +=================================================+
+void LLInventoryPanelObserver::changed(U32 mask)
+{
+ mIP->modelChanged(mask);
+}
+
+
// +=================================================+
// | LLInvFVBridge |
// +=================================================+
+LLInvFVBridge::LLInvFVBridge(LLInventoryPanel* inventory, const LLUUID& uuid) :
+mUUID(uuid), mInvType(LLInventoryType::IT_NONE)
+{
+ mInventoryPanel = inventory->getHandle();
+}
+
const std::string& LLInvFVBridge::getName() const
{
LLInventoryObject* obj = getInventoryObject();
@@ -2302,7 +2319,11 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
}
else if(isAgentInventory()) // do not allow creating in library
{
- mItems.push_back(std::string("New Folder"));
+ LLViewerInventoryCategory *cat = getCategory();
+
+ // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694.
+ if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat))
+ mItems.push_back(std::string("New Folder"));
mItems.push_back(std::string("New Script"));
mItems.push_back(std::string("New Note"));
mItems.push_back(std::string("New Gesture"));
@@ -2310,7 +2331,6 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
mItems.push_back(std::string("New Body Parts"));
mItems.push_back(std::string("Change Type"));
- LLViewerInventoryCategory *cat = getCategory();
if (cat && LLAssetType::lookupIsProtectedCategoryType(cat->getPreferredType()))
{
mDisabledItems.push_back(std::string("Change Type"));
@@ -2879,6 +2899,16 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
// | LLLandmarkBridge |
// +=================================================+
+LLLandmarkBridge::LLLandmarkBridge(LLInventoryPanel* inventory, const LLUUID& uuid, U32 flags/* = 0x00*/) :
+LLItemBridge(inventory, uuid)
+{
+ mVisited = FALSE;
+ if (flags & LLInventoryItem::II_FLAGS_LANDMARK_VISITED)
+ {
+ mVisited = TRUE;
+ }
+}
+
LLUIImagePtr LLLandmarkBridge::getIcon() const
{
return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mVisited, FALSE);
@@ -3216,6 +3246,18 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop,
return rv;
}
+BOOL LLCallingCardBridge::removeItem()
+{
+ if (LLFriendCardsManager::instance().isItemInAnyFriendsList(getItem()))
+ {
+ LLAvatarActions::removeFriendDialog(getItem()->getCreatorUUID());
+ return FALSE;
+ }
+ else
+ {
+ return LLItemBridge::removeItem();
+ }
+}
// +=================================================+
// | LLNotecardBridge |
// +=================================================+
@@ -3450,6 +3492,14 @@ void LLAnimationBridge::openItem()
// static
LLUUID LLObjectBridge::sContextMenuItemID;
+LLObjectBridge::LLObjectBridge(LLInventoryPanel* inventory, const LLUUID& uuid, LLInventoryType::EType type, U32 flags) :
+LLItemBridge(inventory, uuid), mInvType(type)
+{
+ mAttachPt = (flags & 0xff); // low bye of inventory flags
+
+ mIsMultiObject = ( flags & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS ) ? TRUE: FALSE;
+}
+
BOOL LLObjectBridge::isItemRemovable()
{
LLVOAvatarSelf* avatar = gAgent.getAvatarObject();