diff --git a/doc/contributions.txt b/doc/contributions.txt
index a74cf32afaff1f71e7e52c37b89e1a0b343d4cac..8c6bd5e0feaed7a18a1b158cab781025028f4867 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -185,6 +185,8 @@ Dale Glass
 	VWR-2502
 	VWR-1358
 	VWR-2041
+Drew Dri
+	VWR-19683
 Drewan Keats
 	VWR-28
 	VWR-248
diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp
index f814618fc180e968b419f62884ea28cec800e0ac..0587e5642c6e093a838dd71e17a6c7c10f538c57 100644
--- a/indra/llcharacter/llkeyframewalkmotion.cpp
+++ b/indra/llcharacter/llkeyframewalkmotion.cpp
@@ -44,32 +44,31 @@
 //-----------------------------------------------------------------------------
 // Macros
 //-----------------------------------------------------------------------------
-const F32 MAX_WALK_PLAYBACK_SPEED = 8.f;	// max m/s for which we adjust walk cycle speed
-
-const F32 MIN_WALK_SPEED = 0.1f;	// minimum speed at which we use velocity for down foot detection
-const F32 MAX_TIME_DELTA = 2.f;		//max two seconds a frame for calculating interpolation
-F32 SPEED_ADJUST_MAX = 2.5f; // maximum adjustment of walk animation playback speed
-F32 SPEED_ADJUST_MAX_SEC = 3.f;	// maximum adjustment to walk animation playback speed for a second
-F32 ANIM_SPEED_MAX = 10.0f; // absolute upper limit on animation speed
-F32 ANIM_SPEED_MIN = 0.0f; // absolute lower limit on animation speed
-const F32 DRIFT_COMP_MAX_TOTAL = 0.07f;//0.55f; // maximum drift compensation overall, in any direction 
-const F32 DRIFT_COMP_MAX_SPEED = 4.f; // speed at which drift compensation total maxes out
+const F32 MAX_WALK_PLAYBACK_SPEED = 8.f;		// max m/s for which we adjust walk cycle speed
+
+const F32 MIN_WALK_SPEED = 0.1f;				// minimum speed at which we use velocity for down foot detection
+const F32 TIME_EPSILON = 0.001f;				// minumum frame time
+const F32 MAX_TIME_DELTA = 2.f;					// max two seconds a frame for calculating interpolation
+F32 SPEED_ADJUST_MAX_SEC = 2.f;					// maximum adjustment to walk animation playback speed for a second
+F32 ANIM_SPEED_MAX = 1.5f;						// absolute upper limit on animation speed
+const F32 DRIFT_COMP_MAX_TOTAL = 0.1f;			// maximum drift compensation overall, in any direction 
+const F32 DRIFT_COMP_MAX_SPEED = 4.f;			// speed at which drift compensation total maxes out
 const F32 MAX_ROLL = 0.6f;
+const F32 PELVIS_COMPENSATION_WIEGHT = 0.7f; 	// proportion of foot drift that is compensated by moving the avatar directly
+const F32 SPEED_ADJUST_TIME_CONSTANT = 0.1f; 	// time constant for speed adjustment interpolation
 
 //-----------------------------------------------------------------------------
 // LLKeyframeWalkMotion()
 // Class Constructor
 //-----------------------------------------------------------------------------
 LLKeyframeWalkMotion::LLKeyframeWalkMotion(const LLUUID &id)
-  : LLKeyframeMotion(id),
-    
+:	LLKeyframeMotion(id),
     mCharacter(NULL),
     mCyclePhase(0.0f),
     mRealTimeLast(0.0f),
     mAdjTimeLast(0.0f),
     mDownFoot(0)
-{
-}
+{}
 
 
 //-----------------------------------------------------------------------------
@@ -77,8 +76,7 @@ LLKeyframeWalkMotion::LLKeyframeWalkMotion(const LLUUID &id)
 // Class Destructor
 //-----------------------------------------------------------------------------
 LLKeyframeWalkMotion::~LLKeyframeWalkMotion()
-{
-}
+{}
 
 
 //-----------------------------------------------------------------------------
@@ -149,15 +147,12 @@ BOOL LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask)
 LLWalkAdjustMotion::LLWalkAdjustMotion(const LLUUID &id) :
 	LLMotion(id),
 	mLastTime(0.f),
-	mAvgCorrection(0.f),
-	mSpeedAdjust(0.f),
 	mAnimSpeed(0.f),
-	mAvgSpeed(0.f),
+	mAdjustedSpeed(0.f),
 	mRelativeDir(0.f),
 	mAnkleOffset(0.f)
 {
 	mName = "walk_adjust";
-
 	mPelvisState = new LLJointState;
 }
 
@@ -189,15 +184,16 @@ LLMotion::LLMotionInitStatus LLWalkAdjustMotion::onInitialize(LLCharacter *chara
 //-----------------------------------------------------------------------------
 BOOL LLWalkAdjustMotion::onActivate()
 {
-	mAvgCorrection = 0.f;
-	mSpeedAdjust = 0.f;
 	mAnimSpeed = 0.f;
-	mAvgSpeed = 0.f;
+	mAdjustedSpeed = 0.f;
 	mRelativeDir = 1.f;
 	mPelvisState->setPosition(LLVector3::zero);
 	// store ankle positions for next frame
-	mLastLeftAnklePos = mCharacter->getPosGlobalFromAgent(mLeftAnkleJoint->getWorldPosition());
-	mLastRightAnklePos = mCharacter->getPosGlobalFromAgent(mRightAnkleJoint->getWorldPosition());
+	mLastLeftFootGlobalPos = mCharacter->getPosGlobalFromAgent(mLeftAnkleJoint->getWorldPosition());
+	mLastLeftFootGlobalPos.mdV[VZ] = 0.0;
+
+	mLastRightFootGlobalPos = mCharacter->getPosGlobalFromAgent(mRightAnkleJoint->getWorldPosition());
+	mLastRightFootGlobalPos.mdV[VZ] = 0.0;
 
 	F32 leftAnkleOffset = (mLeftAnkleJoint->getWorldPosition() - mCharacter->getCharacterPosition()).magVec();
 	F32 rightAnkleOffset = (mRightAnkleJoint->getWorldPosition() - mCharacter->getCharacterPosition()).magVec();
@@ -211,164 +207,120 @@ BOOL LLWalkAdjustMotion::onActivate()
 //-----------------------------------------------------------------------------
 BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
 {
-	LLVector3 footCorrection;
-	LLVector3 vel = mCharacter->getCharacterVelocity() * mCharacter->getTimeDilation();
-	F32 deltaTime = llclamp(time - mLastTime, 0.f, MAX_TIME_DELTA);
+	// delta_time is guaranteed to be non zero
+	F32 delta_time = llclamp(time - mLastTime, TIME_EPSILON, MAX_TIME_DELTA);
 	mLastTime = time;
 
-	LLQuaternion inv_rotation = ~mPelvisJoint->getWorldRotation();
+	// find the avatar motion vector in the XY plane
+	LLVector3 avatar_velocity = mCharacter->getCharacterVelocity() * mCharacter->getTimeDilation();
+	avatar_velocity.mV[VZ] = 0.f;
 
-	// get speed and normalize velocity vector
-	LLVector3 ang_vel = mCharacter->getCharacterAngularVelocity() * mCharacter->getTimeDilation();
-	F32 speed = llmin(vel.normVec(), MAX_WALK_PLAYBACK_SPEED);
-	mAvgSpeed = lerp(mAvgSpeed, speed, LLCriticalDamp::getInterpolant(0.2f));
+	F32 speed = llclamp(avatar_velocity.magVec(), 0.f, MAX_WALK_PLAYBACK_SPEED);
 
-	// calculate facing vector in pelvis-local space 
-	// (either straight forward or back, depending on velocity)
-	LLVector3 localVel = vel * inv_rotation;
-	if (localVel.mV[VX] > 0.f)
-	{
-		mRelativeDir = 1.f;
-	}
-	else if (localVel.mV[VX] < 0.f)
-	{
-		mRelativeDir = -1.f;
-	}
+	// grab avatar->world transforms
+	LLQuaternion avatar_to_world_rot = mCharacter->getRootJoint()->getWorldRotation();
 
-	// calculate world-space foot drift
-	LLVector3 leftFootDelta;
-	LLVector3 leftFootWorldPosition = mLeftAnkleJoint->getWorldPosition();
-	LLVector3d leftFootGlobalPosition = mCharacter->getPosGlobalFromAgent(leftFootWorldPosition);
-	leftFootDelta.setVec(mLastLeftAnklePos - leftFootGlobalPosition);
-	mLastLeftAnklePos = leftFootGlobalPosition;
+	LLQuaternion world_to_avatar_rot(avatar_to_world_rot);
+	world_to_avatar_rot.conjugate();
 
-	LLVector3 rightFootDelta;
-	LLVector3 rightFootWorldPosition = mRightAnkleJoint->getWorldPosition();
-	LLVector3d rightFootGlobalPosition = mCharacter->getPosGlobalFromAgent(rightFootWorldPosition);
-	rightFootDelta.setVec(mLastRightAnklePos - rightFootGlobalPosition);
-	mLastRightAnklePos = rightFootGlobalPosition;
+	LLVector3 foot_slip_vector;
 
 	// find foot drift along velocity vector
-	if (mAvgSpeed > 0.1)
-	{
-		// walking/running
-		F32 leftFootDriftAmt = leftFootDelta * vel;
-		F32 rightFootDriftAmt = rightFootDelta * vel;
-
-		if (rightFootDriftAmt > leftFootDriftAmt)
-		{
-			footCorrection = rightFootDelta;
-		} else
-		{
-			footCorrection = leftFootDelta;
-		}
-	}
-	else
-	{
-		mAvgSpeed = ang_vel.magVec() * mAnkleOffset;
-		mRelativeDir = 1.f;
-
-		// standing/turning
-		// find the lower foot
-		if (leftFootWorldPosition.mV[VZ] < rightFootWorldPosition.mV[VZ])
-		{
-			// pivot on left foot
-			footCorrection = leftFootDelta;
-		}
+	if (speed > MIN_WALK_SPEED)
+	{	// walking/running
+
+		// calculate world-space foot drift
+		// use global coordinates to seamlessly handle region crossings
+		LLVector3d leftFootGlobalPosition = mCharacter->getPosGlobalFromAgent(mLeftAnkleJoint->getWorldPosition());
+		leftFootGlobalPosition.mdV[VZ] = 0.0;
+		LLVector3 leftFootDelta(leftFootGlobalPosition - mLastLeftFootGlobalPos);
+		mLastLeftFootGlobalPos = leftFootGlobalPosition;
+
+		LLVector3d rightFootGlobalPosition = mCharacter->getPosGlobalFromAgent(mRightAnkleJoint->getWorldPosition());
+		rightFootGlobalPosition.mdV[VZ] = 0.0;
+		LLVector3 rightFootDelta(rightFootGlobalPosition - mLastRightFootGlobalPos);
+		mLastRightFootGlobalPos = rightFootGlobalPosition;
+
+		// get foot drift along avatar direction of motion
+		F32 left_foot_slip_amt = leftFootDelta * avatar_velocity;
+		F32 right_foot_slip_amt = rightFootDelta * avatar_velocity;
+
+		// if right foot is pushing back faster than left foot...
+		if (right_foot_slip_amt < left_foot_slip_amt)
+		{	//...use it to calculate optimal animation speed
+			foot_slip_vector = rightFootDelta;
+		} 
 		else
-		{
-			// pivot on right foot
-			footCorrection = rightFootDelta;
+		{	// otherwise use the left foot
+			foot_slip_vector = leftFootDelta;
 		}
-	}
 
-	// rotate into avatar coordinates
-	footCorrection = footCorrection * inv_rotation;
+		// calculate ideal pelvis offset so that foot is glued to ground and damp towards it
+		// this will soak up transient slippage
+		//
+		// FIXME: this interacts poorly with speed adjustment
+		// mPelvisOffset compensates for foot drift by moving the avatar pelvis in the opposite
+		// direction of the drift, up to a certain limited distance
+		// but this will cause the animation playback rate calculation below to 
+		// kick in too slowly and sometimes start playing the animation in reverse.
 
-	// calculate ideal pelvis offset so that foot is glued to ground and damp towards it
-	// the amount of foot slippage this frame + the offset applied last frame
-	mPelvisOffset = mPelvisState->getPosition() + lerp(LLVector3::zero, footCorrection, LLCriticalDamp::getInterpolant(0.2f));
+		//mPelvisOffset -= PELVIS_COMPENSATION_WIEGHT * (foot_slip_vector * world_to_avatar_rot);//lerp(LLVector3::zero, -1.f * (foot_slip_vector * world_to_avatar_rot), LLCriticalDamp::getInterpolant(0.1f));
 
-	// pelvis drift (along walk direction)
-	mAvgCorrection = lerp(mAvgCorrection, footCorrection.mV[VX] * mRelativeDir, LLCriticalDamp::getInterpolant(0.1f));
+		////F32 drift_comp_max = DRIFT_COMP_MAX_TOTAL * (llclamp(speed, 0.f, DRIFT_COMP_MAX_SPEED) / DRIFT_COMP_MAX_SPEED);
+		//F32 drift_comp_max = DRIFT_COMP_MAX_TOTAL;
 
-	// calculate average velocity of foot slippage
-	F32 footSlipVelocity = (deltaTime != 0.f) ? (-mAvgCorrection / deltaTime) : 0.f;
+		//// clamp pelvis offset to a 90 degree arc behind the nominal position
+		//// NB: this is an ADDITIVE amount that is accumulated every frame, so clamping it alone won't do the trick
+		//// must clamp with absolute position of pelvis in mind
+		//LLVector3 currentPelvisPos = mPelvisState->getJoint()->getPosition();
+		//mPelvisOffset.mV[VX] = llclamp( mPelvisOffset.mV[VX], -drift_comp_max, drift_comp_max );
+		//mPelvisOffset.mV[VY] = llclamp( mPelvisOffset.mV[VY], -drift_comp_max, drift_comp_max );
+		//mPelvisOffset.mV[VZ] = 0.f;
+		//
+		//mLastRightFootGlobalPos += LLVector3d(mPelvisOffset * avatar_to_world_rot);
+		//mLastLeftFootGlobalPos += LLVector3d(mPelvisOffset * avatar_to_world_rot);
 
-	F32 newSpeedAdjust = 0.f;
-	
-	// modulate speed by dot products of facing and velocity
-	// so that if we are moving sideways, we slow down the animation
-	// and if we're moving backward, we walk backward
+		//foot_slip_vector -= mPelvisOffset;
 
-	F32 directional_factor = localVel.mV[VX] * mRelativeDir;
+		LLVector3 avatar_movement_dir = avatar_velocity;
+		avatar_movement_dir.normalize();
 
-	if (speed > 0.1f)
-	{
-		// calculate ratio of desired foot velocity to detected foot velocity
-		newSpeedAdjust = llclamp(footSlipVelocity - mAvgSpeed * (1.f - directional_factor), 
-								-SPEED_ADJUST_MAX, SPEED_ADJUST_MAX);
-		newSpeedAdjust = lerp(mSpeedAdjust, newSpeedAdjust, LLCriticalDamp::getInterpolant(0.2f));
+		// planted foot speed is avatar velocity - foot slip amount along avatar movement direction
+		F32 foot_speed = speed - ((foot_slip_vector * avatar_movement_dir) / delta_time);
 
-		F32 speedDelta = newSpeedAdjust - mSpeedAdjust;
-		speedDelta = llclamp(speedDelta, -SPEED_ADJUST_MAX_SEC * deltaTime, SPEED_ADJUST_MAX_SEC * deltaTime);
+		// multiply animation playback rate so that foot speed matches avatar speed
+		F32 desired_speed_multiplier = llclamp(speed / foot_speed, 0.f, ANIM_SPEED_MAX);
 
-		mSpeedAdjust = mSpeedAdjust + speedDelta;
-	}
-	else
-	{
-		mSpeedAdjust = lerp(mSpeedAdjust, 0.f, LLCriticalDamp::getInterpolant(0.2f));
-	}
+		// blend towards new speed adjustment value
+		F32 new_speed_adjust = lerp(mAdjustedSpeed, desired_speed_multiplier, LLCriticalDamp::getInterpolant(SPEED_ADJUST_TIME_CONSTANT));
 
-	mAnimSpeed = (mAvgSpeed + mSpeedAdjust) * mRelativeDir;
-	if (mAnimSpeed>0)
-	{
-		mAnimSpeed = llclamp(mAnimSpeed, ANIM_SPEED_MIN, ANIM_SPEED_MAX);
+		// limit that rate at which the speed adjustment changes
+		F32 speedDelta = llclamp(new_speed_adjust - mAdjustedSpeed, -SPEED_ADJUST_MAX_SEC * delta_time, SPEED_ADJUST_MAX_SEC * delta_time);
+		mAdjustedSpeed += speedDelta;
+
+		// modulate speed by dot products of facing and velocity
+		// so that if we are moving sideways, we slow down the animation
+		// and if we're moving backward, we walk backward
+		// do this at the end to be more responsive to direction changes instead of in the above speed calculations
+		F32 directional_factor = (avatar_movement_dir * world_to_avatar_rot).mV[VX];
+
+		mAnimSpeed = mAdjustedSpeed * directional_factor;
 	}
 	else
-	{
-		mAnimSpeed = llclamp(mAnimSpeed, -ANIM_SPEED_MAX, -ANIM_SPEED_MIN);
-	}
-// 	char debug_text[64];
-// 	sprintf(debug_text, "Foot slip vel: %.2f", footSlipVelocity);
-// 	mCharacter->addDebugText(debug_text);
-// 	sprintf(debug_text, "Speed: %.2f", mAvgSpeed);
-// 	mCharacter->addDebugText(debug_text);
-// 	sprintf(debug_text, "Speed Adjust: %.2f", mSpeedAdjust);
-// 	mCharacter->addDebugText(debug_text);
-// 	sprintf(debug_text, "Animation Playback Speed: %.2f", mAnimSpeed);
-// 	mCharacter->addDebugText(debug_text);
- 	mCharacter->setAnimationData("Walk Speed", &mAnimSpeed);
-	if (mCharacter->getMotionController().mIsSelf)
-	{
-//		F32 elapsed = mCharacter->getMotionController().getFrameTimer().getElapsedTimeF32();
-// 		llinfos << "PLOT elapsed: " << elapsed 
-// 				<< " footSlipVelocity: " << footSlipVelocity
-// 				<< " mAvgCorrection: " << mAvgCorrection
-// 				<< " mAvgSpeed: " << mAvgSpeed
-// 				<< " mAnimSpeed: " << mAnimSpeed
-// 				<< " ANIM_SPEED_MAX: " << ANIM_SPEED_MAX
-// 				<< " ANIM_SPEED_MIN: " << ANIM_SPEED_MIN
-// 				<< llendl;
-	}
-
-	// clamp pelvis offset to a 90 degree arc behind the nominal position
-	F32 drift_comp_max = llclamp(speed, 0.f, DRIFT_COMP_MAX_SPEED) / DRIFT_COMP_MAX_SPEED;
-	drift_comp_max *= DRIFT_COMP_MAX_TOTAL;
+	{	// standing/turning
 
-	LLVector3 currentPelvisPos = mPelvisState->getJoint()->getPosition();
+		// damp out speed adjustment to 0
+		mAnimSpeed = lerp(mAnimSpeed, 1.f, LLCriticalDamp::getInterpolant(0.2f));
+		//mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLCriticalDamp::getInterpolant(0.2f));
+	}
 
-	// NB: this is an ADDITIVE amount that is accumulated every frame, so clamping it alone won't do the trick
-	// must clamp with absolute position of pelvis in mind
-	mPelvisOffset.mV[VX] = llclamp( mPelvisOffset.mV[VX], -drift_comp_max - currentPelvisPos.mV[VX], drift_comp_max - currentPelvisPos.mV[VX]  );
-	mPelvisOffset.mV[VY] = llclamp( mPelvisOffset.mV[VY], -drift_comp_max - currentPelvisPos.mV[VY], drift_comp_max - currentPelvisPos.mV[VY]);
-	mPelvisOffset.mV[VZ] = 0.f;
+	// broadcast walk speed change
+ 	mCharacter->setAnimationData("Walk Speed", &mAnimSpeed);
 
 	// set position
+	// need to update *some* joint to keep this animation active
 	mPelvisState->setPosition(mPelvisOffset);
 
-	mCharacter->setAnimationData("Pelvis Offset", &mPelvisOffset);
-
 	return TRUE;
 }
 
@@ -438,14 +390,8 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask)
 	// roll is critically damped interpolation between current roll and angular velocity-derived target roll
 	mRoll = lerp(mRoll, target_roll, LLCriticalDamp::getInterpolant(0.1f));
 
-//	llinfos << mRoll << llendl;
-
 	LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f));
 	mPelvisState->setRotation(roll);
 
-//	F32 lerp_amt = LLCriticalDamp::getInterpolant(0.2f);
-//	
-//	LLVector3 pelvis_correction = mPelvisState->getPosition() - lerp(LLVector3::zero, mPelvisState->getJoint()->getPosition() + mPelvisState->getPosition(), lerp_amt);
-//	mPelvisState->setPosition(pelvis_correction);
 	return TRUE;
 }
diff --git a/indra/llcharacter/llkeyframewalkmotion.h b/indra/llcharacter/llkeyframewalkmotion.h
index 90dd4dbcac316f82533bd44c4e77d460478d1621..b507e9423af8a0ddad191cd64e5d3f3833d73d03 100644
--- a/indra/llcharacter/llkeyframewalkmotion.h
+++ b/indra/llcharacter/llkeyframewalkmotion.h
@@ -126,13 +126,11 @@ class LLWalkAdjustMotion : public LLMotion
 	LLJoint*		mRightAnkleJoint;
 	LLPointer<LLJointState>	mPelvisState;
 	LLJoint*		mPelvisJoint;
-	LLVector3d		mLastLeftAnklePos;
-	LLVector3d		mLastRightAnklePos;
+	LLVector3d		mLastLeftFootGlobalPos;
+	LLVector3d		mLastRightFootGlobalPos;
 	F32				mLastTime;
-	F32				mAvgCorrection;
-	F32				mSpeedAdjust;
+	F32				mAdjustedSpeed;
 	F32				mAnimSpeed;
-	F32				mAvgSpeed;
 	F32				mRelativeDir;
 	LLVector3		mPelvisOffset;
 	F32				mAnkleOffset;
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index aa7c8c789aa4a300215d33753af1a8c500e76a5e..0fc5ca1ad6e79575c157b9f7e59db634423a0f21 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -168,8 +168,8 @@ U8* LLImageBase::allocateData(S32 size)
 		}
 		else
 		{
-		llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
-	}
+			llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
+		}
 	}
 	if (!mData || size != mDataSize)
 	{
@@ -267,10 +267,6 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components)
 {
 	mMemType = LLMemType::MTYPE_IMAGERAW;
 	//llassert( S32(width) * S32(height) * S32(components) <= MAX_IMAGE_DATA_SIZE );
-	if(S32(width) * S32(height) * S32(components) > MAX_IMAGE_DATA_SIZE)
-	{
-		llwarns << "over size: width: " << (S32)width << " height: " << (S32)height << " components: " << (S32)components << llendl ;
-	}
 	allocateDataSize(width, height, components);
 	++sRawImageCount;
 }
diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp
index a6ab246a2ca446a42c4b51dc73eb6103b2d476ed..018ce993b55b77f3a379a566cd05b0d68d112dee 100644
--- a/indra/llimage/llimagepng.cpp
+++ b/indra/llimage/llimagepng.cpp
@@ -42,17 +42,12 @@
 // LLImagePNG
 // ---------------------------------------------------------------------------
 LLImagePNG::LLImagePNG()
-    : LLImageFormatted(IMG_CODEC_PNG),
-	  mTmpWriteBuffer(NULL)
+    : LLImageFormatted(IMG_CODEC_PNG)
 {
 }
 
 LLImagePNG::~LLImagePNG()
 {
-	if (mTmpWriteBuffer)
-	{
-		delete[] mTmpWriteBuffer;
-	}
 }
 
 // Virtual
@@ -123,28 +118,24 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
 
 	// Temporary buffer to hold the encoded image. Note: the final image
 	// size should be much smaller due to compression.
-	if (mTmpWriteBuffer)
-	{
-		delete[] mTmpWriteBuffer;
-	}
 	U32 bufferSize = getWidth() * getHeight() * getComponents() + 1024;
-    U8* mTmpWriteBuffer = new U8[ bufferSize ];
+    U8* tmpWriteBuffer = new U8[ bufferSize ];
 
 	// Delegate actual encoding work to wrapper
 	LLPngWrapper pngWrapper;
-	if (! pngWrapper.writePng(raw_image, mTmpWriteBuffer))
+	if (! pngWrapper.writePng(raw_image, tmpWriteBuffer))
 	{
 		setLastError(pngWrapper.getErrorMessage());
-		delete[] mTmpWriteBuffer;
+		delete[] tmpWriteBuffer;
 		return FALSE;
 	}
 
 	// Resize internal buffer and copy from temp
 	U32 encodedSize = pngWrapper.getFinalSize();
 	allocateData(encodedSize);
-	memcpy(getData(), mTmpWriteBuffer, encodedSize);
+	memcpy(getData(), tmpWriteBuffer, encodedSize);
 
-	delete[] mTmpWriteBuffer;
+	delete[] tmpWriteBuffer;
 
 	return TRUE;
 }
diff --git a/indra/llimage/llimagepng.h b/indra/llimage/llimagepng.h
index 083dda73b9f1b387695438b5f9d1553334bc573d..4d6e2ee70ac3c804749069d92655e2d12b2522bb 100644
--- a/indra/llimage/llimagepng.h
+++ b/indra/llimage/llimagepng.h
@@ -47,9 +47,6 @@ class LLImagePNG : public LLImageFormatted
 	/*virtual*/ BOOL updateData();
 	/*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
 	/*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
-
-private:
-	U8* mTmpWriteBuffer;
 };
 
 #endif
diff --git a/indra/llmath/tests/mathmisc_test.cpp b/indra/llmath/tests/mathmisc_test.cpp
index ea42f6e00124cf45a137fd9f696d8852d51387a8..68d9ddc0fe7cbae88be1197bce5a50e59562976a 100644
--- a/indra/llmath/tests/mathmisc_test.cpp
+++ b/indra/llmath/tests/mathmisc_test.cpp
@@ -334,6 +334,8 @@ namespace tut
 	template<> template<>
 	void sphere_object::test<2>()
 	{
+		skip("See SNOW-620.  Neither the test nor the code being tested seem good.  Also sim-only.");
+
 		// test LLSphere::getBoundingSphere()
 		S32 number_of_tests = 100;
 		S32 number_of_spheres = 10;
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index fc93793ed8bb0008b8bc97578609b61dd9a9afb1..237d42090ff97904dcd60aa5d053c163777cc832 100644
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -68,8 +68,9 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params)
  , mSelectedTab( NULL )
  , mTabComparator( NULL )
  , mNoVisibleTabsHelpText(NULL)
+ , mNoVisibleTabsOrigString(params.no_visible_tabs_text.initial_value().asString())
 {
-	initNoTabsWidget(params.empty_accordion_text);
+	initNoTabsWidget(params.no_matched_tabs_text);
 
 	mSingleExpansion = params.single_expansion;
 	if(mFitParent && !mSingleExpansion)
@@ -379,7 +380,7 @@ void	LLAccordionCtrl::initNoTabsWidget(const LLTextBox::Params& tb_params)
 {
 	LLTextBox::Params tp = tb_params;
 	tp.rect(getLocalRect());
-	mNoVisibleTabsOrigString = tp.initial_value().asString();
+	mNoMatchedTabsOrigString = tp.initial_value().asString();
 	mNoVisibleTabsHelpText = LLUICtrlFactory::create<LLTextBox>(tp, this);
 }
 
@@ -820,12 +821,30 @@ void	LLAccordionCtrl::setFilterSubString(const std::string& filter_string)
 {
 	LLStringUtil::format_map_t args;
 	args["[SEARCH_TERM]"] = LLURI::escape(filter_string);
-	std::string text = filter_string.empty() ? LLStringUtil::null : mNoVisibleTabsOrigString;
+	std::string text = filter_string.empty() ? mNoVisibleTabsOrigString : mNoMatchedTabsOrigString;
 	LLStringUtil::format(text, args);
 
 	mNoVisibleTabsHelpText->setValue(text);
 }
 
+const LLAccordionCtrlTab* LLAccordionCtrl::getExpandedTab() const
+{
+	typedef std::vector<LLAccordionCtrlTab*>::const_iterator tabs_const_iterator;
+
+	const LLAccordionCtrlTab* result = 0;
+
+	for (tabs_const_iterator i = mAccordionTabs.begin(); i != mAccordionTabs.end(); ++i)
+	{
+		if ((*i)->isExpanded())
+		{
+			result = *i;
+			break;
+		}
+	}
+
+	return result;
+}
+
 S32 LLAccordionCtrl::calcExpandedTabHeight(S32 tab_index /* = 0 */, S32 available_height /* = 0 */)
 {
 	if(tab_index < 0)
diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h
index fc6f2d896c72521e849687b216b1c9ec5c74ce26..3ad52740855790a03aa1845d84a5f944e6f5e92a 100644
--- a/indra/llui/llaccordionctrl.h
+++ b/indra/llui/llaccordionctrl.h
@@ -78,12 +78,14 @@ class LLAccordionCtrl: public LLPanel
 								accordion tabs are responsible for scrolling their content.
 								*NOTE fit_parent works best when combined with single_expansion.
 								Accordion view should implement getRequiredRect() and provide valid height*/
-		Optional<LLTextBox::Params>	empty_accordion_text;
+		Optional<LLTextBox::Params>	no_matched_tabs_text;
+		Optional<LLTextBox::Params>	no_visible_tabs_text;
 
 		Params()
 			: single_expansion("single_expansion",false)
 			, fit_parent("fit_parent", false)
-			, empty_accordion_text("empty_accordion_text")
+			, no_matched_tabs_text("no_matched_tabs_text")
+			, no_visible_tabs_text("no_visible_tabs_text")
 		{};
 	};
 
