Commits

Anonymous committed 4865c4f Merge

merge from PE's viewer-release

Comments (0)

Files changed (31)

indra/llui/llaccordionctrl.h

 	 */
 	const LLAccordionCtrlTab* getExpandedTab() const;
 
+	const LLAccordionCtrlTab* getSelectedTab() const { return mSelectedTab; }
+
 private:
 	void	initNoTabsWidget(const LLTextBox::Params& tb_params);
 	void	updateNoTabsHelpTextVisibility();

indra/llui/llaccordionctrltab.cpp

 	std::string getTitle();
 	void	setTitle(const std::string& title, const std::string& hl);
 
+	void	setTitleFontStyle(std::string style);
+
 	void	setSelected(bool is_selected) { mIsSelected = is_selected; }
 
 	virtual void onMouseEnter(S32 x, S32 y, MASK mask);
 	LLPointer<LLUIImage> mImageHeaderPressed;
 	LLPointer<LLUIImage> mImageHeaderFocused;
 
+	// style saved when applying it in setTitleFontStyle
+	LLStyle::Params			mStyleParams;
+
 	LLUIColor mHeaderBGColor;
 
 	bool mNeedsHighlight;
 	{
 		LLTextUtil::textboxSetHighlightedVal(
 			mHeaderTextbox,
-			LLStyle::Params(),
+			mStyleParams,
 			title,
 			hl);
 	}
 }
 
+void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::setTitleFontStyle(std::string style)
+{
+	if (mHeaderTextbox)
+	{
+		std::string text = mHeaderTextbox->getText();
+		mStyleParams.font(mHeaderTextbox->getDefaultFont());
+		mStyleParams.font.style(style);
+		mHeaderTextbox->setText(text, mStyleParams);
+	}
+}
+
 void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw()
 {
 	S32 width = getRect().getWidth();
 	}
 }
 
+void LLAccordionCtrlTab::setTitleFontStyle(std::string style)
+{
+	LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME);
+	if (header)
+	{
+		header->setTitleFontStyle(style);
+	}
+}
+
 boost::signals2::connection LLAccordionCtrlTab::setFocusReceivedCallback(const focus_signal_t::slot_type& cb)
 {
 	LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME);

indra/llui/llaccordionctrltab.h

 #include "llrect.h"
 #include "lluictrl.h"
 #include "lluicolor.h"
+#include "llstyle.h"
 
 class LLUICtrlFactory;
 class LLUIImage;
 	// Set text and highlight substring in LLAccordionCtrlTabHeader
 	void setTitle(const std::string& title, const std::string& hl = LLStringUtil::null);
 
+	// Set text font style in LLAccordionCtrlTabHeader
+	void setTitleFontStyle(std::string style);
+
 	boost::signals2::connection setFocusReceivedCallback(const focus_signal_t::slot_type& cb);
 	boost::signals2::connection setFocusLostCallback(const focus_signal_t::slot_type& cb);
 

indra/llui/lltextbase.cpp

 	bg_writeable_color("bg_writeable_color"),
 	bg_focus_color("bg_focus_color"),
 	allow_scroll("allow_scroll", true),
+	plain_text("plain_text",false),
 	track_end("track_end", false),
 	read_only("read_only", false),
 	v_pad("v_pad", 0),
 	mSelectionStart( 0 ),
 	mSelectionEnd( 0 ),
 	mIsSelecting( FALSE ),
+	mPlainText ( p.plain_text ),
 	mWordWrap(p.wrap),
 	mUseEllipses( p.use_ellipses ),
 	mParseHTML(p.allow_html),
 					part = (S32)LLTextParser::MIDDLE;
 				}
 				std::string subtext=text.substr(0,start);
-				appendAndHighlightTextImpl(subtext, part, style_params); 
+				appendAndHighlightText(subtext, part, style_params); 
 			}
 
 			// output an optional icon before the Url
 			// output the styled Url (unless we've been asked to suppress hyperlinking)
 			if (match.isLinkDisabled())
 			{
-				appendAndHighlightTextImpl(match.getLabel(), part, style_params);
+				appendAndHighlightText(match.getLabel(), part, style_params);
 			}
 			else
 			{
-				appendAndHighlightTextImpl(match.getLabel(), part, link_params);
+				appendAndHighlightText(match.getLabel(), part, link_params);
 
 				// set the tooltip for the Url label
 				if (! match.getTooltip().empty())
 		if (part != (S32)LLTextParser::WHOLE) 
 			part=(S32)LLTextParser::END;
 		if (end < (S32)text.length()) 
-			appendAndHighlightTextImpl(text, part, style_params);		
+			appendAndHighlightText(text, part, style_params);		
 	}
 	else
 	{
-		appendAndHighlightTextImpl(new_text, part, style_params);
+		appendAndHighlightText(new_text, part, style_params);
 	}
 }
 
 
 	if(prepend_newline)
 		appendLineBreakSegment(input_params);
-	std::string::size_type start = 0;
-	std::string::size_type pos = new_text.find("\n",start);
-	
-	while(pos!=-1)
-	{
-		if(pos!=start)
-		{
-			std::string str = std::string(new_text,start,pos-start);
-			appendTextImpl(str,input_params);
-		}
-		appendLineBreakSegment(input_params);
-		start = pos+1;
-		pos = new_text.find("\n",start);
-	}
-
-	std::string str = std::string(new_text,start,new_text.length()-start);
-	appendTextImpl(str,input_params);
+	appendTextImpl(new_text,input_params);
 }
 
 void LLTextBase::needsReflow(S32 index)
 
 void LLTextBase::appendImageSegment(S32 highlight_part, const LLStyle::Params& style_params)
 {
+	if(getPlainText())
+	{
+		return;
+	}
 	segment_vec_t segments;
 	LLStyleConstSP sp(new LLStyle(style_params));
 	segments.push_back(new LLImageTextSegment(sp, getLength(),*this));
 	}
 }
 
