Commits

leyla_linden committed c5515a1 Merge

Merge

Comments (0)

Files changed (57)

indra/llcharacter/llmultigesture.cpp

 		strings.push_back("until animations are done");
 	//	label += "until animations are done";
 	}
+	else
+	{
+		strings.push_back("");
+	}
 
 	return strings;
 }

indra/llcommon/llapp.cpp

 
 #include <cstdlib>
 
+#ifdef LL_DARWIN
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/sysctl.h>
+#endif
+
 #include "linden_common.h"
 #include "llapp.h"
 
 	setup_signals();
 	
 	// Add google breakpad exception handler configured for Darwin/Linux.
-	if(mExceptionHandler == 0)
+	bool installHandler = true;
+#ifdef LL_DARWIN
+	// For the special case of Darwin, we do not want to install the handler if
+	// the process is being debugged as the app will exit with value ABRT (6) if
+	// we do.  Unfortunately, the code below which performs that test relies on
+	// the structure kinfo_proc which has been tagged by apple as an unstable
+	// API.  We disable this test for shipping versions to avoid conflicts with
+	// future releases of Darwin.  This test is really only needed for developers
+	// starting the app from a debugger anyway.
+	#ifndef LL_RELEASE_FOR_DOWNLOAD
+    int mib[4];
+	mib[0] = CTL_KERN;
+	mib[1] = KERN_PROC;
+	mib[2] = KERN_PROC_PID;
+	mib[3] = getpid();
+	
+	struct kinfo_proc info;
+	memset(&info, 0, sizeof(info));
+	
+	size_t size = sizeof(info);
+	int result = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
+	if((result == 0) || (errno == ENOMEM))
+	{
+		// P_TRACED flag is set, so this process is being debugged; do not install
+		// the handler
+		if(info.kp_proc.p_flag & P_TRACED) installHandler = false;
+	}
+	else
+	{
+		// Failed to discover if the process is being debugged; default to
+		// installing the handler.
+		installHandler = true;
+	}
+	#endif
+#endif
+	if(installHandler && (mExceptionHandler == 0))
 	{
 		std::string dumpPath = "/tmp/";
 		mExceptionHandler = new google_breakpad::ExceptionHandler(dumpPath, 0, &unix_post_minidump_callback, 0, true);
 
 void LLApp::setMiniDumpDir(const std::string &path)
 {
-	llassert(mExceptionHandler);
+	if(mExceptionHandler == 0) return;
 #ifdef LL_WINDOWS
 	wchar_t buffer[MAX_MINDUMP_PATH_LENGTH];
 	mbstowcs(buffer, path.c_str(), MAX_MINDUMP_PATH_LENGTH);
 
 void LLApp::writeMiniDump()
 {
-	llassert(mExceptionHandler);
+	if(mExceptionHandler == 0) return;
 	mExceptionHandler->WriteMinidump();
 }
 

indra/llcommon/llfasttimer_class.cpp

 #else // windows or x86-mac or x86-linux or x86-solaris
 U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer
 {
-	static U64 sCPUClockFrequency = U64(LLProcessorInfo().getCPUFrequency());
+	//getCPUFrequency returns MHz and sCPUClockFrequency wants to be in Hz
+	static U64 sCPUClockFrequency = U64(LLProcessorInfo().getCPUFrequency()*1000000.0);
 
 	// we drop the low-order byte in our timers, so report a lower frequency
 	return sCPUClockFrequency >> 8;

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/app_settings/settings.xml

       <key>Value</key>
       <integer>0</integer>
     </map>
-    <key>FullScreen</key>
-    <map>
-      <key>Comment</key>
-      <string>Run SL in fullscreen mode</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
     <key>FullScreenAspectRatio</key>
     <map>
       <key>Comment</key>
       <key>Type</key>
       <string>F32</string>
       <key>Value</key>
-      <real>1.33329999447</real>
+      <real>3</real>
     </map>
     <key>FullScreenAutoDetectAspectRatio</key>
     <map>
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FullScreenHeight</key>
-    <map>
-      <key>Comment</key>
-      <string>Fullscreen resolution in height</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>768</integer>
-    </map>
-    <key>FullScreenWidth</key>
-    <map>
-      <key>Comment</key>
-      <string>Fullscreen resolution in width</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>1024</integer>
+      <integer>0</integer>
     </map>
     <key>GesturesMarketplaceURL</key>
     <map>

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/llappviewer.cpp

 
 	LLNotificationsUI::LLNotificationManager::getInstance();
 		
-	if (gSavedSettings.getBOOL("FullScreen"))
-	{
-		// request to go full screen... which will be delayed until login
-		gViewerWindow->toggleFullscreen(FALSE);
-	}
-	
 	if (gSavedSettings.getBOOL("WindowMaximized"))
 	{
 		gViewerWindow->mWindow->maximize();
-		gViewerWindow->getWindow()->setNativeAspectRatio(gSavedSettings.getF32("FullScreenAspectRatio"));
 	}
 
 	if (!gNoRender)
 		}
 	}
 
-	// save window position if not fullscreen
+	// save window position if not maximized
 	// as we don't track it in callbacks
-	BOOL fullscreen = gViewerWindow->mWindow->getFullscreen();
 	BOOL maximized = gViewerWindow->mWindow->getMaximized();
-	if (!fullscreen && !maximized)
+	if (!maximized)
 	{
 		LLCoordScreen window_pos;
 

indra/newview/llchatbar.cpp

 {
 	BOOL handled = FALSE;
 
-	// ALT-RETURN is reserved for windowed/fullscreen toggle
 	if( KEY_RETURN == key )
 	{
 		if (mask == MASK_CONTROL)

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/llface.cpp

 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom");
+
 BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 							   const S32 &f,
 								const LLMatrix4& mat_vert, const LLMatrix3& mat_normal,
 								const U16 &index_offset)
 {
+	LLFastTimer t(FTM_FACE_GET_GEOM);
 	const LLVolumeFace &vf = volume.getVolumeFace(f);
 	S32 num_vertices = (S32)vf.mVertices.size();
 	S32 num_indices = LLPipeline::sUseTriStrips ? (S32)vf.mTriStrip.size() : (S32) vf.mIndices.size();

indra/newview/llfloaterhardwaresettings.cpp

 		LLWindow* window = gViewerWindow->getWindow();
 		LLCoordScreen size;
 		window->getSize(&size);
-		gViewerWindow->changeDisplaySettings(window->getFullscreen(), 
-														size,
-														gSavedSettings.getBOOL("DisableVerticalSync"),
-														logged_in);
+		gViewerWindow->changeDisplaySettings(size,
+											gSavedSettings.getBOOL("DisableVerticalSync"),
+											logged_in);
 	}
 	else if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic)
 	{

indra/newview/llfloaterpreference.cpp

 			gAgent.sendAgentUpdateUserInfo(new_im_via_email,mDirectoryVisibility);
 		}
 	}
-
-	applyResolution();
 }
 
 void LLFloaterPreference::cancel()
 	}
 }
 