@@ -129,6 +131,13 @@ class LLAccordionCtrl: public LLPanel
 	 */
 	void	setFilterSubString(const std::string& filter_string);
 
+	/**
+	 * This method returns the first expanded accordion tab.
+	 * It is expected to be called for accordion which doesn't allow multiple
+	 * tabs to be expanded. Use with care.
+	 */
+	const LLAccordionCtrlTab* getExpandedTab() const;
+
 private:
 	void	initNoTabsWidget(const LLTextBox::Params& tb_params);
 	void	updateNoTabsHelpTextVisibility();
@@ -173,6 +182,8 @@ class LLAccordionCtrl: public LLPanel
 	bool			mAutoScrolling;
 	F32				mAutoScrollRate;
 	LLTextBox*		mNoVisibleTabsHelpText;
+
+	std::string		mNoMatchedTabsOrigString;
 	std::string		mNoVisibleTabsOrigString;
 
 	LLAccordionCtrlTab*		mSelectedTab;
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp
index 1bc8086a2768296a78ca98a7282559ef8acfd5a9..54bb328a18dbaa586825e086d0eb974385cd3563 100644
--- a/indra/llui/llaccordionctrltab.cpp
+++ b/indra/llui/llaccordionctrltab.cpp
@@ -968,3 +968,16 @@ BOOL LLAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask)
 	}
 	return LLUICtrl::handleToolTip(x, y, mask);
 }
+BOOL LLAccordionCtrlTab::handleScrollWheel		( S32 x, S32 y, S32 clicks )
+{
+	if( LLUICtrl::handleScrollWheel(x,y,clicks))
+	{
+		return TRUE;
+	}
+	if( mScrollbar && mScrollbar->getVisible() && mScrollbar->handleScrollWheel( 0, 0, clicks ) )
+	{
+		return TRUE;
+	}
+	return FALSE;
+}
+
diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h
index 480b26e1302e05b4466d1cd776bbfdd558eee215..7bf7eeef8fe66945c8ed5381ffaa65d52068c34a 100644
--- a/indra/llui/llaccordionctrltab.h
+++ b/indra/llui/llaccordionctrltab.h
@@ -166,10 +166,12 @@ class LLAccordionCtrlTab : public LLUICtrl
 	virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
 
 	virtual BOOL handleToolTip(S32 x, S32 y, MASK mask);
+	virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks );
+
 
 	virtual bool addChild(LLView* child, S32 tab_group);
 
-	bool isExpanded() { return mDisplayChildren; }
+	bool isExpanded() const { return mDisplayChildren; }
 
 	S32 getHeaderHeight();
 
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 341debc9a831c8556a93e90ee47c949eac8bb5fb..9a56372e6821feb8dc71c7ec0fef8015927fd66e 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -347,7 +347,7 @@ void LLFloater::layoutDragHandle()
 	{
 		rect = getLocalRect();
 	}
-	mDragHandle->setRect(rect);
+	mDragHandle->setShape(rect);
 	updateTitleButtons();
 }
 
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 1a4b804ce428162dd5fd4c1615434ded7e9618b2..3c6c7d3e829c453d5e9d492645c47410101e66c3 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2803,13 +2803,13 @@ S32	 LLImageTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
 {
 	LLUIImagePtr image = mStyle->getImage();
 	S32 image_width = image->getWidth();
-	if(num_pixels>image_width + IMAGE_HPAD)
+	if(line_offset == 0 || num_pixels>image_width + IMAGE_HPAD)
 	{
 		return 1;
 	}
-
 	return 0;
 }
+
 F32	LLImageTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect)
 {
 	if ( (start >= 0) && (end <= mEnd - mStart))
diff --git a/indra/media_plugins/gstreamer010/CMakeLists.txt b/indra/media_plugins/gstreamer010/CMakeLists.txt
index 3b73e04786f4c231fe2c939ad279441c31495d1d..9f0ff654fca67653b5b18769c80f22232c4fedc3 100644
--- a/indra/media_plugins/gstreamer010/CMakeLists.txt
+++ b/indra/media_plugins/gstreamer010/CMakeLists.txt
@@ -42,12 +42,12 @@ set(media_plugin_gstreamer010_HEADER_FILES
     llmediaimplgstreamertriviallogging.h
     )
 
-if (${CXX_VERSION_NUMBER} MATCHES "4[23].")
+if (${CXX_VERSION_NUMBER} MATCHES "4[23456789].")
     # Work around a bad interaction between broken gstreamer headers and
-    # g++ 4.3's increased strictness.
+    # g++ >= 4.2's increased strictness.
     set_source_files_properties(llmediaimplgstreamervidplug.cpp PROPERTIES
                                 COMPILE_FLAGS -Wno-write-strings)
-endif (${CXX_VERSION_NUMBER} MATCHES "4[23].")
+endif (${CXX_VERSION_NUMBER} MATCHES "4[23456789].")
 
 add_library(media_plugin_gstreamer010
     SHARED
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 0cd6e48d14a61f24389d639876090fced42d61c7..69903544860818f6206e28da0f73f11edb798313 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -297,11 +297,8 @@ class MediaPluginWebKit :
 		// append details to agent string
 		LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent );
 
-		// TODO: Remove this ifdef when the Linux version of llqtwebkit gets updated with the new WOB constant.
-#if !LL_LINUX
 		// Set up window open behavior
 		LLQtWebKit::getInstance()->setWindowOpenBehavior(mBrowserWindowId, LLQtWebKit::WOB_SIMULATE_BLANK_HREF_CLICK);
-#endif
 		
 #if !LL_QTWEBKIT_USES_PIXMAPS
 		// don't flip bitmap
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 53c636953452a794f110e6bcdb2adc6982b70a6c..24811db3cb48d7c29697871f9cd65770e3cebb3e 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1773,40 +1773,19 @@ if (DARWIN)
         COMMAND ${PYTHON_EXECUTABLE}
         ARGS
           ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
-          --grid=${GRID}
-          --buildtype=${CMAKE_BUILD_TYPE}
-          --configuration=${CMAKE_CFG_INTDIR}
-          --channel=${VIEWER_CHANNEL}
-          --login_channel=${VIEWER_LOGIN_CHANNEL}
-          --source=${CMAKE_CURRENT_SOURCE_DIR}
           --artwork=${ARTWORK_DIR}
           --build=${CMAKE_CURRENT_BINARY_DIR}
-          --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
-          --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
-        DEPENDS
-          ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
-      )
-
-
-      add_custom_command(
-        TARGET package POST_BUILD
-        COMMAND ${PYTHON_EXECUTABLE}
-        ARGS
-          ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
-          --grid=${GRID}
           --buildtype=${CMAKE_BUILD_TYPE}
-          --configuration=${CMAKE_CFG_INTDIR}
           --channel=${VIEWER_CHANNEL}
+          --configuration=${CMAKE_CFG_INTDIR}
+          --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
+          --grid=${GRID}
           --login_channel=${VIEWER_LOGIN_CHANNEL}
           --source=${CMAKE_CURRENT_SOURCE_DIR}
-          --artwork=${ARTWORK_DIR}
-          --build=${CMAKE_CURRENT_BINARY_DIR}
-          --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
           --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
         DEPENDS
           ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
       )
-
   endif (PACKAGE)
 endif (DARWIN)
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 682189fceab1e5e5b3eef5f97cb776c0debce0a9..2244f0510405c9888de61964668dada300f12189 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3545,6 +3545,17 @@
       <key>Value</key>
       <real>9.0</real>
     </map>
+    <key>ForceAssetFail</key>
+    <map>
+      <key>Comment</key>
+      <string>Force wearable fetches to fail for this asset type.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>U32</string>
+      <key>Value</key>
+      <integer>255</integer>
+    </map>
     <key>ForceShowGrid</key>
     <map>
       <key>Comment</key>
@@ -4634,7 +4645,381 @@
       <string>String</string>
       <key>Value</key>
       <string>https://www.xstreetsl.com/modules.php?name=Marketplace</string>
-    </map>    
+    </map>
+    <key>MarketplaceURL_objectFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Attachments Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/attachments</string>
+    </map>
+    <key>MarketplaceURL_objectMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Attachments Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/attachments</string>
+    </map>
+    <key>MarketplaceURL_clothingFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Clothing Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/clothing_female_avatar</string>
+    </map>
+    <key>MarketplaceURL_clothingMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Clothing Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/clothing_male_avatar</string>
+    </map>
+    <key>MarketplaceURL_bodypartFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Bodyparts Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>https://www.xstreetsl.com/modules.php?name=Marketplace</string>
+    </map>
+    <key>MarketplaceURL_bodypartMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Bodyparts Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>https://www.xstreetsl.com/modules.php?name=Marketplace</string>
+    </map>
+    <key>MarketplaceURL_glovesMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Gloves Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/gloves_both_women_and_men</string>
+    </map>
+    <key>MarketplaceURL_glovesFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Gloves Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/gloves_both_women_and_men</string>
+    </map>
+    <key>MarketplaceURL_jacketFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Jacket Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/jacket_womens</string>
+    </map>
+    <key>MarketplaceURL_jacketMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Jacket Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/jacket_mens</string>
+    </map>
+    <key>MarketplaceURL_shirtFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Shirt Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/shirt_womens</string>
+    </map>
+    <key>MarketplaceURL_shirtMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Shirt Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/shirt_mens</string>
+    </map>
+    <key>MarketplaceURL_undershirtFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Undershirt Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/undershirt_womens</string>
+    </map>
+    <key>MarketplaceURL_undershirtMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Undershirt Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/undershirt_mens</string>
+    </map>
+    <key>MarketplaceURL_skirtFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Skirt Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/skirts_women</string>
+    </map>
+    <key>MarketplaceURL_skirtMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Skirt Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/skirts_women</string>
+    </map>
+    <key>MarketplaceURL_pantsFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Pants Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/pants_women</string>
+    </map>
+    <key>MarketplaceURL_pantsMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Pants Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/pants_men</string>
+    </map>
+    <key>MarketplaceURL_underpantsFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Underwear Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/underwear_women</string>
+    </map>
+    <key>MarketplaceURL_underpantsMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Underwear Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/underwear_men</string>
+    </map>
+    <key>MarketplaceURL_shoesFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Shoes Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/shoes_women</string>
+    </map>
+    <key>MarketplaceURL_shoesMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Shoes Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/shoes_men</string>
+    </map>
+    <key>MarketplaceURL_socksFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Socks Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/socks_women</string>
+    </map>
+    <key>MarketplaceURL_socksMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Socks Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/socks_women</string>
+    </map>
+    <key>MarketplaceURL_tattooMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Tattoo Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/tattoo_both_women_and_men</string>
+    </map>
+    <key>MarketplaceURL_tattooFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Tattoo Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/tattoo_both_women_and_men</string>
+    </map>
+    <key>MarketplaceURL_hairFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Hair Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/womens_hair</string>
+    </map>
+    <key>MarketplaceURL_hairMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Hair Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/mens_hair</string>
+    </map>
+    <key>MarketplaceURL_eyesFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Eyes Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/womens_eyes</string>
+    </map>
+    <key>MarketplaceURL_eyesMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Eyes Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/mens_eyes</string>
+    </map>
+    <key>MarketplaceURL_shapeFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Shape Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/womens_shape</string>
+    </map>
+    <key>MarketplaceURL_shapeMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Shape Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/mens_shape</string>
+    </map>
+    <key>MarketplaceURL_skinFemale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Skin Female</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/womens_skin</string>
+    </map>
+    <key>MarketplaceURL_skinMale</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to the Marketplace Skins Male</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://marketplace.secondlife.com/trampoline/viewer21/mens_skin</string>
+    </map>
     <key>MaxDragDistance</key>
     <map>
       <key>Comment</key>
@@ -4657,6 +5042,17 @@
       <key>Value</key>
       <real>64.0</real>
     </map>
+    <key>MaxWearableWaitTime</key>
+    <map>
+      <key>Comment</key>
+      <string>Max seconds to wait for wearable assets to fetch.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>60.0</real>
+    </map>
     <key>MeanCollisionBump</key>
     <map>
       <key>Comment</key>
@@ -6180,7 +6576,7 @@
       <key>Type</key>
       <string>S32</string>
       <key>Value</key>
-      <integer>35</integer>
+      <integer>12</integer>
     </map>
     <key>RenderAvatarVP</key>
     <map>
@@ -10481,7 +10877,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>0</integer>
+      <integer>1</integer>
     </map>
     <key>UseStartScreen</key>
     <map>
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index de4d787d658819ffbcf95a9af1ffe0288bef71af..e8591ca0867a4e3a6b93fc5bfb184496bf33e09f 100644
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -26,7 +26,7 @@ list all
 RenderAnisotropic			1	0
 RenderAvatarCloth			1	1
 RenderAvatarLODFactor		1	1.0
-RenderAvatarMaxVisible      1   35
+RenderAvatarMaxVisible      1   12
 RenderAvatarVP				1	1
 RenderCubeMap				1	1
 RenderDelayVBUpdate			1	0
diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt
index adda7cec4dd435392605cfd83d9fb635e013f4c3..779490c9f76adc898cd2e910ae0dc05037348b12 100644
--- a/indra/newview/featuretable_linux.txt
+++ b/indra/newview/featuretable_linux.txt
@@ -26,7 +26,7 @@ list all
 RenderAnisotropic			1	0
 RenderAvatarCloth			1	1
 RenderAvatarLODFactor		1	1.0
-RenderAvatarMaxVisible      1   35
+RenderAvatarMaxVisible      1   12
 RenderAvatarVP				1	1
 RenderCubeMap				1	1
 RenderDelayVBUpdate			1	0
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 82886d7e2cb115579f6431709ffecc0dcbf48be9..47033efc47046fa3f107b4367bd19c83784fac16 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -26,7 +26,7 @@ list all
 RenderAnisotropic				1	0
 RenderAvatarCloth				0	0
 RenderAvatarLODFactor			1	1.0
-RenderAvatarMaxVisible          1   35
+RenderAvatarMaxVisible          1   12
 RenderAvatarVP					1	0
 RenderCubeMap					1	1
 RenderDelayVBUpdate				1	0
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 977f1c9fa8dcbc081761b9a013466f5f5c5391d3..c6ca9c5e3aad62fa038ab611665d82b55966522e 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -207,13 +207,13 @@ void LLAgentCamera::init()
 	
 	mCameraPreset = (ECameraPreset) gSavedSettings.getU32("CameraPreset");
 
-	mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getVector3("CameraOffsetRearView");
-	mCameraOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getVector3("CameraOffsetFrontView");
-	mCameraOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getVector3("CameraOffsetGroupView");
+	mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("CameraOffsetRearView");
+	mCameraOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("CameraOffsetFrontView");
+	mCameraOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("CameraOffsetGroupView");
 
-	mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getVector3d("FocusOffsetRearView");
-	mFocusOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getVector3d("FocusOffsetFrontView");
-	mFocusOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getVector3d("FocusOffsetGroupView");
+	mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("FocusOffsetRearView");
+	mFocusOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("FocusOffsetFrontView");
+	mFocusOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("FocusOffsetGroupView");
 
 	mCameraCollidePlane.clearVec();
 	mCurrentCameraDistance = getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale");
@@ -1643,8 +1643,8 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset()
 		agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation();
 	}
 
-	focus_offset = mFocusOffsetInitial[mCameraPreset] * agent_rot;
-	return focus_offset;
+	focus_offset = convert_from_llsd<LLVector3d>(mFocusOffsetInitial[mCameraPreset]->get(), TYPE_VEC3D, "");
+	return focus_offset * agent_rot;
 }
 
 void LLAgentCamera::setupSitCamera()
@@ -1978,7 +1978,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
 
 LLVector3 LLAgentCamera::getCameraOffsetInitial()
 {
-	return mCameraOffsetInitial[mCameraPreset];
+	return convert_from_llsd<LLVector3>(mCameraOffsetInitial[mCameraPreset]->get(), TYPE_VEC3, "");
 }
 
 
diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h
index 5cbb1de6f4b482e32d99597f18f751159e7f9776..7afb5c0ed9763066ffcf5b4914021a7ef69f359e 100644
--- a/indra/newview/llagentcamera.h
+++ b/indra/newview/llagentcamera.h
@@ -39,6 +39,7 @@
 
 class LLPickInfo;
 class LLVOAvatarSelf;
+class LLControlVariable;
 
 //--------------------------------------------------------------------
 // Types
@@ -121,10 +122,10 @@ class LLAgentCamera
 	ECameraPreset mCameraPreset; 
 
 	/** Initial camera offsets */
-	std::map<ECameraPreset, LLVector3> mCameraOffsetInitial;
+	std::map<ECameraPreset, LLPointer<LLControlVariable> > mCameraOffsetInitial;
 
 	/** Initial focus offsets */
-	std::map<ECameraPreset, LLVector3d> mFocusOffsetInitial;
+	std::map<ECameraPreset, LLPointer<LLControlVariable> > mFocusOffsetInitial;
 
 	//--------------------------------------------------------------------
 	// Position
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 342f9a5d8011d1b5a9210bfd7fdf3d61f2ea6ffa..557b3b0a77ec5fc08959b1b8dd2e143fc67ddb9b 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -2099,7 +2099,19 @@ void LLAgentWearables::populateMyOutfitsFolder(void)
 	}
 }
 
+boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb)
+{
+	return mLoadingStartedSignal.connect(cb);
+}
+
 boost::signals2::connection LLAgentWearables::addLoadedCallback(loaded_callback_t cb)
 {
 	return mLoadedSignal.connect(cb);
 }
+
+void LLAgentWearables::notifyLoadingStarted()
+{
+	mLoadingStartedSignal();
+}
+
+// EOF
diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h
index a41b949be62217edadfa94aee851d1754d3211e0..3295544e044f360a387abcd61a2d3dbf600d3d99 100644
--- a/indra/newview/llagentwearables.h
+++ b/indra/newview/llagentwearables.h
@@ -224,11 +224,18 @@ class LLAgentWearables
 	// Signals
 	//--------------------------------------------------------------------
 public:
+	typedef boost::function<void()>			loading_started_callback_t;
+	typedef boost::signals2::signal<void()>	loading_started_signal_t;
+	boost::signals2::connection				addLoadingStartedCallback(loading_started_callback_t cb);
+
 	typedef boost::function<void()>			loaded_callback_t;
 	typedef boost::signals2::signal<void()>	loaded_signal_t;
 	boost::signals2::connection				addLoadedCallback(loaded_callback_t cb);
 
+	void									notifyLoadingStarted();
+
 private:
+	loading_started_signal_t				mLoadingStartedSignal; // should be called before wearables are changed
 	loaded_signal_t							mLoadedSignal; // emitted when all agent wearables get loaded
 
 	//--------------------------------------------------------------------
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 3691d731edb24a02385a8602af1e1e98b8e86ec0..52a5587a1622e21373b363fba9eb9fa462ec6978 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -201,7 +201,9 @@ void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item)
 {
 	LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(inv_item);
 	const std::string item_name = item ? item->getName() : "ITEM NOT FOUND";
+#ifndef LL_RELEASE_FOR_DOWNLOAD
 	llinfos << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << llendl;
+#endif
 	mFireCount++;
 }
 
@@ -216,13 +218,15 @@ struct LLFoundData
 				const LLUUID& asset_id,
 				const std::string& name,
 				const LLAssetType::EType& asset_type,
-				const LLWearableType::EType& wearable_type
+				const LLWearableType::EType& wearable_type,
+				const bool is_replacement = false
 		) :
 		mItemID(item_id),
 		mAssetID(asset_id),
 		mName(name),
 		mAssetType(asset_type),
 		mWearableType(wearable_type),
+		mIsReplacement(is_replacement),
 		mWearable( NULL ) {}
 	
 	LLUUID mItemID;
@@ -231,6 +235,7 @@ struct LLFoundData
 	LLAssetType::EType mAssetType;
 	LLWearableType::EType mWearableType;
 	LLWearable* mWearable;
+	bool mIsReplacement;
 };
 
 	
@@ -253,8 +258,18 @@ class LLWearableHoldingPattern
 	
 	void onWearableAssetFetch(LLWearable *wearable);
 	void onAllComplete();
-	
+
 	typedef std::list<LLFoundData> found_list_t;
+	found_list_t& getFoundList();
+	void eraseTypeToLink(LLWearableType::EType type);
+	void eraseTypeToRecover(LLWearableType::EType type);
+	void setObjItems(const LLInventoryModel::item_array_t& items);
+	void setGestItems(const LLInventoryModel::item_array_t& items);
+	bool isMostRecent();
+	void handleLateArrivals();
+	void resetTime(F32 timeout);
+	
+private:
 	found_list_t mFoundList;
 	LLInventoryModel::item_array_t mObjItems;
 	LLInventoryModel::item_array_t mGestItems;
@@ -264,34 +279,94 @@ class LLWearableHoldingPattern
 	S32 mResolved;
 	LLTimer mWaitTime;
 	bool mFired;
+	typedef std::set<LLWearableHoldingPattern*> type_set_hp;
+	static type_set_hp sActiveHoldingPatterns;
+	bool mIsMostRecent;
+	std::set<LLWearable*> mLateArrivals;
+	bool mIsAllComplete;
 };
 
+LLWearableHoldingPattern::type_set_hp LLWearableHoldingPattern::sActiveHoldingPatterns;
+
 LLWearableHoldingPattern::LLWearableHoldingPattern():
 	mResolved(0),
-	mFired(false)
+	mFired(false),
+	mIsMostRecent(true),
+	mIsAllComplete(false)
 {
+	if (sActiveHoldingPatterns.size()>0)
+	{
+		llinfos << "Creating LLWearableHoldingPattern when "
+				<< sActiveHoldingPatterns.size()
+				<< " other attempts are active."
+				<< " Flagging others as invalid."
+				<< llendl;
+		for (type_set_hp::iterator it = sActiveHoldingPatterns.begin();
+			 it != sActiveHoldingPatterns.end();
+			 ++it)
+		{
+			(*it)->mIsMostRecent = false;
+		}
+			 
+	}
+	sActiveHoldingPatterns.insert(this);
 }
 
 LLWearableHoldingPattern::~LLWearableHoldingPattern()
 {
+	sActiveHoldingPatterns.erase(this);
+}
+
+bool LLWearableHoldingPattern::isMostRecent()
+{
+	return mIsMostRecent;
+}
+
+LLWearableHoldingPattern::found_list_t& LLWearableHoldingPattern::getFoundList()
+{
+	return mFoundList;
+}
+
+void LLWearableHoldingPattern::eraseTypeToLink(LLWearableType::EType type)
+{
+	mTypesToLink.erase(type);
+}
+
+void LLWearableHoldingPattern::eraseTypeToRecover(LLWearableType::EType type)
+{
+	mTypesToRecover.erase(type);
+}
+
+void LLWearableHoldingPattern::setObjItems(const LLInventoryModel::item_array_t& items)
+{
+	mObjItems = items;
+}
+
+void LLWearableHoldingPattern::setGestItems(const LLInventoryModel::item_array_t& items)
+{
+	mGestItems = items;
 }
 
 bool LLWearableHoldingPattern::isFetchCompleted()
 {
-	return (mResolved >= (S32)mFoundList.size()); // have everything we were waiting for?
+	return (mResolved >= (S32)getFoundList().size()); // have everything we were waiting for?
 }
 
 bool LLWearableHoldingPattern::isTimedOut()
 {
-	static F32 max_wait_time = 60.0;  // give up if wearable fetches haven't completed in max_wait_time seconds.
-	return mWaitTime.getElapsedTimeF32() > max_wait_time; 
+	return mWaitTime.hasExpired();
 }
 
 void LLWearableHoldingPattern::checkMissingWearables()
 {
+	if (!isMostRecent())
+	{
+		llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+	}
+		
 	std::vector<S32> found_by_type(LLWearableType::WT_COUNT,0);
 	std::vector<S32> requested_by_type(LLWearableType::WT_COUNT,0);
-	for (found_list_t::iterator it = mFoundList.begin(); it != mFoundList.end(); ++it)
+	for (found_list_t::iterator it = getFoundList().begin(); it != getFoundList().end(); ++it)
 	{
 		LLFoundData &data = *it;
 		if (data.mWearableType < LLWearableType::WT_COUNT)
@@ -322,7 +397,7 @@ void LLWearableHoldingPattern::checkMissingWearables()
 		}
 	}
 
-	mWaitTime.reset();
+	resetTime(60.0F);
 	if (!pollMissingWearables())
 	{
 		doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollMissingWearables,this));
@@ -331,6 +406,11 @@ void LLWearableHoldingPattern::checkMissingWearables()
 
 void LLWearableHoldingPattern::onAllComplete()
 {
+	if (!isMostRecent())
+	{
+		llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+	}
+
 	// Activate all gestures in this folder
 	if (mGestItems.count() > 0)
 	{
@@ -366,16 +446,31 @@ void LLWearableHoldingPattern::onAllComplete()
 		// Only safe to delete if all wearable callbacks and all missing wearables completed.
 		delete this;
 	}
+	else
+	{
+		mIsAllComplete = true;
+		handleLateArrivals();
+	}
 }
 
 void LLWearableHoldingPattern::onFetchCompletion()
 {
+	if (!isMostRecent())
+	{
+		llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+	}
+
 	checkMissingWearables();
 }
 
 // Runs as an idle callback until all wearables are fetched (or we time out).
 bool LLWearableHoldingPattern::pollFetchCompletion()
 {
+	if (!isMostRecent())
+	{
+		llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+	}
+
 	bool completed = isFetchCompleted();
 	bool timed_out = isTimedOut();
 	bool done = completed || timed_out;
@@ -408,8 +503,13 @@ class RecoveredItemLinkCB: public LLInventoryCallback
 	}
 	void fire(const LLUUID& item_id)
 	{
+		if (!mHolder->isMostRecent())
+		{
+			llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+		}
+
 		llinfos << "Recovered item link for type " << mType << llendl;
-		mHolder->mTypesToLink.erase(mType);
+		mHolder->eraseTypeToLink(mType);
 		// Add wearable to FoundData for actual wearing
 		LLViewerInventoryItem *item = gInventory.getItem(item_id);
 		LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL;
@@ -421,13 +521,14 @@ class RecoveredItemLinkCB: public LLInventoryCallback
 			if (item)
 			{
 				LLFoundData found(linked_item->getUUID(),
-						  linked_item->getAssetUUID(),
-						  linked_item->getName(),
-						  linked_item->getType(),
-						  linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID
-						  );
+								  linked_item->getAssetUUID(),
+								  linked_item->getName(),
+								  linked_item->getType(),
+								  linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID,
+								  true // is replacement
+					);
 				found.mWearable = mWearable;
-				mHolder->mFoundList.push_front(found);
+				mHolder->getFoundList().push_front(found);
 			}
 			else
 			{
@@ -456,11 +557,16 @@ class RecoveredItemCB: public LLInventoryCallback
 	}
 	void fire(const LLUUID& item_id)
 	{
+		if (!mHolder->isMostRecent())
+		{
+			llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+		}
+
 		llinfos << "Recovered item for type " << mType << llendl;
 		LLViewerInventoryItem *itemp = gInventory.getItem(item_id);
 		mWearable->setItemID(item_id);
 		LLPointer<LLInventoryCallback> cb = new RecoveredItemLinkCB(mType,mWearable,mHolder);
-		mHolder->mTypesToRecover.erase(mType);
+		mHolder->eraseTypeToRecover(mType);
 		llassert(itemp);
 		if (itemp)
 		{
@@ -481,6 +587,11 @@ class RecoveredItemCB: public LLInventoryCallback
 
 void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type)
 {
+	if (!isMostRecent())
+	{
+		llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+	}
+	
 		// Try to recover by replacing missing wearable with a new one.
 	LLNotificationsUtil::add("ReplacedMissingWearable");
 	lldebugs << "Wearable " << LLWearableType::getTypeLabel(type)
@@ -511,7 +622,7 @@ bool LLWearableHoldingPattern::isMissingCompleted()
 
 void LLWearableHoldingPattern::clearCOFLinksForMissingWearables()
 {
-	for (found_list_t::iterator it = mFoundList.begin(); it != mFoundList.end(); ++it)
+	for (found_list_t::iterator it = getFoundList().begin(); it != getFoundList().end(); ++it)
 	{
 		LLFoundData &data = *it;
 		if ((data.mWearableType < LLWearableType::WT_COUNT) && (!data.mWearable))
@@ -525,6 +636,11 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables()
 
 bool LLWearableHoldingPattern::pollMissingWearables()
 {
+	if (!isMostRecent())
+	{
+		llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+	}
+	
 	bool timed_out = isTimedOut();
 	bool missing_completed = isMissingCompleted();
 	bool done = timed_out || missing_completed;
@@ -538,16 +654,122 @@ bool LLWearableHoldingPattern::pollMissingWearables()
 	if (done)
 	{
 		gAgentAvatarp->debugWearablesLoaded();
-		clearCOFLinksForMissingWearables();
+
+		// BAP - if we don't call clearCOFLinksForMissingWearables()
+		// here, we won't have to add the link back in later if the
+		// wearable arrives late.  This is to avoid corruption of
+		// wearable ordering info.  Also has the effect of making
+		// unworn item links visible in the COF under some
+		// circumstances.
+
+		//clearCOFLinksForMissingWearables();
 		onAllComplete();
 	}
 	return done;
 }
 
+// Handle wearables that arrived after the timeout period expired.
+void LLWearableHoldingPattern::handleLateArrivals()
+{
+	// Only safe to run if we have previously finished the missing
+	// wearables and other processing - otherwise we could be in some
+	// intermediate state - but have not been superceded by a later
+	// outfit change request.
+	if (mLateArrivals.size() == 0)
+	{
+		// Nothing to process.
+		return;
+	}
+	if (!isMostRecent())
+	{
+		llwarns << "Late arrivals not handled - outfit change no longer valid" << llendl;
+	}
+	if (!mIsAllComplete)
+	{
+		llwarns << "Late arrivals not handled - in middle of missing wearables processing" << llendl;
+	}
+
+	llinfos << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << llendl;
+
+	// Update mFoundList using late-arriving wearables.
+	std::set<LLWearableType::EType> replaced_types;
+	for (LLWearableHoldingPattern::found_list_t::iterator iter = getFoundList().begin();
+		 iter != getFoundList().end(); ++iter)
+	{
+		LLFoundData& data = *iter;
+		for (std::set<LLWearable*>::iterator wear_it = mLateArrivals.begin();
+			 wear_it != mLateArrivals.end();
+			 ++wear_it)
+		{
+			LLWearable *wearable = *wear_it;
+
+			if(wearable->getAssetID() == data.mAssetID)
+			{
+				data.mWearable = wearable;
+
+				replaced_types.insert(data.mWearableType);
+
+				// BAP - if we didn't call
+				// clearCOFLinksForMissingWearables() earlier, we
+				// don't need to restore the link here.  Fixes
+				// wearable ordering problems.
+
+				// LLAppearanceMgr::instance().addCOFItemLink(data.mItemID,false);
+
+				// BAP failing this means inventory or asset server
+				// are corrupted in a way we don't handle.
+				llassert((data.mWearableType < LLWearableType::WT_COUNT) && (wearable->getType() == data.mWearableType));
+				break;
+			}
+		}
+	}
+
+	// Remove COF links for any default wearables previously used to replace the late arrivals.
+	// All this pussyfooting around with a while loop and explicit
+	// iterator incrementing is to allow removing items from the list
+	// without clobbering the iterator we're using to navigate.
+	LLWearableHoldingPattern::found_list_t::iterator iter = getFoundList().begin();
+	while (iter != getFoundList().end())
+	{
+		LLFoundData& data = *iter;
+
+		// If an item of this type has recently shown up, removed the corresponding replacement wearable from COF.
+		if (data.mWearable && data.mIsReplacement &&
+			replaced_types.find(data.mWearableType) != replaced_types.end())
+		{
+			LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID,false);
+			std::list<LLFoundData>::iterator clobber_ator = iter;
+			++iter;
+			getFoundList().erase(clobber_ator);
+		}
+		else
+		{
+			++iter;
+		}
+	}
+
+	// Clear contents of late arrivals.
+	mLateArrivals.clear();
+
+	// Update appearance based on mFoundList
+	LLAppearanceMgr::instance().updateAgentWearables(this, false);
+}
+
+void LLWearableHoldingPattern::resetTime(F32 timeout)
+{
+	mWaitTime.reset();
+	mWaitTime.setTimerExpirySec(timeout);
+}
+
 void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable)
 {
+	if (!isMostRecent())
+	{
+		llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+	}
+	
 	mResolved += 1;  // just counting callbacks, not successes.
-	llinfos << "onWearableAssetFetch, resolved count " << mResolved << " of requested " << mFoundList.size() << llendl;
+	llinfos << "onWearableAssetFetch, resolved count " << mResolved << " of requested " << getFoundList().size() << llendl;
 	if (wearable)
 	{
 		llinfos << "wearable found, type " << wearable->getType() << " asset " << wearable->getAssetID() << llendl;
@@ -560,6 +782,14 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable)
 	if (mFired)
 	{
 		llwarns << "called after holder fired" << llendl;
+		if (wearable)
+		{
+			mLateArrivals.insert(wearable);
+			if (mIsAllComplete)
+			{
+				handleLateArrivals();
+			}
+		}
 		return;
 	}
 
@@ -568,8 +798,8 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable)
 		return;
 	}
 
-	for (LLWearableHoldingPattern::found_list_t::iterator iter = mFoundList.begin();
-		 iter != mFoundList.end(); ++iter)
+	for (LLWearableHoldingPattern::found_list_t::iterator iter = getFoundList().begin();
+		 iter != getFoundList().end(); ++iter)
 	{
 		LLFoundData& data = *iter;
 		if(wearable->getAssetID() == data.mAssetID)
@@ -644,6 +874,13 @@ const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink()
 		const LLViewerInventoryCategory *cat = item->getLinkedCategory();
 		if (cat && cat->getPreferredType() == LLFolderType::FT_OUTFIT)
 		{
+			const LLUUID parent_id = cat->getParentUUID();
+			LLViewerInventoryCategory*  parent_cat =  gInventory.getCategory(parent_id);
+			// if base outfit moved to trash it means that we don't have base outfit
+			if (parent_cat != NULL && parent_cat->getPreferredType() == LLFolderType::FT_TRASH)
+			{
+				return NULL;
+			}
 			return item;
 		}
 	}
@@ -1061,8 +1298,9 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid,
 
 		const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_uuid);
 		const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND";
