diff -r 2f9a87538ca1 -r 7c55e1e9b649 indra/newview/llpanelcontents.cpp --- a/indra/newview/llpanelcontents.cpp Mon Jul 25 14:38:02 2011 -0400 +++ b/indra/newview/llpanelcontents.cpp Fri Jul 29 05:20:54 2011 +0300 @@ -172,7 +172,7 @@ void LLPanelContents::onClickNewScript(v LLUUID::null, LLAssetType::AT_LSL_TEXT, LLInventoryType::IT_LSL, - LLTrans::getString("PanelContentsNewScript"), + "New Script", desc, LLSaleInfo::DEFAULT, LLInventoryItemFlags::II_FLAGS_NONE, diff -r 2f9a87538ca1 -r 7c55e1e9b649 indra/newview/llpanelobjectinventory.cpp --- a/indra/newview/llpanelobjectinventory.cpp Mon Jul 25 14:38:02 2011 -0400 +++ b/indra/newview/llpanelobjectinventory.cpp Fri Jul 29 05:20:54 2011 +0300 @@ -83,6 +83,7 @@ protected: LLAssetType::EType mAssetType; LLInventoryType::EType mInventoryType; + LLInventoryObject* findInvObject() const; LLInventoryItem* findItem() const; public: @@ -162,14 +163,20 @@ LLTaskInvFVBridge::LLTaskInvFVBridge( } } +LLInventoryObject* LLTaskInvFVBridge::findInvObject() const +{ + LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); + if (object) + { + return object->getInventoryObject(mUUID); + } + return NULL; +} + + LLInventoryItem* LLTaskInvFVBridge::findItem() const { - LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); - if(object) - { - return dynamic_cast(object->getInventoryObject(mUUID)); - } - return NULL; + return dynamic_cast(findInvObject()); } void LLTaskInvFVBridge::showProperties() @@ -295,21 +302,15 @@ const std::string& LLTaskInvFVBridge::ge if(item) { - if(item->getParentUUID().isNull()) + 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")) { - if(item->getName() == "Contents") - { - mDisplayName.assign(LLTrans::getString("ViewerObjectContents")); - } - else - { - mDisplayName.assign(item->getName()); - } + LLStringUtil::replaceString(mDisplayName, "New Script", LLTrans::getString("PanelContentsNewScript")); } - else - { - mDisplayName.assign(item->getName()); - } + 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); @@ -700,7 +701,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); @@ -728,6 +729,27 @@ LLUIImagePtr LLTaskCategoryBridge::getIc 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; diff -r 2f9a87538ca1 -r 7c55e1e9b649 indra/newview/llviewerobject.cpp --- a/indra/newview/llviewerobject.cpp Mon Jul 25 14:38:02 2011 -0400 +++ b/indra/newview/llviewerobject.cpp Fri Jul 29 05:20:54 2011 +0300 @@ -2660,7 +2660,7 @@ void LLViewerObject::processTaskInv(LLMe LLPointer obj; obj = new LLInventoryObject(object->mID, LLUUID::null, LLAssetType::AT_CATEGORY, - LLTrans::getString("ViewerObjectContents").c_str()); + "Contents"); object->mInventory->push_front(obj); object->doInventoryCallback(); delete ft; @@ -2727,7 +2727,7 @@ void LLViewerObject::loadTaskInvFile(con { LLPointer inv = new LLInventoryObject; inv->importLegacyStream(ifs); - inv->rename(LLTrans::getString("ViewerObjectContents").c_str()); + inv->rename("Contents"); mInventory->push_front(inv); } else