From c7f0cabc0eb530efdbbc0bf74bf33979be23e6fa Mon Sep 17 00:00:00 2001 From: Vladimir Pchelko Date: Fri, 18 Jun 2010 20:30:52 +0300 Subject: 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 --- indra/newview/llpaneleditwearable.cpp | 16 ++++++++-------- indra/newview/llpaneleditwearable.h | 4 ++-- .../skins/default/xui/en/panel_edit_wearable.xml | 20 +++++++++++--------- 3 files changed, 21 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 1aedfec86f..4402b2130f 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -652,7 +652,7 @@ BOOL LLPanelEditWearable::postBuild() // handled at appearance panel level? //mBtnBack->setClickedCallback(boost::bind(&LLPanelEditWearable::onBackButtonClicked, this)); - mTextEditor = getChild("description"); + mNameEditor = getChild("description"); mPanelTitle = getChild("edit_wearable_title"); mDescTitle = getChild("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); diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index c63671fcc9..61441435cd 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -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 diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index 950c4a5fdb..3106ed34ff 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -225,15 +225,17 @@ left="0" tool_tip="Female" top="7" width="16" /> - +