-void LLTextBase::appendAndHighlightText(const std::string &new_text, bool prepend_newline, S32 highlight_part, const LLStyle::Params& style_params)
+void LLTextBase::appendAndHighlightText(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params)
 {
 	if (new_text.empty()) return; 
 
-	if(prepend_newline)
-		appendLineBreakSegment(style_params);
-
 	std::string::size_type start = 0;
 	std::string::size_type pos = new_text.find("\n",start);
 	

indra/llui/lltextbase.h

 								track_end,
 								read_only,
 								allow_scroll,
+								plain_text,
 								wrap,
 								use_ellipses,
 								allow_html,
 	void					setReadOnly(bool read_only) { mReadOnly = read_only; }
 	bool					getReadOnly() { return mReadOnly; }
 
+	void					setPlainText(bool value) { mPlainText = value;}
+	bool					getPlainText() const { return mPlainText; }
+
 	// cursor manipulation
 	bool					setCursor(S32 row, S32 column);
 	bool					setCursorPos(S32 cursor_pos, bool keep_cursor_offset = false);
 	S32								insertStringNoUndo(S32 pos, const LLWString &wstr, segment_vec_t* segments = NULL); // returns num of chars actually inserted
 	S32 							removeStringNoUndo(S32 pos, S32 length);
 	S32								overwriteCharNoUndo(S32 pos, llwchar wc);
-	void							appendAndHighlightText(const std::string &new_text, bool prepend_newline, S32 highlight_part, const LLStyle::Params& stylep);
+	void							appendAndHighlightText(const std::string &new_text, S32 highlight_part, const LLStyle::Params& stylep);
 
 
 	// manage segments 
 	bool						mReadOnly;
 	bool						mBGVisible;			// render background?
 	bool						mClipPartial;		// false if we show lines that are partially inside bounding rect
+	bool						mPlainText;			// didn't use Image or Icon segments
 	S32							mMaxTextByteLength;	// Maximum length mText is allowed to be in bytes
 
 	// support widgets

indra/newview/llagentwearables.cpp

 
 LLAgentWearables::LLAgentWearables() :
 	mWearablesLoaded(FALSE)
+,	mCOFChangeInProgress(false)
 {
 }
 
 // static
 // ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume
 // that viewers have a Current Outfit Folder and won't need this message, and thus
-// we can remove/ignore this whole function.
+// we can remove/ignore this whole function. EXCEPT gAgentWearables.notifyLoadingStarted
 void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data)
 {
 	// We should only receive this message a single time.  Ignore subsequent AgentWearablesUpdates
 	// that may result from AgentWearablesRequest having been sent more than once.
 	if (mInitialWearablesUpdateReceived)
 		return;
+
+	// notify subscribers that wearables started loading. See EXT-7777
+	// *TODO: find more proper place to not be called from deprecated method.
+	gAgentWearables.notifyLoadingStarted();
+
 	mInitialWearablesUpdateReceived = true;
 
 	LLUUID agent_id;
 
 	mWearablesLoaded = TRUE; 
 	checkWearablesLoaded();
-	mLoadedSignal();
+	notifyLoadingFinished();
 	
 	updateServer();
 
 	// Start rendering & update the server
 	mWearablesLoaded = TRUE; 
 	checkWearablesLoaded();
-	mLoadedSignal();
+	notifyLoadingFinished();
 	queryWearableCache();
 	updateServer();
 
 	mWearablesLoaded = (itemUpdatePendingCount()==0);
 	if (mWearablesLoaded)
 	{
-		mLoadedSignal();
+		notifyLoadingFinished();
 	}
 }
 
 
 void LLAgentWearables::notifyLoadingStarted()
 {
+	mCOFChangeInProgress = true;
 	mLoadingStartedSignal();
 }
 
+void LLAgentWearables::notifyLoadingFinished()
+{
+	mCOFChangeInProgress = false;
+	mLoadedSignal();
+}
 // EOF

indra/newview/llagentwearables.h

 
 	BOOL			isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const;
 	BOOL			areWearablesLoaded() const;
+	bool			isCOFChangeInProgress() const { return mCOFChangeInProgress; }
 	void			updateWearablesLoaded();
 	void			checkWearablesLoaded() const;
 	bool			canMoveWearable(const LLUUID& item_id, bool closer_to_body);
 	boost::signals2::connection				addLoadedCallback(loaded_callback_t cb);
 
 	void									notifyLoadingStarted();
+	void									notifyLoadingFinished();
 
 private:
 	loading_started_signal_t				mLoadingStartedSignal; // should be called before wearables are changed
 	static BOOL		mInitialWearablesUpdateReceived;
 	BOOL			mWearablesLoaded;
 	std::set<LLUUID>	mItemsAwaitingWearableUpdate;
+
+	/**
+	 * True if agent's outfit is being changed now.
+	 */
+	BOOL			mCOFChangeInProgress;
 	
 	//--------------------------------------------------------------------------------
 	// Support classes