-
-		llinfos << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << llendl; // Seraph remove for 2.1
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+		llinfos << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << llendl;
+#endif
 	}
 }
 
@@ -1131,13 +1369,24 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
 	llinfos << "creating LLUpdateAppearanceOnDestroy" << llendl;
 	LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy;
 
-	llinfos << "Linking body items" << llendl; // Seraph remove for 2.1
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+	llinfos << "Linking body items" << llendl;
+#endif
 	linkAll(cof, body_items, link_waiter);
-	llinfos << "Linking wear items" << llendl; // Seraph remove for 2.1
+
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+	llinfos << "Linking wear items" << llendl;
+#endif
 	linkAll(cof, wear_items, link_waiter);
-	llinfos << "Linking obj items" << llendl; // Seraph remove for 2.1
+
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+	llinfos << "Linking obj items" << llendl;
+#endif
 	linkAll(cof, obj_items, link_waiter);
-	llinfos << "Linking gesture items" << llendl; // Seraph remove for 2.1
+
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+	llinfos << "Linking gesture items" << llendl;
+#endif
 	linkAll(cof, gest_items, link_waiter);
 
 	// Add link to outfit if category is an outfit. 
@@ -1182,12 +1431,11 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo
 	LLInventoryItem::item_array_t items;
 	LLDynamicArray< LLWearable* > wearables;
 
-	// For each wearable type, find the first instance in the category
-	// that we recursed through.
+	// For each wearable type, find the wearables of that type.
 	for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ )
 	{
-		for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin();
-			 iter != holder->mFoundList.end(); ++iter)
+		for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->getFoundList().begin();
+			 iter != holder->getFoundList().end(); ++iter)
 		{
 			LLFoundData& data = *iter;
 			LLWearable* wearable = data.mWearable;
@@ -1279,8 +1527,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF()
 
 	LLWearableHoldingPattern* holder = new LLWearableHoldingPattern;
 
-	holder->mObjItems = obj_items;
-	holder->mGestItems = gest_items;
+	holder->setObjItems(obj_items);
+	holder->setGestItems(gest_items);
 		
 	// Note: can't do normal iteration, because if all the
 	// wearables can be resolved immediately, then the
@@ -1291,6 +1539,12 @@ void LLAppearanceMgr::updateAppearanceFromCOF()
 	{
 		LLViewerInventoryItem *item = wear_items.get(i);
 		LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL;
+
+		// Fault injection: use debug setting to test asset 
+		// fetch failures (should be replaced by new defaults in
+		// lost&found).
+		U32 skip_type = gSavedSettings.getU32("ForceAssetFail");
+
 		if (item && item->getIsLinkType() && linked_item)
 		{
 			LLFoundData found(linked_item->getUUID(),
@@ -1300,18 +1554,12 @@ void LLAppearanceMgr::updateAppearanceFromCOF()
 							  linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID
 				);
 
-#if 0
-			// Fault injection: uncomment this block to test asset
-			// fetch failures (should be replaced by new defaults in
-			// lost&found).
-			if (found.mWearableType == LLWearableType::WT_SHAPE || found.mWearableType == LLWearableType::WT_JACKET)
+			if (skip_type != LLWearableType::WT_INVALID && skip_type == found.mWearableType)
 			{
 				found.mAssetID.generate(); // Replace with new UUID, guaranteed not to exist in DB
-				
 			}
-#endif
 			//pushing back, not front, to preserve order of wearables for LLAgentWearables
-			holder->mFoundList.push_back(found);
+			holder->getFoundList().push_back(found);
 		}
 		else
 		{
@@ -1326,8 +1574,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF()
 		}
 	}
 
-	for (LLWearableHoldingPattern::found_list_t::iterator it = holder->mFoundList.begin();
-		 it != holder->mFoundList.end(); ++it)
+	for (LLWearableHoldingPattern::found_list_t::iterator it = holder->getFoundList().begin();
+		 it != holder->getFoundList().end(); ++it)
 	{
 		LLFoundData& found = *it;
 
@@ -1342,6 +1590,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF()
 
 	}
 
+	holder->resetTime(gSavedSettings.getF32("MaxWearableWaitTime"));
 	if (!holder->pollFetchCompletion())
 	{
 		doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollFetchCompletion,holder));
@@ -1400,6 +1649,7 @@ void LLAppearanceMgr::getUserDescendents(const LLUUID& category,
 
 void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append)
 {
+	gAgentWearables.notifyLoadingStarted();
 	if(!category) return;
 
 	llinfos << "wearInventoryCategory( " << category->getName()
@@ -1992,13 +2242,19 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id)
 class LLShowCreatedOutfit: public LLInventoryCallback
 {
 public:
-	LLShowCreatedOutfit(LLUUID& folder_id): mFolderID(folder_id)
+	LLShowCreatedOutfit(LLUUID& folder_id, bool show_panel = true): mFolderID(folder_id), mShowPanel(show_panel)
 	{}
 
 	virtual ~LLShowCreatedOutfit()
 	{
 		LLSD key;
-		LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key);
+		
+		//EXT-7727. For new accounts LLShowCreatedOutfit is created during login process
+		// add may be processed after login process is finished
+		if (mShowPanel)
+		{
+			LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key);
+		}
 		LLPanelOutfitsInventory *outfit_panel =
 			dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory"));
 		if (outfit_panel)
@@ -2022,9 +2278,10 @@ class LLShowCreatedOutfit: public LLInventoryCallback
 
 private:
 	LLUUID mFolderID;
+	bool mShowPanel;
 };
 
-LLUUID LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name)
+LLUUID LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel)
 {
 	if (!isAgentAvatarValid()) return LLUUID::null;
 
@@ -2037,7 +2294,7 @@ LLUUID LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name)
 
 	updateClothingOrderingInfo();
 
-	LLPointer<LLInventoryCallback> cb = new LLShowCreatedOutfit(folder_id);
+	LLPointer<LLInventoryCallback> cb = new LLShowCreatedOutfit(folder_id,show_panel);
 	shallowCopyCategoryContents(getCOF(),folder_id, cb);
 	createBaseOutfitLink(folder_id, cb);
 
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 2227a43cd88d4a6ef8890e2665217b06a89faf4c..e42f9f7d6f4bd02900479c5333ecb18fd730509e 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -151,7 +151,7 @@ class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
 	void removeItemFromAvatar(const LLUUID& item_id);
 
 
-	LLUUID makeNewOutfitLinks(const std::string& new_folder_name);
+	LLUUID makeNewOutfitLinks(const std::string& new_folder_name,bool show_panel = true);
 
 	bool moveWearable(LLViewerInventoryItem* item, bool closer_to_body);
 
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 475f6649174a3bbb1e07fad7cb5dc6f71d393dad..1ed63555b0780c2afc5611548ea0c8619af05c56 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -412,7 +412,7 @@ static void settings_to_globals()
 	LLVolumeImplFlexible::sUpdateFactor = gSavedSettings.getF32("RenderFlexTimeFactor");
 	LLVOTree::sTreeFactor				= gSavedSettings.getF32("RenderTreeLODFactor");
 	LLVOAvatar::sLODFactor				= gSavedSettings.getF32("RenderAvatarLODFactor");
-	LLVOAvatar::sMaxVisible				= gSavedSettings.getS32("RenderAvatarMaxVisible");
+	LLVOAvatar::sMaxVisible				= (U32)gSavedSettings.getS32("RenderAvatarMaxVisible");
 	LLVOAvatar::sVisibleInFirstPerson	= gSavedSettings.getBOOL("FirstPersonAvatarVisible");
 	// clamp auto-open time to some minimum usable value
 	LLFolderView::sAutoOpenTime			= llmax(0.25f, gSavedSettings.getF32("FolderAutoOpenDelay"));
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index 27dcb9f1c7f9bb32a113b65d3d28f5c145679a4e..116c4cafc2fedba21e7e9ab7c14f1594f574ba63 100644
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -203,19 +203,13 @@ void LLAssetUploadResponder::uploadComplete(const LLSD& content)
 
 LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data,
 														   const LLUUID& vfile_id,
-														   LLAssetType::EType asset_type,
-														   boost::function<void(const LLUUID& uuid)> callback)
-: LLAssetUploadResponder(post_data, vfile_id, asset_type),
-  mCallback(callback)
+														   LLAssetType::EType asset_type)
+: LLAssetUploadResponder(post_data, vfile_id, asset_type)
 {
 }
 
-LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data, 
-														   const std::string& file_name, 
-														   LLAssetType::EType asset_type, 
-														   boost::function<void(const LLUUID& uuid)> callback)
-: LLAssetUploadResponder(post_data, file_name, asset_type),
-  mCallback(callback)
+LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data, const std::string& file_name, LLAssetType::EType asset_type)
+: LLAssetUploadResponder(post_data, file_name, asset_type)
 {
 }
 
@@ -293,12 +287,6 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
 										creation_date_now);
 		gInventory.updateItem(item);
 		gInventory.notifyObservers();
-		
-		if (mCallback)
-		{
-			// call the callback with the new Asset UUID
-			mCallback(item->getAssetUUID());
-		}
 
 		// Show the preview panel for textures and sounds to let
 		// user know that the image (or snapshot) arrived intact.
@@ -346,11 +334,13 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
 		U32 group_perms      = mPostData.has("group_mask")      ? mPostData.get("group_mask"     ).asInteger() : PERM_NONE;
 		U32 next_owner_perms = mPostData.has("next_owner_mask") ? mPostData.get("next_owner_mask").asInteger() : PERM_NONE;
 		std::string display_name = LLStringUtil::null;
+		LLAssetStorage::LLStoreAssetCallback callback = NULL;
+		void *userdata = NULL;
 		upload_new_resource(next_file, asset_name, asset_name,
-				    LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
+				    0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
 				    next_owner_perms, group_perms,
 				    everyone_perms, display_name,
-				    NULL, expected_upload_cost);
+				    callback, expected_upload_cost, userdata);
 	}
 }
 
diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h
index 2358aeb39d0d70c69fb0a791e44e330490df5ea6..91fb39916dbf0bbf4f27834f4b9b81685734018a 100644
--- a/indra/newview/llassetuploadresponders.h
+++ b/indra/newview/llassetuploadresponders.h
@@ -33,7 +33,6 @@
 #ifndef LL_LLASSETUPLOADRESPONDER_H
 #define LL_LLASSETUPLOADRESPONDER_H
 
-#include "llassetstorage.h"
 #include "llhttpclient.h"
 
 // Abstract class for supporting asset upload
@@ -67,15 +66,10 @@ class LLNewAgentInventoryResponder : public LLAssetUploadResponder
 public:
 	LLNewAgentInventoryResponder(const LLSD& post_data,
 								const LLUUID& vfile_id,
-								LLAssetType::EType asset_type,
-								boost::function<void(const LLUUID& uuid)> callback = NULL);
-	LLNewAgentInventoryResponder(const LLSD& post_data, 
-								const std::string& file_name,
-								 LLAssetType::EType asset_type,
-								boost::function<void(const LLUUID& uuid)> callback = NULL);
+								LLAssetType::EType asset_type);
+	LLNewAgentInventoryResponder(const LLSD& post_data, const std::string& file_name,
+											   LLAssetType::EType asset_type);
 	virtual void uploadComplete(const LLSD& content);
-
-	boost::function<void(const LLUUID& uuid)> mCallback;
 };
 
 struct LLBakedUploadData;
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index 611396b0e5741386cbbb1dc90bc6235b378586d6..46d2e0a5db6fab967e0cf9b88a6bbaa8763bfe5c 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -34,6 +34,8 @@
 
 #include "llcofwearables.h"
 
+#include "llaccordionctrl.h"
+#include "llaccordionctrltab.h"
 #include "llagentdata.h"
 #include "llagentwearables.h"
 #include "llappearancemgr.h"
@@ -557,6 +559,14 @@ LLPanel* LLCOFWearables::getSelectedItem()
 	return mLastSelectedList->getSelectedItem();
 }
 
+void LLCOFWearables::getSelectedItems(std::vector<LLPanel*>& selected_items) const
+{
+	if (mLastSelectedList)
+	{
+		mLastSelectedList->getSelectedItems(selected_items);
+	}
+}
+
 void LLCOFWearables::clear()
 {
 	mAttachments->clear();
@@ -564,6 +574,33 @@ void LLCOFWearables::clear()
 	mBodyParts->clear();
 }
 
+LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType()
+{
+	typedef std::map<std::string, LLAssetType::EType> type_map_t;
+
+	static type_map_t type_map;
+	static LLAccordionCtrl* accordion_ctrl = getChild<LLAccordionCtrl>("cof_wearables_accordion");
+
+	if (type_map.empty())
+	{
+		type_map["tab_clothing"] = LLAssetType::AT_CLOTHING;
+		type_map["tab_attachments"] = LLAssetType::AT_OBJECT;
+		type_map["tab_body_parts"] = LLAssetType::AT_BODYPART;
+	}
+
+	const LLAccordionCtrlTab* tab = accordion_ctrl->getExpandedTab();
+	LLAssetType::EType result = LLAssetType::AT_NONE;
+
+	if (tab)
+	{
+		type_map_t::iterator i = type_map.find(tab->getName());
+		llassert(i != type_map.end());
+		result = i->second;
+	}
+
+	return result;
+}
+
 void LLCOFWearables::onListRightClick(LLUICtrl* ctrl, S32 x, S32 y, LLListContextMenu* menu)
 {
 	if(menu)
diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h
index f99f2662e656fa0412daacb155a437e111c90d0a..62f4cfc69276f9dc1ef537fa4a8c31ba2b21e396 100644
--- a/indra/newview/llcofwearables.h
+++ b/indra/newview/llcofwearables.h
@@ -78,10 +78,13 @@ class LLCOFWearables : public LLPanel
 	bool getSelectedUUIDs(uuid_vec_t& selected_ids);
 
 	LLPanel* getSelectedItem();
+	void getSelectedItems(std::vector<LLPanel*>& selected_items) const;
 
 	void refresh();
 	void clear();
 
+	LLAssetType::EType getExpandedAccordionAssetType();
+
 	LLCOFCallbacks& getCOFCallbacks() { return mCOFCallbacks; }
 
 protected:
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 56bc4a79338189cc65223267209f33ba5786d3ae..4bd3151f2edf3c9ff83468508c1ace3668797345 100644
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -135,10 +135,10 @@ BOOL LLFloaterAbout::postBuild()
 
 	// Render the LLSD from getInfo() as a format_map_t
 	LLStringUtil::format_map_t args;
-	// For reasons I don't yet understand, [ReleaseNotes] is not part of the
-	// default substitution strings whereas [APP_NAME] is. But it works to
-	// simply copy it into these specific args.
+
+	// allow the "Release Notes" URL label to be localized
 	args["ReleaseNotes"] = LLTrans::getString("ReleaseNotes");
+
 	for (LLSD::map_const_iterator ii(info.beginMap()), iend(info.endMap());
 		 ii != iend; ++ii)
 	{
@@ -293,14 +293,14 @@ LLSD LLFloaterAbout::getInfo()
 
 static std::string get_viewer_release_notes_url()
 {
-	LLSD query;
-	query["channel"] = gSavedSettings.getString("VersionChannelName");
-	query["version"] = LLVersionInfo::getVersion();
-
-	std::ostringstream url;
-	url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query);
-
-	return LLWeb::escapeURL(url.str());
+	// return a URL to the release notes for this viewer, such as:
+	// http://wiki.secondlife.com/wiki/Release_Notes/Second Life Beta Viewer/2.1.0
+	std::string url = LLTrans::getString("RELEASE_NOTES_BASE_URL");
+	if (! LLStringUtil::endsWith(url, "/"))
+		url += "/";
+	url += gSavedSettings.getString("VersionChannelName") + "/";
+	url += LLVersionInfo::getShortVersion();
+	return LLWeb::escapeURL(url);
 }
 
 class LLFloaterAboutListener: public LLEventAPI
diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp
index 043f753e01e90764b72874c10ced321ab985e883..f14e64e3e42b70f54ae4d4119f3a109330a2fe52 100644
--- a/indra/newview/llfloateranimpreview.cpp
+++ b/indra/newview/llfloateranimpreview.cpp
@@ -1001,18 +1001,19 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata)
 			{
 				std::string name = floaterp->childGetValue("name_form").asString();
 				std::string desc = floaterp->childGetValue("description_form").asString();
+				LLAssetStorage::LLStoreAssetCallback callback = NULL;
 				S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
+				void *userdata = NULL;
 				upload_new_resource(floaterp->mTransactionID, // tid
 						    LLAssetType::AT_ANIMATION,
 						    name,
 						    desc,
+						    0,
 						    LLFolderType::FT_NONE,
 						    LLInventoryType::IT_ANIMATION,
-						    LLFloaterPerms::getNextOwnerPerms(), 
-							LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
+						    LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
 						    name,
-						    NULL, 
-							expected_upload_cost);
+						    callback, expected_upload_cost, userdata);
 			}
 			else
 			{
diff --git a/indra/newview/llfloaterinventory.h b/indra/newview/llfloaterinventory.h
index 473d2b189d699d1d0e6b171a0c9c6999587eefab..dc719bdafe5f56a5ecb78ec65f69bd9c7d348b0e 100644
--- a/indra/newview/llfloaterinventory.h
+++ b/indra/newview/llfloaterinventory.h
@@ -66,6 +66,7 @@ class LLFloaterInventory : public LLFloater
 	/*virtual*/ void onOpen(const LLSD& key);
 
 	LLInventoryPanel* getPanel();
+	LLPanelMainInventory* getMainInventoryPanel() { return mPanelMainInventory;}
 private:
 	LLPanelMainInventory* mPanelMainInventory;
 };
diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp
index 5c343ecb22001fe5c78984c6491dde58d4f6b290..159ce41b790053ab015009dad22cca20c3fbc623 100644
--- a/indra/newview/llfloaternamedesc.cpp
+++ b/indra/newview/llfloaternamedesc.cpp
@@ -169,14 +169,16 @@ void LLFloaterNameDesc::onBtnOK( )
 {
 	childDisable("ok_btn"); // don't allow inadvertent extra uploads
 	
+	LLAssetStorage::LLStoreAssetCallback callback = NULL;
 	S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass).
+	void *nruserdata = NULL;
 	std::string display_name = LLStringUtil::null;
 	upload_new_resource(mFilenameAndPath, // file
 			    childGetValue("name_form").asString(), 
 			    childGetValue("description_form").asString(), 
-			    LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
+			    0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
 			    LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
-			    display_name, NULL, expected_upload_cost);
+			    display_name, callback, expected_upload_cost, nruserdata);
 	closeFloater(false);
 }
 
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 129dd55e489c61db6426d4ef39c752932cf00125..f3baa482a0ada2aaf7a578b6e147c4807f1cc76c 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -39,33 +39,28 @@
 // Viewer includes
 #include "llagent.h"
 #include "llagentcamera.h"
-#include "llagentui.h"
-#include "llavatarpropertiesprocessor.h"
-#include "llbottomtray.h"
-#include "llbutton.h"
 #include "llcallbacklist.h"
-#include "llcheckboxctrl.h"
-#include "llcombobox.h"
 #include "llcriticaldamp.h"
-#include "lleconomy.h"
-#include "llfloaterpostcard.h"
+#include "llui.h"
 #include "llfocusmgr.h"
-#include "lllandmarkactions.h"
-#include "llradiogroup.h"
+#include "llbutton.h"
+#include "llcombobox.h"
+#include "lleconomy.h"
 #include "llsliderctrl.h"
-#include "llslurl.h"
 #include "llspinctrl.h"
-#include "lltoolfocus.h"
-#include "lltoolmgr.h"
-#include "llui.h"
-#include "lluictrlfactory.h"
-#include "llviewercamera.h"
 #include "llviewercontrol.h"
-#include "llviewermenufile.h"	// upload_new_resource()
+#include "lluictrlfactory.h"
 #include "llviewerstats.h"
+#include "llviewercamera.h"
 #include "llviewerwindow.h"
-#include "llweb.h"
+#include "llviewermenufile.h"	// upload_new_resource()
+#include "llfloaterpostcard.h"
+#include "llcheckboxctrl.h"
+#include "llradiogroup.h"
+#include "lltoolfocus.h"
+#include "lltoolmgr.h"
 #include "llworld.h"
+#include "llagentui.h"
 
 // Linden library includes
 #include "llfontgl.h"
@@ -91,6 +86,10 @@
 ///----------------------------------------------------------------------------
 /// Local function declarations, constants, enums, and typedefs
 ///----------------------------------------------------------------------------
+S32 LLFloaterSnapshot::sUIWinHeightLong = 526 ;
+S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 230 ;
+S32 LLFloaterSnapshot::sUIWinWidth = 215 ;
+
 LLSnapshotFloaterView* gSnapshotFloaterView = NULL;
 
 const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f;
@@ -115,7 +114,6 @@ class LLSnapshotLivePreview : public LLView
 	enum ESnapshotType
 	{
 		SNAPSHOT_POSTCARD,
-		SNAPSHOT_WEB,
 		SNAPSHOT_TEXTURE,
 		SNAPSHOT_LOCAL
 	};
@@ -164,9 +162,8 @@ class LLSnapshotLivePreview : public LLView
 	void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; }
 	void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f);
 	LLFloaterPostcard* savePostcard();
-	void saveTexture(bool set_as_profile_pic = false);
+	void saveTexture();
 	BOOL saveLocal();
-	void saveWeb(std::string url);
 
 	BOOL setThumbnailImageSize() ;
 	void generateThumbnailImage(BOOL force_update = FALSE) ;
@@ -175,9 +172,6 @@ class LLSnapshotLivePreview : public LLView
 
 	// Returns TRUE when snapshot generated, FALSE otherwise.
 	static BOOL onIdle( void* snapshot_preview );
-	
-	// callback for region name resolve
-	void regionNameCallback(std::string url, LLSD body, const std::string& name, S32 x, S32 y, S32 z);
 
 private:
 	LLColor4					mColor;
@@ -299,7 +293,7 @@ F32 LLSnapshotLivePreview::getAspect()
 	F32 image_aspect_ratio = ((F32)mWidth[mCurImageIndex]) / ((F32)mHeight[mCurImageIndex]);
 	F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight());
 