-void LLFloaterPreference::applyResolution()
-{
-	gGL.flush();
-	
-	// Screen resolution
-	S32 num_resolutions;
-	LLWindow::LLWindowResolution* supported_resolutions = 
-	gViewerWindow->getWindow()->getSupportedResolutions(num_resolutions);
-	S32 resIndex = getChild<LLComboBox>("fullscreen combo")->getCurrentIndex();
-	if (resIndex == -1)
-	{
-		// use highest resolution if nothing selected
-		resIndex = num_resolutions - 1;
-	}
-	gSavedSettings.setS32("FullScreenWidth", supported_resolutions[resIndex].mWidth);
-	gSavedSettings.setS32("FullScreenHeight", supported_resolutions[resIndex].mHeight);
-	
-	gViewerWindow->requestResolutionUpdate(gSavedSettings.getBOOL("FullScreen"));
-	
-	send_agent_update(TRUE);
-	
-	// Update enable/disable
-	refresh();
-}
-
 void LLFloaterPreference::onChangeMaturity()
 {
 	U8 sim_access = gSavedSettings.getU32("PreferredMaturity");

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/llnearbychatbar.cpp

 {
 	BOOL handled = FALSE;
 
-	// ALT-RETURN is reserved for windowed/fullscreen toggle
 	if( KEY_RETURN == key && mask == MASK_CONTROL)
 	{
 		// shout

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/llpanelobjectinventory.cpp

 	virtual time_t getCreationDate() const;
 	virtual LLUIImagePtr getIcon() const;
 	virtual void openItem();
+	virtual BOOL canOpenItem() const { return FALSE; }
 	virtual void closeItem() {}
 	virtual void previewItem();
 	virtual void selectItem() {}
 			}
 		}
 	}
