diff options
Diffstat (limited to 'indra/newview/llpreviewnotecard.cpp')
-rw-r--r-- | indra/newview/llpreviewnotecard.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index d4a8bbdf45..9a0a80147a 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -110,13 +110,15 @@ bool LLPreviewNotecard::saveItem() void LLPreviewNotecard::setEnabled( BOOL enabled ) { - - LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); - - getChildView("Notecard Editor")->setEnabled(enabled); - getChildView("lock")->setVisible( !enabled); - getChildView("desc")->setEnabled(enabled); - getChildView("Save")->setEnabled(enabled && editor && (!editor->isPristine())); + LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor"); + // editor is part of xml, if it doesn't exists, nothing else does + if (editor) + { + editor->setEnabled(enabled); + getChildView("lock")->setVisible( !enabled); + getChildView("desc")->setEnabled(enabled); + getChildView("Save")->setEnabled(enabled && (!editor->isPristine())); + } } @@ -508,14 +510,19 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) if (mObjectUUID.isNull() && !agent_url.empty()) { - uploadInfo = LLResourceUploadInfo::ptr_t(new LLBufferedAssetUploadInfo(mItemUUID, LLAssetType::AT_NOTECARD, buffer, - boost::bind(&LLPreviewNotecard::finishInventoryUpload, _1, _2, _3))); + uploadInfo = std::make_shared<LLBufferedAssetUploadInfo>(mItemUUID, LLAssetType::AT_NOTECARD, buffer, + [](LLUUID itemId, LLUUID newAssetId, LLUUID newItemId, LLSD) { + LLPreviewNotecard::finishInventoryUpload(itemId, newAssetId, newItemId); + }); url = agent_url; } else if (!mObjectUUID.isNull() && !task_url.empty()) { - uploadInfo = LLResourceUploadInfo::ptr_t(new LLBufferedAssetUploadInfo(mObjectUUID, mItemUUID, LLAssetType::AT_NOTECARD, buffer, - boost::bind(&LLPreviewNotecard::finishTaskUpload, _1, _3, mObjectUUID))); + LLUUID object_uuid(mObjectUUID); + uploadInfo = std::make_shared<LLBufferedAssetUploadInfo>(mObjectUUID, mItemUUID, LLAssetType::AT_NOTECARD, buffer, + [object_uuid](LLUUID itemId, LLUUID, LLUUID newAssetId, LLSD) { + LLPreviewNotecard::finishTaskUpload(itemId, newAssetId, object_uuid); + }); url = task_url; } |