-	if (!mKeepAspectRatio)
+	if (!mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot"))
 	{
 		return image_aspect_ratio;
 	}
@@ -632,20 +626,20 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize()
 	F32 window_aspect_ratio = ((F32)window_width) / ((F32)window_height);
 
 	// UI size for thumbnail
-	LLFloater* floater = LLFloaterReg::getInstance("snapshot");
-	mThumbnailWidth = floater->getChild<LLView>("thumbnail_placeholder")->getRect().getWidth();
-	mThumbnailHeight = floater->getChild<LLView>("thumbnail_placeholder")->getRect().getHeight();
+	S32 max_width = LLFloaterSnapshot::getUIWinWidth() - 20;
+	S32 max_height = 90;
 
-
-	if (window_aspect_ratio > (F32)mThumbnailWidth / mThumbnailHeight)
+	if (window_aspect_ratio > (F32)max_width / max_height)
 	{
 		// image too wide, shrink to width
-		mThumbnailHeight = llround((F32)mThumbnailWidth / window_aspect_ratio);
+		mThumbnailWidth = max_width;
+		mThumbnailHeight = llround((F32)max_width / window_aspect_ratio);
 	}
 	else
 	{
 		// image too tall, shrink to height
-		mThumbnailWidth = llround((F32)mThumbnailHeight * window_aspect_ratio);
+		mThumbnailHeight = max_height;
+		mThumbnailWidth = llround((F32)max_height * window_aspect_ratio);
 	}
 	
 	if(mThumbnailWidth > window_width || mThumbnailHeight > window_height)
@@ -831,21 +825,10 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 		{
 			// delete any existing image
 			previewp->mFormattedImage = NULL;
-
 			// now create the new one of the appropriate format.
-			// note: postcards and web hardcoded to use jpeg always.
-			LLFloaterSnapshot::ESnapshotFormat format;
-			
-			if (previewp->getSnapshotType() == SNAPSHOT_POSTCARD  || 
-				previewp->getSnapshotType() == SNAPSHOT_WEB)
-			{
-				format = LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG;
-			}
-			else
-			{
-				format = previewp->getSnapshotFormat();
-			}
-            			
+			// note: postcards hardcoded to use jpeg always.
+			LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotType() == SNAPSHOT_POSTCARD
+				? LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG : previewp->getSnapshotFormat();
 			switch(format)
 			{
 			case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
@@ -972,20 +955,13 @@ LLFloaterPostcard* LLSnapshotLivePreview::savePostcard()
 	return floater;
 }
 
-// Callback for asset upload
-void profile_pic_upload_callback(const LLUUID& uuid)
-{
-	LLFloaterSnapshot* floater =  LLFloaterReg::getTypedInstance<LLFloaterSnapshot>("snapshot");
-	floater->setAsProfilePic(uuid);
-}
-
-void LLSnapshotLivePreview::saveTexture(bool set_as_profile_pic)
+void LLSnapshotLivePreview::saveTexture()
 {
 	// gen a new uuid for this asset
 	LLTransactionID tid;
 	tid.generate();
 	LLAssetID new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
-
+		
 	LLPointer<LLImageJ2C> formatted = new LLImageJ2C;
 	LLPointer<LLImageRaw> scaled = new LLImageRaw(mPreviewImage->getData(),
 												  mPreviewImage->getWidth(),
@@ -996,30 +972,26 @@ void LLSnapshotLivePreview::saveTexture(bool set_as_profile_pic)
 			
 	if (formatted->encode(scaled, 0.0f))
 	{
-		boost::function<void(const LLUUID& uuid)> callback = NULL;
-
-		if (set_as_profile_pic)
-		{
-			callback = profile_pic_upload_callback;
-		}
-
 		LLVFile::writeFile(formatted->getData(), formatted->getDataSize(), gVFS, new_asset_id, LLAssetType::AT_TEXTURE);
 		std::string pos_string;
 		LLAgentUI::buildLocationString(pos_string, LLAgentUI::LOCATION_FORMAT_FULL);
 		std::string who_took_it;
 		LLAgentUI::buildFullname(who_took_it);
+		LLAssetStorage::LLStoreAssetCallback callback = NULL;
 		S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
+		void *userdata = NULL;
 		upload_new_resource(tid,	// tid
 				    LLAssetType::AT_TEXTURE,
 				    "Snapshot : " + pos_string,
 				    "Taken by " + who_took_it + " at " + pos_string,
+				    0,
 				    LLFolderType::FT_SNAPSHOT_CATEGORY,
 				    LLInventoryType::IT_SNAPSHOT,
 				    PERM_ALL,  // Note: Snapshots to inventory is a special case of content upload
 				    PERM_NONE, // that ignores the user's premissions preferences and continues to
 				    PERM_NONE, // always use these fairly permissive hard-coded initial perms. - MG
 				    "Snapshot : " + pos_string,
-				    callback, expected_upload_cost);
+				    callback, expected_upload_cost, userdata);
 		gViewerWindow->playSnapshotAnimAndSound();
 	}
 	else
@@ -1049,81 +1021,6 @@ BOOL LLSnapshotLivePreview::saveLocal()
 	return success;
 }
 
-
-class LLSendWebResponder : public LLHTTPClient::Responder
-{
-public:
-	
-	virtual void error(U32 status, const std::string& reason)
-	{
-		llwarns << status << ": " << reason << llendl;
-		LLNotificationsUtil::add("ShareToWebFailed");
-	}
-	
-	virtual void result(const LLSD& content)
-	{
-		std::string response_url = content["response_url"].asString();
-
-		if (!response_url.empty())
-		{
-			LLWeb::loadURLExternal(response_url);
-		}
-		else
-		{
-			LLNotificationsUtil::add("ShareToWebFailed");
-		}
-	}
-
-};
-
-void LLSnapshotLivePreview::saveWeb(std::string url)
-{
-	if (url.empty())
-	{
-		llwarns << "No share to web url" << llendl;
-		return;
-	}
-
-	LLImageJPEG* jpg = dynamic_cast<LLImageJPEG*>(mFormattedImage.get());
-	if(!jpg)
-	{
-		llwarns << "Formatted image not a JPEG" << llendl;
-		return;
-	}
-	
-/* figure out if there's a better way to serialize */
-	LLSD body;
-	std::vector<U8> binary_image;
-	U8* data = jpg->getData();
-	for (int i = 0; i < jpg->getDataSize(); i++)
-	{
-		binary_image.push_back(data[i]);
-	}
-	
-	body["image"] = binary_image;
-
-	body["description"] = getChild<LLLineEditor>("description")->getText();
-
-	std::string name;
-	LLAgentUI::buildFullname(name);
-
-	body["avatar_name"] = name;
-	
-	LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(gAgentCamera.getCameraPositionGlobal(),
-		boost::bind(&LLSnapshotLivePreview::regionNameCallback, this, url, body, _1, _2, _3, _4));
-	
-	gViewerWindow->playSnapshotAnimAndSound();
-}
-
-
-void LLSnapshotLivePreview::regionNameCallback(std::string url, LLSD body, const std::string& name, S32 x, S32 y, S32 z)
-{
-	body["slurl"] = LLSLURL(name, LLVector3d(x, y, z)).getSLURLString();
-
-	LLHTTPClient::post(url, body,
-		new LLSendWebResponder());
-}
-
 ///----------------------------------------------------------------------------
 /// Class LLFloaterSnapshot::Impl
 ///----------------------------------------------------------------------------
@@ -1143,8 +1040,14 @@ class LLFloaterSnapshot::Impl
 		mAvatarPauseHandles.clear();
 
 	}
+	static void onClickDiscard(void* data);
+	static void onClickKeep(void* data);
+	static void onCommitSave(LLUICtrl* ctrl, void* data);
 	static void onClickNewSnapshot(void* data);
 	static void onClickAutoSnap(LLUICtrl *ctrl, void* data);
+	//static void onClickAdvanceSnap(LLUICtrl *ctrl, void* data);
+	static void onClickLess(void* data) ;
+	static void onClickMore(void* data) ;
 	static void onClickUICheck(LLUICtrl *ctrl, void* data);
 	static void onClickHUDCheck(LLUICtrl *ctrl, void* data);
 	static void onClickKeepOpenCheck(LLUICtrl *ctrl, void* data);
@@ -1154,14 +1057,9 @@ class LLFloaterSnapshot::Impl
 	static void updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update = TRUE);
 	static void onCommitFreezeFrame(LLUICtrl* ctrl, void* data);
 	static void onCommitLayerTypes(LLUICtrl* ctrl, void*data);
+	static void onCommitSnapshotType(LLUICtrl* ctrl, void* data);
 	static void onCommitSnapshotFormat(LLUICtrl* ctrl, void* data);
 	static void onCommitCustomResolution(LLUICtrl *ctrl, void* data);
-	static void onCommitSnapshot(LLFloaterSnapshot* view, LLSnapshotLivePreview::ESnapshotType type);
-	static void confirmSavingTexture(LLFloaterSnapshot* view, bool set_as_profile_pic = false);
-	static void onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, LLFloaterSnapshot* view, bool set_as_profile_pic);
-	static void checkCloseOnKeep(LLFloaterSnapshot* view);
-	static void onCommitProfilePic(LLFloaterSnapshot* view);
-	static void showAdvanced(LLFloaterSnapshot* view, const BOOL visible);
 	static void resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) ;
 	static BOOL checkImageSize(LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL isWidthChanged, S32 max_value);
 
@@ -1169,8 +1067,10 @@ class LLFloaterSnapshot::Impl
 	static void setResolution(LLFloaterSnapshot* floater, const std::string& comboname);
 	static void updateControls(LLFloaterSnapshot* floater);
 	static void updateLayout(LLFloaterSnapshot* floater);
+	static void updateResolutionTextEntry(LLFloaterSnapshot* floater);
 
 private:
+	static LLSnapshotLivePreview::ESnapshotType getTypeIndex(LLFloaterSnapshot* floater);
 	static ESnapshotFormat getFormatIndex(LLFloaterSnapshot* floater);
 	static LLViewerWindow::ESnapshotType getLayerType(LLFloaterSnapshot* floater);
 	static void comboSetCustom(LLFloaterSnapshot *floater, const std::string& comboname);
@@ -1192,6 +1092,22 @@ LLSnapshotLivePreview* LLFloaterSnapshot::Impl::getPreviewView(LLFloaterSnapshot
 	return previewp;
 }
 
+// static
+LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getTypeIndex(LLFloaterSnapshot* floater)
+{
+	LLSnapshotLivePreview::ESnapshotType index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD;
+	LLSD value = floater->childGetValue("snapshot_type_radio");
+	const std::string id = value.asString();
+	if (id == "postcard")
+		index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD;
+	else if (id == "texture")
+		index = LLSnapshotLivePreview::SNAPSHOT_TEXTURE;
+	else if (id == "local")
+		index = LLSnapshotLivePreview::SNAPSHOT_LOCAL;
+	return index;
+}
+
+
 // static
 LLFloaterSnapshot::ESnapshotFormat LLFloaterSnapshot::Impl::getFormatIndex(LLFloaterSnapshot* floater)
 {
@@ -1240,12 +1156,20 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
 {
 	LLSnapshotLivePreview* previewp = getPreviewView(floaterp);
 
+	S32 delta_height = gSavedSettings.getBOOL("AdvanceSnapshot") ? 0 : floaterp->getUIWinHeightShort() - floaterp->getUIWinHeightLong() ;
+
 	if(!gSavedSettings.getBOOL("AdvanceSnapshot")) //set to original window resolution
 	{
 		previewp->mKeepAspectRatio = TRUE;
 
-		floaterp->getChild<LLComboBox>("snapshot_size_combo")->setCurrentByIndex(0);
-		gSavedSettings.setS32("SnapshotLastResolution", 0);
+		floaterp->getChild<LLComboBox>("postcard_size_combo")->setCurrentByIndex(0);
+		gSavedSettings.setS32("SnapshotPostcardLastResolution", 0);
+
+		floaterp->getChild<LLComboBox>("texture_size_combo")->setCurrentByIndex(0);
+		gSavedSettings.setS32("SnapshotTextureLastResolution", 0);
+
+		floaterp->getChild<LLComboBox>("local_size_combo")->setCurrentByIndex(0);
+		gSavedSettings.setS32("SnapshotLocalLastResolution", 0);
 
 		LLSnapshotLivePreview* previewp = getPreviewView(floaterp);
 		previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
@@ -1258,6 +1182,9 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
 		// stop all mouse events at fullscreen preview layer
 		floaterp->getParent()->setMouseOpaque(TRUE);
 		
+		// shrink to smaller layout
+		floaterp->reshape(floaterp->getRect().getWidth(), floaterp->getUIWinHeightLong() + delta_height);
+
 		// can see and interact with fullscreen preview now
 		if (previewp)
 		{
@@ -1286,6 +1213,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
 	else // turning off freeze frame mode
 	{
 		floaterp->getParent()->setMouseOpaque(FALSE);
+		floaterp->reshape(floaterp->getRect().getWidth(), floaterp->getUIWinHeightLong() + delta_height);
 		if (previewp)
 		{
 			previewp->setVisible(FALSE);
@@ -1314,27 +1242,127 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
 // static
 void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
 {
+	LLRadioGroup* snapshot_type_radio = floater->getChild<LLRadioGroup>("snapshot_type_radio");
+	snapshot_type_radio->setSelectedIndex(gSavedSettings.getS32("LastSnapshotType"));
+	LLSnapshotLivePreview::ESnapshotType shot_type = getTypeIndex(floater);
+	ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); //getFormatIndex(floater);	LLViewerWindow::ESnapshotType layer_type = getLayerType(floater);
+	LLViewerWindow::ESnapshotType layer_type = getLayerType(floater);
+
+	floater->childSetVisible("postcard_size_combo", FALSE);
+	floater->childSetVisible("texture_size_combo", FALSE);
+	floater->childSetVisible("local_size_combo", FALSE);
+
+	floater->getChild<LLComboBox>("postcard_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotPostcardLastResolution"));
+	floater->getChild<LLComboBox>("texture_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotTextureLastResolution"));
+	floater->getChild<LLComboBox>("local_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotLocalLastResolution"));
+	floater->getChild<LLComboBox>("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat"));
+
+	floater->childSetVisible("upload_btn",			shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE);
+	floater->childSetVisible("send_btn",			shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD);
+	floater->childSetVisible("save_btn",			shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL);
+	floater->childSetEnabled("keep_aspect_check",	shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !floater->impl.mAspectRatioCheckOff);
+	floater->childSetEnabled("layer_types",			shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL);
+
+	BOOL is_advance = gSavedSettings.getBOOL("AdvanceSnapshot");
+	BOOL is_local = shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL;
+	BOOL show_slider = 
+		shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD
+		|| (is_local && shot_format == LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
+
+	floater->childSetVisible("more_btn", !is_advance); // the only item hidden in advanced mode
+	floater->childSetVisible("less_btn",				is_advance);
+	floater->childSetVisible("type_label2",				is_advance);
+	floater->childSetVisible("format_label",			is_advance && is_local);
+	floater->childSetVisible("local_format_combo",		is_advance && is_local);
+	floater->childSetVisible("layer_types",				is_advance);
+	floater->childSetVisible("layer_type_label",		is_advance);
+	floater->childSetVisible("snapshot_width",			is_advance);
+	floater->childSetVisible("snapshot_height",			is_advance);
+	floater->childSetVisible("keep_aspect_check",		is_advance);
+	floater->childSetVisible("ui_check",				is_advance);
+	floater->childSetVisible("hud_check",				is_advance);
+	floater->childSetVisible("keep_open_check",			is_advance);
+	floater->childSetVisible("freeze_frame_check",		is_advance);
+	floater->childSetVisible("auto_snapshot_check",		is_advance);
+	floater->childSetVisible("image_quality_slider",	is_advance && show_slider);
+
 	LLSnapshotLivePreview* previewp = getPreviewView(floater);
-	if (NULL == previewp)
-	{
-		return;
+	BOOL got_bytes = previewp && previewp->getDataSize() > 0;
+	BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
+
+	floater->childSetEnabled("send_btn",   shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_snap && previewp->getDataSize() <= MAX_POSTCARD_DATASIZE);
+	floater->childSetEnabled("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE  && got_snap);
+	floater->childSetEnabled("save_btn",   shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL    && got_snap);
+
+	LLLocale locale(LLLocale::USER_LOCALE);
+	std::string bytes_string;
+	if (got_snap)
+	{
+		LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
+	}
+	S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
+	floater->childSetLabelArg("texture", "[AMOUNT]", llformat("%d",upload_cost));
+	floater->childSetLabelArg("upload_btn", "[AMOUNT]", llformat("%d",upload_cost));
+	floater->childSetTextArg("file_size_label", "[SIZE]", got_snap ? bytes_string : floater->getString("unknown"));
+	floater->childSetColor("file_size_label", 
+		shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD 
+		&& got_bytes
+		&& previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" ));
+
+	switch(shot_type)
+	{
+	  case LLSnapshotLivePreview::SNAPSHOT_POSTCARD:
+		layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR;
+		floater->childSetValue("layer_types", "colors");
+		if(is_advance)
+		{			
+			setResolution(floater, "postcard_size_combo");
+		}
+		break;
+	  case LLSnapshotLivePreview::SNAPSHOT_TEXTURE:
+		layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR;
+		floater->childSetValue("layer_types", "colors");
+		if(is_advance)
+		{
+			setResolution(floater, "texture_size_combo");			
+		}
+		break;
+	  case  LLSnapshotLivePreview::SNAPSHOT_LOCAL:
+		if(is_advance)
+		{
+			setResolution(floater, "local_size_combo");
+		}
+		break;
+	  default:
+		break;
 	}
 
-	// Disable buttons until Snapshot is ready. EXT-6534
-	BOOL got_snap = previewp->getSnapshotUpToDate();
+	updateResolutionTextEntry(floater);
 
-	// process Main buttons
-	floater->childSetEnabled("share", got_snap);
-	floater->childSetEnabled("save", got_snap);
-	floater->childSetEnabled("set_profile_pic", got_snap);
+	if (previewp)
+	{
+		previewp->setSnapshotType(shot_type);
+		previewp->setSnapshotFormat(shot_format);
+		previewp->setSnapshotBufferType(layer_type);
+	}
+}
 
-	// process Share actions buttons
-	floater->childSetEnabled("share_to_web", got_snap);
-	floater->childSetEnabled("share_to_email", got_snap);
+// static
+void LLFloaterSnapshot::Impl::updateResolutionTextEntry(LLFloaterSnapshot* floater)
+{
+	LLSpinCtrl* width_spinner = floater->getChild<LLSpinCtrl>("snapshot_width");
+	LLSpinCtrl* height_spinner = floater->getChild<LLSpinCtrl>("snapshot_height");
 
-	// process Save actions buttons
-	floater->childSetEnabled("save_to_inventory", got_snap);
-	floater->childSetEnabled("save_to_computer", got_snap);
+	if(getTypeIndex(floater) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE)
+	{
+		width_spinner->setAllowEdit(FALSE);
+		height_spinner->setAllowEdit(FALSE);
+	}
+	else
+	{
+		width_spinner->setAllowEdit(TRUE);
+		height_spinner->setAllowEdit(TRUE);
+	}
 }
 
 // static
@@ -1347,6 +1375,70 @@ void LLFloaterSnapshot::Impl::checkAutoSnapshot(LLSnapshotLivePreview* previewp,
 	}
 }
 
+// static
+void LLFloaterSnapshot::Impl::onClickDiscard(void* data)
+{
+	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
+	
+	if (view)
+	{
+		view->closeFloater();
+	}
+}
+
+
+// static
+void LLFloaterSnapshot::Impl::onCommitSave(LLUICtrl* ctrl, void* data)
+{
+	if (ctrl->getValue().asString() == "save as")
+	{
+		gViewerWindow->resetSnapshotLoc();
+	}
+	onClickKeep(data);
+}
+
+// static
+void LLFloaterSnapshot::Impl::onClickKeep(void* data)
+{
+	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
+	LLSnapshotLivePreview* previewp = getPreviewView(view);
+	
+	if (previewp)
+	{
+		if (previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_POSTCARD)
+		{
+			LLFloaterPostcard* floater = previewp->savePostcard();
+			// if still in snapshot mode, put postcard floater in snapshot floaterview
+			// and link it to snapshot floater
+			if (floater && !gSavedSettings.getBOOL("CloseSnapshotOnKeep"))
+			{
+				gFloaterView->removeChild(floater);
+				gSnapshotFloaterView->addChild(floater);
+				view->addDependentFloater(floater, FALSE);
+			}
+		}
+		else if (previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE)
+		{
+			previewp->saveTexture();
+		}
+		else
+		{
+			previewp->saveLocal();
+		}
+
+		if (gSavedSettings.getBOOL("CloseSnapshotOnKeep"))
+		{
+			view->closeFloater();
+		}
+		else
+		{
+			checkAutoSnapshot(previewp);
+		}
+
+		updateControls(view);
+	}
+}
+
 // static
 void LLFloaterSnapshot::Impl::onClickNewSnapshot(void* data)
 {
@@ -1372,6 +1464,41 @@ void LLFloaterSnapshot::Impl::onClickAutoSnap(LLUICtrl *ctrl, void* data)
 	}
 }
 
+void LLFloaterSnapshot::Impl::onClickMore(void* data)
+{
+	gSavedSettings.setBOOL( "AdvanceSnapshot", TRUE );
+	
+	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;		
+	if (view)
+	{
+		view->translate( 0, view->getUIWinHeightShort() - view->getUIWinHeightLong() );
+		view->reshape(view->getRect().getWidth(), view->getUIWinHeightLong());
+		updateControls(view) ;
+		updateLayout(view) ;
+		if(getPreviewView(view))
+		{
+			getPreviewView(view)->setThumbnailImageSize() ;
+		}
+	}
+}
+void LLFloaterSnapshot::Impl::onClickLess(void* data)
+{
+	gSavedSettings.setBOOL( "AdvanceSnapshot", FALSE );
+	
+	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;		
+	if (view)
+	{
+		view->translate( 0, view->getUIWinHeightLong() - view->getUIWinHeightShort() );
+		view->reshape(view->getRect().getWidth(), view->getUIWinHeightShort());
+		updateControls(view) ;
+		updateLayout(view) ;
+		if(getPreviewView(view))
+		{
+			getPreviewView(view)->setThumbnailImageSize() ;
+		}
+	}
+}
+
 // static
 void LLFloaterSnapshot::Impl::onClickUICheck(LLUICtrl *ctrl, void* data)
 {
@@ -1548,8 +1675,10 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
 	}
 
 	// save off all selected resolution values
-	gSavedSettings.setS32("SnapshotLastResolution", view->getChild<LLComboBox>("snapshot_size_combo")->getCurrentIndex());
-	
+	gSavedSettings.setS32("SnapshotPostcardLastResolution", view->getChild<LLComboBox>("postcard_size_combo")->getCurrentIndex());
+	gSavedSettings.setS32("SnapshotTextureLastResolution",  view->getChild<LLComboBox>("texture_size_combo")->getCurrentIndex());
+	gSavedSettings.setS32("SnapshotLocalLastResolution",    view->getChild<LLComboBox>("local_size_combo")->getCurrentIndex());
+
 	std::string sdstring = combobox->getSelectedValue();
 	LLSD sdres;
 	std::stringstream sstream(sdstring);
@@ -1629,149 +1758,17 @@ void LLFloaterSnapshot::Impl::onCommitLayerTypes(LLUICtrl* ctrl, void*data)
 }
 
 //static 
-void LLFloaterSnapshot::Impl::showAdvanced(LLFloaterSnapshot* view, const BOOL visible)
-{
-	LLPanel* advanced_panel = view->getChild<LLPanel>("snapshot_advanced");
-
-	if (advanced_panel->getVisible() != visible)
-	{
-		gSavedSettings.setBOOL("AdvanceSnapshot", visible);
-
-		advanced_panel->setVisible(visible);
-		view->getChild<LLButton>("hide_advanced")->setVisible(visible);
-		view->getChild<LLButton>("show_advanced")->setVisible(!visible);
-
-		if (visible)
-		{
-			// stretch the floater so it can accommodate the advanced panel
-			view->reshape(view->getRect().getWidth() + advanced_panel->getRect().getWidth(), view->getRect().getHeight());
-		}
-		else
-		{
-			// shrink floater back to original size
-			view->reshape(view->getRect().getWidth() - advanced_panel->getRect().getWidth(), view->getRect().getHeight());
-		}
-	}
-}
-
-// This object represents a pending request for avatar properties information
-class LLAvatarDataRequest : public LLAvatarPropertiesObserver
-{
-public:
-	LLAvatarDataRequest(const LLUUID& avatar_id, const LLUUID& image_id, LLFloaterSnapshot* floater)
-	:	mAvatarID(avatar_id),
-		mImageID(image_id),
-		mSnapshotFloater(floater)
-
-	{
-	}
-	
-	~LLAvatarDataRequest()
-	{
-		// remove ourselves as an observer
-		LLAvatarPropertiesProcessor::getInstance()->
-		removeObserver(mAvatarID, this);
-	}
-	
-	void processProperties(void* data, EAvatarProcessorType type)
-	{
-		// route the data to the inspector
-		if (data
-			&& type == APT_PROPERTIES)
-		{
-
-			LLAvatarData* avatar_data = static_cast<LLAvatarData*>(data);
-
-			LLAvatarData new_data(*avatar_data);
-			new_data.image_id = mImageID;
-
-			LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate(&new_data);
-
-			delete this;
-		}
-	}
-	
-	// Store avatar ID so we can un-register the observer on destruction
-	LLUUID mAvatarID;
-	LLUUID mImageID;
-	LLFloaterSnapshot* mSnapshotFloater;
-};
-
-void LLFloaterSnapshot::Impl::onCommitProfilePic(LLFloaterSnapshot* view)
-{
-	confirmSavingTexture(view, true);
-}
-
-void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapshotLivePreview::ESnapshotType type)
-{
-	LLSnapshotLivePreview* previewp = getPreviewView(view);
-	
-	if (previewp)
-	{
-		previewp->setSnapshotType(type);
-
-		if (type == LLSnapshotLivePreview::SNAPSHOT_WEB)
-		{
-			previewp->saveWeb(view->getString("share_to_web_url"));
-			checkCloseOnKeep(view);
-		}
-		else if (type == LLSnapshotLivePreview::SNAPSHOT_LOCAL)
-		{
-			previewp->saveLocal();
-			checkCloseOnKeep(view);
-		}
-		else if (type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE)
-		{
-			// uploads and then calls checkCloseOnKeep() on confirmation from user
-			confirmSavingTexture(view);
-		}
-		else if (type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD)
-		{
-			LLFloaterPostcard* floater = previewp->savePostcard();
-			// if still in snapshot mode, put postcard floater in snapshot floaterview
-			// and link it to snapshot floater
-			if (floater && !gSavedSettings.getBOOL("CloseSnapshotOnKeep"))
-			{
-				gFloaterView->removeChild(floater);
-				gSnapshotFloaterView->addChild(floater);
-				view->addDependentFloater(floater, FALSE);
-			}
-			checkCloseOnKeep(view);
-		}
-	}
-}
-
-void LLFloaterSnapshot::Impl::confirmSavingTexture(LLFloaterSnapshot* view, bool set_as_profile_pic)
-{
-	LLSD args;
-	args["AMOUNT"] = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
-	LLNotificationsUtil::add("UploadConfirmation", args, LLSD(),
-							 boost::bind(&onSavingTextureConfirmed, _1, _2, view, set_as_profile_pic));
-}
-
-void LLFloaterSnapshot::Impl::onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, LLFloaterSnapshot* view, bool set_as_profile_pic)
+void LLFloaterSnapshot::Impl::onCommitSnapshotType(LLUICtrl* ctrl, void* data)
 {
-	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-
-	if (option == 0)
+	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;		
+	if (view)
 	{
-		LLSnapshotLivePreview* previewp = getPreviewView(view);
-		previewp->saveTexture(set_as_profile_pic);
-		checkCloseOnKeep(view);
+		gSavedSettings.setS32("LastSnapshotType", getTypeIndex(view));
+		getPreviewView(view)->updateSnapshot(TRUE);
+		updateControls(view);
 	}
 }
 
-void LLFloaterSnapshot::Impl::checkCloseOnKeep(LLFloaterSnapshot* view)
-{
-	if (gSavedSettings.getBOOL("CloseSnapshotOnKeep"))
-	{
-		view->closeFloater();
-	}
-	else
-	{
-		checkAutoSnapshot(getPreviewView(view));
-	}
-}
 
 //static 
 void LLFloaterSnapshot::Impl::onCommitSnapshotFormat(LLUICtrl* ctrl, void* data)
@@ -1785,6 +1782,8 @@ void LLFloaterSnapshot::Impl::onCommitSnapshotFormat(LLUICtrl* ctrl, void* data)
 	}
 }
 
+
+
 // Sets the named size combo to "custom" mode.
 // static
 void LLFloaterSnapshot::Impl::comboSetCustom(LLFloaterSnapshot* floater, const std::string& comboname)
@@ -1793,11 +1792,24 @@ void LLFloaterSnapshot::Impl::comboSetCustom(LLFloaterSnapshot* floater, const s
 
 	combo->setCurrentByIndex(combo->getItemCount() - 1); // "custom" is always the last index
 
-	gSavedSettings.setS32("SnapshotLastResolution", combo->getCurrentIndex());
+	if(comboname == "postcard_size_combo") 
+	{
+		gSavedSettings.setS32("SnapshotPostcardLastResolution", combo->getCurrentIndex());
+	}
+	else if(comboname == "texture_size_combo") 
+	{
+		gSavedSettings.setS32("SnapshotTextureLastResolution", combo->getCurrentIndex());
+	}
+	else if(comboname == "local_size_combo") 
+	{
+		gSavedSettings.setS32("SnapshotLocalLastResolution", combo->getCurrentIndex());
+	}
 
 	checkAspectRatio(floater, -1); // -1 means custom
 }
 
+
+
 //static
 BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL isWidthChanged, S32 max_value)
 {
@@ -1938,7 +1950,9 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat
 				previewp->setSize(w,h);
 				checkAutoSnapshot(previewp, FALSE);
 				previewp->updateSnapshot(FALSE, TRUE);
-				comboSetCustom(view, "snapshot_size_combo");
+				comboSetCustom(view, "postcard_size_combo");
+				comboSetCustom(view, "texture_size_combo");
+				comboSetCustom(view, "local_size_combo");
 			}
 		}
 
@@ -1955,15 +1969,10 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat
 
 // Default constructor
 LLFloaterSnapshot::LLFloaterSnapshot(const LLSD& key)
-	: LLTransientDockableFloater(NULL, true, key),
+	: LLFloater(key),
 	  impl (*(new Impl))
 {
 	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_snapshot.xml", FALSE);
-
-	mCommitCallbackRegistrar.add("Snapshot.ShowButtons",  boost::bind(&LLFloaterSnapshot::updateButtons, this, _2));
-	mCommitCallbackRegistrar.add("Snapshot.ShowAdvanced", boost::bind(&Impl::showAdvanced, this, true));
-	mCommitCallbackRegistrar.add("Snapshot.HideAdvanced", boost::bind(&Impl::showAdvanced, this, false));
-	mCommitCallbackRegistrar.add("Snapshot.Refresh", boost::bind(&Impl::onClickNewSnapshot, this));
 }
 
 // Destroys the object
@@ -1985,14 +1994,19 @@ LLFloaterSnapshot::~LLFloaterSnapshot()
 
 BOOL LLFloaterSnapshot::postBuild()
 {
-	getChild<LLButton>("share_to_web")->setCommitCallback(boost::bind(&Impl::onCommitSnapshot, this, LLSnapshotLivePreview::SNAPSHOT_WEB));
-	getChild<LLButton>("share_to_email")->setCommitCallback(boost::bind(&Impl::onCommitSnapshot, this, LLSnapshotLivePreview::SNAPSHOT_POSTCARD));
-	getChild<LLButton>("save_to_inventory")->setCommitCallback(boost::bind(&Impl::onCommitSnapshot, this, LLSnapshotLivePreview::SNAPSHOT_TEXTURE));
-	getChild<LLButton>("save_to_computer")->setCommitCallback(boost::bind(&Impl::onCommitSnapshot, this, LLSnapshotLivePreview::SNAPSHOT_LOCAL));
-	getChild<LLButton>("set_profile_pic")->setCommitCallback(boost::bind(&Impl::onCommitProfilePic, this));
-
+	childSetCommitCallback("snapshot_type_radio", Impl::onCommitSnapshotType, this);
 	childSetCommitCallback("local_format_combo", Impl::onCommitSnapshotFormat, this);
 	
+	childSetAction("new_snapshot_btn", Impl::onClickNewSnapshot, this);
+
+	childSetAction("more_btn", Impl::onClickMore, this);
+	childSetAction("less_btn", Impl::onClickLess, this);
+
+	childSetAction("upload_btn", Impl::onClickKeep, this);
+	childSetAction("send_btn", Impl::onClickKeep, this);
+	childSetCommitCallback("save_btn", Impl::onCommitSave, this);
+	childSetAction("discard_btn", Impl::onClickDiscard, this);
+
 	childSetCommitCallback("image_quality_slider", Impl::onCommitQuality, this);
 	childSetValue("image_quality_slider", gSavedSettings.getS32("SnapshotQuality"));
 
@@ -2013,6 +2027,7 @@ BOOL LLFloaterSnapshot::postBuild()
 
 	childSetCommitCallback("layer_types", Impl::onCommitLayerTypes, this);
 	childSetValue("layer_types", "colors");
+	childSetEnabled("layer_types", FALSE);
 
 	childSetValue("snapshot_width", gSavedSettings.getS32(lastSnapshotWidthName()));
 	childSetValue("snapshot_height", gSavedSettings.getS32(lastSnapshotHeightName()));
@@ -2023,7 +2038,9 @@ BOOL LLFloaterSnapshot::postBuild()
 	childSetValue("auto_snapshot_check", gSavedSettings.getBOOL("AutoSnapshot"));
 	childSetCommitCallback("auto_snapshot_check", Impl::onClickAutoSnap, this);
 
-	childSetCommitCallback("snapshot_size_combo", Impl::onCommitResolution, this);
+	childSetCommitCallback("postcard_size_combo", Impl::onCommitResolution, this);
+	childSetCommitCallback("texture_size_combo", Impl::onCommitResolution, this);
+	childSetCommitCallback("local_size_combo", Impl::onCommitResolution, this);
 
 	// create preview window
 	LLRect full_screen_rect = getRootView()->getRect();
@@ -2044,15 +2061,8 @@ BOOL LLFloaterSnapshot::postBuild()
 	impl.mPreviewHandle = previewp->getHandle();
 	impl.updateControls(this);
 	impl.updateLayout(this);
-	impl.showAdvanced(this, gSavedSettings.getBOOL("AdvanceSnapshot"));
-
-	//save off the refresh button's rectangle so we can apply offsets with thumbnail resize 
-	mRefreshBtnRect = getChild<LLButton>("new_snapshot_btn")->getRect();
-
-	// make sure we share/hide the general buttons 
-	updateButtons(LLSD("main"));
 	
-	return LLDockableFloater::postBuild();
+	return TRUE;
 }
 
 void LLFloaterSnapshot::draw()
