RLVa 1.1.2 to 1.1.3 upgrade. InvLinks + COF
This commit is contained in:
@@ -81,8 +81,7 @@
|
||||
#include "llviewerobjectlist.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llwearable.h"
|
||||
|
||||
// [RLVa:KB]
|
||||
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b)
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
@@ -146,6 +145,7 @@ public:
|
||||
virtual void cutToClipboard();
|
||||
virtual BOOL isClipboardPasteable() const;
|
||||
virtual void pasteFromClipboard();
|
||||
virtual void pasteLinkFromClipboard();
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action);
|
||||
virtual BOOL isUpToDate() const { return TRUE; }
|
||||
@@ -371,9 +371,9 @@ void LLTaskInvFVBridge::previewItem()
|
||||
|
||||
BOOL LLTaskInvFVBridge::isItemRenameable() const
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a
|
||||
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a
|
||||
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) )
|
||||
if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -396,13 +396,15 @@ BOOL LLTaskInvFVBridge::isItemRenameable() const
|
||||
|
||||
BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name)
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a
|
||||
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a
|
||||
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) )
|
||||
if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) )
|
||||
{
|
||||
return TRUE; // Fallback code [see LLTaskInvFVBridge::isItemRenameable()]
|
||||
return FALSE;
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
// LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
if(object)
|
||||
{
|
||||
LLViewerInventoryItem* item = NULL;
|
||||
@@ -429,13 +431,13 @@ BOOL LLTaskInvFVBridge::isItemMovable()
|
||||
// return TRUE;
|
||||
//}
|
||||
//return FALSE;
|
||||
// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a
|
||||
// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.5a
|
||||
if (rlv_handler_t::isEnabled())
|
||||
{
|
||||
LLViewerObject* pObj = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
const LLViewerObject* pObj = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
if (pObj)
|
||||
{
|
||||
if (gRlvHandler.isLockedAttachment(pObj, RLV_LOCK_REMOVE))
|
||||
if (gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -454,17 +456,18 @@ BOOL LLTaskInvFVBridge::isItemMovable()
|
||||
BOOL LLTaskInvFVBridge::isItemRemovable()
|
||||
{
|
||||
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a
|
||||
// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.5a
|
||||
if ( (object) && (rlv_handler_t::isEnabled()) )
|
||||
{
|
||||
if (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE))
|
||||
const LLViewerObject* pObjRoot = object->getRootEdit();
|
||||
if (gRlvAttachmentLocks.isLockedAttachment(pObjRoot))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) )
|
||||
{
|
||||
LLVOAvatar* pAvatar = gAgent.getAvatarObject();
|
||||
if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == object->getRootEdit()) )
|
||||
if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == pObjRoot) )
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -603,6 +606,10 @@ void LLTaskInvFVBridge::pasteFromClipboard()
|
||||
{
|
||||
}
|
||||
|
||||
void LLTaskInvFVBridge::pasteLinkFromClipboard()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
|
||||
{
|
||||
//llinfos << "LLTaskInvFVBridge::startDrag()" << llendl;
|
||||
@@ -617,9 +624,9 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
|
||||
const LLPermissions& perm = inv->getPermissions();
|
||||
bool can_copy = gAgent.allowOperation(PERM_COPY, perm,
|
||||
GP_OBJECT_MANIPULATE);
|
||||
// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a
|
||||
// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a
|
||||
// Kind of redundant due to the note below, but in case that ever gets fixed
|
||||
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) )
|
||||
if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -746,12 +753,13 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
{
|
||||
disabled_items.push_back(std::string("Task Open"));
|
||||
}
|
||||
// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a
|
||||
// [RLVa:KB] - Checked: 2010-03-01 (RLVa-1.2.0b) | Modified: RLVa-1.1.0a
|
||||
else if (rlv_handler_t::isEnabled())
|
||||
{
|
||||
bool fLocked = gRlvHandler.isLockedAttachment(gObjectList.findObject(mPanel->getTaskUUID()), RLV_LOCK_REMOVE);
|
||||
if ( ((LLAssetType::AT_LSL_TEXT == item->getType()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) || (fLocked))) ||
|
||||
((LLAssetType::AT_NOTECARD == item->getType()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) || (fLocked))) ||
|
||||
LLViewerObject* pAttachObj = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
bool fLocked = (pAttachObj) ? gRlvAttachmentLocks.isLockedAttachment(pAttachObj->getRootEdit()) : false;
|
||||
if ( ((LLAssetType::AT_NOTECARD == item->getType()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) || (fLocked))) ||
|
||||
((LLAssetType::AT_LSL_TEXT == item->getType()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) || (fLocked))) ||
|
||||
((LLAssetType::AT_TEXTURE == item->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) )
|
||||
{
|
||||
disabled_items.push_back(std::string("Task Open"));
|
||||
@@ -760,14 +768,26 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
// [/RLVa:KB]
|
||||
}
|
||||
items.push_back(std::string("Task Properties"));
|
||||
if(isItemRenameable())
|
||||
// if(isItemRenameable())
|
||||
// {
|
||||
// items.push_back(std::string("Task Rename"));
|
||||
// }
|
||||
// if(isItemRemovable())
|
||||
// {
|
||||
// items.push_back(std::string("Task Remove"));
|
||||
// }
|
||||
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Added: RLVa-1.2.1f
|
||||
items.push_back(std::string("Task Rename"));
|
||||
items.push_back(std::string("Task Remove"));
|
||||
if (!isItemRenameable())
|
||||
{
|
||||
items.push_back(std::string("Task Rename"));
|
||||
disabled_items.push_back(std::string("Task Rename"));
|
||||
}
|
||||
if(isItemRemovable())
|
||||
if (!isItemRemovable())
|
||||
{
|
||||
items.push_back(std::string("Task Remove"));
|
||||
disabled_items.push_back(std::string("Task Remove"));
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
hideContextEntries(menu, items, disabled_items);
|
||||
}
|
||||
@@ -849,22 +869,12 @@ BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
|
||||
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
if(object)
|
||||
{
|
||||
LLInventoryItem* inv = NULL;
|
||||
if((inv = (LLInventoryItem*)object->getInventoryObject(mUUID)))
|
||||
const LLInventoryObject* cat = object->getInventoryObject(mUUID);
|
||||
if ( (cat) && (move_inv_category_world_to_agent(mUUID, LLUUID::null, FALSE)) )
|
||||
{
|
||||
const LLPermissions& perm = inv->getPermissions();
|
||||
bool can_copy = gAgent.allowOperation(PERM_COPY, perm,
|
||||
GP_OBJECT_MANIPULATE);
|
||||
if((can_copy && perm.allowTransferTo(gAgent.getID()))
|
||||
|| object->permYouOwner())
|
||||
// || gAgent.isGodlike())
|
||||
|
||||
{
|
||||
*type = LLAssetType::lookupDragAndDropType(inv->getType());
|
||||
|
||||
*id = inv->getUUID();
|
||||
return TRUE;
|
||||
}
|
||||
*type = LLAssetType::lookupDragAndDropType(cat->getType());
|
||||
*id = mUUID;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1279,30 +1289,25 @@ LLTaskLSLBridge::LLTaskLSLBridge(
|
||||
|
||||
void LLTaskLSLBridge::openItem()
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a
|
||||
llinfos << "LLTaskLSLBridge::openItem() " << mUUID << llendl;
|
||||
if(LLLiveLSLEditor::show(mUUID, mPanel->getTaskUUID()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
if ( (rlv_handler_t::isEnabled()) &&
|
||||
((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) || (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE))) )
|
||||
if(!object || object->isInventoryPending())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.1.3b) | Modified: RLVa-1.1.0a
|
||||
if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) )
|
||||
{
|
||||
RlvNotifications::notifyBlockedViewScript();
|
||||
return;
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
llinfos << "LLTaskLSLBridge::openItem() " << mUUID << llendl;
|
||||
if(LLLiveLSLEditor::show(mUUID, mPanel->getTaskUUID()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
llinfos << "LLTaskLSLBridge::openItem() " << mUUID << llendl;
|
||||
if(LLLiveLSLEditor::show(mUUID, mPanel->getTaskUUID()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!object || object->isInventoryPending())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(object->permModify() || gAgent.isGodlike())
|
||||
{
|
||||
std::string title("Script: ");
|
||||
@@ -1413,9 +1418,9 @@ void LLTaskNotecardBridge::openItem()
|
||||
{
|
||||
return;
|
||||
}
|
||||
// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a
|
||||
// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.3b) | Modified: RLVa-1.1.0a
|
||||
if ( (rlv_handler_t::isEnabled()) &&
|
||||
( (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) || (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) ) )
|
||||
((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) || (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit()))) )
|
||||
{
|
||||
RlvNotifications::notifyBlockedViewNote();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user