-	else
+	else if (canOpenItem())
 	{
 		items.push_back(std::string("Task Open"));
 		if (!isItemCopyable())
 	virtual BOOL dragOrDrop(MASK mask, BOOL drop,
 							EDragAndDropType cargo_type,
 							void* cargo_data);
+	virtual BOOL canOpenItem() const { return TRUE; }
+	virtual void openItem();
 };
 
 LLTaskCategoryBridge::LLTaskCategoryBridge(
 {
 	std::vector<std::string> items;
 	std::vector<std::string> disabled_items;
-	items.push_back(std::string("Task Open"));
+	items.push_back(std::string("--no options--"));
+	disabled_items.push_back(std::string("--no options--"));
 	hide_context_entries(menu, items, disabled_items);
 }
 
 	return FALSE;
 }
 
+void LLTaskCategoryBridge::openItem()
+{
+}
+
 BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
 {
 	//llinfos << "LLTaskInvFVBridge::startDrag()" << llendl;
 						const std::string& name) :
 		LLTaskInvFVBridge(panel, uuid, name) {}
 
+	virtual BOOL canOpenItem() const { return TRUE; }
 	virtual void openItem();
 };
 
 					  const std::string& name) :
 		LLTaskInvFVBridge(panel, uuid, name) {}
 
+	virtual BOOL canOpenItem() const { return TRUE; }
 	virtual void openItem();
 	virtual void performAction(LLInventoryModel* model, std::string action);
 	virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
 			}
 		}
 	}
-	else
+	else if (canOpenItem())
 	{
-		items.push_back(std::string("Task Open")); 
 		if (!isItemCopyable())
 		{
 			disabled_items.push_back(std::string("Task Open"));
 					const std::string& name) :
 		LLTaskScriptBridge(panel, uuid, name) {}
 
+	virtual BOOL canOpenItem() const { return TRUE; }
 	virtual void openItem();
 	virtual BOOL removeItem();
 	//virtual void buildContextMenu(LLMenuGL& menu);
 						 const std::string& name) :
 		LLTaskInvFVBridge(panel, uuid, name) {}
 
+	virtual BOOL canOpenItem() const { return TRUE; }
 	virtual void openItem();
 	virtual BOOL removeItem();
 };
 						const std::string& name) :
 	LLTaskInvFVBridge(panel, uuid, name) {}
 
+	virtual BOOL canOpenItem() const { return TRUE; }
 	virtual void openItem();
 	virtual BOOL removeItem();
 };
 						  const std::string& name) :
 		LLTaskInvFVBridge(panel, uuid, name) {}
 
+	virtual BOOL canOpenItem() const { return TRUE; }
 	virtual void openItem();
 	virtual BOOL removeItem();
 };

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/llpreviewgesture.cpp

  */
 
 #include "llviewerprecompiledheaders.h"
-
 #include "llpreviewgesture.h"
 