@@ -2065,19 +2075,15 @@ void LLFloaterSnapshot::draw()
 		return;
 	}
 
-	LLDockableFloater::draw();
-
-	LLButton* refresh_btn = getChild<LLButton>("new_snapshot_btn");
-	// revert the refresh button to original intended position
-	LLRect refresh_rect = mRefreshBtnRect;
+	LLFloater::draw();
 
 	if (previewp)
 	{		
 		if(previewp->getThumbnailImage())
 		{
-			LLRect thumbnail_rect = getChild<LLView>("thumbnail_placeholder")->getRect();
+			LLRect thumbnail_rect = getChild<LLUICtrl>("thumbnail_placeholder")->getRect();
 
-			S32 offset_x = (thumbnail_rect.getWidth() - previewp->getThumbnailWidth()) / 2 + thumbnail_rect.mLeft;
+			S32 offset_x = (getRect().getWidth() - previewp->getThumbnailWidth()) / 2 ;
 			S32 offset_y = thumbnail_rect.mBottom + (thumbnail_rect.getHeight() - previewp->getThumbnailHeight()) / 2 ;
 
 			glMatrixMode(GL_MODELVIEW);
@@ -2086,14 +2092,8 @@ void LLFloaterSnapshot::draw()
 					previewp->getThumbnailImage(), LLColor4::white);	
 
 			previewp->drawPreviewRect(offset_x, offset_y) ;
-
-			refresh_rect.translate(offset_x - thumbnail_rect.mLeft, offset_y - thumbnail_rect.mBottom);
 		}
 	}
-
-	refresh_btn->setRect(refresh_rect);
-	drawChild(refresh_btn);
-	
 }
 
 void LLFloaterSnapshot::onOpen(const LLSD& key)
@@ -2107,12 +2107,6 @@ void LLFloaterSnapshot::onOpen(const LLSD& key)
 	gSnapshotFloaterView->setEnabled(TRUE);
 	gSnapshotFloaterView->setVisible(TRUE);
 	gSnapshotFloaterView->adjustToFitScreen(this, FALSE);
-
-	LLButton *snapshots = LLBottomTray::getInstance()->getChild<LLButton>("snapshots");
-
-	setDockControl(new LLDockControl(
-		snapshots, this,
-		getDockTongue(), LLDockControl::TOP));
 }
 
 void LLFloaterSnapshot::onClose(bool app_quitting)
@@ -2140,34 +2134,6 @@ void LLFloaterSnapshot::update()
 	}
 }
 
-bool LLFloaterSnapshot::updateButtons(const LLSD& mode)
-{
-	std::string button_mode = mode.asString();
-
-	bool mode_main("main" == button_mode);
-	bool mode_share("share" == button_mode);
-	bool mode_save("save" == button_mode);
-
-	// Default to a known state if mode is invalid.
-	if (!mode_main && !mode_share && !mode_save) mode_main = true;
-
-	childSetVisible("panel_snapshot_main", mode_main);
-	childSetVisible("panel_snapshot_share", mode_share);
-	childSetVisible("panel_snapshot_save", mode_save);
-
-	return true;
-}
-
-void LLFloaterSnapshot::setAsProfilePic(const LLUUID& image_id)
-{
-	LLAvatarDataRequest* avatar_data_request = new LLAvatarDataRequest(gAgent.getID(), image_id, this);
-	
-	LLAvatarPropertiesProcessor* processor = 
-		LLAvatarPropertiesProcessor::getInstance();
-	
-	processor->addObserver(gAgent.getID(), avatar_data_request);
-	processor->sendAvatarPropertiesRequest(gAgent.getID());
-}
 
 ///----------------------------------------------------------------------------
 /// Class LLSnapshotFloaterView
diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h
index 8c4373c35c1b99629d4eda91737390a98e438517..1333497bd25f1211aad2746d177b8001e6d17f5e 100644
--- a/indra/newview/llfloatersnapshot.h
+++ b/indra/newview/llfloatersnapshot.h
@@ -34,10 +34,9 @@
 #define LL_LLFLOATERSNAPSHOT_H
 
 #include "llfloater.h"
-#include "lltransientdockablefloater.h"
 
 
-class LLFloaterSnapshot : public LLTransientDockableFloater
+class LLFloaterSnapshot : public LLFloater
 {
 public:
 	typedef enum e_snapshot_format
@@ -57,10 +56,6 @@ class LLFloaterSnapshot : public LLTransientDockableFloater
 	
 	static void update();
 	
-	void setAsProfilePic(const LLUUID& image_id);
-	
-	bool updateButtons(const LLSD& mode);
-	
 	static S32  getUIWinHeightLong()  {return sUIWinHeightLong ;}
 	static S32  getUIWinHeightShort() {return sUIWinHeightShort ;}
 	static S32  getUIWinWidth()       {return sUIWinWidth ;}
@@ -72,8 +67,6 @@ class LLFloaterSnapshot : public LLTransientDockableFloater
 	static S32    sUIWinHeightLong ;
 	static S32    sUIWinHeightShort ;
 	static S32    sUIWinWidth ;
-
-	LLRect mRefreshBtnRect;
 };
 
 class LLSnapshotFloaterView : public LLFloaterView
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 74034cfbf7bc7252f7cc618bf7ba449a49dfa0a7..f241d18a2128ca0304eddd07cc2b9280e51c57af 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -185,6 +185,7 @@ LLFolderView::LLFolderView(const Params& p)
 	mRenameItem( NULL ),
 	mNeedsScroll( FALSE ),
 	mEnableScroll( true ),
+	mUseLabelSuffix(p.use_label_suffix),
 	mPinningSelectedItem(FALSE),
 	mNeedsAutoSelect( FALSE ),
 	mAutoSelectOverride(FALSE),
@@ -961,7 +962,7 @@ void LLFolderView::draw()
 		}
 		mStatusTextBox->setValue(mStatusText);
 		mStatusTextBox->setVisible( TRUE );
-
+		
 		// firstly reshape message textbox with current size. This is necessary to
 		// LLTextBox::getTextPixelHeight works properly
 		const LLRect local_rect = getLocalRect();
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 0dfdbd364bda7eb0e5e5d001f85038e047134cec..55eb543f5f3c426b6b6bce99e78786044e68314d 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -96,6 +96,7 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 		Mandatory<LLPanel*>	    parent_panel;
 		Optional<LLUUID>        task_id;
 		Optional<std::string>   title;
+		Optional<bool>			use_label_suffix;
 	};
 	LLFolderView(const Params&);
 	virtual ~LLFolderView( void );
@@ -273,6 +274,7 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 	virtual S32	notify(const LLSD& info) ;
 	void setEnableScroll(bool enable_scroll) { mEnableScroll = enable_scroll; }
 	
+	bool useLabelSuffix() { return mUseLabelSuffix; }
 private:
 	void updateRenamerPosition();
 
@@ -309,6 +311,7 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 	BOOL							mNeedsAutoSelect;
 	BOOL							mAutoSelectOverride;
 	BOOL							mNeedsAutoRename;
+	bool							mUseLabelSuffix;
 	
 	BOOL							mDebugFilters;
 	U32								mSortOrder;
diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h
index a2ef8c1d12cf7c72d410e5b7558f913e295d2da9..82f8a10cf3bbcef7b4cbf7f29e8ed0d455d95d04 100644
--- a/indra/newview/llfoldervieweventlistener.h
+++ b/indra/newview/llfoldervieweventlistener.h
@@ -37,6 +37,7 @@
 #include "llinventorytype.h"
 #include "llpermissionsflags.h"
 #include "llpointer.h"
+#include "llwearabletype.h"
 
 
 class LLFolderViewItem;
@@ -89,6 +90,7 @@ class LLFolderViewEventListener
 	virtual BOOL hasChildren() const = 0;
 	virtual LLInventoryType::EType getInventoryType() const = 0;
 	virtual void performAction(LLInventoryModel* model, std::string action) = 0;
+	virtual LLWearableType::EType getWearableType() const = 0;
 	
 	// This method should be called when a drag begins. returns TRUE
 	// if the drag can begin, otherwise FALSE.
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 0c437cf035b5bfd045770a81218c04ec3a1b0b24..50b35bfc692448ab84232cdee3309277ed8b8df0 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -289,8 +289,11 @@ void LLFolderViewItem::refreshFromListener()
 			mCreationDate = mListener->getCreationDate();
 			dirtyFilter();
 		}
-		mLabelStyle = mListener->getLabelStyle();
-		mLabelSuffix = mListener->getLabelSuffix();
+		if (mRoot->useLabelSuffix())
+		{
+			mLabelStyle = mListener->getLabelStyle();
+			mLabelSuffix = mListener->getLabelSuffix();
+		}
 	}
 }
 
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 7ce96a6ac14736dd5b279de96b59a170b192db9f..ec367c1746f0b6ed517ef836144f8eb2a05b41ae 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2581,9 +2581,9 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 			mItems.push_back(std::string("New Clothes"));
 			mItems.push_back(std::string("New Body Parts"));
 
-			// Changing folder types is just a debug feature; this is fairly unsupported
+#if SUPPORT_ENSEMBLES
+			// Changing folder types is an unfinished unsupported feature
 			// and can lead to unexpected behavior if enabled.
-#if !LL_RELEASE_FOR_DOWNLOAD
 			mItems.push_back(std::string("Change Type"));
 			const LLViewerInventoryCategory *cat = getCategory();
 			if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
@@ -5184,12 +5184,12 @@ void LLRecentItemsFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 
 	menuentry_vec_t disabled_items, items = getMenuItems();
 
-	items.erase(std::find(items.begin(), items.end(), std::string("New Folder")));
-	items.erase(std::find(items.begin(), items.end(), std::string("New Script")));
-	items.erase(std::find(items.begin(), items.end(), std::string("New Note")));
-	items.erase(std::find(items.begin(), items.end(), std::string("New Gesture")));
-	items.erase(std::find(items.begin(), items.end(), std::string("New Clothes")));
-	items.erase(std::find(items.begin(), items.end(), std::string("New Body Parts")));
+	items.erase(std::remove(items.begin(), items.end(), std::string("New Body Parts")), items.end());
+	items.erase(std::remove(items.begin(), items.end(), std::string("New Clothes")), items.end());
+	items.erase(std::remove(items.begin(), items.end(), std::string("New Note")), items.end());
+	items.erase(std::remove(items.begin(), items.end(), std::string("New Gesture")), items.end());
+	items.erase(std::remove(items.begin(), items.end(), std::string("New Script")), items.end());
+	items.erase(std::remove(items.begin(), items.end(), std::string("New Folder")), items.end());
 
 	hide_context_entries(menu, items, disabled_items);
 }
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index d97dfd535e5dc17b01369841c2bc445a0612b0b4..757808eb93cf50d80cf94e91302e9155dfb59e00 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -123,6 +123,7 @@ class LLInvFVBridge : public LLFolderViewEventListener
 							EDragAndDropType cargo_type,
 							void* cargo_data) { return FALSE; }
 	virtual LLInventoryType::EType getInventoryType() const { return mInvType; }
+	virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; }
 
 	//--------------------------------------------------------------------
 	// Convenience functions for adding various common menu options.
@@ -471,6 +472,7 @@ class LLWearableBridge : public LLItemBridge
 	virtual void	buildContextMenu(LLMenuGL& menu, U32 flags);
 	virtual std::string getLabelSuffix() const;
 	virtual BOOL renameItem(const std::string& new_name);
+	virtual LLWearableType::EType getWearableType() const { return mWearableType; }
 
 	static void		onWearOnAvatar( void* userdata );	// Access to wearOnAvatar() from menu
 	static BOOL		canWearOnAvatar( void* userdata );
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index c90919e8fd7bb268df32ddda7a370916b7d7316f..6e829f2dc2f0afea0232917d47725f2c24c4d3fb 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -49,6 +49,7 @@
 LLInventoryFilter::FilterOps::FilterOps() :
 	mFilterObjectTypes(0xffffffffffffffffULL),
 	mFilterCategoryTypes(0xffffffffffffffffULL),
+	mFilterWearableTypes(0xffffffffffffffffULL),
 	mMinDate(time_min()),
 	mMaxDate(time_max()),
 	mHoursAgo(0),
@@ -139,8 +140,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
 			return FALSE;
 		}
 	}
-	//
-	////////////////////////////////////////////////////////////////////////////////
 	
 	
 	////////////////////////////////////////////////////////////////////////////////
@@ -164,8 +163,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
 		if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0))
 			return FALSE;
 	}
-	//
-	////////////////////////////////////////////////////////////////////////////////
 
 
 	////////////////////////////////////////////////////////////////////////////////
@@ -178,8 +175,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
 		if (object->getLinkedUUID() != mFilterOps.mFilterUUID)
 			return FALSE;
 	}
-	//
-	////////////////////////////////////////////////////////////////////////////////
 
 
 	////////////////////////////////////////////////////////////////////////////////
@@ -201,8 +196,18 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
 			listener->getCreationDate() > mFilterOps.mMaxDate)
 			return FALSE;
 	}
-	//
+
 	////////////////////////////////////////////////////////////////////////////////
+	// FILTERTYPE_WEARABLE
+	// Pass if this item is a wearable of the appropriate type
+	if (filterTypes & FILTERTYPE_WEARABLE)
+	{
+		LLWearableType::EType type = listener->getWearableType();
+		if ((0x1LL << type & mFilterOps.mFilterWearableTypes) == 0)
+		{
+			return FALSE;
+		}
+	}
 
 	return TRUE;
 }
@@ -238,6 +243,8 @@ std::string::size_type LLInventoryFilter::getStringMatchOffset() const
 BOOL LLInventoryFilter::isNotDefault() const
 {
 	return mFilterOps.mFilterObjectTypes != mDefaultFilterOps.mFilterObjectTypes 
+		|| mFilterOps.mFilterCategoryTypes != mDefaultFilterOps.mFilterCategoryTypes 
+		|| mFilterOps.mFilterWearableTypes != mDefaultFilterOps.mFilterWearableTypes 
 		|| mFilterOps.mFilterTypes != FILTERTYPE_OBJECT
 		|| mFilterSubString.size() 
 		|| mFilterOps.mPermissions != mDefaultFilterOps.mPermissions
@@ -249,6 +256,8 @@ BOOL LLInventoryFilter::isNotDefault() const
 BOOL LLInventoryFilter::isActive() const
 {
 	return mFilterOps.mFilterObjectTypes != 0xffffffffffffffffULL
+		|| mFilterOps.mFilterCategoryTypes != 0xffffffffffffffffULL
+		|| mFilterOps.mFilterWearableTypes != 0xffffffffffffffffULL
 		|| mFilterOps.mFilterTypes != FILTERTYPE_OBJECT
 		|| mFilterSubString.size() 
 		|| mFilterOps.mPermissions != PERM_NONE 
@@ -322,7 +331,35 @@ void LLInventoryFilter::setFilterCategoryTypes(U64 types)
 			setModified(FILTER_MORE_RESTRICTIVE);
 		}
 	}
-	mFilterOps.mFilterTypes |= FILTERTYPE_CATEGORY;
+	mFilterOps.mFilterTypes |= FILTERTYPE_OBJECT;
+}
+
+void LLInventoryFilter::setFilterWearableTypes(U64 types)
+{
+	if (mFilterOps.mFilterWearableTypes != types)
+	{
+		// keep current items only if no type bits getting turned off
+		BOOL fewer_bits_set = (mFilterOps.mFilterWearableTypes & ~types);
+		BOOL more_bits_set = (~mFilterOps.mFilterWearableTypes & types);
+
+		mFilterOps.mFilterWearableTypes = types;
+		if (more_bits_set && fewer_bits_set)
+		{
+			// neither less or more restrive, both simultaneously
+			// so we need to filter from scratch
+			setModified(FILTER_RESTART);
+		}
+		else if (more_bits_set)
+		{
+			// target is only one of all requested types so more type bits == less restrictive
+			setModified(FILTER_LESS_RESTRICTIVE);
+		}
+		else if (fewer_bits_set)
+		{
+			setModified(FILTER_MORE_RESTRICTIVE);
+		}
+	}
+	mFilterOps.mFilterTypes |= FILTERTYPE_WEARABLE;
 }
 
 void LLInventoryFilter::setFilterUUID(const LLUUID& object_id)
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 3ef51baefcadb9683250def2cca2780478422b66..f740a6b333119a21fa8016f8857b0cc474c92640 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -59,10 +59,11 @@ class LLInventoryFilter
 	enum EFilterType
 	{
 		FILTERTYPE_NONE = 0,
-		FILTERTYPE_OBJECT = 1,		// normal default search-by-object-type
-		FILTERTYPE_CATEGORY = 2,	// search by folder type
-		FILTERTYPE_UUID	= 4,		// find the object with UUID and any links to it
-		FILTERTYPE_DATE = 8			// search by date range
+		FILTERTYPE_OBJECT = 0x1 << 0,	// normal default search-by-object-type
+		FILTERTYPE_CATEGORY = 0x1 << 1,	// search by folder type
+		FILTERTYPE_UUID	= 0x1 << 2,		// find the object with UUID and any links to it
+		FILTERTYPE_DATE = 0x1 << 3,		// search by date range
+		FILTERTYPE_WEARABLE = 0x1 << 4	// search by wearable type
 	};
 
 	// REFACTOR: Change this to an enum.
@@ -81,6 +82,7 @@ class LLInventoryFilter
 	BOOL 				isFilterObjectTypesWith(LLInventoryType::EType t) const;
 	void 				setFilterCategoryTypes(U64 types);
 	void 				setFilterUUID(const LLUUID &object_id);
+	void				setFilterWearableTypes(U64 types);
 
 	void 				setFilterSubString(const std::string& string);
 	const std::string& 	getFilterSubString(BOOL trim = FALSE) const;
@@ -168,6 +170,7 @@ class LLInventoryFilter
 		U32 			mFilterTypes;
 
 		U64				mFilterObjectTypes; // For _OBJECT
+		U64				mFilterWearableTypes;
 		U64				mFilterCategoryTypes; // For _CATEGORY
 		LLUUID      	mFilterUUID; // for UUID
 
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index c86d463a08844e6afa6ef8cd27a335f0b08b0665..de24bd92d0c0b06ecd9497cac2003d27034d44c3 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -52,6 +52,7 @@
 #include "llappearancemgr.h"
 #include "llappviewer.h"
 //#include "llfirstuse.h"
+#include "llfloaterinventory.h"
 #include "llfocusmgr.h"
 #include "llfolderview.h"
 #include "llgesturemgr.h"
@@ -63,6 +64,7 @@
 #include "llinventorypanel.h"
 #include "lllineeditor.h"
 #include "llmenugl.h"
+#include "llpanelmaininventory.h"
 #include "llpreviewanim.h"
 #include "llpreviewgesture.h"
 #include "llpreviewnotecard.h"
@@ -74,6 +76,7 @@
 #include "llscrollcontainer.h"
 #include "llselectmgr.h"
 #include "llsidetray.h"
+#include "llsidepanelinventory.h"
 #include "lltabcontainer.h"
 #include "lltooldraganddrop.h"
 #include "lluictrlfactory.h"
@@ -332,9 +335,59 @@ void show_item_profile(const LLUUID& item_uuid)
 
 void show_item_original(const LLUUID& item_uuid)
 {
+	//sidetray inventory panel
+	LLSidepanelInventory *sidepanel_inventory =
+		dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
+
+	bool reset_inventory_filter = !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory");
+
 	LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel();
-	if (!active_panel) return;
+	if (!active_panel) 
+	{
+		//this may happen when there is no floatera and other panel is active in inventory tab
+
+		if	(sidepanel_inventory)
+		{
+			sidepanel_inventory->showInventoryPanel();
+		}
+	}
+	
+	active_panel = LLInventoryPanel::getActiveInventoryPanel();
+	if (!active_panel) 
+	{
+		return;
+	}
 	active_panel->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_NO);
+	
+	if(reset_inventory_filter)
+	{
+		//inventory floater
+		bool floater_inventory_visible = false;
+
+		LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory");
+		for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
+		{
+			LLFloaterInventory* floater_inventory = dynamic_cast<LLFloaterInventory*>(*iter);
+			if (floater_inventory)
+			{
+				LLPanelMainInventory* main_inventory = floater_inventory->getMainInventoryPanel();
+
+				main_inventory->onFilterEdit("");
+			}
+
+			if(floater_inventory->getVisible())
+			{
+				floater_inventory_visible = true;
+			}
+
+		}
+		if(sidepanel_inventory && !floater_inventory_visible)
+		{
+			LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel();
+
+			main_inventory->onFilterEdit("");
+		}
+	}
 }
 
 ///----------------------------------------------------------------------------
diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp
index 23ea786484a0e1b718fe600f056b940aa0d2400b..384b24210cf80328d191aef248d19c65e94d0856 100644
--- a/indra/newview/llinventoryitemslist.cpp
+++ b/indra/newview/llinventoryitemslist.cpp
@@ -288,6 +288,8 @@ void LLPanelInventoryListItemBase::setIconImage(const LLUIImagePtr& image)
 
 void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std::string& highlit_text)
 {
+	setToolTip(title);
+
 	LLTextUtil::textboxSetHighlightedVal(
 		mTitleCtrl,
 		LLStyle::Params(),
@@ -295,6 +297,16 @@ void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std:
 		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())
+	{
+		return LLPanel::handleToolTip(x,y,mask);
+	}
+	return FALSE;
+}
+
 void LLPanelInventoryListItemBase::reshapeLeftWidgets()
 {
 	S32 widget_left = 0;
diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h
index d6132717e86716a7f877743a6177cfa3828dee81..489a82829c8cc20ae049fc3f7218832e65b6c9d5 100644
--- a/indra/newview/llinventoryitemslist.h
+++ b/indra/newview/llinventoryitemslist.h
@@ -179,6 +179,10 @@ class LLPanelInventoryListItemBase : public LLPanel
 	/** Set item title - inventory item name usually */
 	virtual void setTitle(const std::string& title, const std::string& highlit_text);
 
+	/**
+	 * Show tool tip if item name text size > panel size
+	 */
+	virtual BOOL handleToolTip( S32 x, S32 y, MASK mask);
 
 	LLViewerInventoryItem* mItem;
 
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 15760bf15545777ad6d29cb50c6efc26a0a0e64e..b9e9f0fc0b12b693472c754108f621338a601633 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1262,12 +1262,6 @@ void LLInventoryModel::addCategory(LLViewerInventoryCategory* category)
 
 void LLInventoryModel::addItem(LLViewerInventoryItem* item)
 {
-	/*
-	const LLViewerInventoryCategory* cat = gInventory.getCategory(item->getParentUUID()); // Seraph remove for 2.1
-	const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND"; // Seraph remove for 2.1
-	llinfos << "Added item [ name:" << item->getName() << " UUID:" << item->getUUID() << " type:" << item->getActualType() << " ] to folder [ name:" << cat_name << " uuid:" << item->getParentUUID() << " ]" << llendl; // Seraph remove for 2.1
-	*/
-
 	llassert(item);
 	if(item)
 	{
@@ -2453,7 +2447,9 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
 	}
 	LLUUID tid;
 	msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, tid);
+#ifndef LL_RELEASE_FOR_DOWNLOAD
 	llinfos << "Bulk inventory: " << tid << llendl;
+#endif
 
 	update_map_t update;
 	cat_array_t folders;
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index bd3525967071f6cb5fbea40aa5bf59a7ef8f5f7e..0ac8fbcb152c093e809eff4666fa9c4e25f8f771 100644
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -308,7 +308,16 @@ void LLInventoryFetchItemsObserver::startFetch()
 			// assume it's agent inventory.
 			owner_id = gAgent.getID();
 		}
-		
+
+		// Ignore categories since they're not items.  We
+		// could also just add this to mComplete but not sure what the
+		// side-effects would be, so ignoring to be safe.
+		LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
+		if (cat)
+		{
+			continue;
+		}
+
 		// It's incomplete, so put it on the incomplete container, and
 		// pack this on the message.
 		mIncomplete.push_back(*it);
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 6b0103e0de7a6baa935796a15b763f2474d9875c..72d35af3b770aa91a22e64fccc9dbd58b9de9a8f 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -110,7 +110,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
 	}
 }
 
-BOOL LLInventoryPanel::postBuild()
+void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
 {
 	LLMemType mt(LLMemType::MTYPE_INVENTORY_POST_BUILD);
 
@@ -128,6 +128,7 @@ BOOL LLInventoryPanel::postBuild()
 		p.rect = folder_rect;
 		p.parent_panel = this;
 		p.tool_tip = p.name;
+		p.use_label_suffix = params.use_label_suffix;
 		mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p);
 		mFolderRoot->setAllowMultiSelect(mAllowMultiSelect);
 	}
@@ -174,8 +175,6 @@ BOOL LLInventoryPanel::postBuild()
 		setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER));
 	}
 	mFolderRoot->setSortOrder(getFilter()->getSortOrder());
-
-	return TRUE;
 }
 
 LLInventoryPanel::~LLInventoryPanel()
@@ -226,6 +225,11 @@ void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask)
 	getFilter()->setFilterPermissions(filter_perm_mask);
 }
 
+void LLInventoryPanel::setFilterWearableTypes(U64 types)
+{
+	getFilter()->setFilterWearableTypes(types);
+}
+
 void LLInventoryPanel::setFilterSubString(const std::string& string)
 {
 	getFilter()->setFilterSubString(string);
@@ -777,7 +781,6 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it
 			fv->startRenamingSelectedItem();
 		}
 	}
-	// Seraph - Put determineFolderType in here for ensemble typing?
 }
 
 void LLInventoryPanel::doToSelected(const LLSD& userdata)
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 67c89048686ed4add0a09017a287ad08f4f0b3cc..84603e8b4ffad8b479b50f95c628c68430d0e569 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -87,6 +87,7 @@ class LLInventoryPanel : public LLPanel
 		Optional<bool>						show_item_link_overlays;
 		Optional<Filter>					filter;
 		Optional<std::string>               start_folder;
+		Optional<bool>						use_label_suffix;
 
 		Params()
 		:	sort_order_setting("sort_order_setting"),
@@ -94,7 +95,8 @@ class LLInventoryPanel : public LLPanel
 			allow_multi_select("allow_multi_select", true),
 			show_item_link_overlays("show_item_link_overlays", false),
 			filter("filter"),
-			start_folder("start_folder")
+			start_folder("start_folder"),
+			use_label_suffix("use_label_suffix", true)
 		{}
 	};
 
@@ -103,6 +105,7 @@ class LLInventoryPanel : public LLPanel
 	//--------------------------------------------------------------------
 protected:
 	LLInventoryPanel(const Params&);
+	void initFromParams(const Params&);
 	friend class LLUICtrlFactory;
 public:
 	virtual ~LLInventoryPanel();
@@ -110,8 +113,6 @@ class LLInventoryPanel : public LLPanel
 public:
 	LLInventoryModel* getModel() { return mInventory; }
 
-	BOOL postBuild();
-
 	// LLView methods
 	void draw();
 	BOOL handleHover(S32 x, S32 y, MASK mask);
@@ -138,6 +139,7 @@ class LLInventoryPanel : public LLPanel
 	U32 getFilterObjectTypes() const { return mFolderRoot->getFilterObjectTypes(); }
 	void setFilterPermMask(PermissionMask filter_perm_mask);
 	U32 getFilterPermMask() const { return mFolderRoot->getFilterPermissions(); }
+	void setFilterWearableTypes(U64 filter);
 	void setFilterSubString(const std::string& string);
 	const std::string getFilterSubString() { return mFolderRoot->getFilterSubString(); }
 	void setSinceLogoff(BOOL sl);
diff --git a/indra/newview/lloutfitobserver.cpp b/indra/newview/lloutfitobserver.cpp
index efa01bade9a0f77ff12b67fcb491c7e7aae036c3..03414b996498ec4a5f14e31b7ca9f2e59a0a7da4 100644
--- a/indra/newview/lloutfitobserver.cpp
+++ b/indra/newview/lloutfitobserver.cpp
@@ -56,12 +56,9 @@ void LLOutfitObserver::changed(U32 mask)
 	if (!gInventory.isInventoryUsable())
 		return;
 
-	bool COF_changed = checkCOF();
+	checkCOF();
 
-	if (!COF_changed)
-	{
-		checkBaseOutfit();
-	}
+	checkBaseOutfit();
 }
 
 // static
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index 03df2d2b208e3021b990a732d81eddc8b4d2b078..de074d6aaf43ccad2becf2675cf77d27ce8123d5 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -278,9 +278,6 @@ void LLOutfitsList::refreshList(const LLUUID& category_id)
 		tab->setRightMouseDownCallback(boost::bind(&LLOutfitsList::onAccordionTabRightClick, this,
 			_1, _2, _3, cat_id));
 
-		tab->setDoubleClickCallback(boost::bind(&LLOutfitsList::onAccordionTabDoubleClick, this,
-			_1, _2, _3, cat_id));
-
 		// Setting tab focus callback to monitor currently selected outfit.
 		tab->setFocusReceivedCallback(boost::bind(&LLOutfitsList::changeOutfitSelection, this, list, cat_id));
 
