summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelobjectinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelobjectinventory.cpp')
-rw-r--r--indra/newview/llpanelobjectinventory.cpp76
1 files changed, 51 insertions, 25 deletions
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index e3b61f695a..1ca24f3031 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -57,7 +57,6 @@
#include "llpreviewtexture.h"
#include "llscrollcontainer.h"
#include "llselectmgr.h"
-#include "llsidetray.h"
#include "llstatusbar.h"
#include "lltooldraganddrop.h"
#include "lltrans.h"
@@ -83,6 +82,7 @@ protected:
LLAssetType::EType mAssetType;
LLInventoryType::EType mInventoryType;
+ LLInventoryObject* findInvObject() const;
LLInventoryItem* findItem() const;
public:
@@ -124,7 +124,7 @@ public:
virtual void move(LLFolderViewEventListener* parent_listener);
virtual BOOL isItemCopyable() const;
virtual BOOL copyToClipboard() const;
- virtual void cutToClipboard();
+ virtual BOOL cutToClipboard() const;
virtual BOOL isClipboardPasteable() const;
virtual void pasteFromClipboard();
virtual void pasteLinkFromClipboard();
@@ -139,7 +139,8 @@ public:
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data);
+ void* cargo_data,
+ std::string& tooltip_msg);
};
LLTaskInvFVBridge::LLTaskInvFVBridge(
@@ -162,16 +163,22 @@ LLTaskInvFVBridge::LLTaskInvFVBridge(
}
}
-LLInventoryItem* LLTaskInvFVBridge::findItem() const
+LLInventoryObject* LLTaskInvFVBridge::findInvObject() const
{
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
- if(object)
+ if (object)
{
- return dynamic_cast<LLInventoryItem*>(object->getInventoryObject(mUUID));
+ return object->getInventoryObject(mUUID);
}
return NULL;
}
+
+LLInventoryItem* LLTaskInvFVBridge::findItem() const
+{
+ return dynamic_cast<LLInventoryItem*>(findInvObject());
+}
+
void LLTaskInvFVBridge::showProperties()
{
show_task_item_profile(mUUID, mPanel->getTaskUUID());
@@ -295,21 +302,15 @@ const std::string& LLTaskInvFVBridge::getDisplayName() const
if(item)
{
- if(item->getParentUUID().isNull())
- {
- if(item->getName() == "Contents")
- {
- mDisplayName.assign(LLTrans::getString("ViewerObjectContents"));
- }
- else
- {
- mDisplayName.assign(item->getName());
- }
- }
- else
+ mDisplayName.assign(item->getName());
+
+ // Localize "New Script", "New Script 1", "New Script 2", etc.
+ if (item->getType() == LLAssetType::AT_LSL_TEXT &&
+ LLStringUtil::startsWith(item->getName(), "New Script"))
{
- mDisplayName.assign(item->getName());
+ LLStringUtil::replaceString(mDisplayName, "New Script", LLTrans::getString("PanelContentsNewScript"));
}
+
const LLPermissions& perm(item->getPermissions());
BOOL copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE);
BOOL mod = gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE);
@@ -523,8 +524,9 @@ BOOL LLTaskInvFVBridge::copyToClipboard() const
return FALSE;
}
-void LLTaskInvFVBridge::cutToClipboard()
+BOOL LLTaskInvFVBridge::cutToClipboard() const
{
+ return FALSE;
}
BOOL LLTaskInvFVBridge::isClipboardPasteable() const
@@ -580,7 +582,8 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
BOOL LLTaskInvFVBridge::dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data)
+ void* cargo_data,
+ std::string& tooltip_msg)
{
//llinfos << "LLTaskInvFVBridge::dragOrDrop()" << llendl;
return FALSE;
@@ -700,7 +703,7 @@ public:
const std::string& name);
virtual LLUIImagePtr getIcon() const;
- virtual const std::string& getDisplayName() const { return getName(); }
+ virtual const std::string& getDisplayName() const;
virtual BOOL isItemRenameable() const;
// virtual BOOL isItemCopyable() const { return FALSE; }
virtual BOOL renameItem(const std::string& new_name);
@@ -710,7 +713,8 @@ public:
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data);
+ void* cargo_data,
+ std::string& tooltip_msg);
virtual BOOL canOpenItem() const { return TRUE; }
virtual void openItem();
};
@@ -728,6 +732,27 @@ LLUIImagePtr LLTaskCategoryBridge::getIcon() const
return LLUI::getUIImage("Inv_FolderClosed");
}
+// virtual
+const std::string& LLTaskCategoryBridge::getDisplayName() const
+{
+ LLInventoryObject* cat = findInvObject();
+
+ if (cat)
+ {
+ // Localize "Contents" folder.
+ if (cat->getParentUUID().isNull() && cat->getName() == "Contents")
+ {
+ mDisplayName.assign(LLTrans::getString("ViewerObjectContents"));
+ }
+ else
+ {
+ mDisplayName.assign(cat->getName());
+ }
+ }
+
+ return mDisplayName;
+}
+
BOOL LLTaskCategoryBridge::isItemRenameable() const
{
return FALSE;
@@ -783,7 +808,8 @@ BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
- void* cargo_data)
+ void* cargo_data,
+ std::string& tooltip_msg)
{
//llinfos << "LLTaskCategoryBridge::dragOrDrop()" << llendl;
BOOL accept = FALSE;
@@ -1543,7 +1569,7 @@ void LLPanelObjectInventory::reset()
scroll_p.rect(scroller_rect);
scroll_p.tab_stop(true);
scroll_p.follows.flags(FOLLOWS_ALL);
- mScroller = LLUICtrlFactory::create<LLScrollContainer>(scroll_p);
+ mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroll_p);
addChild(mScroller);
mScroller->addChild(mFolders);