diff options
Diffstat (limited to 'indra/newview/llviewertexteditor.cpp')
-rwxr-xr-x[-rw-r--r--] | indra/newview/llviewertexteditor.cpp | 81 |
1 files changed, 49 insertions, 32 deletions
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 0c36970878..85ae64aeff 100644..100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -32,6 +32,7 @@ #include "llaudioengine.h" #include "llavataractions.h" #include "llfloaterreg.h" +#include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" #include "llfocusmgr.h" #include "llinventorybridge.h" @@ -50,7 +51,6 @@ #include "llpreviewtexture.h" #include "llscrollbar.h" #include "llscrollcontainer.h" -#include "llsidetray.h" #include "lltooldraganddrop.h" #include "lltooltip.h" #include "lltrans.h" @@ -80,7 +80,7 @@ public: LLSD key; key["type"] = "landmark"; key["id"] = landmark_inv_id; - LLSideTray::getInstance()->showPanel("panel_places", key); + LLFloaterSidePanelContainer::showPanel("places", key); } static void processForeignLandmark(LLLandmark* landmark, const LLUUID& object_id, const LLUUID& notecard_inventory_id, @@ -88,24 +88,29 @@ public: { LLVector3d global_pos; landmark->getGlobalPos(global_pos); - LLViewerInventoryItem* agent_lanmark = + LLViewerInventoryItem* agent_landmark = LLLandmarkActions::findLandmarkForGlobalPos(global_pos); - if (agent_lanmark) + if (agent_landmark) { - showInfo(agent_lanmark->getUUID()); + showInfo(agent_landmark->getUUID()); } else { if (item_ptr.isNull()) { // check to prevent a crash. See EXT-8459. - llwarns << "Passed handle contains a dead inventory item. Most likely notecard has been closed and embedded item was destroyed." << llendl; + LL_WARNS() << "Passed handle contains a dead inventory item. Most likely notecard has been closed and embedded item was destroyed." << LL_ENDL; } else { + LLInventoryItem* item = item_ptr.get(); LLPointer<LLEmbeddedLandmarkCopied> cb = new LLEmbeddedLandmarkCopied(); - copy_inventory_from_notecard(object_id, notecard_inventory_id, item_ptr.get(), gInventoryCallbacks.registerCB(cb)); + copy_inventory_from_notecard(get_folder_by_itemtype(item), + object_id, + notecard_inventory_id, + item, + gInventoryCallbacks.registerCB(cb)); } } } @@ -138,7 +143,7 @@ public: LLInventoryItem* item = gInventory.getItem(inv_item); if(!item) { - llwarns << "Item add reported, but not found in inventory!: " << inv_item << llendl; + LL_WARNS() << "Item add reported, but not found in inventory!: " << inv_item << LL_ENDL; } else { @@ -164,8 +169,7 @@ public: mImage(image), mLabel(utf8str_to_wstring(inv_item->getName())), mItem(inv_item), - mEditor(editor), - mHasMouseHover(false) + mEditor(editor) { mStyle = new LLStyle(LLStyle::Params().font(LLFontGL::getFontSansSerif())); @@ -182,7 +186,7 @@ public: else { width = EMBEDDED_ITEM_LABEL_PADDING + mImage->getWidth() + mStyle->getFont()->getWidth(mLabel.c_str()); - height = llmax(mImage->getHeight(), llceil(mStyle->getFont()->getLineHeight())); + height = llmax(mImage->getHeight(), mStyle->getFont()->getLineHeight()); } return false; } @@ -257,8 +261,6 @@ private: std::string mToolTip; LLPointer<LLInventoryItem> mItem; LLTextEditor& mEditor; - bool mHasMouseHover; - }; @@ -433,7 +435,7 @@ llwchar LLEmbeddedItems::getEmbeddedCharFromIndex(S32 index) { if (index >= (S32)mEmbeddedIndexedChars.size()) { - llwarns << "No item for embedded char " << index << " using LL_UNKNOWN_CHAR" << llendl; + LL_WARNS() << "No item for embedded char " << index << " using LL_UNKNOWN_CHAR" << LL_ENDL; return LL_UNKNOWN_CHAR; } return mEmbeddedIndexedChars[index]; @@ -489,7 +491,7 @@ S32 LLEmbeddedItems::getIndexFromEmbeddedChar(llwchar wch) } else { - llwarns << "Embedded char " << wch << " not found, using 0" << llendl; + LL_WARNS() << "Embedded char " << wch << " not found, using 0" << LL_ENDL; return 0; } } @@ -537,7 +539,8 @@ LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const case LLAssetType::AT_BODYPART: img_name = "Inv_Skin"; break; case LLAssetType::AT_ANIMATION: img_name = "Inv_Animation"; break; case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break; - default: llassert(0); + case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break; + default: img_name = "Inv_Invalid"; break; // use the Inv_Invalid icon for undefined object types (see MAINT-3981) } return LLUI::getUIImage(img_name); @@ -683,6 +686,11 @@ void LLViewerTextEditor::makePristine() LLTextEditor::makePristine(); } +void LLViewerTextEditor::onVisibilityChange( BOOL new_visibility ) +{ + LLUICtrl::onVisibilityChange(new_visibility); +} + BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; @@ -846,17 +854,18 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, { switch( cargo_type ) { - 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: + 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: + case DAD_MESH: { LLInventoryItem *item = (LLInventoryItem *)cargo_data; if( item && allowsEmbeddedItems() ) @@ -913,7 +922,7 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, } handled = TRUE; - lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLViewerTextEditor " << getName() << llendl; + LL_DEBUGS("UserInput") << "dragAndDrop handled by LLViewerTextEditor " << getName() << LL_ENDL; return handled; } @@ -1045,8 +1054,6 @@ void LLViewerTextEditor::findEmbeddedItemSegments(S32 start, S32 end) { LLWString text = getWText(); - LLColor4 text_color = ( mReadOnly ? mReadOnlyFgColor.get() : mFgColor.get() ); - // Start with i just after the first embedded item for(S32 idx = start; idx < end; idx++ ) { @@ -1137,6 +1144,14 @@ void LLViewerTextEditor::openEmbeddedTexture( LLInventoryItem* item, llwchar wc { preview->setAuxItem( item ); preview->setNotecardInfo(mNotecardInventoryID, mObjectID); + if (preview->hasString("Title")) + { + LLStringUtil::format_map_t args; + args["[NAME]"] = item->getName(); + LLUIString title = preview->getString("Title", args); + preview->setTitle(title.getString()); + } + preview->getChild<LLUICtrl>("desc")->setValue(item->getDescription()); } } @@ -1264,9 +1279,11 @@ bool LLViewerTextEditor::importStream(std::istream& str) void LLViewerTextEditor::copyInventory(const LLInventoryItem* item, U32 callback_id) { - copy_inventory_from_notecard(mObjectID, + copy_inventory_from_notecard(LLUUID::null, // Don't specify a destination -- let the sim do that + mObjectID, mNotecardInventoryID, - item, callback_id); + item, + callback_id); } bool LLViewerTextEditor::hasEmbeddedInventory() |