EXT-7821 FIXED Editor type was changed to the type as in "Name:" editor in "My Inventory"->"Object Profile".

Fix details:

Using line_editor instead of text_editor.
Enabled ascii filter for entering, because (for example) Russian charters corrupts outfit items and makes Edit Outfit very buggy.

Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/608/

--HG--
branch : product-engine
meow-7.2.2
Vladimir Pchelko 2010-06-18 20:30:52 +03:00
parent 07427b5d67
commit c7f0cabc0e
3 changed files with 21 additions and 19 deletions

View File

@ -652,7 +652,7 @@ BOOL LLPanelEditWearable::postBuild()
// handled at appearance panel level?
//mBtnBack->setClickedCallback(boost::bind(&LLPanelEditWearable::onBackButtonClicked, this));
mTextEditor = getChild<LLTextEditor>("description");
mNameEditor = getChild<LLLineEditor>("description");
mPanelTitle = getChild<LLTextBox>("edit_wearable_title");
mDescTitle = getChild<LLTextBox>("description_text");
@ -758,7 +758,7 @@ BOOL LLPanelEditWearable::isDirty() const
if (mWearablePtr)
{
if (mWearablePtr->isDirty() ||
mWearablePtr->getName().compare(mTextEditor->getText()) != 0)
mWearablePtr->getName().compare(mNameEditor->getText()) != 0)
{
isDirty = TRUE;
}
@ -796,7 +796,7 @@ void LLPanelEditWearable::onRevertButtonClicked(void* userdata)
void LLPanelEditWearable::onSaveAsButtonClicked()
{
LLSD args;
args["DESC"] = mTextEditor->getText();
args["DESC"] = mNameEditor->getText();
LLNotificationsUtil::add("SaveWearableAs", args, LLSD(), boost::bind(&LLPanelEditWearable::saveAsCallback, this, _1, _2));
}
@ -810,7 +810,7 @@ void LLPanelEditWearable::saveAsCallback(const LLSD& notification, const LLSD& r
LLStringUtil::trim(wearable_name);
if( !wearable_name.empty() )
{
mTextEditor->setText(wearable_name);
mNameEditor->setText(wearable_name);
saveChanges();
}
}
@ -956,10 +956,10 @@ void LLPanelEditWearable::saveChanges()
U32 index = gAgentWearables.getWearableIndex(mWearablePtr);
if (mWearablePtr->getName().compare(mTextEditor->getText()) != 0)
if (mWearablePtr->getName().compare(mNameEditor->getText()) != 0)
{
// the name of the wearable has changed, re-save wearable with new name
gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, mTextEditor->getText(), FALSE);
gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, mNameEditor->getText(), FALSE);
}
else
{
@ -976,7 +976,7 @@ void LLPanelEditWearable::revertChanges()
}
mWearablePtr->revertValues();
mTextEditor->setText(mWearablePtr->getName());
mNameEditor->setText(mWearablePtr->getName());
}
void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show)
@ -1018,7 +1018,7 @@ void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show)
mDescTitle->setText(description_title);
// set name
mTextEditor->setText(wearable->getName());
mNameEditor->setText(wearable->getName());
updatePanelPickerControls(type);
updateTypeSpecificControls(type);

View File

@ -41,7 +41,6 @@
class LLCheckBoxCtrl;
class LLWearable;
class LLTextEditor;
class LLTextBox;
class LLViewerInventoryItem;
class LLViewerVisualParam;
@ -49,6 +48,7 @@ class LLVisualParamHint;
class LLViewerJointMesh;
class LLAccordionCtrlTab;
class LLJoint;
class LLLineEditor;
class LLPanelEditWearable : public LLPanel
{
@ -140,7 +140,7 @@ private:
// This text editor reference will change each time we edit a new wearable -
// it will be grabbed from the currently visible panel
LLTextEditor *mTextEditor;
LLLineEditor *mNameEditor;
// The following panels will be shown/hidden based on what wearable we're editing
// body parts

View File

@ -225,15 +225,17 @@ left="0"
tool_tip="Female"
top="7"
width="16" />
<text_editor
follows="all"
height="23"
left="10"
layout="topleft"
max_length="300"
name="description"
top_pad="3"
width="290" />
<line_editor
follows="all"
height="23"
layout="topleft"
left="10"
max_length="300"
name="description"
prevalidate_callback="ascii"
text_color="black"
top_pad="3"
width="290" />
</panel>
<panel
follows="all"