@@ -632,18 +629,6 @@ void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const
 	}
 }
 
-void LLOutfitsList::onAccordionTabDoubleClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id)
-{
-	LLAccordionCtrlTab* tab = dynamic_cast<LLAccordionCtrlTab*>(ctrl);
-	if(is_tab_header_clicked(tab, y) && cat_id.notNull())
-	{
-		LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
-		if (!cat) return;
-
-		LLAppearanceMgr::instance().wearInventoryCategory( cat, FALSE, FALSE );
-	}
-}
-
 void LLOutfitsList::onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y)
 {
 	LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(ctrl);
diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h
index 478eaa50b3f479972bb105d0d5b89e835018d004..5605044f41a59f7f0417584b0b03067edc75804f 100644
--- a/indra/newview/lloutfitslist.h
+++ b/indra/newview/lloutfitslist.h
@@ -131,7 +131,6 @@ class LLOutfitsList : public LLPanel
 	void applyFilter(const std::string& new_filter_substring);
 
 	void onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id);
-	void onAccordionTabDoubleClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id);
 	void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y);
 	void onCOFChanged();
 
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index b356fe6bfdaf8b5fc69eab2eda5128e1a8e9e19e..26e8a932aa3c48b7cb96a4ca53991b84c1d7df33 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -815,6 +815,8 @@ void LLPanelGroupRolesSubTab::setGroupID(const LLUUID& id)
 	if(mRoleDescription) mRoleDescription->clear();
 	if(mRoleTitle) mRoleTitle->clear();
 
+	mHasRoleChange = FALSE;
+
 	setFooterEnabled(FALSE);
 
 	LLPanelGroupSubTab::setGroupID(id);
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 54d1b46016397b3a06fba87e41501a94419b1a7c..9eece8186156cce6e6833fb3f61b0dbaa5f441e7 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -604,7 +604,7 @@ void LLPanelMainInventory::toggleFindOptions()
 		finder->openFloater();
 
 		LLFloater* parent_floater = gFloaterView->getParentFloater(this);
-		if (parent_floater) // Seraph: Fix this, shouldn't be null even for sidepanel
+		if (parent_floater)
 			parent_floater->addDependentFloater(mFinderHandle);
 		// start background fetch of folders
 		LLInventoryModelBackgroundFetch::instance().start();
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index 5a068373f58102117bcc05d3277cda68ba53b2b9..82b72ac224de1119bc97f3d2dfb66a0564a9197d 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -84,6 +84,7 @@ class LLPanelMainInventory : public LLPanel, LLInventoryObserver
 	
 	void setSelectCallback(const LLFolderView::signal_t::slot_type& cb);
 
+	void onFilterEdit(const std::string& search_string );
 protected:
 	//
 	// Misc functions
@@ -98,7 +99,7 @@ class LLPanelMainInventory : public LLPanel, LLInventoryObserver
 	void onClearSearch();
 	static void onFoldersByName(void *user_data);
 	static BOOL checkFoldersByName(void *user_data);
-	void onFilterEdit(const std::string& search_string );
+	
 	static BOOL incrementalFind(LLFolderViewItem* first_item, const char *find_text, BOOL backward);
 	void onFilterSelected();
 
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index ad3a5c23804daff2e9ebf7df4654ca9745c9c655..da809b7baaaadeeecea1f0f1d30da7c07b3ab0d5 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -135,6 +135,8 @@ class LLTaskInvFVBridge : public LLFolderViewEventListener
 	virtual BOOL isUpToDate() const { return TRUE; }
 	virtual BOOL hasChildren() const { return FALSE; }
 	virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; }
+	virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; }
+
 	// LLDragAndDropBridge functionality
 	virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
 	virtual BOOL dragOrDrop(MASK mask, BOOL drop,
@@ -184,6 +186,7 @@ void LLTaskInvFVBridge::showProperties()
 		floater->setObjectID(mPanel->getTaskUUID());
 	}
 	*/
+	
 }
 
 struct LLBuyInvItemData
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 1454a2f6af70f00d8555ab9ad7c13e0223289c7c..8da7432e0a97347375457d60e906b73d7e4e8482 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -72,6 +72,8 @@
 #include "lltoggleablemenu.h"
 #include "llwearablelist.h"
 #include "llwearableitemslist.h"
+#include "llwearabletype.h"
+#include "llweb.h"
 
 static LLRegisterPanelClassWrapper<LLPanelOutfitEdit> t_outfit_edit("panel_outfit_edit");
 
@@ -81,6 +83,65 @@ const U64 ALL_ITEMS_MASK = WEARABLE_MASK | ATTACHMENT_MASK;
 
 static const std::string REVERT_BTN("revert_btn");
 
+class LLShopURLDispatcher
+{
+public:
+	std::string resolveURL(LLWearableType::EType wearable_type, ESex sex);
+	std::string resolveURL(LLAssetType::EType asset_type, ESex sex);
+};
+
+std::string LLShopURLDispatcher::resolveURL(LLWearableType::EType wearable_type, ESex sex)
+{
+	const std::string prefix = "MarketplaceURL";
+	const std::string sex_str = (sex == SEX_MALE) ? "Male" : "Female";
+	const std::string type_str = LLWearableType::getTypeName(wearable_type);
+
+	std::string setting_name = prefix;
+
+	switch (wearable_type)
+	{
+	case LLWearableType::WT_ALPHA:
+	case LLWearableType::WT_NONE:
+	case LLWearableType::WT_INVALID:	// just in case, this shouldn't happen
+	case LLWearableType::WT_COUNT:		// just in case, this shouldn't happen
+		break;
+
+	default:
+		setting_name += '_';
+		setting_name += type_str;
+		setting_name += sex_str;
+		break;
+	}
+
+	return gSavedSettings.getString(setting_name);
+}
+
+std::string LLShopURLDispatcher::resolveURL(LLAssetType::EType asset_type, ESex sex)
+{
+	const std::string prefix = "MarketplaceURL";
+	const std::string sex_str = (sex == SEX_MALE) ? "Male" : "Female";
+	const std::string type_str = LLAssetType::lookup(asset_type);
+
+	std::string setting_name = prefix;
+
+	switch (asset_type)
+	{
+	case LLAssetType::AT_CLOTHING:
+	case LLAssetType::AT_OBJECT:
+	case LLAssetType::AT_BODYPART:
+		setting_name += '_';
+		setting_name += type_str;
+		setting_name += sex_str;
+		break;
+
+	// to suppress warnings
+	default:
+		break;
+	}
+
+	return gSavedSettings.getString(setting_name);
+}
+
 class LLPanelOutfitEditGearMenu
 {
 public:
@@ -262,6 +323,7 @@ BOOL LLPanelOutfitEdit::postBuild()
 	childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL);
 	childSetCommitCallback("wearables_gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL);
 	childSetCommitCallback("gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL);
+	childSetCommitCallback("shop_btn", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL);
 
 	mCOFWearables = getChild<LLCOFWearables>("cof_wearables_list");
 	mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::filterWearablesBySelectedItem, this));
@@ -530,6 +592,46 @@ void LLPanelOutfitEdit::onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id
 	}
 }
 
+void LLPanelOutfitEdit::onShopButtonClicked()
+{
+	static LLShopURLDispatcher url_resolver;
+
+	std::string url;
+	std::vector<LLPanel*> selected_items;
+	mCOFWearables->getSelectedItems(selected_items);
+
+	ESex sex = gSavedSettings.getU32("AvatarSex") ? SEX_MALE : SEX_FEMALE;
+
+	if (selected_items.size() == 1)
+	{
+		LLWearableType::EType type = LLWearableType::WT_NONE;
+		LLPanel* item = selected_items.front();
+
+		// LLPanelDummyClothingListItem is lower then LLPanelInventoryListItemBase in hierarchy tree
+		if (LLPanelDummyClothingListItem* dummy_item = dynamic_cast<LLPanelDummyClothingListItem*>(item))
+		{
+			type = dummy_item->getWearableType();
+		}
+		else if (LLPanelInventoryListItemBase* real_item = dynamic_cast<LLPanelInventoryListItemBase*>(item))
+		{
+			type = real_item->getWearableType();
+		}
+
+		// WT_INVALID comes for attachments
+		if (type != LLWearableType::WT_INVALID)
+		{
+			url = url_resolver.resolveURL(type, sex);
+		}
+	}
+
+	if (url.empty())
+	{
+		url = url_resolver.resolveURL(mCOFWearables->getExpandedAccordionAssetType(), sex);
+	}
+
+	LLWeb::loadURLExternal(url);
+}
+
 void LLPanelOutfitEdit::onRemoveFromOutfitClicked(void)
 {
 	LLUUID id_to_remove = mCOFWearables->getSelectedUUID();
diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h
index 56c6c6d68020d6de832835216957bd0a064b666f..1705e3043b6abe1542d09b68bac73d53fde40660 100644
--- a/indra/newview/llpaneloutfitedit.h
+++ b/indra/newview/llpaneloutfitedit.h
@@ -163,6 +163,7 @@ class LLPanelOutfitEdit : public LLPanel
 	void onEditWearableClicked(void);
 	void onAddWearableClicked(void);
 	void onReplaceBodyPartMenuItemClicked(LLUUID selected_item_id);
+	void onShopButtonClicked();
 
 	void displayCurrentOutfit();
 	void updateCurrentOutfitName();
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 1157c40b39940778c874d04a0951deeb95d4767d..7e1bff09617d0710fff881c8a910727d75249277 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -86,7 +86,6 @@ class LLOutfitListGearMenu
 
 		registrar.add("Gear.Wear", boost::bind(&LLOutfitListGearMenu::onWear, this));
 		registrar.add("Gear.TakeOff", boost::bind(&LLOutfitListGearMenu::onTakeOff, this));
-		registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenu::onRename, this));
 		registrar.add("Gear.Delete", boost::bind(&LLOutfitListGearMenu::onDelete, this));
 		registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2));
 
@@ -159,15 +158,6 @@ class LLOutfitListGearMenu
 		}
 	}
 
-	void onRename()
-	{
-		const LLUUID& selected_outfit_id = getSelectedOutfitID();
-		if (selected_outfit_id.notNull())
-		{
-			LLAppearanceMgr::instance().renameOutfit(selected_outfit_id);
-		}
-	}
-
 	void onDelete()
 	{
 		const LLUUID& selected_outfit_id = getSelectedOutfitID();
@@ -197,11 +187,7 @@ class LLOutfitListGearMenu
 			return false;
 		}
 
-		if ("rename" == param)
-		{
-			return get_is_category_renameable(&gInventory, selected_outfit_id);
-		}
-		else if ("delete" == param)
+		if ("delete" == param)
 		{
 			return LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit_id);
 		}
@@ -245,6 +231,7 @@ LLPanelOutfitsInventory::LLPanelOutfitsInventory() :
 	mSavedFolderState = new LLSaveFolderState();
 	mSavedFolderState->setApply(FALSE);
 	gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this));
+	gAgentWearables.addLoadingStartedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoading, this));
 
 	LLOutfitObserver& observer = LLOutfitObserver::instance();
 	observer.addBOFChangedCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this));
@@ -382,7 +369,6 @@ void LLPanelOutfitsInventory::onWearButtonClick()
 	if (!isCOFPanelActive())
 	{
 		mMyOutfitsPanel->performAction("replaceoutfit");
-		setWearablesLoading(true);
 	}
 	else
 	{
@@ -854,6 +840,11 @@ void LLPanelOutfitsInventory::onWearablesLoaded()
 	setWearablesLoading(false);
 }
 
+void LLPanelOutfitsInventory::onWearablesLoading()
+{
+	setWearablesLoading(true);
+}
+
 // static
 LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP()
 {
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index d58ae554b04921d6a2c8a14b64a5cb71bba04924..863dc9dd7c2bb8010063a63f356bdd5d2e4a4a57 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -127,6 +127,7 @@ class LLPanelOutfitsInventory : public LLPanel
 	bool hasItemsSelected();
 	void setWearablesLoading(bool val);
 	void onWearablesLoaded();
+	void onWearablesLoading();
 private:
 	LLPanel*					mListCommands;
 	LLOutfitListGearMenu*		mGearMenu;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index f16d1d8fda659208e99fb0120c5630e9758cd2a5..6dd800c0c6a4612eb9c4f7d32859183d17847075 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1450,7 +1450,7 @@ void LLPanelPeople::showFriendsAccordionsIfNeeded()
 		LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion");
 		accordion->arrange();
 
-		// *TODO: new empty_accordion_text attribute was implemented in accordion (EXT-7368).
+		// *TODO: new no_matched_tabs_text attribute was implemented in accordion (EXT-7368).
 		// this code should be refactored to use it
 		// keep help text in a synchronization with accordions visibility.
 		updateFriendListHelpText();
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index 028440562d9175abdc0b71d0fdbf439388eeda0a..705b196ef1114661dbcce961f13ad0f333c5a21b 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -1038,7 +1038,7 @@ void LLPanelPlaces::showAddedLandmarkInfo(const uuid_vec_t& items)
 		 ++item_iter)
 	{
 		const LLUUID& item_id = (*item_iter);
-		if(!highlight_offered_item(item_id))
+		if(!highlight_offered_object(item_id))
 		{
 			continue;
 		}
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 494cba8c6f7d10e12ea0b664e4866695113dd0a0..1048e3fcc017876357eb94a89850bf34e9dae67e 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -648,16 +648,18 @@ void LLTeleportHistoryPanel::refresh()
 	LLDate tab_boundary_date =  LLDate::now();
 
 	LLFlatListView* curr_flat_view = NULL;
+	std::string filter_string = sFilterSubString;
+	LLStringUtil::toUpper(filter_string);
 
 	U32 added_items = 0;
 	while (mCurrentItem >= 0)
 	{
 		// Filtering
-		if (!sFilterSubString.empty())
+		if (!filter_string.empty())
 		{
 			std::string landmark_title(items[mCurrentItem].mTitle);
 			LLStringUtil::toUpper(landmark_title);
-			if( std::string::npos == landmark_title.find(sFilterSubString) )
+			if( std::string::npos == landmark_title.find(filter_string) )
 			{
 				mCurrentItem--;
 				continue;
@@ -706,7 +708,7 @@ void LLTeleportHistoryPanel::refresh()
 				.getFlatItemForPersistentItem(&mContextMenu,
 											  items[mCurrentItem],
 											  mCurrentItem,
-											  sFilterSubString);
+											  filter_string);
 			if ( !curr_flat_view->addItem(item, LLUUID::null, ADD_BOTTOM, false) )
 				llerrs << "Couldn't add flat item to teleport history." << llendl;
 			if (mLastSelectedItemIndex == mCurrentItem)
@@ -729,6 +731,8 @@ void LLTeleportHistoryPanel::refresh()
 		}
 	}
 
+	mHistoryAccordion->setFilterSubString(sFilterSubString);
+
 	mHistoryAccordion->arrange();
 
 	updateVerbs();
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index 445bde1206700c0adbf685cb2d637c959ad6bfd8..e2d4f5ad45a57b49014d14cd795979a442998ae7 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -83,6 +83,7 @@ LLSidepanelAppearance::LLSidepanelAppearance() :
 	mOpened(false)
 {
 	LLOutfitObserver& outfit_observer =  LLOutfitObserver::instance();
+	outfit_observer.addBOFReplacedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, ""));
 	outfit_observer.addBOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, ""));
 	outfit_observer.addCOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, ""));
 }
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index fc5143d33bddbe81e3e7ed7178ed4df6511c4258..63b6fe5ef0e4fcd2a0a7e967d9fe5cb35b19eec4 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -88,6 +88,8 @@ BOOL LLSidepanelInventory::postBuild()
 		
 		mPanelMainInventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
 		mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2));
+		LLTabContainer* tabs = mPanelMainInventory->getChild<LLTabContainer>("inventory filter tabs");
+		tabs->setCommitCallback(boost::bind(&LLSidepanelInventory::updateVerbs, this));
 
 		/* 
 		   EXT-4846 : "Can we suppress the "Landmarks" and "My Favorites" folder since they have their own Task Panel?"
diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h
index 2dc17e741d51d51d065ce81394a208f012008a25..13275d14c05a3bb096df824e05d88b40f67c8c2e 100644
--- a/indra/newview/llsidepanelinventory.h
+++ b/indra/newview/llsidepanelinventory.h
@@ -51,8 +51,13 @@ class LLSidepanelInventory : public LLPanel
 	/*virtual*/ void onOpen(const LLSD& key);
 
 	LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any.
+	LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; }
 	BOOL isMainInventoryPanelActive() const;
 
+	void showItemInfoPanel();
+	void showTaskInfoPanel();
+	void showInventoryPanel();
+
 protected:
 	// Tracks highlighted (selected) item in inventory panel.
 	LLInventoryItem *getSelectedItem();
@@ -62,9 +67,6 @@ class LLSidepanelInventory : public LLPanel
 	void performActionOnSelection(const std::string &action);
 	bool canShare();
 
-	void showItemInfoPanel();
-	void showTaskInfoPanel();
-	void showInventoryPanel();
 	void updateVerbs();
 
 	//
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index 9406f80b75b8f1be51620e743c4ef5cdde4bb8f1..fed39c362e48023e762a51e1fbb4f484d4a8551a 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -35,6 +35,7 @@
 #include "lltextbox.h"
 
 #include "llagentcamera.h"
+#include "llappviewer.h"
 #include "llbottomtray.h"
 #include "llsidetray.h"
 #include "llviewerwindow.h"
@@ -272,9 +273,18 @@ BOOL LLSideTray::postBuild()
 		collapseSideBar();
 
 	setMouseOpaque(false);
+
+	LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSideTray::handleLoginComplete, this));
+
 	return true;
 }
 
+void LLSideTray::handleLoginComplete()
+{
+	//reset tab to "home" tab if it was changesd during login process
+	selectTabByName("sidebar_home");
+}
+
 LLSideTrayTab* LLSideTray::getTab(const std::string& name)
 {
 	return getChild<LLSideTrayTab>(name,false);
diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h
index e176ff5affa6a3f9d157ed0aaf8246f35806c4de..3a8d3084258bd58227da24adbdd7fb93fbc283b2 100644
--- a/indra/newview/llsidetray.h
+++ b/indra/newview/llsidetray.h
@@ -161,6 +161,8 @@ class LLSideTray : public LLPanel, private LLDestroyClass<LLSideTray>
 
 	commit_signal_t& getCollapseSignal() { return mCollapseSignal; }
 
+	void		handleLoginComplete();
+
 protected:
 	LLSideTrayTab* getTab		(const std::string& name);
 
diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp
index ff7e479368a6a5ace6f0f8ff46e3dd99aa9666a9..0df7035f849d1ca2df01832e3524329c4a87e6d4 100644
--- a/indra/newview/llslurl.cpp
+++ b/indra/newview/llslurl.cpp
@@ -48,8 +48,9 @@ const char* LLSLURL::SLURL_COM		         = "slurl.com";
 // text with www.slurl.com or a link explicitly pointing at www.slurl.com so testing for this
 // version is required also.
 
-const char* LLSLURL::WWW_SLURL_COM		 = "www.slurl.com";
-const char* LLSLURL::MAPS_SECONDLIFE_COM	 = "maps.secondlife.com";	
+const char* LLSLURL::WWW_SLURL_COM				 = "www.slurl.com";
+const char* LLSLURL::SECONDLIFE_COM				 = "secondlife.com";
+const char* LLSLURL::MAPS_SECONDLIFE_COM		 = "maps.secondlife.com";
 const char* LLSLURL::SLURL_X_GRID_LOCATION_INFO_SCHEME = "x-grid-location-info";
 const char* LLSLURL::SLURL_APP_PATH              = "app";
 const char* LLSLURL::SLURL_REGION_PATH           = "region";
@@ -187,6 +188,15 @@ LLSLURL::LLSLURL(const std::string& slurl)
 		   (slurl_uri.scheme() == LLSLURL::SLURL_HTTPS_SCHEME) || 
 		   (slurl_uri.scheme() == LLSLURL::SLURL_X_GRID_LOCATION_INFO_SCHEME))
 		{
+			// *HACK: ignore http://secondlife.com/ URLs so that we can use
+			// http://secondlife.com/app/ redirect URLs
+			// This is only necessary while the server returns Release Note
+			// urls using this format rather that pointing to the wiki
+			if ((slurl_uri.scheme() == LLSLURL::SLURL_HTTP_SCHEME ||
+				 slurl_uri.scheme() == LLSLURL::SLURL_HTTPS_SCHEME) &&
+				slurl_uri.hostName() == LLSLURL::SECONDLIFE_COM)
+			  return;
+
 		    // We're dealing with either a Standalone style slurl or slurl.com slurl
 		  if ((slurl_uri.hostName() == LLSLURL::SLURL_COM) ||
 		      (slurl_uri.hostName() == LLSLURL::WWW_SLURL_COM) || 
diff --git a/indra/newview/llslurl.h b/indra/newview/llslurl.h
index 1210c398f17e4ad4e6976c5b16bd2c97f4df70d1..e9b0e7f52a3527dcfc2f7d38316c354ec268f6f2 100644
--- a/indra/newview/llslurl.h
+++ b/indra/newview/llslurl.h
@@ -47,6 +47,7 @@ class LLSLURL
 	static const char* SLURL_SECONDLIFE_PATH;
 	static const char* SLURL_COM;
 	static const char* WWW_SLURL_COM;
+	static const char* SECONDLIFE_COM;
 	static const char* MAPS_SECONDLIFE_COM;
 	static const char* SLURL_X_GRID_LOCATION_INFO_SCHEME;
 	static LLSLURL START_LOCATION;
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index dbfb0ec4aba75c814118651f2ac24d2afa5be285..c33213a05831c38145ded919a98f232235ba01de 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2494,8 +2494,7 @@ void LLStartUp::saveInitialOutfit()
 	{
 		sWearablesLoadedCon.disconnect();
 	}
-
-	LLAppearanceMgr::getInstance()->makeNewOutfitLinks(sInitialOutfit);
+	LLAppearanceMgr::getInstance()->makeNewOutfitLinks(sInitialOutfit,false);
 }
 
 std::string& LLStartUp::getInitialOutfitName()
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index ac419d8dc7d983818862b4728375e7b0d3914b30..8c8fbdc88ccd9fb0fc81e18e14c4ee9ebf565286 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -371,8 +371,7 @@ void LLStatusBar::refresh()
 void LLStatusBar::setVisibleForMouselook(bool visible)
 {
 	mTextTime->setVisible(visible);
-	getChild<LLUICtrl>("buycurrency")->setVisible(visible);
-	getChild<LLUICtrl>("buyL")->setVisible(visible);
+	getChild<LLUICtrl>("balance_bg")->setVisible(visible);
 	mBtnVolume->setVisible(visible);
 	mMediaToggle->setVisible(visible);
 	mSGBandwidth->setVisible(visible);
diff --git a/indra/newview/lltexglobalcolor.cpp b/indra/newview/lltexglobalcolor.cpp
index d7840fb4355b337fbc352344a5800acb65aaf3b0..347f8bf627487c0bc414b86d71e2139eb37d9c67 100644
--- a/indra/newview/lltexglobalcolor.cpp
+++ b/indra/newview/lltexglobalcolor.cpp
@@ -1,6 +1,6 @@
 /** 
  * @file lltexlayerglobalcolor.cpp
- * @brief SERAPH - ADD IN
+ * @brief Color for texture layers.
  *
  * $LicenseInfo:firstyear=2008&license=viewergpl$
  * 
diff --git a/indra/newview/lltexlayerparams.cpp b/indra/newview/lltexlayerparams.cpp
index 35acf883c7f6198c59cff62e1c5b6e33223b411d..f2d1b5d032f78f97b6efab718edd912bde701609 100644
--- a/indra/newview/lltexlayerparams.cpp
+++ b/indra/newview/lltexlayerparams.cpp
@@ -1,6 +1,6 @@
 /** 
  * @file lltexlayerparams.cpp
- * @brief SERAPH - ADD IN
+ * @brief Texture layer parameters
  *
  * $LicenseInfo:firstyear=2002&license=viewergpl$
  * 
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 52d227f82796d20296d8f732f72590e972291bf6..ceed90e21018087b8aa6f846fe1a4b3214436ef5 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -582,14 +582,26 @@ bool LLTextureFetchWorker::doWork(S32 param)
 {
 	LLMutexLock lock(&mWorkMutex);
 
-	if ((mFetcher->isQuitting() || mImagePriority < 1.0f || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED)))
+	if ((mFetcher->isQuitting() || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED)))
 	{
 		if (mState < DECODE_IMAGE)
 		{
 			return true; // abort
 		}
 	}
-	
+	if(mImagePriority < 1.0f)
+	{
+		if (mState == INIT || mState == LOAD_FROM_NETWORK || mState == LOAD_FROM_SIMULATOR)
+		{
+			return true; // abort
+		}
+	}
+	if(mState > CACHE_POST && !mCanUseNET && !mCanUseHTTP)
+	{
+		//nowhere to get data, abort.
+		return true ;
+	}
+
 	if (mFetcher->mDebugPause)
 	{
 		return false; // debug: don't do any work
@@ -777,7 +789,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
 			}
 			// don't return, fall through to next state
 		}
-		else if (mSentRequest == UNSENT)
+		else if (mSentRequest == UNSENT && mCanUseNET)
 		{
 			// Add this to the network queue and sit here.
 			// LLTextureFetch::update() will send off a request which will change our state
@@ -830,6 +842,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
 	
 	if (mState == SEND_HTTP_REQ)
 	{
+		if(mCanUseHTTP)
 		{
 			const S32 HTTP_QUEUE_MAX_SIZE = 8;
 			// *TODO: Integrate this with llviewerthrottle
@@ -895,6 +908,10 @@ bool LLTextureFetchWorker::doWork(S32 param)
 			}
 			// fall through
 		}
+		else //can not use http fetch.
+		{
+			return true ; //abort
+		}
 	}
 	
 	if (mState == WAIT_HTTP_REQ)
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 3482ac508ed9940035f47734e1e0317d78477bb4..ab6ff880738d2f936996071d1ceeab265f218134 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -597,7 +597,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 
 		LLPipeline::sFastAlpha = gSavedSettings.getBOOL("RenderFastAlpha");
 		LLPipeline::sUseFarClip = gSavedSettings.getBOOL("RenderUseFarClip");
-		LLVOAvatar::sMaxVisible = gSavedSettings.getS32("RenderAvatarMaxVisible");
+		LLVOAvatar::sMaxVisible = (U32)gSavedSettings.getS32("RenderAvatarMaxVisible");
 		LLPipeline::sDelayVBUpdate = gSavedSettings.getBOOL("RenderDelayVBUpdate");
 
 		S32 occlusion = LLPipeline::sUseOcclusion;
@@ -699,8 +699,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 		// Doing this here gives hardware occlusion queries extra time to complete
 		LLAppViewer::instance()->pingMainloopTimeout("Display:UpdateImages");
 		LLError::LLCallStacks::clear() ;
-		llpushcallstacks ;
-
+		
 		{
 			LLMemType mt_iu(LLMemType::MTYPE_DISPLAY_IMAGE_UPDATE);
 			LLFastTimer t(FTM_IMAGE_UPDATE);
@@ -718,7 +717,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 			LLImageGL::deleteDeadTextures();
 			stop_glerror();
 		}
-		llpushcallstacks ;
 		///////////////////////////////////
 		//
 		// StateSort
diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp
index 56b5d7467c7a4f34cf1fbfbdf984f2855686bfe1..3105a6ec437063c21fd113f2bbf45654f9a66ede 100644
--- a/indra/newview/llviewerfoldertype.cpp
+++ b/indra/newview/llviewerfoldertype.cpp
@@ -110,8 +110,6 @@ class LLViewerFolderDictionary : public LLSingleton<LLViewerFolderDictionary>,
 
 LLViewerFolderDictionary::LLViewerFolderDictionary()
 {
-	initEnsemblesFromFile();
-
 	//       													    	  NEW CATEGORY NAME         FOLDER OPEN             FOLDER CLOSED          QUIET?
 	//      												  		     |-------------------------|-----------------------|----------------------|-----------|
 	addEntry(LLFolderType::FT_TEXTURE, 				new ViewerFolderEntry("Textures",				"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
@@ -137,6 +135,15 @@ LLViewerFolderDictionary::LLViewerFolderDictionary()
 	addEntry(LLFolderType::FT_INBOX, 				new ViewerFolderEntry("Inbox",					"Inv_SysOpen",			"Inv_SysClosed",		FALSE));
 		 
 	addEntry(LLFolderType::FT_NONE, 				new ViewerFolderEntry("New Folder",				"Inv_FolderOpen",		"Inv_FolderClosed",		FALSE, "default"));
+
+#if SUPPORT_ENSEMBLES
+	initEnsemblesFromFile();
+#else
+	for (U32 type = (U32)LLFolderType::FT_ENSEMBLE_START; type <= (U32)LLFolderType::FT_ENSEMBLE_END; ++type)
+	{
+		addEntry((LLFolderType::EType)type, 		new ViewerFolderEntry("New Folder",				"Inv_FolderOpen",		"Inv_FolderClosed",		FALSE));
+	}	
+#endif
 }
 
 bool LLViewerFolderDictionary::initEnsemblesFromFile()
@@ -231,6 +238,15 @@ const std::string &LLViewerFolderType::lookupIconName(LLFolderType::EType folder
 		else
 			return entry->mIconNameClosed;
 	}
+	
+	// Error condition.  Return something so that we don't show a grey box in inventory view.
+	const ViewerFolderEntry *default_entry = LLViewerFolderDictionary::getInstance()->lookup(LLFolderType::FT_NONE);
+	if (default_entry)
+	{
+		return default_entry->mIconNameClosed;
+	}
+	
+	// Should not get here unless there's something corrupted with the FT_NONE entry.
 	return badLookup();
 }
 
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 14e58f416766c75c2d60974e98e78021012f23ab..d7190f26a36e1da5bacc642a50793b1467cb04e8 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1776,29 +1776,22 @@ void LLViewerMediaImpl::loadURI()
 		llinfos << "Asking media source to load URI: " << uri << llendl;
 		
 		mMediaSource->loadURI( uri );
-
+		
+		// A non-zero mPreviousMediaTime means that either this media was previously unloaded by the priority code while playing/paused, 
+		// or a seek happened before the media loaded.  In either case, seek to the saved time.
+		if(mPreviousMediaTime != 0.0f)
+		{
+			seek(mPreviousMediaTime);
+		}
+			
 		if(mPreviousMediaState == MEDIA_PLAYING)
 		{
 			// This media was playing before this instance was unloaded.
-
-			if(mPreviousMediaTime != 0.0f)
-			{
-				// Seek back to where we left off, if possible.
-				seek(mPreviousMediaTime);
-			}
-			
 			start();
 		}
 		else if(mPreviousMediaState == MEDIA_PAUSED)
 		{
 			// This media was paused before this instance was unloaded.
-
-			if(mPreviousMediaTime != 0.0f)
-			{
-				// Seek back to where we left off, if possible.
-				seek(mPreviousMediaTime);
-			}
-			
 			pause();
 		}
 		else
@@ -1857,6 +1850,10 @@ void LLViewerMediaImpl::pause()
 	{
 		mMediaSource->pause();
 	}
+	else
+	{
+		mPreviousMediaState = MEDIA_PAUSED;
+	}
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -1866,6 +1863,10 @@ void LLViewerMediaImpl::start()
 	{
 		mMediaSource->start();
 	}
+	else
+	{
+		mPreviousMediaState = MEDIA_PLAYING;
+	}
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -1875,6 +1876,11 @@ void LLViewerMediaImpl::seek(F32 time)
 	{
 		mMediaSource->seek(time);
 	}
+	else
+	{
+		// Save the seek time to be set when the media is loaded.
+		mPreviousMediaTime = time;
+	}
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 5570fe5fec76133dd3ba8fd2fc467a09d6c17214..f741e1bc10c1626ee84520283c5195422d83f0bb 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -318,11 +318,13 @@ class LLFileUploadBulk : public view_listener_t
 			LLStringUtil::trim(asset_name);
 			
 			std::string display_name = LLStringUtil::null;
+			LLAssetStorage::LLStoreAssetCallback callback = NULL;
 			S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
-			upload_new_resource(filename, asset_name, asset_name, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
+			void *userdata = NULL;
+			upload_new_resource(filename, asset_name, asset_name, 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
 				LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
 					    display_name,
-					    NULL, expected_upload_cost);
+					    callback, expected_upload_cost, userdata);
 
 			// *NOTE: Ew, we don't iterate over the file list here,
 			// we handle the next files in upload_done_callback()
@@ -478,15 +480,16 @@ void handle_compress_image(void*)
 }
 
 void upload_new_resource(const std::string& src_filename, std::string name,
-			 std::string desc,
+			 std::string desc, S32 compression_info,
 			 LLFolderType::EType destination_folder_type,
 			 LLInventoryType::EType inv_type,
 			 U32 next_owner_perms,
 			 U32 group_perms,
 			 U32 everyone_perms,
 			 const std::string& display_name,
-			 boost::function<void(const LLUUID& uuid)> callback,
-			 S32 expected_upload_cost)
+			 LLAssetStorage::LLStoreAssetCallback callback,
+			 S32 expected_upload_cost,
+			 void *userdata)
 {	
 	// Generate the temporary UUID.
 	std::string filename = gDirUtilp->getTempFilename();
@@ -768,9 +771,9 @@ void upload_new_resource(const std::string& src_filename, std::string name,
 		{
 			t_disp_name = src_filename;
 		}
-		upload_new_resource(tid, asset_type, name, desc,
+		upload_new_resource(tid, asset_type, name, desc, compression_info, // tid
 				    destination_folder_type, inv_type, next_owner_perms, group_perms, everyone_perms,
-				    display_name, callback, expected_upload_cost);
+				    display_name, callback, expected_upload_cost, userdata);
 	}
 	else
 	{
@@ -889,28 +892,30 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt
 		LLStringUtil::trim(asset_name);
 
 		std::string display_name = LLStringUtil::null;
+		LLAssetStorage::LLStoreAssetCallback callback = NULL;
+		void *userdata = NULL;
 		upload_new_resource(next_file, asset_name, asset_name,	// file
-				    LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
+				    0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
 				    PERM_NONE, PERM_NONE, PERM_NONE,
 				    display_name,
-				    NULL,
-				    expected_upload_cost); // assuming next in a group of uploads is of roughly the same type, i.e. same upload cost
-				
+				    callback,
+				    expected_upload_cost, // assuming next in a group of uploads is of roughly the same type, i.e. same upload cost
+				    userdata);
 	}
 }
 
-void upload_new_resource(const LLTransactionID &tid, 
-			 LLAssetType::EType asset_type,
+void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_type,
 			 std::string name,
-			 std::string desc, 
+			 std::string desc, S32 compression_info,
 			 LLFolderType::EType destination_folder_type,
 			 LLInventoryType::EType inv_type,
 			 U32 next_owner_perms,
 			 U32 group_perms,
 			 U32 everyone_perms,
 			 const std::string& display_name,
-			 boost::function<void(const LLUUID& uuid)> callback,
-			 S32 expected_upload_cost)
+			 LLAssetStorage::LLStoreAssetCallback callback,
+			 S32 expected_upload_cost,
+			 void *userdata)
 {
 	if(gDisconnected)
 	{
@@ -954,26 +959,79 @@ void upload_new_resource(const LLTransactionID &tid,
 	upload_message.append(display_name);
 	LLUploadDialog::modalUploadDialog(upload_message);
 
+	llinfos << "*** Uploading: " << llendl;
+	llinfos << "Type: " << LLAssetType::lookup(asset_type) << llendl;
+	llinfos << "UUID: " << uuid << llendl;
+	llinfos << "Name: " << name << llendl;
+	llinfos << "Desc: " << desc << llendl;
+	llinfos << "Expected Upload Cost: " << expected_upload_cost << llendl;
+	lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type) << llendl;
+	lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl;
 	std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory");
-	
-	if (url.empty()) {
-		llwarns << "Could not get NewFileAgentInventory capability" << llendl;
-		return;
-	}
+	if (!url.empty())
+	{
+		llinfos << "New Agent Inventory via capability" << llendl;
+		LLSD body;
+		body["folder_id"] = gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type);
+		body["asset_type"] = LLAssetType::lookup(asset_type);
+		body["inventory_type"] = LLInventoryType::lookup(inv_type);
+		body["name"] = name;
+		body["description"] = desc;
+		body["next_owner_mask"] = LLSD::Integer(next_owner_perms);
+		body["group_mask"] = LLSD::Integer(group_perms);
+		body["everyone_mask"] = LLSD::Integer(everyone_perms);
+		body["expected_upload_cost"] = LLSD::Integer(expected_upload_cost);
+		
+		//std::ostringstream llsdxml;
+		//LLSDSerialize::toPrettyXML(body, llsdxml);
+		//llinfos << "posting body to capability: " << llsdxml.str() << llendl;
 
-	llinfos << "New Agent Inventory via capability" << llendl;
-	LLSD body;
-	body["folder_id"] = gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type);
-	body["asset_type"] = LLAssetType::lookup(asset_type);
-	body["inventory_type"] = LLInventoryType::lookup(inv_type);
-	body["name"] = name;
-	body["description"] = desc;
-	body["next_owner_mask"] = LLSD::Integer(next_owner_perms);
-	body["group_mask"] = LLSD::Integer(group_perms);
-	body["everyone_mask"] = LLSD::Integer(everyone_perms);
-	body["expected_upload_cost"] = LLSD::Integer(expected_upload_cost);
+		LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type));
+	}
+	else
+	{
+		llinfos << "NewAgentInventory capability not found, new agent inventory via asset system." << llendl;
+		// check for adequate funds
+		// TODO: do this check on the sim
+		if (LLAssetType::AT_SOUND == asset_type ||
+			LLAssetType::AT_TEXTURE == asset_type ||
+			LLAssetType::AT_ANIMATION == asset_type)
+		{
+			S32 balance = gStatusBar->getBalance();
+			if (balance < expected_upload_cost)
+			{
+				LLStringUtil::format_map_t args;
+				args["NAME"] = name;
+				args["AMOUNT"] = llformat("%d", expected_upload_cost);
+				// insufficient funds, bail on this upload
+				LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("UploadingCosts", args), expected_upload_cost );
+				return;
+			}
+		}
 
-	LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type, callback));
+		LLResourceData* data = new LLResourceData;
+		data->mAssetInfo.mTransactionID = tid;
+		data->mAssetInfo.mUuid = uuid;
+		data->mAssetInfo.mType = asset_type;
+		data->mAssetInfo.mCreatorID = gAgentID;
+		data->mInventoryType = inv_type;
+		data->mNextOwnerPerm = next_owner_perms;
+		data->mExpectedUploadCost = expected_upload_cost;
+		data->mUserData = userdata;
+		data->mAssetInfo.setName(name);
+		data->mAssetInfo.setDescription(desc);
+		data->mPreferredLocation = destination_folder_type;
+
+		LLAssetStorage::LLStoreAssetCallback asset_callback = &upload_done_callback;
+		if (callback)
+		{
+			asset_callback = callback;
+		}
+		gAssetStorage->storeAssetData(data->mAssetInfo.mTransactionID, data->mAssetInfo.mType,
+										asset_callback,
+										(void*)data,
+										FALSE);
+	}
 }
 
 void init_menu_file()
diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h
index 33f8243ac0db1c00fe91118823c23b9e1a475392..1e6d13f1c62cbffdeb2706b59fd79ea6c464afc8 100644
--- a/indra/newview/llviewermenufile.h
+++ b/indra/newview/llviewermenufile.h
@@ -34,35 +34,41 @@
 #define LLVIEWERMENUFILE_H
 
 #include "llfoldertype.h"
+#include "llassetstorage.h"
 #include "llinventorytype.h"
 
 class LLTransactionID;
 
+
 void init_menu_file();
 
 void upload_new_resource(const std::string& src_filename, 
 			 std::string name,
 			 std::string desc, 
+			 S32 compression_info,
 			 LLFolderType::EType destination_folder_type,
 			 LLInventoryType::EType inv_type,
 			 U32 next_owner_perms,
 			 U32 group_perms,
 			 U32 everyone_perms,
 			 const std::string& display_name,
-			 boost::function<void(const LLUUID& uuid)> callback,
-			 S32 expected_upload_cost);
+			 LLAssetStorage::LLStoreAssetCallback callback,
+			 S32 expected_upload_cost,
+			 void *userdata);
 
 void upload_new_resource(const LLTransactionID &tid, 
 			 LLAssetType::EType type,
 			 std::string name,
 			 std::string desc, 
+			 S32 compression_info,
 			 LLFolderType::EType destination_folder_type,
 			 LLInventoryType::EType inv_type,
 			 U32 next_owner_perms,
 			 U32 group_perms,
 			 U32 everyone_perms,
 			 const std::string& display_name,
-			 boost::function<void(const LLUUID& uuid)> callback,
-			 S32 expected_upload_cost);
+			 LLAssetStorage::LLStoreAssetCallback callback,
+			 S32 expected_upload_cost,
+			 void *userdata);
 
 #endif
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 3d107555bf7ce886c58d924dec505e06c0c9cb3a..d81fa5ee1cffce335531fe5a59985241533be3f4 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -702,7 +702,7 @@ static void highlight_inventory_items_in_panel(const std::vector<LLUUID>& items,
 		++item_iter)
 	{
 		const LLUUID& item_id = (*item_iter);
-		if(!highlight_offered_item(item_id))
+		if(!highlight_offered_object(item_id))
 		{
 			continue;
 		}
@@ -753,6 +753,18 @@ class LLOpenAgentOffer : public LLInventoryFetchItemsObserver
 					 const std::string& from_name) : 
 		LLInventoryFetchItemsObserver(object_id),
 		mFromName(from_name) {}
+	/*virtual*/ void startFetch()
+	{
+		for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it)
+		{
+			LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
+			if (cat)
+			{
+				mComplete.push_back((*it));
+			}
+		}
+		LLInventoryFetchItemsObserver::startFetch();
+	}
 	/*virtual*/ void done()
 	{
 		open_inventory_offer(mComplete, mFromName);
@@ -1065,111 +1077,119 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
 	}
 }
  
