summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewnotecard.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-08-11 00:47:46 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-08-11 00:47:46 +0000
commitad04dcc19d174d774c2cb598f047436849333386 (patch)
tree6a0a46feda18559342e77a91163501f846de0fdd /indra/newview/llpreviewnotecard.cpp
parent6da22957610c8dcfe1f466375a76861946fb5f6e (diff)
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.
Diffstat (limited to 'indra/newview/llpreviewnotecard.cpp')
-rw-r--r--indra/newview/llpreviewnotecard.cpp27
1 files changed, 8 insertions, 19 deletions
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<LLButton>("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<LLViewerTextEditor>("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;
}
}