indra/newview/llappearancemgr.cpp

 {
 	if (item_id_to_wear.isNull()) return false;
 
+	// *TODO: issue with multi-wearable should be fixed:
+	// in this case this method will be called N times - loading started for each item
+	// and than N times will be called - loading completed for each item.
+	// That means subscribers will be notified that loading is done after first item in a batch is worn.
+	// (loading indicator disappears for example before all selected items are worn)
+	// Have not fix this issue for 2.1 because of stability reason. EXT-7777.
+	gAgentWearables.notifyLoadingStarted();
+
 	LLViewerInventoryItem* item_to_wear = gInventory.getItem(item_id_to_wear);
 	if (!item_to_wear) return false;
 
 {
 	LLInventoryModel::cat_array_t cats;
 	LLInventoryModel::item_array_t items;
-	LLFindWorn collector;
+	LLFindWearablesEx collector(/*is_worn=*/ true, /*include_body_parts=*/ false);
 
 	gInventory.collectDescendentsIf(cat_id, cats, items, FALSE, collector);
 
 	return true;
 }
 
+// static
+bool LLAppearanceMgr::getCanRemoveFromCOF(const LLUUID& outfit_cat_id)
+{
+	LLInventoryModel::cat_array_t cats;
+	LLInventoryModel::item_array_t items;
+	LLFindWearablesEx is_worn(/*is_worn=*/ true, /*include_body_parts=*/ false);
+	gInventory.collectDescendentsIf(outfit_cat_id,
+		cats,
+		items,
+		LLInventoryModel::EXCLUDE_TRASH,
+		is_worn);
+	return items.size() > 0;
+}
+
+// static
+bool LLAppearanceMgr::getCanAddToCOF(const LLUUID& outfit_cat_id)
+{
+	LLInventoryModel::cat_array_t cats;
+	LLInventoryModel::item_array_t items;
+	LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false);
+	gInventory.collectDescendentsIf(outfit_cat_id,
+		cats,
+		items,
+		LLInventoryModel::EXCLUDE_TRASH,
+		not_worn);
+	return items.size() > 0;
+}
+
 void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category)
 {
 	LLInventoryModel::cat_array_t cats;
 
 	// - Body parts: always include COF contents as a fallback in case any
 	// required parts are missing.
+	// Preserve body parts from COF if appending.
 	LLInventoryModel::item_array_t body_items;
 	getDescendentsOfAssetType(cof, body_items, LLAssetType::AT_BODYPART, false);
 	getDescendentsOfAssetType(category, body_items, LLAssetType::AT_BODYPART, false);
+	if (append)
+		reverse(body_items.begin(), body_items.end());
 	// Reduce body items to max of one per type.
 	removeDuplicateItems(body_items);
 	filterWearableItems(body_items, 1);

indra/newview/llappearancemgr.h

 	// Determine whether a given outfit can be removed.
 	bool getCanRemoveOutfit(const LLUUID& outfit_cat_id);
 
+	// Determine whether we're wearing any of the outfit contents (excluding body parts).
+	static bool getCanRemoveFromCOF(const LLUUID& outfit_cat_id);
+
+	// Determine whether we can add anything (but body parts) from the outfit contents to COF.
+	static bool getCanAddToCOF(const LLUUID& outfit_cat_id);
+
 	// Copy all items in a category.
 	void shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id,
 									 LLPointer<LLInventoryCallback> cb);

indra/newview/llchathistory.cpp

 {
 	bool use_plain_text_chat_history = args["use_plain_text_chat_history"].asBoolean();
 
+	if(mEditor)
+	{
+		mEditor->setPlainText(use_plain_text_chat_history);
+	}
+
 	if (!mEditor->scrolledToEnd() && chat.mFromID != gAgent.getID() && !chat.mFromName.empty())
 	{
 		mUnreadChatSources.insert(chat.mFromName);

indra/newview/llcofwearables.cpp

 		}
 		else if ("edit" == param)
 		{
-			return gAgentWearables.isWearableModifiable(selected_id);
+			return mUUIDs.size() == 1 && gAgentWearables.isWearableModifiable(selected_id);
 		}
 		return true;
 	}
 
 		if ("edit" == param)
 		{
-			return gAgentWearables.isWearableModifiable(selected_id);
+			return mUUIDs.size() == 1 && gAgentWearables.isWearableModifiable(selected_id);
 		}
 
 		return true;

indra/newview/llcolorswatch.cpp

 	if (!pickerp)
 	{
 		pickerp = new LLFloaterColorPicker(this, mCanApplyImmediately);
-		//gFloaterView->getParentFloater(this)->addDependentFloater(pickerp);
+		LLFloater* parent = gFloaterView->getParentFloater(this);
+		if (parent)
+		{
+			parent->addDependentFloater(pickerp);
+		}
 		mPickerHandle = pickerp->getHandle();
 	}
 

indra/newview/llinventorybridge.cpp

 			mItems.push_back(std::string("Wear As Ensemble"));
 		}
 		mItems.push_back(std::string("Remove From Outfit"));
-		if (!areAnyContentsWorn(model))
+		if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID))
 		{
 			disabled_items.push_back(std::string("Remove From Outfit"));
 		}
 	return ((item_array.count() > 0) ? TRUE : FALSE );
 }
 
-BOOL LLFolderBridge::areAnyContentsWorn(LLInventoryModel* model) const
-{
-	LLInventoryModel::cat_array_t cat_array;
-	LLInventoryModel::item_array_t item_array;
-	LLFindWorn is_worn;
-	model->collectDescendentsIf(mUUID,
-								cat_array,
-								item_array,
-								LLInventoryModel::EXCLUDE_TRASH,
-								is_worn);
-	return (item_array.size() > 0);
-}
-
 // Flags unused
 void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 {

indra/newview/llinventorybridge.h

 	static void createNewEyes(void* user_data);
 
 	BOOL checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& typeToCheck);