-void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name)
+void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name)
 {
-	for (uuid_vec_t::const_iterator item_iter = items.begin();
-		 item_iter != items.end();
-		 ++item_iter)
+	for (uuid_vec_t::const_iterator obj_iter = objects.begin();
+		 obj_iter != objects.end();
+		 ++obj_iter)
 	{
-		const LLUUID& item_id = (*item_iter);
-		if(!highlight_offered_item(item_id))
+		const LLUUID& obj_id = (*obj_iter);
+		if(!highlight_offered_object(obj_id))
 		{
 			continue;
 		}
 
-		LLInventoryItem* item = gInventory.getItem(item_id);
-		llassert(item);
-		if (!item) {
+		const LLInventoryObject *obj = gInventory.getObject(obj_id);
+		if (!obj)
+		{
+			llwarns << "Cannot find object [ itemID:" << obj_id << " ] to open." << llendl;
 			continue;
 		}
 
-		////////////////////////////////////////////////////////////////////////////////
-		// Special handling for various types.
-		const LLAssetType::EType asset_type = item->getActualType();
-		if (check_offer_throttle(from_name, false)) // If we are throttled, don't display
-		{
-			LL_DEBUGS("Messaging") << "Highlighting inventory item: " << item->getUUID()  << LL_ENDL;
-			// If we opened this ourselves, focus it
-			const BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO;
-			switch(asset_type)
+		const LLAssetType::EType asset_type = obj->getActualType();
+
+		// Either an inventory item or a category.
+		const LLInventoryItem* item = dynamic_cast<const LLInventoryItem*>(obj);
+		if (item)
+		{
+			////////////////////////////////////////////////////////////////////////////////
+			// Special handling for various types.
+			if (check_offer_throttle(from_name, false)) // If we are throttled, don't display
 			{
-			  case LLAssetType::AT_NOTECARD:
-			  {
-				  LLFloaterReg::showInstance("preview_notecard", LLSD(item_id), take_focus);
-				  break;
-			  }
-			  case LLAssetType::AT_LANDMARK:
-			  	{
-					LLInventoryCategory* parent_folder = gInventory.getCategory(item->getParentUUID());
-					if ("inventory_handler" == from_name)
+				LL_DEBUGS("Messaging") << "Highlighting inventory item: " << item->getUUID()  << LL_ENDL;
+				// If we opened this ourselves, focus it
+				const BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO;
+				switch(asset_type)
+				{
+					case LLAssetType::AT_NOTECARD:
 					{
-						//we have to filter inventory_handler messages to avoid notification displaying
-						LLSideTray::getInstance()->showPanel("panel_places",
-								LLSD().with("type", "landmark").with("id", item->getUUID()));
+						LLFloaterReg::showInstance("preview_notecard", LLSD(obj_id), take_focus);
+						break;
 					}
-					else if("group_offer" == from_name)
+					case LLAssetType::AT_LANDMARK:
 					{
-						// "group_offer" is passed by LLOpenTaskGroupOffer
-						// Notification about added landmark will be generated under the "from_name.empty()" called from LLOpenTaskOffer::done().
-						LLSD args;
-						args["type"] = "landmark";
-						args["id"] = item_id;
-						LLSideTray::getInstance()->showPanel("panel_places", args);
-
-						continue;
+						LLInventoryCategory* parent_folder = gInventory.getCategory(item->getParentUUID());
+						if ("inventory_handler" == from_name)
+						{
+							//we have to filter inventory_handler messages to avoid notification displaying
+							LLSideTray::getInstance()->showPanel("panel_places",
+																 LLSD().with("type", "landmark").with("id", item->getUUID()));
+						}
+						else if("group_offer" == from_name)
+						{
+							// "group_offer" is passed by LLOpenTaskGroupOffer
+							// Notification about added landmark will be generated under the "from_name.empty()" called from LLOpenTaskOffer::done().
+							LLSD args;
+							args["type"] = "landmark";
+							args["id"] = obj_id;
+							LLSideTray::getInstance()->showPanel("panel_places", args);
+
+							continue;
+						}
+						else if(from_name.empty())
+						{
+							// we receive a message from LLOpenTaskOffer, it mean that new landmark has been added.
+							LLSD args;
+							args["LANDMARK_NAME"] = item->getName();
+							args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unknown");
+							LLNotificationsUtil::add("LandmarkCreated", args);
+						}
 					}
-					else if(from_name.empty())
+					break;
+					case LLAssetType::AT_TEXTURE:
 					{
-						// we receive a message from LLOpenTaskOffer, it mean that new landmark has been added.
-						LLSD args;
-						args["LANDMARK_NAME"] = item->getName();
-						args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unknown");
-						LLNotificationsUtil::add("LandmarkCreated", args);
+						LLFloaterReg::showInstance("preview_texture", LLSD(obj_id), take_focus);
+						break;
 					}
+					case LLAssetType::AT_ANIMATION:
+						LLFloaterReg::showInstance("preview_anim", LLSD(obj_id), take_focus);
+						break;
+					case LLAssetType::AT_SCRIPT:
+						LLFloaterReg::showInstance("preview_script", LLSD(obj_id), take_focus);
+						break;
+					case LLAssetType::AT_SOUND:
+						LLFloaterReg::showInstance("preview_sound", LLSD(obj_id), take_focus);
+						break;
+					default:
+						break;
 				}
-				break;
-			  case LLAssetType::AT_TEXTURE:
-			  {
-				  LLFloaterReg::showInstance("preview_texture", LLSD(item_id), take_focus);
-				  break;
-			  }
-			  case LLAssetType::AT_ANIMATION:
-				  LLFloaterReg::showInstance("preview_anim", LLSD(item_id), take_focus);
-				  break;
-			  case LLAssetType::AT_SCRIPT:
-				  LLFloaterReg::showInstance("preview_script", LLSD(item_id), take_focus);
-				  break;
-			  case LLAssetType::AT_SOUND:
-				  LLFloaterReg::showInstance("preview_sound", LLSD(item_id), take_focus);
-				  break;
-			  default:
-				break;
 			}
 		}
-		
+
 		////////////////////////////////////////////////////////////////////////////////
 		// Highlight item if it's not in the trash, lost+found, or COF
-		const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") &&
+		const BOOL auto_open = 
+			gSavedSettings.getBOOL("ShowInInventory") &&
 			(asset_type != LLAssetType::AT_CALLINGCARD) &&
-			(item->getInventoryType() != LLInventoryType::IT_ATTACHMENT) &&
+			!(item && item->getInventoryType() != LLInventoryType::IT_ATTACHMENT) &&
 			!from_name.empty();
 		LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open);
 		if(active_panel)
 		{
-			LL_DEBUGS("Messaging") << "Highlighting" << item_id  << LL_ENDL;
+			LL_DEBUGS("Messaging") << "Highlighting" << obj_id  << LL_ENDL;
 			LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
-			active_panel->setSelection(item_id, TAKE_FOCUS_NO);
+			active_panel->setSelection(obj_id, TAKE_FOCUS_NO);
 			gFocusMgr.setKeyboardFocus(focus_ctrl);
 		}
 	}
 }
 
-bool highlight_offered_item(const LLUUID& item_id)
+bool highlight_offered_object(const LLUUID& obj_id)
 {
-	LLInventoryItem* item = gInventory.getItem(item_id);
-	if(!item)
+	const LLInventoryObject* obj = gInventory.getObject(obj_id);
+	if(!obj)
 	{
-		LL_WARNS("Messaging") << "Unable to show inventory item: " << item_id << LL_ENDL;
+		LL_WARNS("Messaging") << "Unable to show inventory item: " << obj_id << LL_ENDL;
 		return false;
 	}
 
@@ -1178,7 +1198,7 @@ bool highlight_offered_item(const LLUUID& item_id)
 	// notification (e.g. trash, cof, lost-and-found).
 	if(!gAgent.getAFK())
 	{
-		const LLViewerInventoryCategory *parent = gInventory.getFirstNondefaultParent(item_id);
+		const LLViewerInventoryCategory *parent = gInventory.getFirstNondefaultParent(obj_id);
 		if (parent)
 		{
 			const LLFolderType::EType parent_type = parent->getPreferredType();
diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h
index 72ad3c8926085d878fe11afdb7addc2deeb04900..eca253ee036cacc39a6bff6c2306b5de7575fe85 100644
--- a/indra/newview/llviewermessage.h
+++ b/indra/newview/llviewermessage.h
@@ -207,7 +207,7 @@ void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name)
 // Returns true if item is not in certain "quiet" folder which don't need UI
 // notification (e.g. trash, cof, lost-and-found) and agent is not AFK, false otherwise.
 // Returns false if item is not found.
-bool highlight_offered_item(const LLUUID& item_id);
+bool highlight_offered_object(const LLUUID& obj_id);
 
 void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder_uuid);
 
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index ebc42aa5d2827b60f76a84c0ddf06d9a41d9cae8..c9c0b72528dfa904e46e9544c9f43b441fa43558 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2426,7 +2426,7 @@ void LLViewerWindow::updateUI()
 	LLLayoutStack::updateClass();
 
 	// use full window for world view when not rendering UI
-	bool world_view_uses_full_window = !gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI);
+	bool world_view_uses_full_window = gAgentCamera.cameraMouselook() || !gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI);
 	updateWorldViewRect(world_view_uses_full_window);
 
 	LLView::sMouseHandlerMessage.clear();
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 3e93dc1a9027e79ed93ede69d7a8d758244db676..179002d2a869b36f584155ece87c7d89f6adbea0 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -595,7 +595,7 @@ LLVOAvatarSkeletonInfo* LLVOAvatar::sAvatarSkeletonInfo = NULL;
 LLVOAvatar::LLVOAvatarXmlInfo* LLVOAvatar::sAvatarXmlInfo = NULL;
 LLVOAvatarDictionary *LLVOAvatar::sAvatarDictionary = NULL;
 S32 LLVOAvatar::sFreezeCounter = 0;
-S32 LLVOAvatar::sMaxVisible = 50;
+U32 LLVOAvatar::sMaxVisible = 12;
 F32 LLVOAvatar::sRenderDistance = 256.f;
 S32	LLVOAvatar::sNumVisibleAvatars = 0;
 S32	LLVOAvatar::sNumLODChangesThisFrame = 0;
@@ -3173,23 +3173,23 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
 		{ // muted avatars update at 16 hz
 			mUpdatePeriod = 16;
 		}
-		else if (visible && mVisibilityRank <= LLVOAvatar::sMaxVisible * 0.25f)
+		else if (visible && mVisibilityRank <= LLVOAvatar::sMaxVisible)
 		{ //first 25% of max visible avatars are not impostored
 			mUpdatePeriod = 1;
 		}
-		else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 0.75f)
-		{ //back 25% of max visible avatars are slow updating impostors
-			mUpdatePeriod = 8;
-		}
-		else if (visible && mVisibilityRank > (U32) LLVOAvatar::sMaxVisible)
+		else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 4)
 		{ //background avatars are REALLY slow updating impostors
 			mUpdatePeriod = 16;
 		}
+		else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 3)
+		{ //back 25% of max visible avatars are slow updating impostors
+			mUpdatePeriod = 8;
+		}
 		else if (visible && mImpostorPixelArea <= impostor_area)
 		{  // stuff in between gets an update period based on pixel area
 			mUpdatePeriod = llclamp((S32) sqrtf(impostor_area*4.f/mImpostorPixelArea), 2, 8);
 		}
-		else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible * 0.25f)
+		else if (visible && mVisibilityRank > LLVOAvatar::sMaxVisible)
 		{ // force nearby impostors in ultra crowded areas
 			mUpdatePeriod = 2;
 		}
@@ -3551,7 +3551,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
 //							AUDIO_STEP_LO_SPEED, AUDIO_STEP_HI_SPEED,
 //							AUDIO_STEP_LO_GAIN, AUDIO_STEP_HI_GAIN );
 
-			const F32 STEP_VOLUME = 0.5f;
+			const F32 STEP_VOLUME = 0.3f;
 			const LLUUID& step_sound_id = getStepSound();
 
 			LLVector3d foot_pos_global = gAgent.getPosGlobalFromAgent(foot_pos_agent);
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index b30cce09f65d3930194ac3a4cbafa3ac67304d7e..4259bb8e7382018c5b79e7a1593f49d723aa24d2 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -223,8 +223,8 @@ class LLVOAvatar :
 public:
 	static S32		sRenderName;
 	static BOOL		sRenderGroupTitles;
-	static S32		sMaxVisible;
-	static F32		sRenderDistance; //distance at which avatars will render (affected by control "RenderAvatarMaxVisible")
+	static U32		sMaxVisible; //(affected by control "RenderAvatarMaxVisible")
+	static F32		sRenderDistance; //distance at which avatars will render.
 	static BOOL		sShowAnimationDebug; // show animation debug info
 	static BOOL		sUseImpostors; //use impostors for far away avatars
 	static BOOL		sShowFootPlane;	// show foot collision plane reported by server
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index a4d888cd7237af66880640ffbe03150a0e0a6c7f..91af5fefdee7d586d964a429ba78d795170661a2 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -1267,8 +1267,8 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLTexLayerSet* layerset)
 //-----------------------------------------------------------------------------
 BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLTexLayerSet* layerset) const
 {
-	//const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); 
-	const U32 desired_tex_discard_level = 0; // SERAPH hack to not bake textures on lower discard levels.
+	const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); 
+	// const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels.
 
 	for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
 	{
@@ -1299,8 +1299,8 @@ BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLTexLayerSet* layerset) cons
 
 BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const
 {
-	// const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); 
-	const U32 desired_tex_discard_level = 0; // SERAPH hack to not bake textures on lower discard levels
+	const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); 
+	// const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels
 
 	for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
 	{
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index f86838194e9bc853ae811e9a65e3af1ad97dcb05..ea0c5f1d0f47100d25dd17ece70f705f7f20be44 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -106,24 +106,9 @@ LLPanelWearableOutfitItem* LLPanelWearableOutfitItem::create(LLViewerInventoryIt
 	return list_item;
 }
 
-BOOL LLPanelWearableOutfitItem::handleDoubleClick(S32 x, S32 y, MASK mask)
+LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item)
+: LLPanelInventoryListItemBase(item)
 {
-	LLViewerInventoryItem* item = getItem();
-	if (item)
-	{
-		LLUUID id = item->getUUID();
-
-		if (get_is_item_worn(id))
-		{
-			LLAppearanceMgr::getInstance()->removeItemFromAvatar(id);
-		}
-		else
-		{
-			LLAppearanceMgr::getInstance()->wearItemOnAvatar(id, true, false);
-		}
-	}
-
-	return LLUICtrl::handleDoubleClick(x, y, mask);
 }
 
 // virtual
@@ -139,11 +124,6 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name)
 	LLPanelInventoryListItemBase::updateItem(search_label);
 }
 
-LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item)
-: LLPanelInventoryListItemBase(item)
-{
-}
-
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
@@ -667,6 +647,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
 
 	// *TODO: eliminate multiple traversals over the menu items
 	setMenuItemVisible(menu, "wear_add",			mask == MASK_CLOTHING && n_worn == 0);
+	setMenuItemEnabled(menu, "wear_add",			n_items == 1 && canAddWearable(ids.front()));
 	setMenuItemVisible(menu, "wear",				n_worn == 0);
 	setMenuItemVisible(menu, "edit",				!standalone && mask & (MASK_CLOTHING|MASK_BODYPART));
 	setMenuItemEnabled(menu, "edit",				n_editable == 1 && n_worn == 1 && n_items == 1);
@@ -760,4 +741,23 @@ void LLWearableItemsList::ContextMenu::createNewWearable(const LLUUID& item_id)
 	LLAgentWearables::createWearable(item->getWearableType(), true);
 }
 
+// Can we wear another wearable of the given item's wearable type?
+// static
+bool LLWearableItemsList::ContextMenu::canAddWearable(const LLUUID& item_id)
+{
+	if (!gAgentWearables.areWearablesLoaded())
+	{
+		return false;
+	}
+
+	LLViewerInventoryItem* item = gInventory.getItem(item_id);
+	if (!item || item->getType() != LLAssetType::AT_CLOTHING)
+	{
+		return false;
+	}
+
+	U32 wearable_count = gAgentWearables.getWearableCount(item->getWearableType());
+	return wearable_count < LLAgentWearables::MAX_CLOTHING_PER_TYPE;
+}
+
 // EOF
diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h
index 2f95c733aa0db96707f18945828dabfe6e6f73a7..69134dd6462b49511867854899648182aa073a23 100644
--- a/indra/newview/llwearableitemslist.h
+++ b/indra/newview/llwearableitemslist.h
@@ -56,13 +56,13 @@ class LLPanelWearableListItem : public LLPanelInventoryListItemBase
 public:
 
 	/**
-	 * Shows buttons when mouse is over
-	 */
+	* Shows buttons when mouse is over
+	*/
 	/*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
 
 	/**
-	 * Hides buttons when mouse is out
-	 */
+	* Hides buttons when mouse is out
+	*/
 	/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
 
 protected:
@@ -83,19 +83,13 @@ class LLPanelWearableOutfitItem : public LLPanelInventoryListItemBase
 public:
 	static LLPanelWearableOutfitItem* create(LLViewerInventoryItem* item);
 
-	/**
-	 * Puts item on if it is not worn by agent
-	 * otherwise takes it off on double click.
-	 */
-	/*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
-
 	/**
 	 * Updates item name and (worn) suffix.
 	 */
 	/*virtual*/ void updateItem(const std::string& name);
 
-protected:
 
+protected:
 	LLPanelWearableOutfitItem(LLViewerInventoryItem* item);
 };
 
@@ -348,6 +342,7 @@ class LLWearableItemsList : public LLInventoryItemsList
 		static void setMenuItemEnabled(LLContextMenu* menu, const std::string& name, bool val);
 		static void updateMask(U32& mask, LLAssetType::EType at);
 		static void createNewWearable(const LLUUID& item_id);
+		static bool canAddWearable(const LLUUID& item_id);
 
 		LLWearableItemsList*	mParent;
 	};
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index cc65b34a612e3eb6d4b7ed1312634457b54e2f7c..ee3a2fc34f2f7d7c302ac6af5752d2a3f1f874b0 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -2207,7 +2207,6 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 	//LLVertexBuffer::unbind();
 
 	grabReferences(result);