-#include <algorithm>
-
-// libraries
-#include "lldatapacker.h"
-#include "lldarray.h"
-#include "llstring.h"
-#include "lldir.h"
+#include "llagent.h"
+#include "llanimstatelabels.h"
+#include "llanimationstates.h"
+#include "llappviewer.h"			// gVFS
+#include "llassetuploadresponders.h"
+#include "llcheckboxctrl.h"
+#include "llcombobox.h"
+#include "lldelayedgestureerror.h"
 #include "llfloaterreg.h"
+#include "llgesturemgr.h"
 #include "llinventorydefines.h"
 #include "llinventoryfunctions.h"
 #include "llinventorymodel.h"
 #include "llinventorymodelbackgroundfetch.h"
 #include "llmultigesture.h"
 #include "llnotificationsutil.h"
+#include "llradiogroup.h"
+#include "llresmgr.h"
+#include "lltrans.h"
 #include "llvfile.h"
-
-// newview
-#include "llagent.h"		// todo: remove
-#include "llanimationstates.h"
-#include "llassetuploadresponders.h"
-#include "llbutton.h"
-#include "llcheckboxctrl.h"
-#include "llcombobox.h"
-#include "lldelayedgestureerror.h"
-#include "llfloatergesture.h" // for some label constants
-#include "llgesturemgr.h"
-#include "llkeyboard.h"
-#include "lllineeditor.h"
-#include "llradiogroup.h"
-#include "llscrolllistctrl.h"
-#include "llscrolllistitem.h"
-#include "llscrolllistcell.h"
-#include "lltextbox.h"
-#include "lluictrlfactory.h"
-#include "llviewerinventory.h"
-#include "llviewerobject.h"
 #include "llviewerobjectlist.h"
 #include "llviewerregion.h"
 #include "llviewerstats.h"
-#include "llviewerwindow.h"		// busycount
-#include "llvoavatarself.h"
-#include "llappviewer.h"			// gVFS
-#include "llanimstatelabels.h"
-#include "llresmgr.h"
-#include "lltrans.h"
-
 
 std::string NONE_LABEL;
 std::string SHIFT_LABEL;
 	const LLInventoryItem* item = getItem();
 	if (!item) 
 	{
-		mAssetStatus = PREVIEW_ASSET_ERROR;
+		// 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_ERROR;
 		return;
 	}
 

indra/newview/llpreviewgesture.h

 #define LL_LLPREVIEWGESTURE_H
 
 #include "llassettype.h"
+#include "llpreview.h"
 #include "llmultigesture.h"
-#include "llpreview.h"
 
-class LLMultiGesture;
 class LLLineEditor;
 class LLTextBox;
 class LLCheckBoxCtrl;
 class LLScrollListCtrl;
 class LLScrollListItem;
 class LLButton;
-class LLGestureStep;
 class LLRadioGroup;
 class LLVFS;
 
 
 	static void onDonePreview(LLMultiGesture* gesture, void* data);
 
-protected:
+private:
 	// LLPreview contains mDescEditor
 	LLLineEditor*	mTriggerEditor;
 	LLTextBox*		mReplaceText;
 	BOOL mDirty;
 };
 
-#endif
+#endif // LL_LLPREVIEWGESTURE_H

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/llstartup.cpp

 
 //---------------------------------------------------------------------------
 
-
-bool LLStartUp::canGoFullscreen()
-{
-	return gStartupState >= STATE_WORLD_INIT;
-}
-
 // Initialize all plug-ins except the web browser (which was initialized
 // early, before the login screen). JC
 void LLStartUp::multimediaInit()