-	BOOL areAnyContentsWorn(LLInventoryModel* model) const;
 
 	void modifyOutfit(BOOL append);
 	void determineFolderType();

indra/newview/llinventoryfunctions.cpp

 	return FALSE;
 }
 
+LLFindWearablesEx::LLFindWearablesEx(bool is_worn, bool include_body_parts)
+:	mIsWorn(is_worn)
+,	mIncludeBodyParts(include_body_parts)
+{}
+
+bool LLFindWearablesEx::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
+{
+	LLViewerInventoryItem *vitem = dynamic_cast<LLViewerInventoryItem*>(item);
+	if (!vitem) return false;
+
+	// Skip non-wearables.
+	if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT)
+	{
+		return false;
+	}
+
+	// Skip body parts if requested.
+	if (!mIncludeBodyParts && vitem->getType() == LLAssetType::AT_BODYPART)
+	{
+		return false;
+	}
+
+	return (bool) get_is_item_worn(item->getUUID()) == mIsWorn;
+}
+
 bool LLFindWearablesOfType::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
 {
 	if (!item) return false;
 	mWearableType = type;
 }
 
-bool LLFindWorn::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
-{
-	return item && get_is_item_worn(item->getUUID());
-}
-
 bool LLFindNonRemovableObjects::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
 {
 	if (item)

indra/newview/llinventoryfunctions.h

 							LLInventoryItem* item);
 };
 
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLFindWearablesEx
+//
+// Collects wearables based on given criteria.
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+class LLFindWearablesEx : public LLInventoryCollectFunctor
+{
+public:
+	LLFindWearablesEx(bool is_worn, bool include_body_parts = true);
+	virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item);
+private:
+	bool mIncludeBodyParts;
+	bool mIsWorn;
+};
+
 //Inventory collect functor collecting wearables of a specific wearable type
 class LLFindWearablesOfType : public LLInventoryCollectFunctor
 {
 	}
 };
 
-// Find worn items.
-class LLFindWorn : public LLInventoryCollectFunctor
-{
-public:
-	LLFindWorn() {}
-	virtual ~LLFindWorn() {}
-	virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item);
-};
-
 // Collect non-removable folders and items.
 class LLFindNonRemovableObjects : public LLInventoryCollectFunctor
 {

indra/newview/llinventoryitemslist.cpp

 }
 
 // virtual
-void LLPanelInventoryListItemBase::updateItem(const std::string& name)
+void LLPanelInventoryListItemBase::updateItem(const std::string& name,
+											  const LLStyle::Params& input_params)
 {
 	setIconImage(mIconImage);
-	setTitle(name, mHighlightedText);
+	setTitle(name, mHighlightedText, input_params);
 }
 
 void LLPanelInventoryListItemBase::addWidgetToLeftSide(const std::string& name, bool show_widget/* = true*/)
 	}
 }
 
-void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std::string& highlit_text)
+void LLPanelInventoryListItemBase::setTitle(const std::string& title,
+											const std::string& highlit_text,
+											const LLStyle::Params& input_params)
 {
-	setToolTip(title);
+	mTitleCtrl->setToolTip(title);
 
 	LLTextUtil::textboxSetHighlightedVal(
 		mTitleCtrl,
-		LLStyle::Params(),
+		input_params,
 		title,
 		highlit_text);
 }
 
 BOOL LLPanelInventoryListItemBase::handleToolTip( S32 x, S32 y, MASK mask)
 {
-	LLTextBox* item_name = getChild<LLTextBox>("item_name");
-	if (item_name->getRect().getWidth() < item_name->getTextPixelWidth())
+	LLRect text_box_rect = mTitleCtrl->getRect();
+	if (text_box_rect.pointInRect(x, y) &&
+		mTitleCtrl->getTextPixelWidth() <= text_box_rect.getWidth())
 	{
-		return LLPanel::handleToolTip(x,y,mask);
+		return FALSE;
 	}
-	return FALSE;
+	return LLPanel::handleToolTip(x, y, mask);
 }
 
 void LLPanelInventoryListItemBase::reshapeLeftWidgets()

indra/newview/llinventoryitemslist.h

 	/**
 	 * Called after inventory item was updated, update panel widgets to reflect inventory changes.
 	 */
-	virtual void updateItem(const std::string& name);
+	virtual void updateItem(const std::string& name,
+							const LLStyle::Params& input_params = LLStyle::Params());
 
 	/** setter for mIconCtrl */
 	void setIconCtrl(LLIconCtrl* icon) { mIconCtrl = icon; }
 	void setIconImage(const LLUIImagePtr& image);
 
 	/** Set item title - inventory item name usually */
