diff options
| author | Loren Shih <seraph@lindenlab.com> | 2009-07-24 16:20:15 +0000 |
|---|---|---|
| committer | Loren Shih <seraph@lindenlab.com> | 2009-07-24 16:20:15 +0000 |
| commit | f5ba6df4c2dc5a5e0842ed028dd4de01406dca3b (patch) | |
| tree | 20c3672125adec3f3db81864ef78143da01ec3c2 /indra/newview/llviewertexteditor.cpp | |
| parent | be7e9a46dbfa6bea2c6d1a0d4e9177eb633f26b4 (diff) | |
svn merge -r 127369:127511 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/landmark-permissions__merge__viewer2.0.0.3-r127280 into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3
includes post-merge fix for DEV-36563 : Remove mAcceptsCallingCardNames
For DEV-36496 : Viewer merge for Landmark & Callingcard Permissions [VIEWER]
For DEV-36563 : Remove mAcceptsCallingCardNames
Test plans - EXTERNAL
* [ Test against a 1.30 server ]
* Test various permissions operations - both on items in inventory, and rezzed items and items that are embedded in objects.
* Test creating landmarks.
Test plans - INTERNAL
* Test against any inventory permissions smoke tests.
* See test plans in QAR-1644 for full Landmark&Callingcard Permissions test plan.
Diffstat (limited to 'indra/newview/llviewertexteditor.cpp')
| -rw-r--r-- | indra/newview/llviewertexteditor.cpp | 199 |
1 files changed, 105 insertions, 94 deletions
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 23f3f46570..902b59c732 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -44,6 +44,7 @@ #include "llviewertexteditor.h" #include "llfloaterchat.h" +#include "llfloateravatarinfo.h" #include "llfloaterworldmap.h" #include "llnotify.h" #include "llpreview.h" @@ -372,47 +373,61 @@ void LLEmbeddedItems::bindEmbeddedChars( const LLFontGL* font ) const const char* img_name; switch( item->getType() ) { - case LLAssetType::AT_TEXTURE: - if(item->getInventoryType() == LLInventoryType::IT_SNAPSHOT) - { - img_name = "inv_item_snapshot.tga"; - } - else - { - img_name = "inv_item_texture.tga"; - } + case LLAssetType::AT_TEXTURE: + if(item->getInventoryType() == LLInventoryType::IT_SNAPSHOT) + { + img_name = "inv_item_snapshot.tga"; + } + else + { + img_name = "inv_item_texture.tga"; + } - break; - case LLAssetType::AT_SOUND: img_name = "inv_item_sound.tga"; break; - case LLAssetType::AT_LANDMARK: - if (item->getFlags() & LLInventoryItem::II_FLAGS_LANDMARK_VISITED) - { - img_name = "inv_item_landmark_visited.tga"; - } - else - { - img_name = "inv_item_landmark.tga"; - } - break; - case LLAssetType::AT_CLOTHING: img_name = "inv_item_clothing.tga"; break; - case LLAssetType::AT_OBJECT: - if (item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS) - { - img_name = "inv_item_object_multi.tga"; - } - else + break; + case LLAssetType::AT_SOUND: img_name = "inv_item_sound.tga"; break; + case LLAssetType::AT_LANDMARK: + if (item->getFlags() & LLInventoryItem::II_FLAGS_LANDMARK_VISITED) + { + img_name = "inv_item_landmark_visited.tga"; + } + else + { + img_name = "inv_item_landmark.tga"; + } + break; + case LLAssetType::AT_CALLINGCARD: { - img_name = "inv_item_object.tga"; + BOOL online; + online = LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID()); + if (online) + { + img_name = "inv_item_callingcard_online.tga"; break; + } + else + { + img_name = "inv_item_callingcard_offline.tga"; break; + } + break; } - break; - case LLAssetType::AT_NOTECARD: img_name = "inv_item_notecard.tga"; break; - case LLAssetType::AT_LSL_TEXT: img_name = "inv_item_script.tga"; break; - case LLAssetType::AT_BODYPART: img_name = "inv_item_skin.tga"; break; - case LLAssetType::AT_ANIMATION: img_name = "inv_item_animation.tga";break; - case LLAssetType::AT_GESTURE: img_name = "inv_item_gesture.tga"; break; - //TODO need img_name - case LLAssetType::AT_FAVORITE: img_name = "inv_item_landmark.tga"; break; - default: llassert(0); continue; + case LLAssetType::AT_CLOTHING: img_name = "inv_item_clothing.tga"; break; + case LLAssetType::AT_OBJECT: + if (item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS) + { + img_name = "inv_item_object_multi.tga"; + } + else + { + img_name = "inv_item_object.tga"; + } + break; + case LLAssetType::AT_NOTECARD: img_name = "inv_item_notecard.tga"; break; + case LLAssetType::AT_LSL_TEXT: img_name = "inv_item_script.tga"; break; + case LLAssetType::AT_BODYPART: img_name = "inv_item_skin.tga"; break; + case LLAssetType::AT_ANIMATION: img_name = "inv_item_animation.tga";break; + case LLAssetType::AT_GESTURE: img_name = "inv_item_gesture.tga"; break; + //TODO need img_name + case LLAssetType::AT_FAVORITE: img_name = "inv_item_landmark.tga"; break; + default: llassert(0); continue; } LLUIImagePtr image = LLUI::getUIImage(img_name); @@ -1019,8 +1034,6 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) } -// Allow calling cards to be dropped onto text fields. Append the name and -// a carriage return. // virtual BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, @@ -1043,33 +1056,17 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, { switch( cargo_type ) { - case DAD_CALLINGCARD: - if(acceptsCallingCardNames()) - { - if (drop) - { - LLInventoryItem *item = (LLInventoryItem *)cargo_data; - std::string name = item->getName(); - appendText(name, true, true); - } - *accept = ACCEPT_YES_COPY_SINGLE; - } - else - { - *accept = ACCEPT_NO; - } - break; - - case DAD_TEXTURE: - case DAD_SOUND: - case DAD_LANDMARK: - case DAD_SCRIPT: - case DAD_CLOTHING: - case DAD_OBJECT: - case DAD_NOTECARD: - case DAD_BODYPART: - case DAD_ANIMATION: - case DAD_GESTURE: + case DAD_CALLINGCARD: + case DAD_TEXTURE: + case DAD_SOUND: + case DAD_LANDMARK: + case DAD_SCRIPT: + case DAD_CLOTHING: + case DAD_OBJECT: + case DAD_NOTECARD: + case DAD_BODYPART: + case DAD_ANIMATION: + case DAD_GESTURE: { LLInventoryItem *item = (LLInventoryItem *)cargo_data; if( item && allowsEmbeddedItems() ) @@ -1101,8 +1098,8 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, { // *TODO: Translate tooltip_msg.assign("Only items with unrestricted\n" - "'next owner' permissions \n" - "can be attached to notecards."); + "'next owner' permissions \n" + "can be attached to notecards."); } } } @@ -1113,9 +1110,9 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, break; } - default: - *accept = ACCEPT_NO; - break; + default: + *accept = ACCEPT_NO; + break; } } else @@ -1301,32 +1298,36 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, llwchar wc) switch( item->getType() ) { - case LLAssetType::AT_TEXTURE: - openEmbeddedTexture( item, wc ); - return TRUE; + case LLAssetType::AT_TEXTURE: + openEmbeddedTexture( item, wc ); + return TRUE; - case LLAssetType::AT_SOUND: - openEmbeddedSound( item, wc ); - return TRUE; + case LLAssetType::AT_SOUND: + openEmbeddedSound( item, wc ); + return TRUE; - case LLAssetType::AT_NOTECARD: - openEmbeddedNotecard( item, wc ); - return TRUE; + case LLAssetType::AT_NOTECARD: + openEmbeddedNotecard( item, wc ); + return TRUE; - case LLAssetType::AT_LANDMARK: - openEmbeddedLandmark( item, wc ); - return TRUE; + case LLAssetType::AT_LANDMARK: + openEmbeddedLandmark( item, wc ); + return TRUE; - case LLAssetType::AT_LSL_TEXT: - case LLAssetType::AT_CLOTHING: - case LLAssetType::AT_OBJECT: - case LLAssetType::AT_BODYPART: - case LLAssetType::AT_ANIMATION: - case LLAssetType::AT_GESTURE: - showCopyToInvDialog( item, wc ); - return TRUE; - default: - return FALSE; + case LLAssetType::AT_CALLINGCARD: + openEmbeddedCallingcard( item, wc ); + return TRUE; + + case LLAssetType::AT_LSL_TEXT: + case LLAssetType::AT_CLOTHING: + case LLAssetType::AT_OBJECT: + case LLAssetType::AT_BODYPART: + case LLAssetType::AT_ANIMATION: + case LLAssetType::AT_GESTURE: + showCopyToInvDialog( item, wc ); + return TRUE; + default: + return FALSE; } } @@ -1376,6 +1377,16 @@ void LLViewerTextEditor::openEmbeddedNotecard( LLInventoryItem* item, llwchar wc copyInventory(item, gInventoryCallbacks.registerCB(mInventoryCallback)); } +void LLViewerTextEditor::openEmbeddedCallingcard( LLInventoryItem* item, llwchar wc ) +{ + if(item && !item->getCreatorUUID().isNull()) + { + BOOL online; + online = LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID()); + LLFloaterAvatarInfo::showFromFriend(item->getCreatorUUID(), online); + } +} + void LLViewerTextEditor::showUnsavedAlertDialog( LLInventoryItem* item ) { LLSD payload; |
