From ad04dcc19d174d774c2cb598f047436849333386 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 11 Aug 2009 00:47:46 +0000 Subject: DEV-35969 - notecards opened from object inventory are blank Also changed notecard previews to only have a "Save" button; "Keep/Discard" behavior has been deprecated. --- indra/newview/llpreviewnotecard.cpp | 27 +++++++--------------- indra/newview/llpreviewnotecard.h | 1 - .../default/xui/en/floater_preview_notecard.xml | 16 ++----------- 3 files changed, 10 insertions(+), 34 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index f3d0dc538d..ce9fcd9da2 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -73,10 +73,9 @@ LLPreviewNotecard::LLPreviewNotecard(const LLSD& key) //const LLUUID& item_id, const LLInventoryItem *item = getItem(); if (item) { - mShowKeepDiscard = item->getPermissions().getCreator() != gAgent.getID(); - //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_notecard.xml", FALSE); mAssetID = item->getAssetUUID(); } + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_notecard.xml", FALSE); } LLPreviewNotecard::~LLPreviewNotecard() @@ -91,18 +90,8 @@ BOOL LLPreviewNotecard::postBuild() ed->setNotecardInfo(mItemUUID, mObjectID, getKey()); ed->makePristine(); } - if (mShowKeepDiscard) - { - childSetAction("Keep",onKeepBtn,this); - childSetAction("Discard",onDiscardBtn,this); - } - else - { - getChild("Keep")->setLabel(getString("Save")); - childSetAction("Keep",onClickSave,this); - childSetVisible("Discard", false); - } + childSetAction("Save", onClickSave, this); childSetVisible("lock", FALSE); const LLInventoryItem* item = getItem(); @@ -137,18 +126,16 @@ void LLPreviewNotecard::setEnabled( BOOL enabled ) childSetEnabled("Notecard Editor", enabled); childSetVisible("lock", !enabled); childSetEnabled("desc", enabled); - childSetEnabled("Keep", enabled && editor && (!editor->isPristine())); - + childSetEnabled("Save", enabled && editor && (!editor->isPristine())); } void LLPreviewNotecard::draw() { - LLViewerTextEditor* editor = getChild("Notecard Editor"); - BOOL script_changed = !editor->isPristine(); + BOOL changed = !editor->isPristine(); - childSetEnabled("Keep", script_changed && getEnabled()); + childSetEnabled("Save", changed && getEnabled()); LLPreview::draw(); } @@ -293,7 +280,9 @@ void LLPreviewNotecard::loadAsset() editor->setText(LLStringUtil::null); editor->makePristine(); editor->setEnabled(TRUE); - mAssetStatus = PREVIEW_ASSET_LOADED; + // Don't set asset status here; we may not have set the item id yet + // (e.g. when this gets called initially) + //mAssetStatus = PREVIEW_ASSET_LOADED; } } diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index 2a008be1e6..5b8cf1c2f6 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -102,7 +102,6 @@ protected: LLUUID mAssetID; LLUUID mObjectID; - BOOL mShowKeepDiscard; }; diff --git a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml index 3327dc8c8b..f8f1abd179 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml @@ -83,23 +83,11 @@