-	virtual void setTitle(const std::string& title, const std::string& highlit_text);
+	virtual void setTitle(const std::string& title,
+						  const std::string& highlit_text,
+						  const LLStyle::Params& input_params = LLStyle::Params());
 
 	/**
 	 * Show tool tip if item name text size > panel size

indra/newview/lloutfitslist.cpp

 		{
 			return get_is_category_renameable(&gInventory, outfit_cat_id);
 		}
+		else if ("wear_add" == param)
+		{
+			return LLAppearanceMgr::getCanAddToCOF(outfit_cat_id);
+		}
+		else if ("take_off" == param)
+		{
+			return LLAppearanceMgr::getCanRemoveFromCOF(outfit_cat_id);
+		}
 
 		return true;
 	}
 		{
 			return !is_worn;
 		}
-		else if ("wear_add" == param)
-		{
-			return !is_worn;
-		}
-		else if ("take_off" == param)
-		{
-			return is_worn;
-		}
 		else if ("delete" == param)
 		{
 			return LLAppearanceMgr::instance().getCanRemoveOutfit(outfit_cat_id);
 	,	mAccordion(NULL)
 	,	mListCommands(NULL)
 	,	mIsInitialized(false)
+	,	mItemSelected(false)
 {
 	mCategoriesObserver = new LLInventoryCategoriesObserver();
 
 		mCategoriesObserver->addCategory(outfits,
 			boost::bind(&LLOutfitsList::refreshList, this, outfits));
 
-		// Start observing changes in Current Outfit to update items worn state.
-		LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLOutfitsList::onCOFChanged, this));
+		const LLUUID cof = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
+
+		// Start observing changes in Current Outfit category.
+		mCategoriesObserver->addCategory(cof, boost::bind(&LLOutfitsList::onCOFChanged, this));
+
+		LLOutfitObserver::instance().addBOFChangedCallback(boost::bind(&LLOutfitsList::highlightBaseOutfit, this));
+		LLOutfitObserver::instance().addBOFReplacedCallback(boost::bind(&LLOutfitsList::highlightBaseOutfit, this));
 
 		// Fetch "My Outfits" contents and refresh the list to display
 		// initially fetched items. If not all items are fetched now
 		// arrive.
 		category->fetch();
 		refreshList(outfits);
+		highlightBaseOutfit();
 
 		mIsInitialized = true;
 	}
 			// 1. Remove outfit category from observer to stop monitoring its changes.
 			mCategoriesObserver->removeCategory(outfit_id);
 
-			// 2. Remove selected lists map entry.
-			mSelectedListsMap.erase(outfit_id);
+			// 2. Remove the outfit from selection.
+			deselectOutfit(outfit_id);
 
-			// 3. Reset currently selected outfit id if it is being removed.
-			if (outfit_id == mSelectedOutfitUUID)
-			{
-				setSelectedOutfitUUID(LLUUID());
-			}
-
-			// 4. Remove category UUID to accordion tab mapping.
+			// 3. Remove category UUID to accordion tab mapping.
 			mOutfitsMap.erase(outfits_iter);
 
-			// 5. Remove outfit tab from accordion.
+			// 4. Remove outfit tab from accordion.
 			mAccordion->removeCollapsibleCtrl(tab);
 		}
 	}
 	mAccordion->sort();
 }
 
+void LLOutfitsList::highlightBaseOutfit()
+{
+	// id of base outfit
+	LLUUID base_id = LLAppearanceMgr::getInstance()->getBaseOutfitUUID();
+	if (base_id != mHighlightedOutfitUUID)
+	{
+		if (mOutfitsMap[mHighlightedOutfitUUID])
+		{
+			mOutfitsMap[mHighlightedOutfitUUID]->setTitleFontStyle("NORMAL");
+		}
+
+		mHighlightedOutfitUUID = base_id;
+	}
+	if (mOutfitsMap[base_id])
+	{
+		mOutfitsMap[base_id]->setTitleFontStyle("BOLD");
+	}
+}
+
 void LLOutfitsList::onSelectionChange(LLUICtrl* ctrl)
 {
 	LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(ctrl);
 	return mSelectionChangeSignal.connect(cb);
 }
 
+bool LLOutfitsList::hasItemSelected()
+{
+	return mItemSelected;
+}
+
 //////////////////////////////////////////////////////////////////////////
 // Private methods
 //////////////////////////////////////////////////////////////////////////
 		mSelectedListsMap.clear();
 	}
 
+	mItemSelected = list && (list->getSelectedItem() != NULL);
+
 	mSelectedListsMap.insert(wearables_lists_map_value_t(category_id, list));
 	setSelectedOutfitUUID(category_id);
 }
 	mSelectionChangeSignal(mSelectedOutfitUUID = category_id);
 }
 
+void LLOutfitsList::deselectOutfit(const LLUUID& category_id)
+{
+	// Remove selected lists map entry.
+	mSelectedListsMap.erase(category_id);
+
+	// Reset selection if the outfit is selected.
+	if (category_id == mSelectedOutfitUUID)
+	{
+		setSelectedOutfitUUID(LLUUID::null);
+	}
+}
+
+void LLOutfitsList::restoreOutfitSelection(LLAccordionCtrlTab* tab, const LLUUID& category_id)
+{
+	// Try restoring outfit selection after filtering.
+	if (mAccordion->getSelectedTab() == tab)
+	{
+		setSelectedOutfitUUID(category_id);
+	}
+}
+
 void LLOutfitsList::onFilteredWearableItemsListRefresh(LLUICtrl* ctrl)
 {
 	if (!ctrl || mFilterSubString.empty())
 		LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
 		if (list != ctrl) continue;
 
-		std::string title = tab->getTitle();
-		LLStringUtil::toUpper(title);
-
-		std::string cur_filter = mFilterSubString;
-		LLStringUtil::toUpper(cur_filter);
-
-		if (std::string::npos == title.find(cur_filter))
-		{
-			// hide tab if its title doesn't pass filter
-			// and it has no visible items
-			tab->setVisible(list->size() != 0);
-
-			// remove title highlighting because it might
-			// have been previously highlighted by less restrictive filter
-			tab->setTitle(tab->getTitle());
-		}
-		else
-		{
-			tab->setTitle(tab->getTitle(), cur_filter);
-		}
+		applyFilterToTab(iter->first, tab, mFilterSubString);
 	}
 }
 
 
 		if (!new_filter_substring.empty())
 		{
-			std::string title = tab->getTitle();
-			LLStringUtil::toUpper(title);
-
-			std::string cur_filter = new_filter_substring;
-			LLStringUtil::toUpper(cur_filter);
-
-			if (std::string::npos == title.find(cur_filter))
-			{
-				// hide tab if its title doesn't pass filter
-				// and it has no visible items
-				tab->setVisible(list->size() != 0);
-
-				// remove title highlighting because it might
-				// have been previously highlighted by less restrictive filter
-				tab->setTitle(tab->getTitle());
-			}
-			else
-			{
-				tab->setTitle(tab->getTitle(), cur_filter);
-			}
+			applyFilterToTab(iter->first, tab, new_filter_substring);
 
 			if (tab->getVisible())
 			{
 
 			//restore accordion state after all those accodrion tab manipulations
 			tab->notifyChildren(LLSD().with("action","restore_state"));
+
+			// Try restoring the tab selection.
+			restoreOutfitSelection(tab, iter->first);
 		}
 	}
 }
 
+void LLOutfitsList::applyFilterToTab(
+	const LLUUID&		category_id,
+	LLAccordionCtrlTab*	tab,
+	const std::string&	filter_substring)
+{
+	if (!tab) return;
+	LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
+	if (!list) return;
+
+	std::string title = tab->getTitle();
+	LLStringUtil::toUpper(title);
+
+	std::string cur_filter = filter_substring;
+	LLStringUtil::toUpper(cur_filter);
+
+	tab->setTitle(tab->getTitle(), cur_filter);
+
+	if (std::string::npos == title.find(cur_filter))
+	{
+		// hide tab if its title doesn't pass filter
+		// and it has no visible items
+		tab->setVisible(list->size() > 0);
+
+		// remove title highlighting because it might
+		// have been previously highlighted by less restrictive filter
+		tab->setTitle(tab->getTitle());
+
+		// Remove the tab from selection.
+		deselectOutfit(category_id);
+	}
+	else
+	{
+		// Try restoring the tab selection.
+		restoreOutfitSelection(tab, category_id);
+	}
+}
+
 void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id)
 {
 	LLAccordionCtrlTab* tab = dynamic_cast<LLAccordionCtrlTab*>(ctrl);

indra/newview/lloutfitslist.h

 
 	void refreshList(const LLUUID& category_id);
 
+	// highlits currently worn outfit tab text and unhighlights previously worn
+	void highlightBaseOutfit();
+
 	void performAction(std::string action);
 
 	void setFilterSubString(const std::string& string);
 
 	boost::signals2::connection addSelectionChangeCallback(selection_change_callback_t cb);
 
+	/**
+	 * Returns true if there is a selection inside currently selected outfit
+	 */
+	bool hasItemSelected();
+
 private:
 	/**
 	 * Reads xml with accordion tab and Flat list from xml file.
 	void setSelectedOutfitUUID(const LLUUID& category_id);
 
 	/**
+	 * Removes the outfit from selection.
+	 */
+	void deselectOutfit(const LLUUID& category_id);
+
+	/**
+	 * Try restoring selection for a temporary hidden tab.
+	 *
+	 * A tab may be hidden if it doesn't match current filter.
+	 */
+	void restoreOutfitSelection(LLAccordionCtrlTab* tab, const LLUUID& category_id);
+
+	/**
 	 * Called upon list refresh event to update tab visibility depending on
 	 * the results of applying filter to the title and list items of the tab.
 	 */
 	 */
 	void applyFilter(const std::string& new_filter_substring);
 