indra/newview/llstartup.h

 class LLStartUp
 {
 public:
-	static bool canGoFullscreen();
-		// returns true if we are far enough along in startup to allow
-		// going full screen
 
 	// Always use this to set gStartupState so changes are logged
 	static void setStartupState( EStartupState state );

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/lltoolbar.cpp

 	// this function may be called before postBuild(), in which case mResizeHandle won't have been set up yet.
 	if(mResizeHandle != NULL)
 	{
-		if(!gViewerWindow->getWindow()->getFullscreen())
-		{
-			// Only when running in windowed mode on the Mac, leave room for a resize widget on the right edge of the bar.
-			width -= RESIZE_HANDLE_WIDTH;
+		// Only when running in windowed mode on the Mac, leave room for a resize widget on the right edge of the bar.
+		width -= RESIZE_HANDLE_WIDTH;
 
-			LLRect r;
-			r.mLeft = width - pad;
-			r.mBottom = 0;
-			r.mRight = r.mLeft + RESIZE_HANDLE_WIDTH;
-			r.mTop = r.mBottom + RESIZE_HANDLE_HEIGHT;
-			mResizeHandle->setRect(r);
-			mResizeHandle->setVisible(TRUE);
-		}
-		else
-		{
-			mResizeHandle->setVisible(FALSE);
-		}
+		LLRect r;
+		r.mLeft = width - pad;
+		r.mBottom = 0;
+		r.mRight = r.mLeft + RESIZE_HANDLE_WIDTH;
+		r.mTop = r.mBottom + RESIZE_HANDLE_HEIGHT;
+		mResizeHandle->setRect(r);
+		mResizeHandle->setVisible(TRUE);
 	}
 #endif // LL_DARWIN
 }

indra/newview/lltoolgrab.cpp

 // Not dragging.  Just showing affordances
 void LLToolGrab::handleHoverInactive(S32 x, S32 y, MASK mask)
 {
-	const F32 ROTATE_ANGLE_PER_SECOND = 40.f * DEG_TO_RAD;
-	const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped;
-
-	// Look for cursor against the edge of the screen
-	// Only works in fullscreen
-	if (gSavedSettings.getBOOL("FullScreen"))
-	{
-		if (gAgentCamera.cameraThirdPerson() )
-		{
-			if (x == 0)
-			{
-				gAgent.yaw(rotate_angle);
-				//gAgent.setControlFlags(AGENT_CONTROL_YAW_POS);
-			}
-			else if (x == (gViewerWindow->getWorldViewWidthScaled() - 1) )
-			{
-				gAgent.yaw(-rotate_angle);
-				//gAgent.setControlFlags(AGENT_CONTROL_YAW_NEG);
-			}
-		}
-	}
-
 	// JC - TODO - change cursor based on gGrabBtnVertical, gGrabBtnSpin
 	lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (inactive-not over editable object)" << llendl;		
 	gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB);

indra/newview/llviewermenu.cpp

 	}
 };
 
-class LLViewFullscreen : public view_listener_t
-{
-	bool handleEvent(const LLSD& userdata)
-	{
-		// we no longer permit full screen mode EXT-6775
-		// gViewerWindow->toggleFullscreen(TRUE);
-		llwarns << "full screen mode no longer supported" << llendl;
-		return true;
-	}
-};
-
 class LLViewDefaultUISize : public view_listener_t
 {
 	bool handleEvent(const LLSD& userdata)
 	view_listener_t::addMenu(new LLZoomer(1.2f), "View.ZoomOut");
 	view_listener_t::addMenu(new LLZoomer(1/1.2f), "View.ZoomIn");
 	view_listener_t::addMenu(new LLZoomer(DEFAULT_FIELD_OF_VIEW, false), "View.ZoomDefault");
-	view_listener_t::addMenu(new LLViewFullscreen(), "View.Fullscreen");
 	view_listener_t::addMenu(new LLViewDefaultUISize(), "View.DefaultUISize");
 
 	view_listener_t::addMenu(new LLViewEnableMouselook(), "View.EnableMouselook");

indra/newview/llviewerwindow.cpp

 		mActive = TRUE;
 		send_agent_resume();
 		gAgent.clearAFK();
-		if (mWindow->getFullscreen() && !mIgnoreActivate)