aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpanelinventory.cpp')
-rw-r--r--linden/indra/newview/llpanelinventory.cpp86
1 files changed, 84 insertions, 2 deletions
diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp
index c53395d..7ab850f 100644
--- a/linden/indra/newview/llpanelinventory.cpp
+++ b/linden/indra/newview/llpanelinventory.cpp
@@ -81,6 +81,10 @@
81#include "llviewerwindow.h" 81#include "llviewerwindow.h"
82#include "llwearable.h" 82#include "llwearable.h"
83 83
84// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c)
85#include "llvoavatar.h"
86// [/RLVa:KB]
87
84///---------------------------------------------------------------------------- 88///----------------------------------------------------------------------------
85/// Local function declarations, constants, enums, and typedefs 89/// Local function declarations, constants, enums, and typedefs
86///---------------------------------------------------------------------------- 90///----------------------------------------------------------------------------
@@ -364,8 +368,16 @@ void LLTaskInvFVBridge::previewItem()
364 368
365BOOL LLTaskInvFVBridge::isItemRenameable() const 369BOOL LLTaskInvFVBridge::isItemRenameable() const
366{ 370{
367 if(gAgent.isGodlike()) return TRUE; 371// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c)
368 LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); 372 LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
373 if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) )
374 {
375 return FALSE;
376 }
377// [/RLVa:KB]
378
379 if(gAgent.isGodlike()) return TRUE;
380// LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
369 if(object) 381 if(object)
370 { 382 {
371 LLInventoryItem* item; 383 LLInventoryItem* item;
@@ -382,6 +394,12 @@ BOOL LLTaskInvFVBridge::isItemRenameable() const
382BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name) 394BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name)
383{ 395{
384 LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); 396 LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
397// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c)
398 if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) )
399 {
400 return TRUE; // Fallback code [see LLTaskInvFVBridge::isItemRenameable()]
401 }
402// [/RLVa:KB]
385 if(object) 403 if(object)
386 { 404 {
387 LLViewerInventoryItem* item = NULL; 405 LLViewerInventoryItem* item = NULL;
@@ -408,12 +426,47 @@ BOOL LLTaskInvFVBridge::isItemMovable()
408 // return TRUE; 426 // return TRUE;
409 //} 427 //}
410 //return FALSE; 428 //return FALSE;
429// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0g
430 if (rlv_handler_t::isEnabled())
431 {
432 LLViewerObject* pObj = gObjectList.findObject(mPanel->getTaskUUID());
433 if (pObj)
434 {
435 if (!gRlvHandler.isDetachable(pObj))
436 {
437 return FALSE;
438 }
439 else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) )
440 {
441 LLVOAvatar* pAvatar = gAgent.getAvatarObject();
442 if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == pObj->getRootEdit()) )
443 return FALSE;
444 }
445 }
446 }
447// [/RLVa:KB]
411 return TRUE; 448 return TRUE;
412} 449}
413 450
414BOOL LLTaskInvFVBridge::isItemRemovable() 451BOOL LLTaskInvFVBridge::isItemRemovable()
415{ 452{
416 LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); 453 LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
454// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0g
455 if ( (object) && (rlv_handler_t::isEnabled()) )
456 {
457 if (!gRlvHandler.isDetachable(object))
458 {
459 return FALSE;
460 }
461 else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) )
462 {
463 LLVOAvatar* pAvatar = gAgent.getAvatarObject();
464 if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == object->getRootEdit()) )
465 return FALSE;
466 }
467 }
468// [/RLVa:KB]
469
417 if(object 470 if(object
418 && (object->permModify() || object->permYouOwner())) 471 && (object->permModify() || object->permYouOwner()))
419 { 472 {
@@ -558,6 +611,13 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
558 const LLPermissions& perm = inv->getPermissions(); 611 const LLPermissions& perm = inv->getPermissions();
559 bool can_copy = gAgent.allowOperation(PERM_COPY, perm, 612 bool can_copy = gAgent.allowOperation(PERM_COPY, perm,
560 GP_OBJECT_MANIPULATE); 613 GP_OBJECT_MANIPULATE);
614// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c)
615 // Kind of redundant due to the note below, but in case that ever gets fixed
616 if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) )
617 {
618 return FALSE;
619 }
620// [/RLVa:KB]
561 if (object->isAttachment() && !can_copy) 621 if (object->isAttachment() && !can_copy)
562 { 622 {
563 //RN: no copy contents of attachments cannot be dragged out 623 //RN: no copy contents of attachments cannot be dragged out
@@ -675,6 +735,14 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
675 { 735 {
676 disabled_items.push_back(std::string("Task Open")); 736 disabled_items.push_back(std::string("Task Open"));
677 } 737 }
738// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c)
739 else if ( (rlv_handler_t::isEnabled()) &&
740 ((LLAssetType::AT_LSL_TEXT == item->getType()) || (LLAssetType::AT_NOTECARD == item->getType())) &&
741 (!gRlvHandler.isDetachable(gObjectList.findObject(mPanel->getTaskUUID()))) )
742 {
743 disabled_items.push_back(std::string("Task Open"));
744 }
745// [/RLVa:KB]
678 } 746 }
679 items.push_back(std::string("Task Properties")); 747 items.push_back(std::string("Task Properties"));
680 if(isItemRenameable()) 748 if(isItemRenameable())
@@ -1180,12 +1248,20 @@ LLTaskLSLBridge::LLTaskLSLBridge(
1180 1248
1181void LLTaskLSLBridge::openItem() 1249void LLTaskLSLBridge::openItem()
1182{ 1250{
1251// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c)
1252 LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
1253 if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(object)) )
1254 {
1255 return;
1256 }
1257// [/RLVa:KB]
1258
1183 llinfos << "LLTaskLSLBridge::openItem() " << mUUID << llendl; 1259 llinfos << "LLTaskLSLBridge::openItem() " << mUUID << llendl;
1184 if(LLLiveLSLEditor::show(mUUID, mPanel->getTaskUUID())) 1260 if(LLLiveLSLEditor::show(mUUID, mPanel->getTaskUUID()))
1185 { 1261 {
1186 return; 1262 return;
1187 } 1263 }
1188 LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); 1264// LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
1189 if(!object || object->isInventoryPending()) 1265 if(!object || object->isInventoryPending())
1190 { 1266 {
1191 return; 1267 return;
@@ -1300,6 +1376,12 @@ void LLTaskNotecardBridge::openItem()
1300 { 1376 {
1301 return; 1377 return;
1302 } 1378 }
1379// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c)
1380 if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour("viewnote")) || (!gRlvHandler.isDetachable(object))) )
1381 {
1382 return;
1383 }
1384// [/RLVa:KB]
1303 if(object->permModify() || gAgent.isGodlike()) 1385 if(object->permModify() || gAgent.isGodlike())
1304 { 1386 {
1305 S32 left, top; 1387 S32 left, top;