+	/**
+	 * Applies filter to the given tab
+	 *
+	 * @see applyFilter()
+	 */
+	void applyFilterToTab(const LLUUID& category_id, LLAccordionCtrlTab* tab, const std::string& filter_substring);
+
 	void onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id);
 	void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y);
 	void onCOFChanged();
 	wearables_lists_map_t			mSelectedListsMap;
 
 	LLUUID							mSelectedOutfitUUID;
+	// id of currently highlited outfit
+	LLUUID							mHighlightedOutfitUUID;
 	selection_change_signal_t		mSelectionChangeSignal;
 
 	std::string 					mFilterSubString;
 	LLListContextMenu*			mOutfitMenu;
 
 	bool							mIsInitialized;
+	/**
+	 * True if there is a selection inside currently selected outfit
+	 */
+	bool							mItemSelected;
 };
 
 #endif //LL_LLOUTFITSLIST_H

indra/newview/llpaneloutfitsinventory.cpp

 		{
 			return LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit_id);
 		}
+		else if ("take_off" == param)
+		{
+			return LLAppearanceMgr::getCanRemoveFromCOF(selected_outfit_id);
+		}
 
 		return true;
 	}
 		{
 			return !is_worn;
 		}
-		else if ("take_off" == param)
-		{
-			return is_worn;
-		}
 
 		return true;
 	}
 LLPanelOutfitsInventory::LLPanelOutfitsInventory() :
 	mMyOutfitsPanel(NULL),
 	mCurrentOutfitPanel(NULL),
-	mParent(NULL),
 	mGearMenu(NULL),
 	mInitialized(false)
 {
 	}
 }
 