-	llpushcallstacks ;
 	for (LLCullResult::sg_list_t::iterator iter = sCull->beginDrawableGroups(); iter != sCull->endDrawableGroups(); ++iter)
 	{
 		LLSpatialGroup* group = *iter;
@@ -2225,7 +2224,6 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 			}
 		}
 	}
-	llpushcallstacks ;
 	for (LLCullResult::sg_list_t::iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
 	{
 		LLSpatialGroup* group = *iter;
@@ -2241,7 +2239,6 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 		}
 	}
 	
-	llpushcallstacks ;
 	if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD)
 	{
 		for (LLCullResult::bridge_list_t::iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
@@ -2268,12 +2265,13 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
 			}
 		}
 	}
-
+	llpushcallstacks ;	
 	{
 		LLFastTimer ftm(FTM_CLIENT_COPY);
 		LLVertexBuffer::clientCopy();
 	}
-
+	llpushcallstacks ;
+	
 	postSort(camera);
 	llpushcallstacks ;
 }
@@ -7117,7 +7115,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 			skip_avatar_update = TRUE;
 		}
 
-		llpushcallstacks ;
 		if (!skip_avatar_update)
 		{
 			gAgentAvatarp->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON);
@@ -7216,7 +7213,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 										(1 << LLPipeline::RENDER_TYPE_WL_SKY));
 					static LLCullResult result;
 					updateCull(camera, result);
-					llpushcallstacks ;
 					stateSort(camera, result);
 					mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) |
 										(1 << LLPipeline::RENDER_TYPE_CLOUDS) |
@@ -7251,7 +7247,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 					LLGLUserClipPlane clip_plane(plane, mat, projection);
 					LLGLDisable cull(GL_CULL_FACE);
 					updateCull(camera, ref_result, 1);
-					llpushcallstacks ;
 					stateSort(camera, ref_result);
 				}
 				
@@ -7308,7 +7303,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 				LLGLUserClipPlane clip_plane(LLPlane(-pnorm, -(pd+pad)), mat, projection);
 				static LLCullResult result;
 				updateCull(camera, result, water_clip);
-				llpushcallstacks ;
 				stateSort(camera, result);
 
 				gGL.setColorMask(true, true);
@@ -7347,7 +7341,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
 		{
 			gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode());
 		}
-		llpushcallstacks ;
 	}
 }
 
diff --git a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml
index e94af2c8d512c9f4d5c02a186947629cd1e4c838..d1db5c17bad13fea24d79e0f34c075aeb4a66aad 100644
--- a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml
+++ b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml
@@ -18,6 +18,7 @@
      max_length="2147483647"
      name="Chat History Editor"
      parse_highlights="true" 
+     read_only="true"
      width="420"
      word_wrap="true" />
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 7d81c3e551bf27647fc3b6aa03edb9dd8a8ccb37..452b2ac664f9438e9a6bbbfcb898eb2535225027 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -1,166 +1,399 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  legacy_header_height="18"
- can_minimize="true"
- can_close="false"
+ can_minimize="false"
+ can_close="true"
  follows="left|top"
- height="340"
+ height="516"
  layout="topleft"
  name="Snapshot"
  help_topic="snapshot"
  save_rect="true"
  save_visibility="true"
- can_dock="true"
- title="Snapshot"
- width="250">
-  <floater.string
-   name="unknown">
-    unknown
-  </floater.string>
-  <floater.string
-   name="share_to_web_url" translate="false">
-    http://pdp36.lindenlab.com:12777/
-  </floater.string>
-  <view
-    height="160"
-    width="230"
+ title="SNAPSHOT PREVIEW"
+ width="215">   
+    <floater.string
+     name="share_to_web_url" translate="false">
+http://pdp36.lindenlab.com:12777/
+    </floater.string>
+    <floater.string
+     name="unknown">
+        unknown
+    </floater.string>
+    <radio_group
+     height="58"
+     label="Snapshot type"
+     layout="topleft"
+     left="10"
+     name="snapshot_type_radio"
+     top="25"
+     width="205">
+        <radio_item
+         bottom="19"
+         height="16"
+         label="Email"
+         layout="topleft"
+         name="postcard" />
+        <radio_item
+         bottom="38"
+         height="16"
+         label="My inventory (L$[AMOUNT])"
+         layout="topleft"
+         name="texture" />
+        <radio_item
+         bottom="57"
+         height="16"
+         label="Save to my computer"
+         layout="topleft"
+         name="local" />
+    </radio_group>
+  <ui_ctrl 
+    height="90"
+    width="125"
     layout="topleft"
     name="thumbnail_placeholder"
-    top_pad="30"
+    top_pad="6"
     follows="left|top"
     left="10"
     />
-  <button
-    follows="left|top"
-    height="22"
-    image_overlay="Refresh_Off"
-    layout="topleft"
-    left="20"
-    top_pad="-30"
-    name="new_snapshot_btn"
-    width="23"
-    commit_callback.function="Snapshot.Refresh"/>
-  <line_editor
-    border_style="line"
-    border_thickness="1"
-    follows="left|top"
-    height="20"
-    layout="topleft"
-    left="10"
-    max_length="500"
-    name="description"
-    top_pad="15"
-    width="230"
-    label="Description"/>
-  <panel
-   top_pad="20"
-   left="10"
-   height="83"
-   name="panel_snapshot_main"
-   width="130">
-    <button
-     label="Share Snapshot"
-     name="share"
-     top="0"
-     left="0"
-     width="130"
-     commit_callback.function="Snapshot.ShowButtons"
-     commit_callback.parameter="share"/>
-    <button
-     label="Save Snapshot"
-     name="save"
-     top_pad="7"
+    <text
+     type="string"
+     font="SansSerifSmall"
+     length="1"
+     follows="left|top"
+     height="14"
+     layout="topleft"
+     right="-5"
      left_delta="0"
-     width="130"
-     commit_callback.function="Snapshot.ShowButtons"
-     commit_callback.parameter="save"/>
+     halign="right"
+     name="file_size_label"
+     top_pad="10"
+     width="195">
+        [SIZE] KB
+    </text>
     <button
-     label="Set As Profile Pic"
-     name="set_profile_pic"
-     top_pad="7"
-     left_delta="0"
-     width="130"/>
-  </panel>
-  <panel
-   top_delta="0"
-   left_delta="0"
-   height="83"
-   name="panel_snapshot_share"
-   width="130">
+     follows="left|top"
+     height="22"
+     image_overlay="Refresh_Off"
+     layout="topleft"
+     left="10"
+     name="new_snapshot_btn"
+     width="23" />
     <button
-     label="Share to Web"
-     name="share_to_web"
-     top="0"
-     left="0"
-     visible="false"
-     width="130"/>
+     follows="left|top"
+     height="23"
+     label="Send"
+     layout="topleft"
+     left_pad="5"
+     right="-5"
+     name="send_btn"
+     width="100" />
     <button
-     label="Email Snapshot"
-     name="share_to_email"
-     top_pad="7"
-     left_delta="0"
-     width="130"/>
+     follows="left|top"
+     height="23"
+     label="Save (L$[AMOUNT])"
+     layout="topleft"
+     right="-5"
+     name="upload_btn"
+     top_delta="0"
+     width="100" />
+    <flyout_button
+     follows="left|top"
+     height="23"
+     label="Save"
+     layout="topleft"
+     right="-5"
+     name="save_btn"
+     tool_tip="Save image to a file"
+     top_delta="0"
+     width="100">
+        <flyout_button.item
+         label="Save"
+         name="save_item"
+         value="save" />
+        <flyout_button.item
+         label="Save As..."
+         name="saveas_item"
+         value="save as" />
+    </flyout_button>
+        <button
+     follows="left|top"
+     height="23"
+     label="More"
+     layout="topleft"
+     left="10"
+     name="more_btn"
+     tool_tip="Advanced options"
+     width="80" />
     <button
-     label="Back"
-     name="cancel_share"
-     top_pad="7"
+     follows="left|top"
+     height="23"
+     label="Less"
+     layout="topleft"
      left_delta="0"
-     width="130"
-     commit_callback.function="Snapshot.ShowButtons"
-     commit_callback.parameter="main"/>
-  </panel>
-  <panel
-   top_delta="0"
-   left_delta="0"
-   height="83"
-   name="panel_snapshot_save"
-   width="130">
+     name="less_btn"
+     tool_tip="Advanced options"
+     top_delta="0"
+     width="80" />
     <button
-     label="Save to My Inventory"
-     name="save_to_inventory"
-     top="0"
-     left="0"
-     width="130"/>
-    <button
-     label="Save to My Computer"
-     name="save_to_computer"
-     top_pad="7"
+     follows="left|top"
+     height="23"
+     label="Cancel"
+     layout="topleft"
+     right="-5"
+     left_pad="5"
+     name="discard_btn"
+     width="100" />
+    <text
+     type="string"
+     length="1"
+     follows="top|left"
+     height="12"
+     layout="topleft"
+     left="10"
+     name="type_label2"
+     top_pad="5"
+     width="127">
+        Size
+    </text>
+    <text
+     type="string"
+     length="1"
+     follows="top|left"
+     height="12"
+     layout="topleft"
+     left_pad="5"
+     name="format_label"
+     top_delta="0"
+     width="70">
+        Format
+    </text>
+    <combo_box
+     height="23"
+     label="Resolution"
+     layout="topleft"
+     left="10"
+     name="postcard_size_combo"
+     width="120">
+        <combo_box.item
+         label="Current Window"
+         name="CurrentWindow"
+         value="[i0,i0]" />
+        <combo_box.item
+         label="640x480"
+         name="640x480"
+         value="[i640,i480]" />
+        <combo_box.item
+         label="800x600"
+         name="800x600"
+         value="[i800,i600]" />
+        <combo_box.item
+         label="1024x768"
+         name="1024x768"
+         value="[i1024,i768]" />
+        <combo_box.item
+         label="Custom"
+         name="Custom"
+         value="[i-1,i-1]" />
+    </combo_box>
+    <combo_box
+     height="23"
+     label="Resolution"
+     layout="topleft"
      left_delta="0"
-     width="130"/>
-    <button
-     label="Back"
-     name="cancel_save"
-     top_pad="7"
+     name="texture_size_combo"
+     top_delta="0"
+     width="127">
+        <combo_box.item
+         label="Current Window"
+         name="CurrentWindow"
+         value="[i0,i0]" />
+        <combo_box.item
+         label="Small (128x128)"
+         name="Small(128x128)"
+         value="[i128,i128]" />
+        <combo_box.item
+         label="Medium (256x256)"
+         name="Medium(256x256)"
+         value="[i256,i256]" />
+        <combo_box.item
+         label="Large (512x512)"
+         name="Large(512x512)"
+         value="[i512,i512]" />
+        <combo_box.item
+         label="Custom"
+         name="Custom"
+         value="[i-1,i-1]" />
+    </combo_box>
+    <combo_box
+     height="23"
+     label="Resolution"
+     layout="topleft"
+     left_delta="0"
+     name="local_size_combo"
+     top_delta="0"
+     width="127">
+        <combo_box.item
+         label="Current Window"
+         name="CurrentWindow"
+         value="[i0,i0]" />
+        <combo_box.item
+         label="320x240"
+         name="320x240"
+         value="[i320,i240]" />
+        <combo_box.item
+         label="640x480"
+         name="640x480"
+         value="[i640,i480]" />
+        <combo_box.item
+         label="800x600"
+         name="800x600"
+         value="[i800,i600]" />
+        <combo_box.item
+         label="1024x768"
+         name="1024x768"
+         value="[i1024,i768]" />
+        <combo_box.item
+         label="1280x1024"
+         name="1280x1024"
+         value="[i1280,i1024]" />
+        <combo_box.item
+         label="1600x1200"
+         name="1600x1200"
+         value="[i1600,i1200]" />
+        <combo_box.item
+         label="Custom"
+         name="Custom"
+         value="[i-1,i-1]" />
+    </combo_box>
+    <combo_box
+     height="23"
+     label="Format"
+     layout="topleft"
+     left_pad="5"
+     name="local_format_combo"
+     width="70">
+        <combo_box.item
+         label="PNG"
+         name="PNG" />
+        <combo_box.item
+         label="JPEG"
+         name="JPEG" />
+        <combo_box.item
+         label="BMP"
+         name="BMP" />
+    </combo_box>
+    <spinner
+     allow_text_entry="false"
+     decimal_digits="0"
+     follows="left|top"
+     height="20"
+     increment="32"
+     label="Width"
+     label_width="40"
+     layout="topleft"
+     left="10"
+     max_val="6016"
+     min_val="32"
+     name="snapshot_width"
+     top_pad="10"
+     width="95" />
+    <spinner
+     allow_text_entry="false"
+     decimal_digits="0"
+     follows="left|top"
+     height="20"
+     increment="32"
+     label="Height"
+     label_width="40"
+     layout="topleft"
+     left_pad="5"
+     max_val="6016"
+     min_val="32"
+     name="snapshot_height"
+     top_delta="0"
+     width="95" />
+    <check_box
+     bottom_delta="20"
+     label="Constrain proportions"
+     layout="topleft"
+     left="10"
+     name="keep_aspect_check" />
+    <slider
+     decimal_digits="0"
+     follows="left|top"
+     height="15"
+     increment="1"
+     initial_value="75"
+     label="Image quality"
+     label_width="100"
+     layout="topleft"
      left_delta="0"
-     width="130"
-     commit_callback.function="Snapshot.ShowButtons"
-     commit_callback.parameter="main"/>
-  </panel>
-  <button
-   follows="left"
-   height="22"
-   layout="topleft"
-   left="210"
-   name="show_advanced"
-   image_overlay="TabIcon_Close_Off"
-   bottom_delta="0"
-   width="30"
-   commit_callback.function="Snapshot.ShowAdvanced"/>
-  <button
-   follows="left"
-   height="22"
-   layout="topleft"
-   left="210"
-   name="hide_advanced"
-   image_overlay="TabIcon_Open_Off"
-   top_delta="0"
-   visible="false"
-   width="30"
-   commit_callback.function="Snapshot.HideAdvanced"/>
-  <panel 
-   visible="false"
-   left="250"
-   top="17"
-   name="snapshot_advanced"
-   filename="panel_snapshot_advanced.xml"/>
+     max_val="100"
+     name="image_quality_slider"
+     top_pad="5"
+     width="205" />
+    <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="13"
+     layout="topleft"
+     left="10"
+     name="layer_type_label"
+     top_pad="5"
+     width="50">
+        Capture:
+    </text>
+    <combo_box
+     height="23"
+     label="Image Layers"
+     layout="topleft"
+     left="30"
+     name="layer_types"
+     width="145">
+        <combo_box.item
+         label="Colors"
+         name="Colors"
+         value="colors" />
+        <combo_box.item
+         label="Depth"
+         name="Depth"
+         value="depth" />
+    </combo_box>
+    <check_box
+     label="Interface"
+     layout="topleft"
+     left="30"
+     top_pad="10"
+     width="180"
+     name="ui_check" />
+    <check_box
+     label="HUDs"
+     layout="topleft"
+     left="30"
+     top_pad="10"
+     width="180"
+     name="hud_check" />
+    <check_box
+     label="Keep open after saving"
+     layout="topleft"
+     left="10"
+     top_pad="8"
+     width="180"
+     name="keep_open_check" />
+    <check_box
+     label="Freeze frame (fullscreen)"
+     layout="topleft"
+     left="10"
+     top_pad="8"
+     width="180"
+     name="freeze_frame_check" />
+    <check_box
+     label="Auto-refresh"
+     layout="topleft"
+     left="10"
+     top_pad="8"
+     width="180"
+     name="auto_snapshot_check" />
 </floater>
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
index 8e7ef7f0b55f964384f301b54ee94bfe8a5b53ea..16b33eff892f6b941328150248f49eb27ea3b6c5 100644
--- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
@@ -175,19 +175,6 @@
             <!-- copied from menu_inventory_add.xml -->
 
     <menu_item_separator name="sepatator2" />
-    <menu_item_call
-     label="Rename Outfit"
-     layout="topleft"
-     name="rename">
-        <on_click
-         function="Gear.Rename" />
-        <on_enable
-         function="Gear.OnEnable"
-         parameter="rename" />
-        <on_visible
-         function="Gear.OnVisible"
-         parameter="rename" />
-    </menu_item_call>
     <menu_item_call
      label="Delete Outfit"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 2641ce4ee4de2ca1074a441c9ef7e657bee3d847..355731870555883e52f9827153652a8d3d04bfbc 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -927,7 +927,7 @@
         <menu_item_check
          label="Show Advanced Menu"
          name="Show Advanced Menu"
-         shortcut="control|alt|D">
+         shortcut="control|alt|shift|D">
           <on_check
            function="CheckControl"
            parameter="UseDebugMenus" />
@@ -1477,6 +1477,18 @@
                 <menu_item_call.on_click
                  function="View.DefaultUISize" />
             </menu_item_call>
+            <!-- This second, alternative shortcut for Show Advanced Menu is for backward compatibility.  The main shortcut has been changed so it's Linux-friendly, where the old shortcut is typically eaten by the window manager. -->
+            <menu_item_check
+               label="Show Advanced Menu - legacy shortcut"
+               name="Show Advanced Menu - legacy shortcut"
+               shortcut="control|alt|D">
+              <on_check
+		 function="CheckControl"
+		 parameter="UseDebugMenus" />
+              <on_click
+		 function="ToggleControl"
+		 parameter="UseDebugMenus" />
+            </menu_item_check>
             <menu_item_separator/>
             <menu_item_check
              label="Always Run"
@@ -1652,7 +1664,6 @@
              function="ToggleControl"
              parameter="QAMode" />
         </menu_item_check>
-    
     </menu>
     <menu
      create_jump_keys="true"
@@ -3278,4 +3289,4 @@
             </menu>
         </menu>
     </menu>
-</menu_bar>
\ No newline at end of file
+</menu_bar>
diff --git a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
index 430a7b6444475308d2646a6b14a917740b59ac20..efea2ae3e8f65c752316582b4eadee9bfcdb332a 100644
--- a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
+++ b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
@@ -2,7 +2,7 @@
 <context_menu
  name="Outfit Wearable Context Menu">
     <menu_item_call
-     label="Wear"
+     label="Replace"
      layout="topleft"
      name="wear">
         <on_click
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index aca3b750c8dfa44b4e3cef13826a54e1bbae4414..20a2a7d954a5aea4fffb51641942de47802b90bd 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -1397,8 +1397,7 @@ Unable to encode file: [FILE]
    icon="alertmodal.tga"
    name="CorruptedProtectedDataStore"
    type="alertmodal">
-  We are unable to read your protected data so it is being reset.
-   This may happen when you change network setup.
+   We can't fill in your username and password.  This may happen when you change network setup
 
     <usetemplate
      name="okbutton"
@@ -4518,18 +4517,6 @@ Uploading in-world and web site snapshots...
 (Takes about 5 minutes.)
   </notification>
 
-  <notification
-   icon="alertmodal.tga"
-   name="UploadConfirmation"
-   type="alertmodal">
-Uploading costs L$[AMOUNT].
-Do you wish to proceed?
-    <usetemplate
-     name="okcancelbuttons"
-     notext="Cancel"
-     yestext="Upload"/>
-  </notification>
-
   <notification
    icon="notify.tga"
    name="UploadPayment"
@@ -5526,14 +5513,6 @@ Failed to find [TYPE] in database.
 Failed to find [TYPE] named [DESC] in database.
   </notification>
 
-  <notification
-   icon="notify.tga"
-   name="ShareToWebFailed"
-   persist="true"
-   type="notify">
-    Failed to upload image to web.
-  </notification>
-  
   <notification
    icon="notify.tga"
    name="InvalidWearable"
diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml
index e4eb9afb290a859a4561177ff228f446f594aa93..e894fc8fb8bd8431ae2b4ed7c44ed8012188ca22 100644
--- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml
@@ -95,7 +95,8 @@ background_visible="true"
        name="group_accordions"
        follows="all"
        layout="topleft"
-       auto_resize="true">
+       auto_resize="true"
+       width="313">
    <accordion
      left="0"
      top="0"
@@ -103,7 +104,8 @@ background_visible="true"
      fit_parent="true"
      follows="all"
      layout="topleft"
-     name="groups_accordion">
+     name="groups_accordion"
+     width="313">
          <accordion_tab
             expanded="true"
             layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
index ed3b1762678fdfb99d256c54d54e4a4d797e2870..03a0c464d2fcde93632ec9d953c12ef395423a95 100644
--- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
@@ -144,7 +144,7 @@ Required height for dragbar (icon in spec) is 10, so resizebar height should be
 It is calculated as border_size + 2*UIResizeBarOverlap
 -->
     <layout_stack
-     animate="false"
+     animate="true"
      border_size="8"
      clip="false"
      default_tab_group="2"
@@ -284,7 +284,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
          bg_alpha_color="DkGray2"
          auto_resize="true"
          default_tab_group="3"
-         height="211"
+         height="450"
          min_height="210"
          name="add_wearables_panel"
          width="313"
@@ -307,7 +307,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
              background_visible="false"
              border="false"
              follows="left|top|right|bottom"
-             height="203"
+             height="442"
              layout="topleft"
              left="0"
              mouse_opaque="false"
@@ -322,7 +322,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
              layout="topleft"
              follows="left|top|right|bottom"
              border="false"
-             height="210"
+             height="449"
              left="0"
              mouse_opaque="false"
              width="310"
@@ -336,7 +336,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
                  follows="all"
                  multi_select="true"
                  width="310"
-                 height="210"
+                 height="449"
                  left="0"
                  top="0"/>
             </panel>
@@ -375,7 +375,19 @@ It is calculated as border_size + 2*UIResizeBarOverlap
          layout="topleft"
          left_pad="1"
          name="dummy_right_icon"
-         width="281" />
+         width="246" />
+        <button
+         follows="bottom|right"
+         height="25"
+         image_hover_unselected="Toolbar_Middle_Over"
+         image_overlay="AddItem_Off"
+         image_selected="Toolbar_Middle_Selected"
+         image_unselected="Toolbar_Middle_Off"
+         layout="topleft"
+         left_pad="0"
+         name="shop_btn"
+         top="1"
+         width="31" />
     </panel>
     
     
@@ -490,7 +502,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
          follows="bottom|left|right"
          height="23"
          left_pad="12"
-         label="Revert"
+         label="Undo Changes"
          layout="topleft"
          name="revert_btn"
          top="0"
diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
index 37eb5eaa984c632dbfd1b1e56069e447c059d9e1..a59070496e9f4a15715d6a325a7db43b8a2f2258 100644
--- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
@@ -48,6 +48,7 @@
            mouse_opaque="true"
            name="cof_tab"
            start_folder="Current Outfit"
+           use_label_suffix="true" 
            width="315" />
    </tab_container>
 	 <panel
@@ -83,18 +84,18 @@
       width="241"
         />
 
-     <dnd_button
-      follows="bottom|right"
-      height="25"
-      image_hover_unselected="Toolbar_Right_Over"
-      image_overlay="TrashItem_Off"
-      image_selected="Toolbar_Right_Selected"
-      image_unselected="Toolbar_Right_Off"
-      layout="topleft"
-      left_pad="1"
-      name="trash_btn"
+        <dnd_button
+         follows="bottom|right"
+         height="25"
+         image_hover_unselected="Toolbar_Right_Over"
+          image_overlay="TrashItem_Off"
+          image_selected="Toolbar_Right_Selected"
+          image_unselected="Toolbar_Right_Off"
+         layout="topleft"
+         left_pad="1"
+         name="trash_btn"
       tool_tip="Delete selected outfit"
-      width="31"/>
+         width="31"/>         
      <button
        follows="bottom|left"
        height="23"
@@ -129,4 +130,4 @@
       width="152" />
 	 </panel>
        
-</panel>
\ No newline at end of file
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_outfits_list.xml b/indra/newview/skins/default/xui/en/panel_outfits_list.xml
index 5c9ae51a483e376418a43e2198a62e332f602282..d0c44c4328916c5f6c8f2e2a90f8ded7ebdabf95 100644
--- a/indra/newview/skins/default/xui/en/panel_outfits_list.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfits_list.xml
@@ -14,7 +14,8 @@
      background_visible="true"
      bg_alpha_color="DkGray2"
      bg_opaque_color="DkGray2"
-     empty_accordion_text.value="Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]."
+     no_matched_tabs_text.value="Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]."
+     no_visible_tabs_text.value="There are no any outfits. Try [secondlife:///app/search/all/ Search]."
      follows="all"
      height="400"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index da28773c74c57241b1394679e53abe03a94e5426..b79ef1e287b58d2bc364b20a31cd820c8acb72e7 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -173,7 +173,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
        		 background_visible="true"
        		 bg_alpha_color="DkGray2"
        		 bg_opaque_color="DkGray2"
-             empty_accordion_text.value=""
              follows="all"
              height="356"
              layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index 266fd6cb5e7e49393bbe871e9a19c9d2e4969acc..f4694180a121d36fc2eebbfba1f2a607f610da69 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -372,29 +372,17 @@
     decimal_digits="0"
     follows="left|top"
     height="16"
-    increment="2"
-    initial_value="35"
-    label="Max. avatar draw distance:"
+    increment="1"
+    initial_value="12"
+    label="Max. # of non-impostor avatars:"
     label_width="185"
     layout="topleft"
     left_delta="0"
     max_val="65"
     min_val="1"
-    name="MaxAvatarDrawDistance"
+    name="MaxNumberAvatarDrawn"
     top_pad="4"
     width="290" />
-    <text
-    type="string"
-    length="1"
-    follows="left|top"
-    height="12"
-    layout="topleft"
-    left_delta="291"
-    name="DrawDistanceMeterText3"
-    top_delta="0"
-    width="128">
-      m
-    </text>
 		<slider
 		control_name="RenderGlowResolutionPow"
 		decimal_digits="0"
diff --git a/indra/newview/skins/default/xui/en/panel_scrolling_param.xml b/indra/newview/skins/default/xui/en/panel_scrolling_param.xml
index 19eb4bb0d64205f4dbf414bc846a1b20806a615f..78d64620a55fa3cbb9ad52573cb124123a4dd7a5 100644
--- a/indra/newview/skins/default/xui/en/panel_scrolling_param.xml
+++ b/indra/newview/skins/default/xui/en/panel_scrolling_param.xml
@@ -12,6 +12,8 @@
      layout="topleft"
      left="12"
      name="min param text"
+     text_color="EmphasisColor"
+     font_shadow="hard"
      top="120"
      width="120" />
     <text
@@ -20,6 +22,8 @@
      layout="topleft"
      left="155"
      name="max param text"
+     text_color="EmphasisColor" 
+     font_shadow="hard"
      top_delta="0"
      width="120" />
     <text
diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history.xml b/indra/newview/skins/default/xui/en/panel_teleport_history.xml
index 21addb8e6fe9f80fed2e17ea768261aefe43aba4..daa4356c836513f96085f575cdf0a797d37eed4e 100644
--- a/indra/newview/skins/default/xui/en/panel_teleport_history.xml
+++ b/indra/newview/skins/default/xui/en/panel_teleport_history.xml
@@ -5,14 +5,16 @@
      background_visible="true"
      bg_alpha_color="DkGray">     
     <accordion
+     no_matched_tabs_text.value="Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search]."
+     no_visible_tabs_text.value="Teleport history is empty. Try [secondlife:///app/search/places/ Search]."
      follows="left|top|right|bottom"
      height="373"
      layout="topleft"
      left="3"
      top="0"
      name="history_accordion"
-   background_visible="true"
-   bg_alpha_color="DkGray2"
+     background_visible="true"
+     bg_alpha_color="DkGray2"
      width="307">
 	    <accordion_tab
          layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 294267d43b2864ce6b43d400e7e1f14c32e031f7..68eea8dc9a6b1d332d0f1a239d74f22bbe4a1386 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -136,7 +136,7 @@
 	<string name="RetrievingData">Retrieving...</string>
 
 	<string name="ReleaseNotes">Release Notes</string>
-	<string name="RELEASE_NOTES_BASE_URL">http://secondlife.com/app/releasenotes/</string>
+	<string name="RELEASE_NOTES_BASE_URL">http://wiki.secondlife.com/wiki/Release_Notes/</string>
 
 	<!-- Indicates something is being loaded. Maybe should be merged with RetrievingData -->
 	<string name="LoadingData">Loading...</string>
diff --git a/indra/newview/skins/default/xui/en/widgets/accordion.xml b/indra/newview/skins/default/xui/en/widgets/accordion.xml
index 05d7447a6f8b5824510b569ddf34d92ec5f199dd..19f8234389d5ff034c670b4effb2c511008d7bcd 100644
--- a/indra/newview/skins/default/xui/en/widgets/accordion.xml
+++ b/indra/newview/skins/default/xui/en/widgets/accordion.xml
@@ -3,12 +3,16 @@
  height="100"
  name="accordion"
  width="200">
-    <empty_accordion_text
+    <no_matched_tabs_text
      follows="all"
      height="100"
      h_pad="10"
-     name="no_visible_items_msg"
+     name="no_matched_tabs_msg"
      v_pad="15"
      width="200"
      wrap="true "/>
+    <!-- This widget will not be created in viewer. Only its value will be used for empty accordion without filter. -->
+    <no_visible_tabs_text
+     name="no_visible_tabs_msg"
+     visible="false"/>
 </accordion>
diff --git a/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml b/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml
index a71b293f31942b5838658fee6fdd51bd99a34cb3..e05ddf98158780b5ba47dcfb5cb9ee2a63f0dd69 100644
--- a/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml
@@ -11,6 +11,6 @@
      name="no_items_msg"
      v_pad="10"
      h_pad="10"
-     value="There are no any items in the list"
+     value="No matches found"
      wrap="true" />
 </flat_list_view>
\ No newline at end of file
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 8d2525dd2643de6d14293e01f63bf941c318644a..0fd3cf5b3b19243738ca185116f2743fa93c4d7d 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -559,6 +559,10 @@ def package_finish(self):
 
 
 class DarwinManifest(ViewerManifest):
+    def is_packaging_viewer(self):
+        # darwin requires full app bundle packaging even for debugging.
+        return True
+
     def construct(self):
         # copy over the build result (this is a no-op if run within the xcode script)
         self.path(self.args['configuration'] + "/Second Life.app", dst="")