-void LLPanelOutfitsInventory::setParent(LLSidepanelAppearance* parent)
-{
-	mParent = parent;
-}
-
 // virtual
 void LLPanelOutfitsInventory::onSearchEdit(const std::string& string)
 {
 void LLPanelOutfitsInventory::updateListCommands()
 {
 	bool trash_enabled = isActionEnabled("delete");
-	bool wear_enabled = isActionEnabled("wear");
+	bool wear_enabled =  !gAgentWearables.isCOFChangeInProgress() && isActionEnabled("wear");
 	bool wear_visible = !isCOFPanelActive();
 	bool make_outfit_enabled = isActionEnabled("save_outfit");
 
 		else // "My Outfits" tab active
 		{
 			const LLUUID& selected_outfit = mMyOutfitsPanel->getSelectedOutfitUUID();
-			can_delete = LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit);
+			// first condition prevents trash btn from enabling when items are selected inside outfit (EXT-7847)
+			can_delete = !mMyOutfitsPanel->hasItemSelected() && LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit);
 		}
 
 		return can_delete;
 void LLPanelOutfitsInventory::setWearablesLoading(bool val)
 {
 	mListCommands->childSetEnabled("wear_btn", !val);
-
-	llassert(mParent);
-	if (mParent)
-	{
-		mParent->setWearablesLoading(val);
-	}
 }
 
 void LLPanelOutfitsInventory::onWearablesLoaded()

indra/newview/llpaneloutfitsinventory.h

 	// If a compatible listener type is selected, then return a pointer to that.
 	// Otherwise, return NULL.
 	LLFolderViewEventListener* getCorrectListenerForAction();
-	void setParent(LLSidepanelAppearance *parent);
 
 	LLFolderView* getRootFolder();
 	static LLSidepanelAppearance* getAppearanceSP();
 	bool getIsCorrectType(const LLFolderViewEventListener *listenerp) const;
 
 private:
-	LLSidepanelAppearance*  mParent;
 	LLSaveFolderState*		mSavedFolderState;
 	LLTabContainer*			mAppearanceTabs;
 	std::string 			mFilterSubString;

indra/newview/llsidepanelappearance.cpp

 	outfit_observer.addBOFReplacedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, ""));
 	outfit_observer.addBOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, ""));
 	outfit_observer.addCOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, ""));
+
+	gAgentWearables.addLoadingStartedCallback(boost::bind(&LLSidepanelAppearance::setWearablesLoading, this, true));
+	gAgentWearables.addLoadedCallback(boost::bind(&LLSidepanelAppearance::setWearablesLoading, this, false));
 }
 
 LLSidepanelAppearance::~LLSidepanelAppearance()
 	}
 
 	mPanelOutfitsInventory = dynamic_cast<LLPanelOutfitsInventory *>(getChild<LLPanel>("panel_outfits_inventory"));
-	mPanelOutfitsInventory->setParent(this);
 
 	mOutfitEdit = dynamic_cast<LLPanelOutfitEdit*>(getChild<LLPanel>("panel_outfit_edit"));
 	if (mOutfitEdit)
 				mCurrentLookName->setText(outfit_name);
 				return;
 		}
-		mCurrentLookName->setText(getString("No Outfit"));
+
+		std::string look_name = gAgentWearables.isCOFChangeInProgress() ? "" : getString("No Outfit");
+		mCurrentLookName->setText(look_name);
 		mOpenOutfitBtn->setEnabled(FALSE);
 	}
 	else

indra/newview/lltoastalertpanel.cpp

 	msg_box->setRect( rect );
 	LLToastPanel::addChild(msg_box);
 
-	// Buttons	
-	S32 button_left = (LLToastPanel::getRect().getWidth() - btn_total_width) / 2;
-	
-	for( S32 i = 0; i < num_options; i++ )
-	{
-		LLRect button_rect;
-		
-		LLButton* btn = LLUICtrlFactory::getInstance()->createFromFile<LLButton>("alert_button.xml", this, LLPanel::child_registry_t::instance());
-		if(btn)
-		{
-			btn->setName(options[i].first);
-			btn->setRect(button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT ));
-			btn->setLabel(options[i].second);
-			btn->setFont(font);
-			
-			btn->setClickedCallback(boost::bind(&LLToastAlertPanel::onButtonPressed, this, _2, i));
-
-			mButtonData[i].mButton = btn;
-
-			LLToastPanel::addChild(btn);
-
-			if( i == mDefaultOption )
-			{
-				btn->setFocus(TRUE);
-			}
-		}
-		button_left += button_width + BTN_HPAD;
-	}
-
 	// (Optional) Edit Box	
 	if (!edit_text_name.empty())
 	{
 			mLineEditor->setDrawAsterixes(is_password);
 
 			setEditTextArgs(notification->getSubstitutions());
+
+			mLineEditor->setFollowsLeft();
+			mLineEditor->setFollowsRight();
+
+			// find form text input field
+			LLSD form_text;
+			for (LLSD::array_const_iterator it = form_sd.beginArray(); it != form_sd.endArray(); ++it)
+			{
+				std::string type = (*it)["type"].asString();
+				if (type == "text")
+				{
+					form_text = (*it);
+				}
+			}
+
+			// if form text input field has width attribute
+			if (form_text.has("width"))
+			{
+				// adjust floater width to fit line editor
+				S32 editor_width = form_text["width"];
+				LLRect editor_rect =  mLineEditor->getRect();
+				U32 width_delta = editor_width  - editor_rect.getWidth();
+				LLRect toast_rect = getRect();
+				reshape(toast_rect.getWidth() +  width_delta, toast_rect.getHeight());
+			}
 		}
 	}
 
+	// Buttons
+	S32 button_left = (LLToastPanel::getRect().getWidth() - btn_total_width) / 2;
+
+	for( S32 i = 0; i < num_options; i++ )
+	{
+		LLRect button_rect;
+
+		LLButton* btn = LLUICtrlFactory::getInstance()->createFromFile<LLButton>("alert_button.xml", this, LLPanel::child_registry_t::instance());
+		if(btn)
+		{
+			btn->setName(options[i].first);
+			btn->setRect(button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT ));
+			btn->setLabel(options[i].second);
+			btn->setFont(font);
+
+			btn->setClickedCallback(boost::bind(&LLToastAlertPanel::onButtonPressed, this, _2, i));
+
+			mButtonData[i].mButton = btn;
+
+			LLToastPanel::addChild(btn);
+
+			if( i == mDefaultOption )
+			{
+				btn->setFocus(TRUE);
+			}
+		}
+		button_left += button_width + BTN_HPAD;
+	}
+
 	std::string ignore_label;
 
 	if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE)

indra/newview/llwearableitemslist.cpp

 }
 
 // virtual
-void LLPanelWearableOutfitItem::updateItem(const std::string& name)
+void LLPanelWearableOutfitItem::updateItem(const std::string& name,
+										   const LLStyle::Params& input_params)
 {
 	std::string search_label = name;
+	LLStyle::Params style_params = input_params;
 
 	if (mItem && get_is_item_worn(mItem->getUUID()))
 	{
 		search_label += LLTrans::getString("worn");
+		style_params.font.style("BOLD");
 	}
 
-	LLPanelInventoryListItemBase::updateItem(search_label);
+	LLPanelInventoryListItemBase::updateItem(search_label, style_params);
 }
 
 //////////////////////////////////////////////////////////////////////////
 	return list_item;
 }
 
-void LLPanelAttachmentListItem::setTitle(const std::string& title, const std::string& highlit_text)
+void LLPanelAttachmentListItem::setTitle(const std::string& title,
+										 const std::string& highlit_text,
+										 const LLStyle::Params& input_params)
 {
 	std::string title_joint = title;
 
 		title_joint = title + " (" + joint + ")";
 	}
 
-	LLPanelDeletableWearableListItem::setTitle(title_joint, highlit_text);
+	LLPanelDeletableWearableListItem::setTitle(title_joint, highlit_text, input_params);
 }
 
 //////////////////////////////////////////////////////////////////////////

indra/newview/llwearableitemslist.h

 	/**
 	 * Updates item name and (worn) suffix.
 	 */
-	/*virtual*/ void updateItem(const std::string& name);
-
+	/*virtual*/ void updateItem(const std::string& name,
+								const LLStyle::Params& input_params = LLStyle::Params());
 
 protected:
 	LLPanelWearableOutfitItem(LLViewerInventoryItem* item);
 	virtual ~LLPanelAttachmentListItem() {};
 
 	/** Set item title. Joint name is added to the title in parenthesis */
-	/*virtual*/ void setTitle(const std::string& title, const std::string& highlit_text);
+	/*virtual*/ void setTitle(const std::string& title,
+							  const std::string& highlit_text,
+							  const LLStyle::Params& input_params = LLStyle::Params());
 
 protected:
 	LLPanelAttachmentListItem(LLViewerInventoryItem* item) : LLPanelDeletableWearableListItem(item) {};

indra/newview/llworldmapmessage.cpp

 		U32 x_world = (U32)(x_regions) * REGION_WIDTH_UNITS;
 		U32 y_world = (U32)(y_regions) * REGION_WIDTH_UNITS;
 
+		// name shouldn't be empty, see EXT-4568
+		llassert(!name.empty());
+
 		// Insert that region in the world map, if failure, flag it as a "null_sim"
 		if (!(LLWorldMap::getInstance()->insertRegion(x_world, y_world, name, image_id, (U32)accesscode, region_flags)))
 		{

indra/newview/skins/default/textures/textures.xml

   <texture name="DisclosureArrow_Opened_Off" file_name="widgets/DisclosureArrow_Opened_Off.png" preload="true" />
 
   <texture name="DownArrow" file_name="bottomtray/DownArrow.png" preload="false" />
-  <texture name="DownArrow_Off" file_name="icons/DownArrow_off.png" preload="false" />
+  <texture name="DownArrow_Off" file_name="icons/DownArrow_Off.png" preload="false" />
   <texture name="Dragbar" file_name="windows/Dragbar.png" preload="false" scale.left="35" scale.top="5" scale.right="29" scale.bottom="5" />
 
   <texture name="DropDown_Disabled" file_name="widgets/DropDown_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="99" scale.bottom="4" />

indra/newview/skins/default/xui/en/menu_outfit_tab.xml

      name="wear_add">
         <on_click
          function="Outfit.WearAdd" />
+        <on_enable
+         function="Outfit.OnEnable"
+         parameter="wear_add" />
         <on_visible
          function="Outfit.OnVisible"
          parameter="wear_add" />
      name="take_off">
         <on_click
          function="Outfit.TakeOff" />
+        <on_enable
+         function="Outfit.OnEnable"
+         parameter="take_off" />
         <on_visible
          function="Outfit.OnVisible"
          parameter="take_off" />
     </menu_item_call>
     <menu_item_separator />
     <menu_item_call
-     label="Rename"
+     label="Rename Outfit"
      layout="topleft"
      name="rename">
         <on_click

indra/newview/skins/default/xui/en/notifications.xml

    type="alertmodal">
     New outfit name:
     <form name="form">
-      <input name="new_name" type="text">
+      <input name="new_name" type="text" width="300">
         [NAME]
       </input>
       <button

indra/newview/skins/default/xui/en/panel_group_general.xml

          top_pad="4"
          width="190">
 			<combo_item name="select_mature" value="Select">
-			- Select Mature -
+			- Select maturity rating -
 			</combo_item>
             <combo_box.item
              label="Moderate Content"