diff --git a/doc/contributions.txt b/doc/contributions.txt
index fb3f7ea466cb200b4768e2dc241c4a25c9f1464f..2b0d3abd9e0f3204837ae61da1bf29f64fec6324 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -29,6 +29,9 @@ Aimee Trescothick
 	VWR-9255
 Alejandro Rosenthal
 	VWR-1184
+Aleric Inglewood
+	VWR-10759
+	VWR-10837
 Alissa Sabre
 	VWR-81
 	VWR-83
@@ -50,23 +53,25 @@ Alissa Sabre
 	VWR-1351
 	VWR-1353
 	VWR-1410
+        VWR-1843
 	VWR-2116
 	VWR-2826
 	VWR-3290
+	VWR-3410
 	VWR-3857
 	VWR-4010
-	VWR-3410
+	VWR-5575
+        VWR-5929
+        VWR-6384
+        VWR-6385
 	VWR-6386
-	VWR-6384
-	VWR-6385
-	VWR-5929
-	VWR-6430
-	VWR-1843
-	VWR-6668
-	VWR-7153
-	VWR-7168
-	VWR-7087
-	VWR-7086
+        VWR-6430
+	VWR-6858
+        VWR-6668
+        VWR-7086
+        VWR-7087
+        VWR-7153
+        VWR-7168
 	VWR-9190
 	VWR-10728
 Angus Boyd
@@ -193,7 +198,6 @@ Hiro Sommambulist
 	VWR-97
 	VWR-100
 	VWR-105
-	VWR-108
 	VWR-118
 	VWR-132
 	VWR-136
@@ -219,9 +223,13 @@ Kage Pixel
 	VWR-11
 Kerutsen Sellery
 	VWR-1350
+Khyota Wulluf
+	VWR-9256
 Kunnis Basiat
 	VWR-82
 	VWR-102
+Lockhart Cordoso
+	VWR-108
 maciek marksman
 	CT-86
 march Korda
@@ -235,11 +243,13 @@ Matthew Dowd
 McCabe Maxsted
 	VWR-1318
 	VWR-4065
+	VWR-4826
 	VWR-7827
 	VWR-7877
 	VWR-7893
 	VWR-8080
 	VWR-8689
+	VWR-9007
 Michelle2 Zenovka
 	VWR-2652
 	VWR-2662
@@ -254,6 +264,7 @@ Michelle2 Zenovka
 	VWR-7831
 	VWR-8889
 	VWR-8310
+	VWR-9499
 Mm Alder
 	VWR-3777
 	VWR-4794
@@ -351,6 +362,8 @@ Peekay Semyorka
 	VWR-19
 	VWR-49
 	VWR-79
+Peter Lameth
+	VWR-7331
 princess niven
 	VWR-5733
         CT-85
@@ -378,6 +391,7 @@ SignpostMarv Martin
 	VWR-155
 	VWR-218
 	VWR-373
+	VWR-8357
 Simon Nolan
 	VWR-409
 SpacedOut Frye
@@ -436,15 +450,36 @@ Whoops Babii
 	VWR-631
 	VWR-1640
 	VWR-3340
+	VWR-4800
+	VWR-4802
+	VWR-4804
+	VWR-4805
+	VWR-4806
+	VWR-4808
+	VWR-4809
+	VWR-4811
+	VWR-4815
+	VWR-4816
+	VWR-4818
 	VWR-5659
+	VWR-8291
+	VWR-8292
+	VWR-8293
+	VWR-8294
+	VWR-8295
+	VWR-8296
+	VWR-8297
+	VWR-8298
 Wilton Lundquist
 	VWR-7682
 Zarkonnen Decosta
 	VWR-253
 Zi Ree
+	VWR-423
 	VWR-671
 	VWR-682
 	VWR-684
+	VWR-9127
 	VWR-1140
 Zipherius Turas
 	VWR-76
diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake
index 68ee8817fd10a8fb9411944cf18fedb1fb46fb51..2a8abdac23aa47e70d5004b42c96640ee41ace7e 100644
--- a/indra/cmake/ViewerMiscLibs.cmake
+++ b/indra/cmake/ViewerMiscLibs.cmake
@@ -2,7 +2,6 @@
 include(Prebuilt)
 
 if (NOT STANDALONE)
-  use_prebuilt_binary(libstdc++)
   use_prebuilt_binary(libuuid)
   use_prebuilt_binary(vivox)
   use_prebuilt_binary(fontconfig)
diff --git a/indra/llcharacter/llanimationstates.cpp b/indra/llcharacter/llanimationstates.cpp
index d62595cf091320a18bbf5f8fa1678be344da96d7..365fb673f37453772e8ff1f27b518c5d23a0bf48 100644
--- a/indra/llcharacter/llanimationstates.cpp
+++ b/indra/llcharacter/llanimationstates.cpp
@@ -40,19 +40,19 @@
 #include "llstring.h"
 
 LLUUID AGENT_WALK_ANIMS[] = {ANIM_AGENT_WALK, ANIM_AGENT_RUN, ANIM_AGENT_CROUCHWALK, ANIM_AGENT_TURNLEFT, ANIM_AGENT_TURNRIGHT};
-S32 NUM_AGENT_WALK_ANIMS = sizeof(AGENT_WALK_ANIMS) / sizeof(LLUUID);
+S32 NUM_AGENT_WALK_ANIMS = LL_ARRAY_SIZE(AGENT_WALK_ANIMS);
 
 LLUUID AGENT_GUN_HOLD_ANIMS[] = {ANIM_AGENT_HOLD_RIFLE_R, ANIM_AGENT_HOLD_HANDGUN_R, ANIM_AGENT_HOLD_BAZOOKA_R, ANIM_AGENT_HOLD_BOW_L};
-S32 NUM_AGENT_GUN_HOLD_ANIMS = sizeof(AGENT_GUN_HOLD_ANIMS) / sizeof(LLUUID);
+S32 NUM_AGENT_GUN_HOLD_ANIMS = LL_ARRAY_SIZE(AGENT_GUN_HOLD_ANIMS);
 
 LLUUID AGENT_GUN_AIM_ANIMS[] = {ANIM_AGENT_AIM_RIFLE_R, ANIM_AGENT_AIM_HANDGUN_R, ANIM_AGENT_AIM_BAZOOKA_R, ANIM_AGENT_AIM_BOW_L};
-S32 NUM_AGENT_GUN_AIM_ANIMS = sizeof(AGENT_GUN_AIM_ANIMS) / sizeof(LLUUID);
+S32 NUM_AGENT_GUN_AIM_ANIMS = LL_ARRAY_SIZE(AGENT_GUN_AIM_ANIMS);
 
 LLUUID AGENT_NO_ROTATE_ANIMS[] = {ANIM_AGENT_SIT_GROUND, ANIM_AGENT_SIT_GROUND_CONSTRAINED, ANIM_AGENT_STANDUP};
-S32 NUM_AGENT_NO_ROTATE_ANIMS = sizeof(AGENT_NO_ROTATE_ANIMS) / sizeof(LLUUID);
+S32 NUM_AGENT_NO_ROTATE_ANIMS = LL_ARRAY_SIZE(AGENT_NO_ROTATE_ANIMS);
 
 LLUUID AGENT_STAND_ANIMS[] = {ANIM_AGENT_STAND, ANIM_AGENT_STAND_1, ANIM_AGENT_STAND_2, ANIM_AGENT_STAND_3, ANIM_AGENT_STAND_4};
-S32 NUM_AGENT_STAND_ANIMS = sizeof(AGENT_STAND_ANIMS) / sizeof(LLUUID);
+S32 NUM_AGENT_STAND_ANIMS = LL_ARRAY_SIZE(AGENT_STAND_ANIMS);
 
 
 LLAnimationLibrary gAnimLibrary;
@@ -334,7 +334,7 @@ const LLAnimStateEntry gUserAnimStates[] = {
 	LLAnimStateEntry("yes_head",				ANIM_AGENT_YES),
 };
 
-const S32 gUserAnimStatesCount = sizeof(gUserAnimStates) / sizeof(gUserAnimStates[0]);
+const S32 gUserAnimStatesCount = LL_ARRAY_SIZE(gUserAnimStates);
 
 
 
diff --git a/indra/llcharacter/llmultigesture.h b/indra/llcharacter/llmultigesture.h
index 39f2696f55d1bd0651c5045f6ac60e926ceb2455..eb15f600ca915ef1dfcde5fa8bb0b735212dc48c 100644
--- a/indra/llcharacter/llmultigesture.h
+++ b/indra/llcharacter/llmultigesture.h
@@ -108,6 +108,8 @@ class LLMultiGesture
 };
 
 
+// Order must match the library_list in floater_preview_gesture.xml!
+
 enum EStepType
 {
 	STEP_ANIMATION = 0,
diff --git a/indra/llcommon/llbase32.cpp b/indra/llcommon/llbase32.cpp
index c8b6ffff38fab8df9a17a7b2d4e92b9f5ce551de..5e6ced9ce1ed2ecb6deeb93984344a9664dc3d68 100644
--- a/indra/llcommon/llbase32.cpp
+++ b/indra/llcommon/llbase32.cpp
@@ -146,8 +146,6 @@ base32_encode(char *dst, size_t size, const void *data, size_t len)
 
 /* *TODO: Implement base32 encode.
 
-#define ARRAY_LEN(a) (sizeof (a) / sizeof((a)[0]))
-
 static inline int
 ascii_toupper(int c)
 {
@@ -173,7 +171,7 @@ base32_decode(char *dst, size_t size, const void *data, size_t len)
   unsigned max_pad = 3;
 
   if (0 == base32_map[0]) {
-    for (i = 0; i < ARRAY_LEN(base32_map); i++) {
+    for (i = 0; i < LL_ARRAY_SIZE(base32_map); i++) {
       const char *x;
       
       x = memchr(base32_alphabet, ascii_toupper(i), sizeof base32_alphabet);
@@ -197,7 +195,7 @@ base32_decode(char *dst, size_t size, const void *data, size_t len)
       }
     }
 
-    j = i % ARRAY_LEN(s);
+    j = i % LL_ARRAY_SIZE(s);
     s[j] = c;
 
     if (7 == j) {
@@ -209,7 +207,7 @@ base32_decode(char *dst, size_t size, const void *data, size_t len)
       b[3] = ((s[4] & 1) << 7) | ((s[5] & 0x1f) << 2) | ((s[6] >> 3) & 0x03);
       b[4] = ((s[6] & 0x07) << 5) | (s[7] & 0x1f);
 
-      for (j = 0; j < ARRAY_LEN(b); j++) {
+      for (j = 0; j < LL_ARRAY_SIZE(b); j++) {
         if (q != end)
           *q = b[j];
         q++;
diff --git a/indra/llcommon/llerrorlegacy.h b/indra/llcommon/llerrorlegacy.h
index 8b8af4cc9da56621e402429c80c017a98b607255..143fe201807c2dcbf1271593bce64531fd2d8c95 100644
--- a/indra/llcommon/llerrorlegacy.h
+++ b/indra/llcommon/llerrorlegacy.h
@@ -53,6 +53,7 @@ const int LL_ERR_FILE_NOT_FOUND = -43;
 const int LL_ERR_FILE_EMPTY     = -44;
 const int LL_ERR_TCP_TIMEOUT    = -23016;
 const int LL_ERR_CIRCUIT_GONE   = -23017;
+const int LL_ERR_PRICE_MISMATCH = -23018;
 
 
 
diff --git a/indra/llcommon/llfindlocale.cpp b/indra/llcommon/llfindlocale.cpp
index a511d3ffededa037c55df514c9f7157e545ff5cf..505f5c540b544fd49c44b457cf281d651e029f76 100644
--- a/indra/llcommon/llfindlocale.cpp
+++ b/indra/llcommon/llfindlocale.cpp
@@ -417,10 +417,8 @@ static const IDToCode primary_to_code[] = {
 /*{LANG_WALON,      "wa"},*/
   {LANG_CHINESE,    "zh"},
 };
-static int num_primary_to_code =
-  sizeof(primary_to_code) / sizeof(*primary_to_code);
-static int num_both_to_code =
-  sizeof(both_to_code) / sizeof(*both_to_code);
+static int num_primary_to_code = LL_ARRAY_SIZE(primary_to_code);
+static int num_both_to_code = LL_ARRAY_SIZE(both_to_code);
 
 static const int
 lcid_to_fl(LCID lcid,
diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp
index 29f916bc46448b2b79fe701b9ebaff622e6e9216..a6de3d2d698f199bb493b04e7878de20d2561663 100644
--- a/indra/llcommon/llmemory.cpp
+++ b/indra/llcommon/llmemory.cpp
@@ -39,7 +39,7 @@
 # include <sys/types.h>
 # include <mach/task.h>
 # include <mach/mach_init.h>
-#elif defined(LL_LINUX)
+#elif LL_LINUX || LL_SOLARIS
 # include <unistd.h>
 #endif
 
@@ -389,6 +389,34 @@ U64 getCurrentRSS()
 	return rss;
 }
 
+#elif LL_SOLARIS
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
+
+U64 getCurrentRSS()
+{
+	char path [LL_MAX_PATH];	/* Flawfinder: ignore */ 
+
+	sprintf(path, "/proc/%d/psinfo", (int)getpid());
+	int proc_fd = -1;
+	if((proc_fd = open(path, O_RDONLY)) == -1){
+		llwarns << "LLmemory::getCurrentRSS() unable to open " << path << ". Returning 0 RSS!" << llendl;
+		return 0;
+	}
+	psinfo_t proc_psinfo;
+	if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
+		llwarns << "LLmemory::getCurrentRSS() Unable to read from " << path << ". Returning 0 RSS!" << llendl;
+		close(proc_fd);
+		return 0;
+	}
+
+	close(proc_fd);
+
+	return((U64)proc_psinfo.pr_rssize * 1024);
+}
 #else
 
 U64 getCurrentRSS()
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 1ac2c9422b830ca4495a0825a046c4d7c6a9b85d..2e4fd4787a1c837fa1c345a73bab8aa99c0f6e28 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -40,7 +40,16 @@
 #include <endian.h>
 #endif	//	LL_LINUX
 
-#if (defined(LL_WINDOWS) || (defined(LL_LINUX) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(LL_DARWIN) && defined(__LITTLE_ENDIAN__)))
+#if LL_SOLARIS
+#   ifdef  __sparc     // Since we're talking Solaris 10 and up, only 64 bit is supported.
+#      define LL_BIG_ENDIAN 1
+#      define LL_SOLARIS_ALIGNED_CPU 1     //  used to designate issues where SPARC alignment is addressed
+#      define LL_SOLARIS_NON_MESA_GL 1      //  The SPARC GL does not provide a MESA-based GL API
+#   endif
+#   include <sys/isa_defs.h> // ensure we know which end is up
+#endif // LL_SOLARIS
+
+#if (defined(LL_WINDOWS) || (defined(LL_LINUX) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(LL_DARWIN) && defined(__LITTLE_ENDIAN__)) || (defined(LL_SOLARIS) && defined(__i386)))
 #define LL_LITTLE_ENDIAN 1
 #else
 #define LL_BIG_ENDIAN 1
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index c6f9d3c7585c5f0dc81d23d574f348e959671e99..469e544b16f7f2ded252f8fbf8cfd6f5efda077f 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -279,7 +279,7 @@ bool CProcessor::AnalyzeIntelProcessor()
 
 	// Only override the brand if we have it in the lookup table.  We should
 	// already have a string here from GetCPUInfo().  JC
-	if (CPUInfo.uiBrandID < (sizeof(INTEL_BRAND)/sizeof(INTEL_BRAND[0])))
+	if ( CPUInfo.uiBrandID < LL_ARRAY_SIZE(INTEL_BRAND) )
 	{
 		strcpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID]);
 
@@ -1665,6 +1665,10 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
 #elif LL_SOLARIS
 #include <kstat.h>
 
+#if defined(__i386)
+#include <sys/auxv.h>
+#endif
+
 // ======================
 // Class constructor:
 /////////////////////////
@@ -1778,6 +1782,37 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
 
 	// DEBUG llinfo << "The system has " << ncpus << " CPUs with a clock rate of " <<  uqwFrequency << "MHz." << llendl;
 	
+#if defined (__i386)  //  we really don't care about the CPU extensions on SPARC but on x86...
+
+	// Now get cpu extensions
+
+	uint_t ui;
+
+	(void) getisax(&ui, 1);
+	
+	if(ui & AV_386_FPU)
+		CPUInfo._Ext.FPU_FloatingPointUnit = true;
+	if(ui & AV_386_CX8)
+		CPUInfo._Ext.CX8_COMPXCHG8B_Instruction = true;
+	if(ui & AV_386_MMX)
+		CPUInfo._Ext.MMX_MultimediaExtensions = true;
+	if(ui & AV_386_AMD_MMX)
+		CPUInfo._Ext.MMX_MultimediaExtensions = true;
+	if(ui & AV_386_FXSR)
+		CPUInfo._Ext.FXSR_FastStreamingSIMD_ExtensionsSaveRestore = true;
+	if(ui & AV_386_SSE)
+		 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = true;
+	if(ui & AV_386_SSE2)
+		CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = true;
+/* Left these here since they may get used later
+	if(ui & AV_386_SSE3)
+		CPUInfo._Ext.... = true;
+	if(ui & AV_386_AMD_3DNow)
+		CPUInfo._Ext.... = true;
+	if(ui & AV_386_AMD_3DNowx)
+		CPUInfo._Ext.... = true;
+*/
+#endif
 	return (&CPUInfo);
 }
 
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index 8f6626b501dc32220f963608361dc56915b23bb6..d728221b54c8280f20ddaeebe226827a1cfdfa30 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -38,6 +38,13 @@
 #include <wchar.h>
 #endif
 
+#if LL_SOLARIS
+// stricmp and strnicmp do not exist on Solaris:
+#include <string.h>
+#define stricmp strcasecmp
+#define strnicmp strncasecmp
+#endif
+
 const char LL_UNKNOWN_CHAR = '?';
 
 #if LL_DARWIN || LL_LINUX || LL_SOLARIS
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index cf281e92e77a0702e996409fb919232a16e2a17f..f68d86ff7cd6e11d056afe4f55c9cf3307467fba 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -59,6 +59,17 @@
 #	include <sys/sysinfo.h>
 const char MEMINFO_FILE[] = "/proc/meminfo";
 const char CPUINFO_FILE[] = "/proc/cpuinfo";
+#elif LL_SOLARIS
+#	include <stdio.h>
+#	include <unistd.h>
+#	include <sys/utsname.h>
+#	define _STRUCTURED_PROC 1
+#	include <sys/procfs.h>
+#	include <sys/types.h>
+#	include <sys/stat.h>
+#	include <fcntl.h>
+#	include <errno.h>
+extern int errno;
 #endif
 
 
diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h
index 452df2ee5802733913c9cafb18b12d8b69e45a71..e2cf1c7689bfe003e8ce568c4bc36a48edfca87d 100644
--- a/indra/llcommon/lltimer.h
+++ b/indra/llcommon/lltimer.h
@@ -33,7 +33,7 @@
 #ifndef LL_TIMER_H					
 #define LL_TIMER_H
 
-#if LL_LINUX || LL_DARWIN
+#if LL_LINUX || LL_DARWIN || LL_SOLARIS
 #include <sys/time.h>
 #endif
 #include <limits.h>
diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h
index 62fe7b98ff0a043768d127b9960f64e3f29a85f3..6b25b2d355d577c439e019b3049098689588f92c 100644
--- a/indra/llcommon/stdtypes.h
+++ b/indra/llcommon/stdtypes.h
@@ -105,6 +105,8 @@ typedef U32             		TPACKETID;
 
 typedef U8 LLPCode;
 
+#define	LL_ARRAY_SIZE( _kArray ) ( sizeof( (_kArray) ) / sizeof( _kArray[0] ) )
+
 #if LL_LINUX && __GNUC__ <= 2
 typedef int intptr_t;
 #endif
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index 87d465fa81326578ceb5f453450f2560bd82fa0c..bfa129ea1dcd21e60edb321e76db997aea194c5f 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -1137,7 +1137,7 @@ file_extensions[] =
 	{ "dxt", IMG_CODEC_DXT },
 	{ "png", IMG_CODEC_PNG }
 };
-#define NUM_FILE_EXTENSIONS sizeof(file_extensions)/sizeof(file_extensions[0])
+#define NUM_FILE_EXTENSIONS LL_ARRAY_SIZE(file_extensions)
 
 static std::string find_file(std::string &name, S8 *codec)
 {
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index 6d03ccbf25b7a4b712acc3a0a00c1afcf32ed9e6..a6721bfa0f9d228c22443d3e553c72b25f17448c 100644
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -105,7 +105,7 @@ LLImageTGA::LLImageTGA(const std::string& file_name)
 
 LLImageTGA::~LLImageTGA()
 {
-	delete mColorMap;
+	delete [] mColorMap;
 }
 
 BOOL LLImageTGA::updateData()
diff --git a/indra/llinventory/lleconomy.cpp b/indra/llinventory/lleconomy.cpp
index ad37c0c27a151a4a39a6b636b62f98e0ae01517d..4366d1eb2a0bbc477805af4b6470bb5ca316aa20 100644
--- a/indra/llinventory/lleconomy.cpp
+++ b/indra/llinventory/lleconomy.cpp
@@ -74,6 +74,18 @@ void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy*
 	econ_data->setPricePublicObjectDelete(i);
 	msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceUpload, i);
 	econ_data->setPriceUpload(i);
+#if LL_LINUX
+	// We can optionally fake the received upload price for testing.
+	// Note that the server is within its rights to not obey our fake
+	// price. :)
+	const char* fakeprice_str = getenv("LL_FAKE_UPLOAD_PRICE");
+	if (fakeprice_str)
+	{
+		S32 fakeprice = (S32)atoi(fakeprice_str);
+		llwarns << "LL_FAKE_UPLOAD_PRICE: Faking upload price as L$" << fakeprice << llendl;
+		econ_data->setPriceUpload(fakeprice);
+	}
+#endif
 	msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceRentLight, i);
 	econ_data->setPriceRentLight(i);
 	msg->getS32Fast(_PREHASH_Info, _PREHASH_TeleportMinPrice, i);
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 7d01ba059c8b8fd50dd4138912842513f2028af6..1250f539f52b1719e47cc723f79136ddea35c3fc 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -1973,34 +1973,29 @@ inline LLVector3 sculpt_xy_to_vector(U32 x, U32 y, U16 sculpt_width, U16 sculpt_
 }
 
 
-F32 LLVolume::sculptGetSurfaceArea(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data)
+F32 LLVolume::sculptGetSurfaceArea()
 {
 	// test to see if image has enough variation to create non-degenerate geometry
 
+	F32 area = 0;
+
 	S32 sizeS = mPathp->mPath.size();
 	S32 sizeT = mProfilep->mProfile.size();
-
-	F32 area = 0;
-	
-	if ((sculpt_width != 0) &&
-		(sculpt_height != 0) &&
-		(sculpt_components != 0) &&
-		(sculpt_data != NULL))
+			
+	for (S32 s = 0; s < sizeS-1; s++)
 	{
-		for (S32 s = 0; s < sizeS - 1; s++)
+		for (S32 t = 0; t < sizeT-1; t++)
 		{
-			for (S32 t = 0; t < sizeT - 1; t++)
-			{
-				// convert image data to vectors
-				LLVector3 p1 = sculpt_st_to_vector(s, t, sizeS, sizeT, sculpt_width, sculpt_height, sculpt_components, sculpt_data);
-				LLVector3 p2 = sculpt_st_to_vector(s+1, t, sizeS, sizeT, sculpt_width, sculpt_height, sculpt_components, sculpt_data);
-				LLVector3 p3 = sculpt_st_to_vector(s, t+1, sizeS, sizeT, sculpt_width, sculpt_height, sculpt_components, sculpt_data);
-
-				// compute the area of the parallelogram by taking the length of the cross product:
-				// (parallegram is an approximation of two triangles)
-				LLVector3 cross = (p1 - p2) % (p1 - p3);
-				area += cross.magVec();
-			}
+			// get four corners of quad
+			LLVector3 p1 = mMesh[(s  )*sizeT + (t  )].mPos;
+			LLVector3 p2 = mMesh[(s+1)*sizeT + (t  )].mPos;
+			LLVector3 p3 = mMesh[(s  )*sizeT + (t+1)].mPos;
+			LLVector3 p4 = mMesh[(s+1)*sizeT + (t+1)].mPos;
+
+			// compute the area of the quad by taking the length of the cross product of the two triangles
+			LLVector3 cross1 = (p1 - p2) % (p1 - p3);
+			LLVector3 cross2 = (p4 - p2) % (p4 - p3);
+			area += (cross1.magVec() + cross2.magVec()) / 2.0;
 		}
 	}
 
@@ -2164,7 +2159,21 @@ S32 sculpt_sides(F32 detail)
 // determine the number of vertices in both s and t direction for this sculpt
 void sculpt_calc_mesh_resolution(U16 width, U16 height, U8 type, F32 detail, S32& s, S32& t)
 {
-	S32 vertices = sculpt_sides(detail);
+	// this code has the following properties:
+	// 1) the aspect ratio of the mesh is as close as possible to the ratio of the map
+	//    while still using all available verts
+	// 2) the mesh cannot have more verts than is allowed by LOD
+	// 3) the mesh cannot have more verts than is allowed by the map
+	
+	S32 max_vertices_lod = (S32)pow((double)sculpt_sides(detail), 2.0);
+	S32 max_vertices_map = width * height / 4;
+	
+	S32 vertices;
+	if (max_vertices_map > 0)
+		vertices = llmin(max_vertices_lod, max_vertices_map);
+	else
+		vertices = max_vertices_lod;
+	
 
 	F32 ratio;
 	if ((width == 0) || (height == 0))
@@ -2173,13 +2182,13 @@ void sculpt_calc_mesh_resolution(U16 width, U16 height, U8 type, F32 detail, S32
 		ratio = (F32) width / (F32) height;
 
 	
-	s = (S32)(vertices / fsqrtf(ratio));
+	s = (S32)fsqrtf(((F32)vertices / ratio));
 
-	s = llmax(s, 3);   // no degenerate sizes, please
-	t = vertices * vertices / s;
+	s = llmax(s, 4);              // no degenerate sizes, please
+	t = vertices / s;
 
-	t = llmax(t, 3);   // no degenerate sizes, please
-	s = vertices * vertices / t;
+	t = llmax(t, 4);              // no degenerate sizes, please
+	s = vertices / t;
 }
 
 // sculpt replaces generate() for sculpted surfaces
@@ -2216,20 +2225,25 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
 	sNumMeshPoints -= mMesh.size();
 	mMesh.resize(sizeS * sizeT);
 	sNumMeshPoints += mMesh.size();
-	
-	if (!data_is_empty && sculptGetSurfaceArea(sculpt_width, sculpt_height, sculpt_components, sculpt_data) < SCULPT_MIN_AREA)
-		data_is_empty = TRUE;
 
 	//generate vertex positions
-	if (data_is_empty) // if empty, make a placeholder mesh
-	{
-		sculptGeneratePlaceholder();
-	}	
-	else
+	if (!data_is_empty)
 	{
 		sculptGenerateMapVertices(sculpt_width, sculpt_height, sculpt_components, sculpt_data, sculpt_type);
+		
+		if (sculptGetSurfaceArea() < SCULPT_MIN_AREA)
+		{
+			data_is_empty = TRUE;
+		}
 	}
 
+	if (data_is_empty)
+	{
+		sculptGeneratePlaceholder();
+	}
+
+
+	
 	for (S32 i = 0; i < (S32)mProfilep->mFaces.size(); i++)
 	{
 		mFaceMask |= mProfilep->mFaces[i].mFaceID;
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index ab30d78333d45371b6a5cb381e3400858f56cdbf..e55fe52c91ef8a35ec87445f678cfc54cbc5c5f9 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -943,8 +943,8 @@ class LLVolume : public LLRefCount
 	
 	void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level);
 private:
-	F32 sculptGetSurfaceArea(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data);
 	void sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type);
+	F32 sculptGetSurfaceArea();
 	void sculptGeneratePlaceholder();
 	void sculptCalcMeshResolution(U16 width, U16 height, U8 type, S32& s, S32& t);
 
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index 4d10f1e3dad61cb4695a6e67dd562b84ad49a3d5..2966b602d7576c2ebf67f9202c7d16d55c6d21cd 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -1210,6 +1210,9 @@ const char* LLAssetStorage::getErrorString(S32 status)
 	case LL_ERR_CIRCUIT_GONE:
 		return "Circuit gone";
 
+	case LL_ERR_PRICE_MISMATCH:
+		return "Viewer and server do not agree on price";
+
 	default:
 		return "Unknown status";
 	}
diff --git a/indra/llmessage/llinstantmessage.h b/indra/llmessage/llinstantmessage.h
index 774349036d388ce8ca9e02a065b14b6d42e4fc22..96a2cf9cabe747f9e753d0b5320c7939a928a8f1 100644
--- a/indra/llmessage/llinstantmessage.h
+++ b/indra/llmessage/llinstantmessage.h
@@ -159,7 +159,7 @@ enum EInstantMessage
 
 	IM_FRIENDSHIP_OFFERED = 38,
 	IM_FRIENDSHIP_ACCEPTED = 39,
-	IM_FRIENDSHIP_DECLINED = 40,
+	IM_FRIENDSHIP_DECLINED_DEPRECATED = 40,
 
 	IM_TYPING_START = 41,
 	IM_TYPING_STOP = 42,
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 01df71c570ff1e52da7edd738ced7a2eec04da5c..74313974c965478cf9d9dd3fddd204abd1c75860 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -65,7 +65,7 @@ LLMatrix4 gGLObliqueProjectionInverse;
 
 LLGLNamePool::pool_list_t LLGLNamePool::sInstances;
 
-#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS
+#if (LL_WINDOWS || LL_LINUX || LL_SOLARIS)  && !LL_MESA_HEADLESS
 // ATI prototypes
 // vertex blending prototypes
 PFNGLWEIGHTPOINTERARBPROC			glWeightPointerARB = NULL;
@@ -175,7 +175,7 @@ PFNGLGETUNIFORMIVARBPROC glGetUniformivARB = NULL;
 PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB = NULL;
 
 // vertex shader prototypes
-#if LL_LINUX
+#if LL_LINUX || LL_SOLARIS
 PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB = NULL;
 PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB = NULL;
 PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB = NULL;
@@ -194,7 +194,7 @@ PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB = NULL;
 PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB = NULL;
 PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB = NULL;
 PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB = NULL;
-#endif // LL_LINUX
+#endif // LL_LINUX || LL_SOLARIS
 PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4nbvARB = NULL;
 PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4nivARB = NULL;
 PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4nsvARB = NULL;
@@ -202,7 +202,7 @@ PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB = NULL;
 PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB = NULL;
 PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB = NULL;
 PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB = NULL;
-#if LL_LINUX
+#if LL_LINUX  || LL_SOLARIS
 PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB = NULL;
 PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB = NULL;
 PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB = NULL;
@@ -240,7 +240,7 @@ PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB = NULL;
 PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB = NULL;
 PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB = NULL;
 PFNGLISPROGRAMARBPROC glIsProgramARB = NULL;
-#endif // LL_LINUX
+#endif // LL_LINUX || LL_SOLARIS
 PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB = NULL;
 PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB = NULL;
 PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB = NULL;
@@ -249,10 +249,6 @@ PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB = NULL;
 PFNWGLSWAPINTERVALEXTPROC			wglSwapIntervalEXT = NULL;
 #endif
 
-#if LL_LINUX
-PFNGLCOLORTABLEEXTPROC glColorTableEXT = NULL;
-#endif // LL_LINUX
-
 #endif
 
 LLGLManager gGLManager;
@@ -490,7 +486,7 @@ std::string LLGLManager::getGLInfoString()
 	info_str += std::string("GL_RENDERER    ") + ll_safe_string((const char *)glGetString(GL_RENDERER)) + std::string("\n");
 	info_str += std::string("GL_VERSION     ") + ll_safe_string((const char *)glGetString(GL_VERSION)) + std::string("\n");
 
-#if !LL_MESA_HEADLESS
+#if !LL_MESA_HEADLESS 
 	all_exts = (const char *)gGLHExts.mSysExts;
 	LLStringUtil::replaceChar(all_exts, ' ', '\n');
 	info_str += std::string("GL_EXTENSIONS:\n") + all_exts + std::string("\n");
@@ -597,7 +593,8 @@ void LLGLManager::initExtensions()
 	mHasFragmentShader = ExtensionExists("GL_ARB_fragment_shader", gGLHExts.mSysExts) && ExtensionExists("GL_ARB_shading_language_100", gGLHExts.mSysExts);
 #endif
 
-#if LL_LINUX
+#if LL_LINUX || LL_SOLARIS
+	llinfos << "initExtensions() checking shell variables to adjust features..." << llendl;
 	// Our extension support for the Linux Client is very young with some
 	// potential driver gotchas, so offer a semi-secret way to turn it off.
 	if (getenv("LL_GL_NOEXT"))	/* Flawfinder: ignore */
@@ -657,7 +654,7 @@ void LLGLManager::initExtensions()
 		if (strchr(blacklist,'p')) mHasPointParameters = FALSE;//S
 		if (strchr(blacklist,'q')) mHasFramebufferObject = FALSE;//S
 	}
-#endif // LL_LINUX
+#endif // LL_LINUX || LL_SOLARIS
 	
 	if (!mHasMultitexture)
 	{
@@ -720,7 +717,7 @@ void LLGLManager::initExtensions()
 	glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange);
 	glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange);
 	
-#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS
+#if (LL_WINDOWS || LL_LINUX || LL_SOLARIS) && !LL_MESA_HEADLESS
 	LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL;
 	if (mHasVertexBufferObject)
 	{
@@ -745,6 +742,7 @@ void LLGLManager::initExtensions()
 	}
 	if (mHasFramebufferObject)
 	{
+		llinfos << "initExtensions() FramebufferObject-related procs..." << llendl;
 		glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC) GLH_EXT_GET_PROC_ADDRESS("glIsRenderbufferEXT");
 		glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC) GLH_EXT_GET_PROC_ADDRESS("glBindRenderbufferEXT");
 		glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glDeleteRenderbuffersEXT");
@@ -763,7 +761,7 @@ void LLGLManager::initExtensions()
 		glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glGetFramebufferAttachmentParameterivEXT");
 		glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glGenerateMipmapEXT");
 	}
-#if !LL_LINUX
+#if !LL_LINUX && !LL_SOLARIS
 	// This is expected to be a static symbol on Linux GL implementations
 	glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElements");
 	if (!glDrawRangeElements)
@@ -775,6 +773,7 @@ void LLGLManager::initExtensions()
 
 	if (mHasOcclusionQuery)
 	{
+		llinfos << "initExtensions() OcclusionQuery-related procs..." << llendl;
 		glGenQueriesARB = (PFNGLGENQUERIESARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGenQueriesARB");
 		glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteQueriesARB");
 		glIsQueryARB = (PFNGLISQUERYARBPROC)GLH_EXT_GET_PROC_ADDRESS("glIsQueryARB");
@@ -786,6 +785,7 @@ void LLGLManager::initExtensions()
 	}
 	if (mHasPointParameters)
 	{
+		llinfos << "initExtensions() PointParameters-related procs..." << llendl;
 		glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameterfARB");
 		glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameterfvARB");
 	}
@@ -833,6 +833,7 @@ void LLGLManager::initExtensions()
 	}
 	if (mHasVertexShader)
 	{
+		llinfos << "initExtensions() VertexShader-related procs..." << llendl;
 		glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetAttribLocationARB");
 		glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC) GLH_EXT_GET_PROC_ADDRESS("glBindAttribLocationARB");
 		glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetActiveAttribARB");
diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index 9c72c179f744ea38c3a771e5e931b05985efd66e..e9a9ad1a7722a308811783293e633adb8c6c0018 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -33,11 +33,215 @@
 #ifndef LL_LLGLHEADERS_H
 #define LL_LLGLHEADERS_H
 
-#if LL_MESA
+#if LL_SOLARIS
+#   if defined(__sparc)
+#      define I_NEED_OS2_H 	//  avoiding BOOL conflicts
+#   endif
+#   include "GL/gl.h"
+#   if defined(__sparc)
+#      undef I_NEED_OS2_H
+#      ifdef BOOL
+#         undef BOOL		// now get rid of Xmd.h crap
+#      endif
+#   endif
+#   include "GL/glx.h"
+#   define  GL_GLEXT_PROTOTYPES 1
+#   include "GL/glext.h"
+#   include "GL/glu.h"
+#   include "GL/glx.h"
+#   define  GLX_GLXEXT_PROTOTYPES 1
+#   include "GL/glxext.h"
+//#   define  GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddressARB((const GLubyte*)(p))
+#   define  GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddress((const GLubyte*)(p))
+//  the X headers define 'Status'.  Undefine to avoid confusion.
+#undef Status
+
+// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
+// This header is distributed with SL.  You'll find it in linden/libraries/include/GL/
+# define __APPLE__
+# include "GL/glh_extensions.h"
+# undef __APPLE__
+
+
+// GL_ARB_vertex_buffer_object
+extern PFNGLBINDBUFFERARBPROC		glBindBufferARB;
+extern PFNGLDELETEBUFFERSARBPROC	glDeleteBuffersARB;
+extern PFNGLGENBUFFERSARBPROC		glGenBuffersARB;
+extern PFNGLISBUFFERARBPROC			glIsBufferARB;
+extern PFNGLBUFFERDATAARBPROC		glBufferDataARB;
+extern PFNGLBUFFERSUBDATAARBPROC	glBufferSubDataARB;
+extern PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB;
+extern PFNGLMAPBUFFERARBPROC		glMapBufferARB;
+extern PFNGLUNMAPBUFFERARBPROC		glUnmapBufferARB;
+extern PFNGLGETBUFFERPARAMETERIVARBPROC	glGetBufferParameterivARB;
+extern PFNGLGETBUFFERPOINTERVARBPROC	glGetBufferPointervARB;
+
+// GL_ATI_vertex_array_object
+extern PFNGLNEWOBJECTBUFFERATIPROC			glNewObjectBufferATI;
+extern PFNGLISOBJECTBUFFERATIPROC			glIsObjectBufferATI;
+extern PFNGLUPDATEOBJECTBUFFERATIPROC		glUpdateObjectBufferATI;
+extern PFNGLGETOBJECTBUFFERFVATIPROC		glGetObjectBufferfvATI;
+extern PFNGLGETOBJECTBUFFERIVATIPROC		glGetObjectBufferivATI;
+extern PFNGLFREEOBJECTBUFFERATIPROC		    glFreeObjectBufferATI;
+extern PFNGLARRAYOBJECTATIPROC				glArrayObjectATI;
+extern PFNGLVERTEXATTRIBARRAYOBJECTATIPROC	glVertexAttribArrayObjectATI;
+extern PFNGLGETARRAYOBJECTFVATIPROC			glGetArrayObjectfvATI;
+extern PFNGLGETARRAYOBJECTIVATIPROC			glGetArrayObjectivATI;
+extern PFNGLVARIANTARRAYOBJECTATIPROC		glVariantObjectArrayATI;
+extern PFNGLGETVARIANTARRAYOBJECTFVATIPROC	glGetVariantArrayObjectfvATI;
+extern PFNGLGETVARIANTARRAYOBJECTIVATIPROC	glGetVariantArrayObjectivATI;
+
+// GL_ARB_occlusion_query
+extern PFNGLGENQUERIESARBPROC glGenQueriesARB;
+extern PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
+extern PFNGLISQUERYARBPROC glIsQueryARB;
+extern PFNGLBEGINQUERYARBPROC glBeginQueryARB;
+extern PFNGLENDQUERYARBPROC glEndQueryARB;
+extern PFNGLGETQUERYIVARBPROC glGetQueryivARB;
+extern PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB;
+extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
+
+// GL_ARB_point_parameters
+extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB;
+extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB;
+
+// GL_ARB_shader_objects
+extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
+extern PFNGLGETHANDLEARBPROC glGetHandleARB;
+extern PFNGLDETACHOBJECTARBPROC glDetachObjectARB;
+extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
+extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
+extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
+extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
+extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
+extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
+extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
+extern PFNGLVALIDATEPROGRAMARBPROC glValidateProgramARB;
+extern PFNGLUNIFORM1FARBPROC glUniform1fARB;
+extern PFNGLUNIFORM2FARBPROC glUniform2fARB;
+extern PFNGLUNIFORM3FARBPROC glUniform3fARB;
+extern PFNGLUNIFORM4FARBPROC glUniform4fARB;
+extern PFNGLUNIFORM1IARBPROC glUniform1iARB;
+extern PFNGLUNIFORM2IARBPROC glUniform2iARB;
+extern PFNGLUNIFORM3IARBPROC glUniform3iARB;
+extern PFNGLUNIFORM4IARBPROC glUniform4iARB;
+extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
+extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
+extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
+extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
+extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
+extern PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
+extern PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
+extern PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
+extern PFNGLUNIFORMMATRIX2FVARBPROC glUniformMatrix2fvARB;
+extern PFNGLUNIFORMMATRIX3FVARBPROC glUniformMatrix3fvARB;
+extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
+extern PFNGLGETOBJECTPARAMETERFVARBPROC glGetObjectParameterfvARB;
+extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
+extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
+extern PFNGLGETATTACHEDOBJECTSARBPROC glGetAttachedObjectsARB;
+extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
+extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
+extern PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB;
+extern PFNGLGETUNIFORMIVARBPROC glGetUniformivARB;
+extern PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB;
+
+// GL_ARB_vertex_shader
+extern PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB;
+extern PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB;
+extern PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB;
+extern PFNGLVERTEXATTRIB1FVARBPROC glVertexAttrib1fvARB;
+extern PFNGLVERTEXATTRIB1SARBPROC glVertexAttrib1sARB;
+extern PFNGLVERTEXATTRIB1SVARBPROC glVertexAttrib1svARB;
+extern PFNGLVERTEXATTRIB2DARBPROC glVertexAttrib2dARB;
+extern PFNGLVERTEXATTRIB2DVARBPROC glVertexAttrib2dvARB;
+extern PFNGLVERTEXATTRIB2FARBPROC glVertexAttrib2fARB;
+extern PFNGLVERTEXATTRIB2FVARBPROC glVertexAttrib2fvARB;
+extern PFNGLVERTEXATTRIB2SARBPROC glVertexAttrib2sARB;
+extern PFNGLVERTEXATTRIB2SVARBPROC glVertexAttrib2svARB;
+extern PFNGLVERTEXATTRIB3DARBPROC glVertexAttrib3dARB;
+extern PFNGLVERTEXATTRIB3DVARBPROC glVertexAttrib3dvARB;
+extern PFNGLVERTEXATTRIB3FARBPROC glVertexAttrib3fARB;
+extern PFNGLVERTEXATTRIB3FVARBPROC glVertexAttrib3fvARB;
+extern PFNGLVERTEXATTRIB3SARBPROC glVertexAttrib3sARB;
+extern PFNGLVERTEXATTRIB3SVARBPROC glVertexAttrib3svARB;
+extern PFNGLVERTEXATTRIB4NBVARBPROC glVertexAttrib4nbvARB;
+extern PFNGLVERTEXATTRIB4NIVARBPROC glVertexAttrib4nivARB;
+extern PFNGLVERTEXATTRIB4NSVARBPROC glVertexAttrib4nsvARB;
+extern PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB;
+extern PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB;
+extern PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB;
+extern PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB;
+extern PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB;
+extern PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB;
+extern PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB;
+extern PFNGLVERTEXATTRIB4FARBPROC glVertexAttrib4fARB;
+extern PFNGLVERTEXATTRIB4FVARBPROC glVertexAttrib4fvARB;
+extern PFNGLVERTEXATTRIB4IVARBPROC glVertexAttrib4ivARB;
+extern PFNGLVERTEXATTRIB4SARBPROC glVertexAttrib4sARB;
+extern PFNGLVERTEXATTRIB4SVARBPROC glVertexAttrib4svARB;
+extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB;
+extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB;
+extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB;
+extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB;
+extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB;
+extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB;
+extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB;
+extern PFNGLBINDPROGRAMARBPROC glBindProgramARB;
+extern PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB;
+extern PFNGLGENPROGRAMSARBPROC glGenProgramsARB;
+extern PFNGLPROGRAMENVPARAMETER4DARBPROC glProgramEnvParameter4dARB;
+extern PFNGLPROGRAMENVPARAMETER4DVARBPROC glProgramEnvParameter4dvARB;
+extern PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB;
+extern PFNGLPROGRAMENVPARAMETER4FVARBPROC glProgramEnvParameter4fvARB;
+extern PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB;
+extern PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glProgramLocalParameter4dvARB;
+extern PFNGLPROGRAMLOCALPARAMETER4FARBPROC glProgramLocalParameter4fARB;
+extern PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB;
+extern PFNGLGETPROGRAMENVPARAMETERDVARBPROC glGetProgramEnvParameterdvARB;
+extern PFNGLGETPROGRAMENVPARAMETERFVARBPROC glGetProgramEnvParameterfvARB;
+extern PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB;
+extern PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glGetProgramLocalParameterfvARB;
+extern PFNGLGETPROGRAMIVARBPROC glGetProgramivARB;
+extern PFNGLGETPROGRAMSTRINGARBPROC glGetProgramStringARB;
+extern PFNGLGETVERTEXATTRIBDVARBPROC glGetVertexAttribdvARB;
+extern PFNGLGETVERTEXATTRIBFVARBPROC glGetVertexAttribfvARB;
+extern PFNGLGETVERTEXATTRIBIVARBPROC glGetVertexAttribivARB;
+extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC glGetVertexAttribPointervARB;
+extern PFNGLISPROGRAMARBPROC glIsProgramARB;
+extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB;
+extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB;
+extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB;
+
+extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB;
+extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glGetCompressedTexImageARB;
+
+extern PFNGLCOLORTABLEEXTPROC glColorTableEXT;
+
+//GL_EXT_framebuffer_object
+extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT;
+extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT;
+extern PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT;
+extern PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT;
+extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT;
+extern PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT;
+extern PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT;
+extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
+extern PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
+extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
+extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
+extern PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT;
+extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;
+extern PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT;
+extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
+extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT;
+extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT;
+
+#elif LL_MESA
 //----------------------------------------------------------------------------
 // MESA headers
 // quotes so we get libraries/.../GL/ version
-#define GL_GLEXT_PROTOTYPES
+#define GL_GLEXT_PROTOTYPES 1
 #include "GL/gl.h"
 #include "GL/glext.h"
 #include "GL/glu.h"
@@ -47,7 +251,7 @@
 # include "GL/glh_extensions.h"
 # undef __APPLE__
 
-#elif LL_LINUX
+#elif LL_LINUX 
 //----------------------------------------------------------------------------
 // Linux, MESA headers, but not necessarily assuming MESA runtime.
 // quotes so we get libraries/.../GL/ version
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 91c6a4ee3521d1bbe7f2f3b151846166d0873780..1286e91e49c6355b18073404de16b714cdab4448 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -364,7 +364,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
 
 
 	//copy file into memory
-	while(fgets((char *)buff, 1024, file) != NULL && count < (sizeof(buff)/sizeof(buff[0]))) 
+	while( fgets((char *)buff, 1024, file) != NULL && count < LL_ARRAY_SIZE(buff) ) 
 	{
 		text[count++] = (GLcharARB *)strdup((char *)buff); 
 	}
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt
index 1b4d4e7d54c88102f666241838faddbafb7d86f0..8ae0137a5e2dbb77f603409585f56fe4cdb3a3c0 100644
--- a/indra/llui/CMakeLists.txt
+++ b/indra/llui/CMakeLists.txt
@@ -68,6 +68,7 @@ set(llui_SOURCE_FILES
     lluictrl.cpp
     lluictrlfactory.cpp
     lluistring.cpp
+    lluitrans.cpp
     llundo.cpp
     llviewborder.cpp
     llview.cpp
@@ -124,6 +125,7 @@ set(llui_HEADER_FILES
     lluifwd.h
     llui.h
     lluistring.h
+    lluitrans.h
     lluixmltags.h
     llundo.h
     llviewborder.h
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index c4e928ce5571a9b12208ddc1339e9e5de5718008..3d92280828f7ec102fd797903ba7c7a5dc76e2f9 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -780,7 +780,7 @@ void LLFloater::snappedTo(const LLView* snap_view)
 
 void LLFloater::userSetShape(const LLRect& new_rect)
 {
-	const LLRect& old_rect = getRect();
+	const LLRect old_rect = getRect();
 	LLView::userSetShape(new_rect);
 
 	// if not minimized, adjust all snapped dependents to new shape
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index ad980d67fcb0a67ff1841dac0fb52d4ea5a08aef..64649b664c50804df79f784d046f84907870cbf6 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -59,6 +59,8 @@
 #include "llresmgr.h"
 #include "llui.h"
 
+#include "lluitrans.h"
+
 #include "llstl.h"
 
 #include "v2math.h"
@@ -267,24 +269,24 @@ void LLMenuItemGL::appendAcceleratorString( std::string& st ) const
 	{
 		if ( mAcceleratorMask & MASK_MAC_CONTROL )
 		{
-			st.append( "Ctrl-" );
+			st.append( LLUITrans::getString("accel-mac-control") );
 		}
 		else
 		{
-			st.append( "Cmd-" );		// Symbol would be "\xE2\x8C\x98"
+			st.append( LLUITrans::getString("accel-mac-command") );		// Symbol would be "\xE2\x8C\x98"
 		}
 	}
 	if( mAcceleratorMask & MASK_ALT )
-		st.append( "Opt-" );		// Symbol would be "\xE2\x8C\xA5"
+		st.append( LLUITrans::getString("accel-mac-option") );		// Symbol would be "\xE2\x8C\xA5"
 	if( mAcceleratorMask & MASK_SHIFT )
-		st.append( "Shift-" );		// Symbol would be "\xE2\x8C\xA7"
+		st.append( LLUITrans::getString("accel-mac-shift") );		// Symbol would be "\xE2\x8C\xA7"
 #else
 	if( mAcceleratorMask & MASK_CONTROL )
-		st.append( "Ctrl-" );
+		st.append( LLUITrans::getString("accel-win-control") );
 	if( mAcceleratorMask & MASK_ALT )
-		st.append( "Alt-" );
+		st.append( LLUITrans::getString("accel-win-alt") );
 	if( mAcceleratorMask & MASK_SHIFT )
-		st.append( "Shift-" );
+		st.append( LLUITrans::getString("accel-win-shift") );
 #endif
 
 	std::string keystr = LLKeyboard::stringFromKey( mAcceleratorKey );
diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h
index 424cda120752fe26767a8cdf3cf2c17247217112..dfd0eb3ac1a7368ee6901d8008c5f3f608682962 100644
--- a/indra/llui/llspinctrl.h
+++ b/indra/llui/llspinctrl.h
@@ -82,6 +82,7 @@ class LLSpinCtrl
 	virtual void	setFocus( BOOL b );
 	virtual void	clear();
 	virtual BOOL	isDirty() const { return( mValue != mInitialValue ); }
+	virtual void    resetDirty() { mInitialValue = mValue; }
 
 	virtual void	setPrecision(S32 precision);
 	virtual void	setMinValue(F32 min)			{ mMinValue = min; }
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 3ad4270929874e65aa82915921bf5dc9f24a3f34..a626a7a1bc11c4ac7e211b8cadc440b1409e232a 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1322,6 +1322,8 @@ BOOL LLTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
 			
 			setCursorAtLocalPos( x, y, TRUE );
 			endSelection();
+
+			updateScrollFromCursor();
 		}
 		
 		if( !hasSelection() )
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index 07e7a93f9f83c4b06c7538717b3015dea6f5d9c4..d6a6eca34150dfdbddbad07de729a33a6d5d2a00 100644
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -433,7 +433,7 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
 		expanded_filename.assign("");
 	}
 
-	//llinfos << "*** EXPANDED FILENAME: <" << mExpandedFilename << ">" << llendl;
+	//llinfos << "*** EXPANDED FILENAME: <" << expanded_filename << ">" << llendl;
 
 	return expanded_filename;
 }
@@ -661,6 +661,11 @@ void LLDir::dumpCurrentDirectories()
 	LL_DEBUGS2("AppInit","Directories") << "  TempDir:               " << getTempDir() << LL_ENDL;
 	LL_DEBUGS2("AppInit","Directories") << "  CAFile:				 " << getCAFile() << LL_ENDL;
 	LL_DEBUGS2("AppInit","Directories") << "  SkinDir:               " << getSkinDir() << LL_ENDL;
+
+#if LL_LIBXUL_ENABLED
+ 	LL_DEBUGS2("AppInit","Directories") << "  HTML Path:             " << getExpandedFilename( LL_PATH_HTML, "" ) << llendl;
+ 	LL_DEBUGS2("AppInit","Directories") << "  Mozilla Profile Path:  " << getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ) << llendl;
+#endif
 }
 
 
diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h
index 2bdc0ced002a4cb96ab1b422d5edf85c961c1f91..760b6512a5469089b0a77ac6099c012388d6da5b 100644
--- a/indra/llvfs/lldir.h
+++ b/indra/llvfs/lldir.h
@@ -33,6 +33,11 @@
 #ifndef LL_LLDIR_H
 #define LL_LLDIR_H
 
+#if LL_SOLARIS
+#include <sys/param.h>
+#define MAX_PATH MAXPATHLEN
+#endif
+
 // these numbers *may* get serialized, so we need to be explicit
 typedef enum ELLPath
 {
diff --git a/indra/llvfs/lldir_solaris.cpp b/indra/llvfs/lldir_solaris.cpp
index 49e2d3e6c5f8120132c2336d049a1a85a85dd16f..9553d923aaa91546fb425e3a6b2e1070b534c40f 100644
--- a/indra/llvfs/lldir_solaris.cpp
+++ b/indra/llvfs/lldir_solaris.cpp
@@ -37,14 +37,13 @@
 #include "llrand.h"
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/param.h>
 #include <unistd.h>
 #include <glob.h>
 #include <pwd.h>
 #include <sys/utsname.h>
 #define _STRUCTURED_PROC 1
 #include <sys/procfs.h>
+#include <fcntl.h>
 
 static std::string getCurrentUserHome(char* fallback)
 {
@@ -83,7 +82,16 @@ LLDir_Solaris::LLDir_Solaris()
 	mDirp = NULL;
 
 	char tmp_str[LL_MAX_PATH];	/* Flawfinder: ignore */ 
-	getcwd(tmp_str, LL_MAX_PATH);
+	if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
+	{
+		strcpy(tmp_str, "/tmp");
+		llwarns << "Could not get current directory; changing to "
+				<< tmp_str << llendl;
+		if (chdir(tmp_str) == -1)
+		{
+			llerrs << "Could not change directory to " << tmp_str << llendl;
+		}
+	}
 
 	mExecutableFilename = "";
 	mExecutablePathAndName = "";
@@ -122,20 +130,35 @@ LLDir_Solaris::LLDir_Solaris()
 		return;
 	}
 
+	char *p = execpath;			// nuke trash in link, if any exists
+	int i = 0;
+	while(*p != NULL && ++i < LL_MAX_PATH && isprint((int)(*p++)));
+	*p = NULL;
+
 	mExecutablePathAndName = strdup(execpath);
 	llinfos << "mExecutablePathAndName = [" << mExecutablePathAndName << "]" << llendl;
 
+	//NOTE: Why force people to cd into the package directory?
+	//      Look for SECONDLIFE env variable and use it, if set.
+
+	char *dcf = getenv("SECONDLIFE");
+	if(dcf != NULL){
+		(void)strcpy(path, dcf);
+		(void)strcat(path, "/bin");	//NOTE:  make sure we point at the bin
+		mExecutableDir = strdup(path);
+	}else{
 			// plunk a null at last '/' to get exec dir
-	char *s = execpath + strlen(execpath) -1;
-	while(*s != '/' && s != execpath){
-		--s;
-	}
+		char *s = execpath + strlen(execpath) -1;
+		while(*s != '/' && s != execpath){
+			--s;
+		}
 	
-	if(s != execpath){
-		*s = (char)NULL;
+		if(s != execpath){
+			*s = (char)NULL;
 	
-		mExecutableDir = strdup(execpath);
-		llinfos << "mExecutableDir = [" << mExecutableDir << "]" << llendl;
+			mExecutableDir = strdup(execpath);
+			llinfos << "mExecutableDir = [" << mExecutableDir << "]" << llendl;
+		}
 	}
 	
 	// *TODO: don't use /tmp, use $HOME/.secondlife/tmp or something.
@@ -355,12 +378,16 @@ void LLDir_Solaris::getRandomFileInDir(const std::string &dirname, const std::st
 std::string LLDir_Solaris::getCurPath()
 {
 	char tmp_str[LL_MAX_PATH];	/* Flawfinder: ignore */ 
-	getcwd(tmp_str, LL_MAX_PATH);
+	if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
+	{
+		llwarns << "Could not get current directory" << llendl;
+		tmp_str[0] = '\0';
+	}
 	return tmp_str;
 }
 
 
-BOOL LLDir_Solaris::fileExists(const std::string &filename)
+BOOL LLDir_Solaris::fileExists(const std::string &filename) const
 {
 	struct stat stat_data;
 	// Check the age of the file
diff --git a/indra/llvfs/lldir_solaris.h b/indra/llvfs/lldir_solaris.h
index f6e7c3cba5e6624dbffe559a0fe68864ede9ccd3..139754ba28abe20a7c0684478c7183ded87cc5aa 100644
--- a/indra/llvfs/lldir_solaris.h
+++ b/indra/llvfs/lldir_solaris.h
@@ -50,7 +50,7 @@ class LLDir_Solaris : public LLDir
 	virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask);
 	virtual BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap);
 	virtual void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname);
-	/*virtual*/ BOOL fileExists(const std::string &filename);
+	/*virtual*/ BOOL fileExists(const std::string &filename) const;
 
 private:
 	DIR *mDirp;
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 49fbb78d9d04bc7f7904150a21816edb8786e1c8..8d446f18f1b82d1aa9cb08b8cf963dfbaec3328b 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -702,7 +702,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
 		"Radeon DDR",
 		"Radeon VE",
 		"GDI Generic" };
-		const S32 CARD_COUNT = sizeof(CARD_LIST)/sizeof(char*);
+		const S32 CARD_COUNT = LL_ARRAY_SIZE(CARD_LIST);
 
 		// Future candidates:
 		// ProSavage/Twister
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index bd38a60fa26b611ffdf661865d04663c55ee210d..6b1b6f4d609982390df0e4ec54e19422a129adb7 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -85,8 +85,6 @@ static bool ATIbug = false;
 // be only one object of this class at any time.  Currently this is true.
 static LLWindowSDL *gWindowImplementation = NULL;
 
-static BOOL was_fullscreen = FALSE;
-
 
 void maybe_lock_display(void)
 {
@@ -324,8 +322,7 @@ static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str)
 
 static int x11_detect_VRAM_kb()
 {
-#if LL_SOLARIS
-#error Can this be done without an explicit architecture test, ie a test FOR xorg? Was followed by: && defined(__sparc)
+#if LL_SOLARIS && defined(__sparc)
       //  NOTE: there's no Xorg server on SPARC so just return 0
       //        and allow SDL to attempt to get the amount of VRAM
       return(0);
@@ -421,7 +418,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
 	if (SDL_Init(SDL_INIT_VIDEO) < 0)
 	{
 		llinfos << "sdl_init() failed! " << SDL_GetError() << llendl;
-		setupFailure("window creation error", "error", OSMB_OK);
+		setupFailure("sdl_init() failure,  window creation error", "error", OSMB_OK);
 		return false;
 	}
 
@@ -442,7 +439,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
 	if (!videoInfo)
 	{
 		llinfos << "SDL_GetVideoInfo() failed! " << SDL_GetError() << llendl;
-		setupFailure("Window creation error", "Error", OSMB_OK);
+		setupFailure("SDL_GetVideoInfo() failed, Window creation error", "Error", OSMB_OK);
 		return FALSE;
 	}
 
@@ -498,7 +495,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
         // *FIX: try to toggle vsync here?
 
 	mFullscreen = fullscreen;
-	was_fullscreen = fullscreen;
 
 	int sdlflags = SDL_OPENGL | SDL_RESIZABLE | SDL_ANYFORMAT;
 
@@ -574,7 +570,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
 		if (mWindow)
 		{
 			mFullscreen = TRUE;
-			was_fullscreen = TRUE;
 			mFullscreenWidth   = mWindow->w;
 			mFullscreenHeight  = mWindow->h;
 			mFullscreenBits    = mWindow->format->BitsPerPixel;
@@ -591,7 +586,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
 			llwarns << "createContext: fullscreen creation failure. SDL: " << SDL_GetError() << llendl;
 			// No fullscreen support
 			mFullscreen = FALSE;
-			was_fullscreen = FALSE;
 			mFullscreenWidth   = -1;
 			mFullscreenHeight  = -1;
 			mFullscreenBits    = -1;
@@ -673,8 +667,8 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
 	// fixme: actually, it's REALLY important for picking that we get at
 	// least 8 bits each of red,green,blue.  Alpha we can be a bit more
 	// relaxed about if we have to.
-#if LL_SOLARIS
-#error && defined(__sparc)
+#if LL_SOLARIS && defined(__sparc)
+//  again the __sparc required because Xsun support, 32bit are very pricey on SPARC
 	if(colorBits < 24)		//HACK:  on SPARC allow 24-bit color
 #else
 	if (colorBits < 32)
@@ -682,8 +676,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
 	{
 		close();
 		setupFailure(
-#if LL_SOLARIS
-#error && defined(__sparc)
+#if LL_SOLARIS && defined(__sparc)
 			"Second Life requires at least 24-bit color on SPARC to run in a window.\n"
 			"Please use fbconfig to set your default color depth to 24 bits.\n"
 			"You may also need to adjust the X11 setting in SMF.  To do so use\n"
@@ -927,7 +920,6 @@ BOOL LLWindowSDL::getSize(LLCoordScreen *size)
 	return (TRUE);
     }
 
-    llwarns << "LLWindowSDL::getPosition(): no window and not fullscreen!" << llendl;
     return (FALSE);
 }
 
@@ -940,7 +932,6 @@ BOOL LLWindowSDL::getSize(LLCoordWindow *size)
 	return (TRUE);
     }
 
-    llwarns << "LLWindowSDL::getPosition(): no window and not fullscreen!" << llendl;
     return (FALSE);
 }
 
@@ -959,11 +950,18 @@ BOOL LLWindowSDL::setSize(const LLCoordScreen size)
 {
 	if(mWindow)
 	{
-        // *FIX: (???)
-		//SizeWindow(mWindow, size.mX, size.mY, true);
-	}
+		// Push a resize event onto SDL's queue - we'll handle it
+		// when it comes out again.
+		SDL_Event event;
+		event.type = SDL_VIDEORESIZE;
+		event.resize.w = size.mX;
+		event.resize.h = size.mY;
+		SDL_PushEvent(&event); // copied into queue
 
-	return TRUE;
+		return TRUE;
+	}
+		
+	return FALSE;
 }
 
 void LLWindowSDL::swapBuffers()
@@ -1107,24 +1105,28 @@ F32 LLWindowSDL::getPixelAspectRatio()
 }
 
 
-// some of this stuff is to support 'temporarily windowed' mode so that
-// dialogs are still usable in fullscreen.  HOWEVER! - it's not enabled/working
-// yet.
-static LLCoordScreen old_size;
-static BOOL old_fullscreen;
+// This is to support 'temporarily windowed' mode so that
+// dialogs are still usable in fullscreen.
 void LLWindowSDL::beforeDialog()
 {
+	bool running_x11 = false;
+#if LL_X11
+	running_x11 = (mSDL_XWindowID != None);
+#endif //LL_X11
+
 	llinfos << "LLWindowSDL::beforeDialog()" << llendl;
 
-	if (SDLReallyCaptureInput(FALSE) // must ungrab input so popup works!
-	    && getSize(&old_size))
+	if (SDLReallyCaptureInput(FALSE)) // must ungrab input so popup works!
 	{
-		old_fullscreen = was_fullscreen;
-		
-		if (old_fullscreen)
+		if (mFullscreen)
 		{
-			// NOT YET WORKING
-			//switchContext(FALSE, old_size, TRUE);
+			// need to temporarily go non-fullscreen; bless SDL
+			// for providing a SDL_WM_ToggleFullScreen() - though
+			// it only works in X11
+			if (running_x11 && mWindow)
+			{
+				SDL_WM_ToggleFullScreen(mWindow);
+			}
 		}
 	}
 
@@ -1150,17 +1152,24 @@ void LLWindowSDL::beforeDialog()
 
 void LLWindowSDL::afterDialog()
 {
+	bool running_x11 = false;
+#if LL_X11
+	running_x11 = (mSDL_XWindowID != None);
+#endif //LL_X11
+
 	llinfos << "LLWindowSDL::afterDialog()" << llendl;
 
 	maybe_unlock_display();
 
-	if (old_fullscreen && !was_fullscreen)
+	if (mFullscreen)
 	{
-		// *FIX: NOT YET WORKING (see below)
-		//switchContext(TRUE, old_size, TRUE);
+		// need to restore fullscreen mode after dialog - only works
+		// in X11
+		if (running_x11 && mWindow)
+		{
+			SDL_WM_ToggleFullScreen(mWindow);
+		}
 	}
-	// *FIX: we need to restore the GL context using
-	// LLViewerWindow::restoreGL() - but how??
 }
 
 
@@ -1703,12 +1712,12 @@ void LLWindowSDL::gatherInput()
 			// which confuses the focus code [SL-24071].
 			if (event.active.gain != mHaveInputFocus)
 			{
-				if (event.active.gain)
+				mHaveInputFocus = !!event.active.gain;
+
+				if (mHaveInputFocus)
 					mCallbacks->handleFocus(this);
 				else
 					mCallbacks->handleFocusLost(this);
-			
-				mHaveInputFocus = !!event.active.gain;
 			}
                 }
                 if (event.active.state & SDL_APPACTIVE)
@@ -1716,10 +1725,10 @@ void LLWindowSDL::gatherInput()
 			// Change in iconification/minimization state.
 			if ((!event.active.gain) != mIsMinimized)
 			{
-				mCallbacks->handleActivate(this, !!event.active.gain);
-				llinfos << "SDL deiconification state switched to " << BOOL(event.active.gain) << llendl;
-	
 				mIsMinimized = (!event.active.gain);
+
+				mCallbacks->handleActivate(this, !mIsMinimized);
+				llinfos << "SDL deiconification state switched to " << BOOL(event.active.gain) << llendl;
 			}
 			else
 			{
@@ -2047,10 +2056,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ
 	if(gWindowImplementation != NULL)
 		gWindowImplementation->beforeDialog();
 
-	if (LLWindowSDL::ll_try_gtk_init()
-	    // We can NOT expect to combine GTK and SDL's aggressive fullscreen
-	    && ((NULL==gWindowImplementation) || (!was_fullscreen))
-	    )
+	if (LLWindowSDL::ll_try_gtk_init())
 	{
 		GtkWidget *win = NULL;
 
@@ -2155,10 +2161,7 @@ BOOL LLWindowSDL::dialog_color_picker ( F32 *r, F32 *g, F32 *b)
 
 	beforeDialog();
 
-	if (ll_try_gtk_init()
-	    // We can NOT expect to combine GTK and SDL's aggressive fullscreen
-	    && !was_fullscreen
-	    )
+	if (ll_try_gtk_init())
 	{
 		GtkWidget *win = NULL;
 
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 58d09672260adad091360a903079f8a5badf82b5..d1fdc8caa18213a326b0fd9c9bb0e35f67afe3e3 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2931,7 +2931,7 @@ void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url )
 	/*
 	std::string reg_path_str = gURLProtocolWhitelistHandler[i] + "\\shell\\open\\command";
 	WCHAR reg_path_wstr[256];
-	mbstowcs(reg_path_wstr, reg_path_str.c_str(), sizeof(reg_path_wstr)/sizeof(reg_path_wstr[0]));
+	mbstowcs( reg_path_wstr, reg_path_str.c_str(), LL_ARRAY_SIZE(reg_path_wstr) );
 
 	HKEY key;
 	WCHAR browser_open_wstr[1024];
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 750771f6ce22ee21e36701afeaaee2e19e72a425..9ec838ad46bb1e32a3c36e7605dee9f427e84a50 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -41,6 +41,7 @@ if (WINDOWS)
 endif (WINDOWS)
 
 include_directories(
+    ${DBUSGLIB_INCLUDE_DIRS}
     ${ELFIO_INCLUDE_DIR}
     ${LLAUDIO_INCLUDE_DIRS}
     ${LLCHARACTER_INCLUDE_DIRS}
@@ -937,11 +938,8 @@ if (WINDOWS)
         res/arrowcop.cur
         res/arrowcopmulti.cur
         res/arrowdrag.cur
-        res/bitmap2.bmp
         res/circleandline.cur
         res/icon1.ico
-        res/install_icon.BMP
-        res/install_icon.ico
         res/llarrow.cur
         res/llarrowdrag.cur
         res/llarrowdragmulti.cur
@@ -963,7 +961,6 @@ if (WINDOWS)
         res/lltoolzoomout.cur
         res/ll_icon.BMP
         res/ll_icon.ico
-        res/loginbackground.bmp
         res/resource.h
         res/toolbuy.cur
         res/toolopen.cur
@@ -973,8 +970,6 @@ if (WINDOWS)
         res/toolpickobject3.cur
         res/toolpipette.cur
         res/toolsit.cur
-        res/uninstall_icon.BMP
-        res/uninstall_icon.ico
         )
 
     set_source_files_properties(${viewer_RESOURCE_FILES}
@@ -1070,7 +1065,6 @@ set(viewer_XUI_FILES
     skins/default/xui/en-us/floater_html_simple.xml
     skins/default/xui/en-us/floater_hud.xml
     skins/default/xui/en-us/floater_image_preview.xml
-    skins/default/xui/en-us/floater_import.xml
     skins/default/xui/en-us/floater_im.xml
     skins/default/xui/en-us/floater_inspect.xml
     skins/default/xui/en-us/floater_instant_message_ad_hoc.xml
@@ -1535,6 +1529,25 @@ if (DARWIN)
           ${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}
+          --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
+      )
+
   endif (PACKAGE)
 endif (DARWIN)
 
diff --git a/indra/newview/featuretable_solaris.txt b/indra/newview/featuretable_solaris.txt
index 2a514eaab1fc32522ea4b7d6a4edf84ea5dbc07c..f24cbde5e2e5c351536bb418f5ec24ddb94b6dce 100644
--- a/indra/newview/featuretable_solaris.txt
+++ b/indra/newview/featuretable_solaris.txt
@@ -35,6 +35,8 @@ RenderRippleWater	1	1
 RenderTerrainDetail	1	2
 VertexShaderEnable	1	1
 RenderTextureMemoryMultiple		1	1.0
+UseOcclusion		1       1
+RenderCubeMap		1       1
 
 //
 // Class 0 Hardware (Unknown or just old)
@@ -108,6 +110,8 @@ RenderAvatarVP		0	0
 RenderLighting		1	0
 RenderParticleCount	1	1024
 RenderTerrainDetail 1	0
+RenderCubeMap		0	0
+UseOcclusion		0	0
 
 
 list low
@@ -146,6 +150,7 @@ RenderVBO			1	0
 RenderAniso			1	0
 RenderLighting		1	0
 RenderTerrainDetail	1	0
+RenderCubeMap		0	0
 
 list GeForce2
 RenderVBO			1	1
@@ -157,6 +162,7 @@ RenderTerrainDetail	1	0
 list GeForce3
 
 list ATI
+UseOcclusion		0	0
 
 list Radeon8500
 RenderLighting		1	0
diff --git a/indra/newview/res/install_icon.BMP b/indra/newview/installers/windows/install_icon.BMP
similarity index 100%
rename from indra/newview/res/install_icon.BMP
rename to indra/newview/installers/windows/install_icon.BMP
diff --git a/indra/newview/installers/windows/install_icon.ico b/indra/newview/installers/windows/install_icon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..1e00530c9016b16548de6890ab5562bbe2cbbe1d
Binary files /dev/null and b/indra/newview/installers/windows/install_icon.ico differ
diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi
index 0a68d6badcf0c19a2916cfc30f6a86f93adb2586..483568f9744f516858295b17eb58df25960913f2 100644
--- a/indra/newview/installers/windows/installer_template.nsi
+++ b/indra/newview/installers/windows/installer_template.nsi
@@ -68,8 +68,8 @@ Name ${INSTNAME}
 SubCaption 0 $(LicenseSubTitleSetup)	; override "license agreement" text
 
 BrandingText " "						; bottom of window text
-Icon %%SOURCE%%\res\install_icon.ico	; our custom icon
-UninstallIcon %%SOURCE%%\res\uninstall_icon.ico    ; our custom icon
+Icon          %%SOURCE%%\installers\windows\install_icon.ico
+UninstallIcon %%SOURCE%%\installers\windows\uninstall_icon.ico
 WindowIcon on							; show our icon in left corner
 BGGradient off							; no big background window
 CRCCheck on								; make sure CRC is OK
diff --git a/indra/newview/res/uninstall_icon.BMP b/indra/newview/installers/windows/uninstall_icon.BMP
similarity index 100%
rename from indra/newview/res/uninstall_icon.BMP
rename to indra/newview/installers/windows/uninstall_icon.BMP
diff --git a/indra/newview/installers/windows/uninstall_icon.ico b/indra/newview/installers/windows/uninstall_icon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..c4ec6c70bd7f325369d8763afef61ee8e93f2960
Binary files /dev/null and b/indra/newview/installers/windows/uninstall_icon.ico differ
diff --git a/indra/newview/linux_tools/client-readme.txt b/indra/newview/linux_tools/client-readme.txt
index 543a7a1881d543e1137c82a3923bd572840cb7a8..757e4a08cc1428a4c29ab51063dae23f1cc80ddd 100644
--- a/indra/newview/linux_tools/client-readme.txt
+++ b/indra/newview/linux_tools/client-readme.txt
@@ -95,12 +95,6 @@ you wish.
 4. KNOWN ISSUES
 -=-=-=-=-=-=-=-
 
-These are the most commonly-encountered known issues which are specific to
-the Beta release of the Linux client.
-
-* UPLOAD / SAVE / COLOR-PICKER DIALOGS - These only appear when the client
-  is in 'windowed' mode, not 'fullscreen' mode.
-
 * UPDATING - when the client detects that a new version of Second Life
   is available, it will ask you if you wish to download the new version.
   This option is not implemented; to upgrade, you should manually download a
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index efa7504a48627b2f75e7e688464537a273040274..7ef757f1bad1358464f5bb1d1c4d3bb985b60349 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -4348,7 +4348,19 @@ void LLAgent::setFocusObject(LLViewerObject* object)
 //-----------------------------------------------------------------------------
 void LLAgent::setFocusGlobal(const LLPickInfo& pick)
 {
-	setFocusGlobal(pick.mPosGlobal, pick.mObjectID);
+	LLViewerObject* objectp = gObjectList.findObject(pick.mObjectID);
+
+	if (objectp)
+	{
+		// focus on object plus designated offset
+		// which may or may not be same as pick.mPosGlobal
+		setFocusGlobal(objectp->getPositionGlobal() + LLVector3d(pick.mObjectOffset), pick.mObjectID);
+	}
+	else
+	{
+		// focus directly on point where user clicked
+		setFocusGlobal(pick.mPosGlobal, pick.mObjectID);
+	}
 }
 
 
@@ -5831,7 +5843,12 @@ bool LLAgent::teleportCore(bool is_local)
 		return false;
 	}
 
-	// Stop all animation before actual teleporting
+#if 0
+	// This should not exist. It has been added, removed, added, and now removed again.
+	// This change needs to come from the simulator. Otherwise, the agent ends up out of
+	// sync with other viewers. Discuss in DEV-14145/VWR-6744 before reenabling.
+
+	// Stop all animation before actual teleporting 
 	LLVOAvatar* avatarp = gAgent.getAvatarObject();
         if (avatarp)
 	{
@@ -5843,6 +5860,7 @@ bool LLAgent::teleportCore(bool is_local)
                }
                avatarp->processAnimationStateChanges();
        }
+#endif
 
 	// Don't call LLFirstUse::useTeleport because we don't know
 	// yet if the teleport will succeed.  Look in 
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 1be0644840721309993e28d6042d2e4b246a4874..44b9cb2198bb502ebe1e862af1de9b7f2c6e612c 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -104,6 +104,7 @@
 #include "llviewermenu.h"
 #include "llselectmgr.h"
 #include "lltrans.h"
+#include "lluitrans.h"
 #include "lltracker.h"
 #include "llviewerparcelmgr.h"
 #include "llworldmapview.h"
@@ -604,25 +605,6 @@ bool LLAppViewer::init()
 	/////////////////////////////////////////////////
 	// OS-specific login dialogs
 	/////////////////////////////////////////////////
-#if LL_WINDOWS
-	/*
-	// Display initial login screen, comes up quickly. JC
-	{
-		LLSplashScreen::hide();
-
-		INT_PTR result = DialogBox(hInstance, L"CONNECTBOX", NULL, login_dialog_func);
-		if (result < 0)
-		{
-			llwarns << "Connect dialog box failed, returned " << result << llendl;
-			return 1;
-		}
-		// success, result contains which button user clicked
-		llinfos << "Connect dialog box clicked " << result << llendl;
-
-		LLSplashScreen::show();
-	}
-	*/
-#endif
 
 	//test_cached_control();
 
@@ -1292,6 +1274,13 @@ bool LLAppViewer::cleanup()
 	LLVFile::cleanupClass();
 	llinfos << "VFS cleaned up" << llendflush;
 
+	// Quitting with "Remember Password" turned off should always stomp your
+	// saved password, whether or not you successfully logged in.  JC
+	if (!gSavedSettings.getBOOL("RememberPassword"))
+	{
+		LLStartUp::deletePasswordFromDisk();
+	}
+	
 	// Store the time of our current logoff
 	gSavedPerAccountSettings.setU32("LastLogoff", time_corrected());
 
@@ -2139,6 +2128,7 @@ bool LLAppViewer::initWindow()
 	LLUI::sWindow = gViewerWindow->getWindow();
 
 	LLTrans::parseStrings("strings.xml");
+	LLUITrans::parseStrings("ui_strings.xml");
 
 	// Show watch cursor
 	gViewerWindow->setCursor(UI_CURSOR_WAIT);
diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp
index 427f67c331da5b6fdde7fe4ab517156e4e84661c..0778503a92f38e7f76c0169a0ddab61d2c781305 100644
--- a/indra/newview/llappviewerlinux.cpp
+++ b/indra/newview/llappviewerlinux.cpp
@@ -540,9 +540,11 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze)
 	cmd += gDirUtilp->getDirDelimiter();
 #if LL_LINUX
 	cmd += "linux-crash-logger.bin";
-#else // LL_SOLARIS
-	cmd += "bin/solaris-crash-logger";
-#endif // LL_LINUX
+#elif LL_SOLARIS
+	cmd += "solaris-crash-logger";
+#else
+# error Unknown platform
+#endif
 
 	if(reportFreeze)
 	{
@@ -623,7 +625,10 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze)
 bool LLAppViewerLinux::beingDebugged()
 {
 	static enum {unknown, no, yes} debugged = unknown;
-	
+
+#if LL_SOLARIS
+	return debugged == no;	// BUG: fix this for Solaris
+#else
 	if (debugged == unknown)
 	{
 		pid_t ppid = getppid();
@@ -658,6 +663,7 @@ bool LLAppViewerLinux::beingDebugged()
 	}
 
 	return debugged == yes;
+#endif
 }
 
 bool LLAppViewerLinux::initLogging()
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index 5bdfbb09759b7d419c13938db228ab3eae9a1192..9dd06687873940e7d5c7e1465bcc98117a1a5317 100644
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -206,6 +206,7 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
 
 	LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString());
 	LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString());
+	S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
 
 	// Update L$ and ownership credit information
 	// since it probably changed on the server
@@ -222,7 +223,7 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
 		gAgent.sendReliableMessage();
 
 		LLSD args;
-		args["AMOUNT"] = llformat("%d",LLGlobalEconomy::Singleton::getInstance()->getPriceUpload());
+		args["AMOUNT"] = llformat("%d", expected_upload_cost);
 		LLNotifications::instance().add("UploadPayment", args);
 	}
 
@@ -320,9 +321,14 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
 		U32 everyone_perms   = mPostData.has("everyone_mask")   ? mPostData.get("everyone_mask"  ).asInteger() : PERM_NONE;
 		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,
-							0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE,
-							next_owner_perms, group_perms, everyone_perms);
+				    0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE,
+				    next_owner_perms, group_perms,
+				    everyone_perms, display_name,
+				    callback, expected_upload_cost, userdata);
 	}
 }
 
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index c76cbbeb3e18b259a9b8bae73539f4e3f6f26908..2395f3c5ae4bd1605d737fc3143794e60ce07731 100644
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -523,7 +523,8 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata )
 		{
 			if (self->mInputEditor)
 			{
-				self->mInputEditor->setText(utf8_out_str);
+				std::string rest_of_match = utf8_out_str.substr(utf8_trigger.size());
+				self->mInputEditor->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part
 				S32 outlength = self->mInputEditor->getLength(); // in characters
 			
 				// Select to end of line, starting from the character
diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp
index c89d56474d4232e6396f437629e340319b7fc78f..8b0ed39eb03f4c723c413429f142d8c6ec52306e 100644
--- a/indra/newview/lldirpicker.cpp
+++ b/indra/newview/lldirpicker.cpp
@@ -39,8 +39,9 @@
 #include "llkeyboard.h"
 #include "lldir.h"
 #include "llframetimer.h"
+#include "lltrans.h"
 
-#if LL_LINUX
+#if LL_LINUX || LL_SOLARIS
 # include "llfilepicker.h"
 #endif
 
@@ -264,7 +265,7 @@ void LLDirPicker::reset()
 	mDir.clear();
 }
 
-#elif LL_LINUX
+#elif LL_LINUX || LL_SOLARIS
 
 LLDirPicker::LLDirPicker() 
 {
@@ -294,7 +295,7 @@ BOOL LLDirPicker::getDir(std::string* filename)
 
 		if (picker)
 		{		   
-		   gtk_window_set_title(GTK_WINDOW(picker), "Choose Directory");
+		   gtk_window_set_title(GTK_WINDOW(picker), LLTrans::getString("choose_the_directory").c_str());
 		   gtk_widget_show_all(GTK_WIDGET(picker));
 		   gtk_main();
 		   return (!mFilePicker->getFirstFile().empty());
diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h
index 9c36dc6750bd46cdfe1040ca202d94a08bc2ad97..26f76915aeeccbdb16cb10af4cb531d7d5ac3b39 100644
--- a/indra/newview/lldirpicker.h
+++ b/indra/newview/lldirpicker.h
@@ -90,7 +90,7 @@ class LLDirPicker
 	
 #endif
 
-#if LL_LINUX
+#if LL_LINUX || LL_SOLARIS
 	// On Linux we just implement LLDirPicker on top of LLFilePicker
 	LLFilePicker *mFilePicker;
 #endif
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 768a728749de7f4903422f298eb7e6e1573a7e49..25a26f05d87ed7038ab5396c1ca94504b4b2637f 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -205,7 +205,7 @@ static struct ft_display_info ft_display_table[] =
 	{ LLFastTimer::FTM_OTHER,				" Other",			&red0 }
 };
 static int ft_display_didcalc = 0;
-static const int FTV_DISPLAY_NUM  = (sizeof(ft_display_table)/sizeof(ft_display_table[0]));
+static const int FTV_DISPLAY_NUM  = LL_ARRAY_SIZE(ft_display_table);
 
 S32 ft_display_idx[FTV_DISPLAY_NUM]; // line of table entry for display purposes (for collapse)
 
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 1ad55ae35c9cfa2ee362a52b3f4f9eb6f0c9c6ad..8f5882615f95c13c8470c0609cb42dabbb73f458 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -38,6 +38,7 @@
 #include "llkeyboard.h"
 #include "lldir.h"
 #include "llframetimer.h"
+#include "lltrans.h"
 
 #if LL_SDL
 #include "llwindowsdl.h" // for some X/GTK utils to help with filepickers
@@ -893,19 +894,45 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename)
 	return success;
 }
 
-#elif LL_LINUX
+#elif LL_LINUX || LL_SOLARIS
 
 # if LL_GTK
 
 // static
 void LLFilePicker::add_to_selectedfiles(gpointer data, gpointer user_data)
 {
+	// We need to run g_filename_to_utf8 in the user's locale
+	std::string saved_locale(setlocale(LC_ALL, NULL));
+	setlocale(LC_ALL, "");
+
 	LLFilePicker* picker = (LLFilePicker*) user_data;
+	GError *error = NULL;
 	gchar* filename_utf8 = g_filename_to_utf8((gchar*)data,
-						  -1, NULL, NULL, NULL);
-	picker->mFiles.push_back(std::string(filename_utf8));
-	lldebugs << "ADDED FILE " << filename_utf8 << llendl;
-	g_free(filename_utf8);
+						  -1, NULL, NULL, &error);
+	if (error)
+	{
+		// *FIXME.
+		// This condition should really be notified to the user, e.g.
+		// through a message box.  Just logging it is inappropriate.
+		
+		// g_filename_display_name is ideal, but >= glib 2.6, so:
+		// a hand-rolled hacky makeASCII which disallows control chars
+		std::string display_name;
+		for (const gchar *str = (const gchar *)data; *str; str++)
+		{
+			display_name += (char)((*str >= 0x20 && *str <= 0x7E) ? *str : '?');
+		}
+		llwarns << "g_filename_to_utf8 failed on \"" << display_name << "\": " << error->message << llendl;
+	}
+
+	if (filename_utf8)
+	{
+		picker->mFiles.push_back(std::string(filename_utf8));
+		lldebugs << "ADDED FILE " << filename_utf8 << llendl;
+		g_free(filename_utf8);
+	}
+
+	setlocale(LC_ALL, saved_locale.c_str());
 }
 
 // static
@@ -934,8 +961,7 @@ void LLFilePicker::chooser_responder(GtkWidget *widget, gint response, gpointer
 
 GtkWindow* LLFilePicker::buildFilePicker(bool is_save, bool is_folder, std::string context)
 {
-	if (LLWindowSDL::ll_try_gtk_init() &&
-	    ! gViewerWindow->getWindow()->getFullscreen())
+	if (LLWindowSDL::ll_try_gtk_init())
 	{
 		GtkWidget *win = NULL;
 		GtkFileChooserAction pickertype =
@@ -1017,7 +1043,7 @@ static void add_common_filters_to_gtkchooser(GtkFileFilter *gfilter,
 				    gfilter);
 	GtkFileFilter *allfilter = gtk_file_filter_new();
 	gtk_file_filter_add_pattern(allfilter, "*");
-	gtk_file_filter_set_name(allfilter, "All Files");
+	gtk_file_filter_set_name(allfilter, LLTrans::getString("all_files").c_str());
 	gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(picker), allfilter);
 	gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(picker), gfilter);
 }
@@ -1045,13 +1071,13 @@ static std::string add_simple_mime_filter_to_gtkchooser(GtkWindow *picker,
 static std::string add_wav_filter_to_gtkchooser(GtkWindow *picker)
 {
 	return add_simple_mime_filter_to_gtkchooser(picker,  "audio/x-wav",
-						    "Sounds (*.wav)");
+						    LLTrans::getString("sound_files") + " (*.wav)");
 }
 
 static std::string add_bvh_filter_to_gtkchooser(GtkWindow *picker)
 {
 	return add_simple_pattern_filter_to_gtkchooser(picker,  "*.bvh",
-						       "Animations (*.bvh)");
+						       LLTrans::getString("animation_files") + " (*.bvh)");
 }
 
 static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker)
@@ -1061,7 +1087,7 @@ static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker)
 	gtk_file_filter_add_mime_type(gfilter, "image/jpeg");
 	gtk_file_filter_add_mime_type(gfilter, "image/png");
 	gtk_file_filter_add_mime_type(gfilter, "image/bmp");
-	std::string filtername = "Images (*.tga; *.bmp; *.jpg; *.png)";
+	std::string filtername = LLTrans::getString("image_files") + " (*.tga; *.bmp; *.jpg; *.png)";
 	add_common_filters_to_gtkchooser(gfilter, picker, filtername);
 	return filtername;
 }
@@ -1081,7 +1107,7 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename
 	{
 		std::string suggest_name = "untitled";
 		std::string suggest_ext = "";
-		std::string caption = "Save ";
+		std::string caption = LLTrans::getString("save_file_verb") + " ";
 		switch (filter)
 		{
 		case FFSAVE_WAV:
@@ -1090,39 +1116,39 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename
 			break;
 		case FFSAVE_TGA:
 			caption += add_simple_pattern_filter_to_gtkchooser
-				(picker, "*.tga", "Targa Images (*.tga)");
+				(picker, "*.tga", LLTrans::getString("targa_image_files") + " (*.tga)");
 			suggest_ext = ".tga";
 			break;
 		case FFSAVE_BMP:
 			caption += add_simple_mime_filter_to_gtkchooser
-				(picker, "image/bmp", "Bitmap Images (*.bmp)");
+				(picker, "image/bmp", LLTrans::getString("bitmap_image_files") + " (*.bmp)");
 			suggest_ext = ".bmp";
 			break;
 		case FFSAVE_AVI:
 			caption += add_simple_mime_filter_to_gtkchooser
 				(picker, "video/x-msvideo",
-				 "AVI Movie File (*.avi)");
+				 LLTrans::getString("avi_movie_file") + " (*.avi)");
 			suggest_ext = ".avi";
 			break;
 		case FFSAVE_ANIM:
 			caption += add_simple_pattern_filter_to_gtkchooser
-				(picker, "*.xaf", "XAF Anim File (*.xaf)");
+				(picker, "*.xaf", LLTrans::getString("xaf_animation_file") + " (*.xaf)");
 			suggest_ext = ".xaf";
 			break;
 		case FFSAVE_XML:
 			caption += add_simple_pattern_filter_to_gtkchooser
-				(picker, "*.xml", "XML File (*.xml)");
+				(picker, "*.xml", LLTrans::getString("xml_file") + " (*.xml)");
 			suggest_ext = ".xml";
 			break;
 		case FFSAVE_RAW:
 			caption += add_simple_pattern_filter_to_gtkchooser
-				(picker, "*.raw", "RAW File (*.raw)");
+				(picker, "*.raw", LLTrans::getString("raw_file") + " (*.raw)");
 			suggest_ext = ".raw";
 			break;
 		case FFSAVE_J2C:
 			caption += add_simple_mime_filter_to_gtkchooser
 				(picker, "images/jp2",
-				 "Compressed Images (*.j2c)");
+				 LLTrans::getString("compressed_image_files") + " (*.j2c)");
 			suggest_ext = ".j2c";
 			break;
 		default:;
@@ -1168,7 +1194,7 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter )
 
 	if (picker)
 	{
-		std::string caption = "Load ";
+		std::string caption = LLTrans::getString("load_file_verb") + " ";
 		std::string filtername = "";
 		switch (filter)
 		{
@@ -1215,7 +1241,7 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter )
 		gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER(picker),
 						      TRUE);
 
-		gtk_window_set_title(GTK_WINDOW(picker), "Load Files");
+		gtk_window_set_title(GTK_WINDOW(picker), LLTrans::getString("load_files").c_str());
 
 		gtk_widget_show_all(GTK_WIDGET(picker));
 		gtk_main();
diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp
index 0cdd3f5b66f90e1335bc17d732921a1573617339..045ca6aa364cd7bb90a8310fa385a6b39e09d72e 100644
--- a/indra/newview/llfloateranimpreview.cpp
+++ b/indra/newview/llfloateranimpreview.cpp
@@ -989,15 +989,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 = sUploadAmount;
+				void *userdata = NULL;
 				upload_new_resource(floaterp->mTransactionID, // tid
-									LLAssetType::AT_ANIMATION,
-									name,
-									desc,
-									0,
-									LLAssetType::AT_NONE,
-									LLInventoryType::IT_ANIMATION,
-									LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
-									name);
+						    LLAssetType::AT_ANIMATION,
+						    name,
+						    desc,
+						    0,
+						    LLAssetType::AT_NONE,
+						    LLInventoryType::IT_ANIMATION,
+						    LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
+						    name,
+						    callback, expected_upload_cost, userdata);
 			}
 			else
 			{
diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp
index 793ae954aef8cc963a5ac13a2898f9db1b6270e6..f57042eedb3b72098fdb79177c9cdb5073aff953 100644
--- a/indra/newview/llfloaterchat.cpp
+++ b/indra/newview/llfloaterchat.cpp
@@ -393,7 +393,11 @@ void LLFloaterChat::addChat(const LLChat& chat,
 			text_color = gSavedSettings.getColor("IMChatColor");
 			size = INSTANT_MSG_SIZE;
 		}
-		gConsole->addLine(chat.mText, size, text_color);
+		// We display anything if it's not an IM. If it's an IM, check pref...
+		if	( !from_instant_message || gSavedSettings.getBOOL("IMInChatHistory") ) 
+		{
+			gConsole->addLine(chat.mText, size, text_color);
+		}
 	}
 
 	if(from_instant_message && gSavedPerAccountSettings.getBOOL("LogChatIM"))
diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp
index db9d943ed3a19c9ef3f9590ad256c7802a9141a2..acfcfab445a627d11ff9d94462a4f84946a5ec09 100644
--- a/indra/newview/llfloaternamedesc.cpp
+++ b/indra/newview/llfloaternamedesc.cpp
@@ -49,6 +49,7 @@
 #include "llviewermenufile.h"	// upload_new_resource()
 #include "lluictrlfactory.h"
 #include "llstring.h"
+#include "lleconomy.h"
 
 // linden includes
 #include "llassetstorage.h"
@@ -179,11 +180,16 @@ void LLFloaterNameDesc::onBtnOK( void* userdata )
 
 	fp->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(fp->mFilenameAndPath, // file
-		fp->childGetValue("name_form").asString(), 
-		fp->childGetValue("description_form").asString(), 
-		0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE,
-		LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms());
+			    fp->childGetValue("name_form").asString(), 
+			    fp->childGetValue("description_form").asString(), 
+			    0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE,
+			    LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
+			    display_name, callback, expected_upload_cost, nruserdata);
 	fp->close(false);
 }
 
diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp
index 8a057b442cdbae5879998fff59ec4c04b86c3cf1..406d940cf0fc1fa7503ae75efcaa5fcb64bc1e63 100644
--- a/indra/newview/llfloaterproperties.cpp
+++ b/indra/newview/llfloaterproperties.cpp
@@ -248,7 +248,7 @@ void LLFloaterProperties::refresh()
 			"RadioSaleType",
 			"EditPrice"
 		};
-		for(size_t t=0; t<sizeof(enableNames)/sizeof(char*); ++t)
+		for(size_t t=0; t<LL_ARRAY_SIZE(enableNames); ++t)
 		{
 			childSetEnabled(enableNames[t],false);
 		}
@@ -259,7 +259,7 @@ void LLFloaterProperties::refresh()
 			"EveryoneMaskDebug",
 			"NextMaskDebug"
 		};
-		for(size_t t=0; t<sizeof(hideNames)/sizeof(char*); ++t)
+		for(size_t t=0; t<LL_ARRAY_SIZE(hideNames); ++t)
 		{
 			childSetVisible(hideNames[t],false);
 		}
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index 1f401acc4c8be18083fe09cc74459c4cec972e46..3f699fda99b599977efe4afaf8fa9352248407f3 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -693,6 +693,9 @@ LLSD LLFloaterReporter::gatherReport()
 #elif LL_LINUX
 	const char* platform = "Lnx";
 	const char* short_platform = "O:L";
+#elif LL_SOLARIS
+	const char* platform = "Sol";
+	const char* short_platform = "O:S";
 #else
 	const char* platform = "???";
 	const char* short_platform = "O:?";
@@ -885,6 +888,8 @@ void LLFloaterReporter::takeScreenshot()
 
 	// create a resource data
 	mResourceDatap->mInventoryType = LLInventoryType::IT_NONE;
+	mResourceDatap->mNextOwnerPerm = 0; // not used
+	mResourceDatap->mExpectedUploadCost = 0; // we expect that abuse screenshots are free
 	mResourceDatap->mAssetInfo.mTransactionID.generate();
 	mResourceDatap->mAssetInfo.mUuid = mResourceDatap->mAssetInfo.mTransactionID.makeAssetID(gAgent.getSecureSessionID());
 	if (BUG_REPORT == mReportType)
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index dd5f2662d6ac27ec0315eede97064010a538c2ba..14caed9d97aa5964883a1eff960d5ed6575bffdd 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -51,6 +51,7 @@
 #include "llfocusmgr.h"
 #include "llbutton.h"
 #include "llcombobox.h"
+#include "lleconomy.h"
 #include "llsliderctrl.h"
 #include "llspinctrl.h"
 #include "llviewercontrol.h"
@@ -952,17 +953,21 @@ void LLSnapshotLivePreview::saveTexture()
 		gAgent.buildLocationString(pos_string);
 		std::string who_took_it;
 		gAgent.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,
-							LLAssetType::AT_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);
+				    LLAssetType::AT_TEXTURE,
+				    "Snapshot : " + pos_string,
+				    "Taken by " + who_took_it + " at " + pos_string,
+				    0,
+				    LLAssetType::AT_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, userdata);
 		gViewerWindow->playSnapshotAnimAndSound();
 	}
 	else
@@ -1271,6 +1276,9 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
 	LLLocale locale(LLLocale::USER_LOCALE);
 	std::string bytes_string;
 	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 
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 9a0d831be485aac83d7db9542948d57a8bdcdadd..704b53e8164fff0848a0e9280f48572b04ee4685 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -271,7 +271,7 @@ BOOL	LLFloaterTools::postBuild()
 			&LLToolPlacerPanel::sTriangleTorus,
 			&LLToolPlacerPanel::sTree,
 			&LLToolPlacerPanel::sGrass};
-	for(size_t t=0; t<sizeof(toolNames)/sizeof(toolNames[0]); ++t)
+	for(size_t t=0; t<LL_ARRAY_SIZE(toolNames); ++t)
 	{
 		LLButton *found = getChild<LLButton>(toolNames[t]);
 		if(found)
diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp
index a9c182455c080dc04e89a07bbefa8a5ffd0e8eb2..16428ce6d1cc745341f701eb88f08943951d1a0c 100644
--- a/indra/newview/llfloatertopobjects.cpp
+++ b/indra/newview/llfloatertopobjects.cpp
@@ -185,7 +185,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
 		{
 			have_extended_data = true;
 			msg->getU32("DataExtended", "TimeStamp", time_stamp, block);
-			msg->getF32(_PREHASH_ReportData, "MonoScore", mono_score, block);
+			msg->getF32("DataExtended", "MonoScore", mono_score, block);
 		}
 
 		LLSD element;
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index 1ba85e6e536123747bcea88104ac2876d59c8244..6a392e03fbca0c6edd2659da127959c282ebedc0 100644
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -34,21 +34,25 @@
 
 #include "llfloatertos.h"
 
-#include "llbutton.h"
-#include "llradiogroup.h"
-#include "llvfile.h"
-#include "lltextbox.h"
-#include "llviewertexteditor.h"
+// viewer includes
+#include "llagent.h"
 #include "llappviewer.h"
 #include "llstartup.h"
-#include "message.h"
-#include "llagent.h"
-#include "lluictrlfactory.h"
-#include "llviewerwindow.h"
 #include "llviewerstats.h"
-#include "llui.h"
+#include "llviewertexteditor.h"
+#include "llviewerwindow.h"
+
+// linden library includes
+#include "llbutton.h"
 #include "llhttpclient.h"
+#include "llhttpstatuscodes.h"	// for HTTP_FOUND
 #include "llradiogroup.h"
+#include "lltextbox.h"
+#include "llui.h"
+#include "lluictrlfactory.h"
+#include "llvfile.h"
+#include "message.h"
+
 
 // static 
 LLFloaterTOS* LLFloaterTOS::sInstance = NULL;
@@ -115,7 +119,13 @@ class LLIamHere : public LLHTTPClient::Responder
 		virtual void error( U32 status, const std::string& reason )
 		{
 			if ( mParent )
-				mParent->setSiteIsAlive( false );
+			{
+				// *HACK: For purposes of this alive check, 302 Found
+				// (aka Moved Temporarily) is considered alive.  The web site
+				// redirects this link to a "cache busting" temporary URL. JC
+				bool alive = (status == HTTP_FOUND);
+				mParent->setSiteIsAlive( alive );
+			}
 		};
 };
 
@@ -185,12 +195,6 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
 			// but if the page is unavailable, we need to do this now
 			LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
 			tos_agreement->setEnabled( true );
-
-			if ( web_browser )
-			{
-				// hide browser control (revealing default text message)
-				web_browser->setVisible( FALSE );
-			};
 		};
 	};
 }
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 7f2321aafbec28d752d570fee94a19565c821a53..d59f5139252b0fecd33611a92905c7417e5dbd94 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -742,7 +742,7 @@ void LLFloaterWorldMap::updateLocation()
 void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord)
 {
 	LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name);
-	z_coord = llclamp(z_coord, 0, 1000);
+	z_coord = llclamp(z_coord, 0, 4096);
 	if (sim_info)
 	{
 		LLVector3 local_pos;
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 48d9a8a76b3e1098609abe6473bf0fdf9dc45437..f98a3f9ee51d4e0cf99159aca5a8a5e8b5d539e6 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1067,7 +1067,7 @@ void  LLInventoryModel::fetchInventoryResponder::result(const LLSD& content)
 	S32 count = content["items"].size();
 	bool all_one_folder = true;
 	LLUUID folder_id;
-	// Does this loop ever execute more than once? -Gigs
+	// Does this loop ever execute more than once?
 	for(S32 i = 0; i < count; ++i)
 	{
 		LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
@@ -2645,7 +2645,7 @@ void LLInventoryModel::processFetchInventoryReply(LLMessageSystem* msg, void**)
 
 bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
 {
-	//make sure our added inventory observer is active -Gigs
+	//make sure our added inventory observer is active
 	start_new_inventory_observer();
 
 	LLUUID agent_id;
@@ -2661,7 +2661,7 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
 	S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData);
 	bool all_one_folder = true;
 	LLUUID folder_id;
-	// Does this loop ever execute more than once? -Gigs
+	// Does this loop ever execute more than once?
 	for(S32 i = 0; i < count; ++i)
 	{
 		LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
@@ -3791,7 +3791,6 @@ void LLInventoryAddedObserver::changed(U32 mask)
 
 	// *HACK: If this was in response to a packet off
 	// the network, figure out which item was updated.
-	// Code from Gigs Taggert, sin allowed by JC.
 	LLMessageSystem* msg = gMessageSystem;
 
 	std::string msg_name;
diff --git a/indra/newview/llloginhandler.cpp b/indra/newview/llloginhandler.cpp
index d298f8e0e7bd8085bcfe34cc2fc18cf103926b31..053f79888273580a6efb72549dff43c43f654fb7 100644
--- a/indra/newview/llloginhandler.cpp
+++ b/indra/newview/llloginhandler.cpp
@@ -192,27 +192,18 @@ bool LLLoginHandler::handle(const LLSD& tokens,
 			LLMD5 pass((unsigned char*)password.c_str());
 			char md5pass[33];		/* Flawfinder: ignore */
 			pass.hex_digest(md5pass);
-			password = ll_safe_string(md5pass, 32);
-			save_password_to_disk(password.c_str());
+			std::string hashed_password = ll_safe_string(md5pass, 32);
+			LLStartUp::savePasswordToDisk(hashed_password);
 		}
 	}
-	else
-	{
-		save_password_to_disk(NULL);
-		gSavedSettings.setBOOL("RememberPassword", FALSE);
-	}
 			
 
 	if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP)  //on splash page
 	{
 		if (!mFirstName.empty() || !mLastName.empty())
 		{
-			// Fill in the name, and maybe the password, preserving the
-			// remember-password setting. JC
-			std::string ignore;
-			BOOL remember;
-			LLPanelLogin::getFields(ignore, ignore, ignore, remember);
-			LLPanelLogin::setFields(mFirstName, mLastName, password, remember);
+			// Fill in the name, and maybe the password
+			LLPanelLogin::setFields(mFirstName, mLastName, password);
 		}
 
 		if (mWebLoginKey.isNull())
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index b9a700991e033ffed749b30fc11d5c1a74d8973d..959a575950a4eef1ec8af60779337d293f834a03 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -1635,7 +1635,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
 	}
 	
 	U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_ALPHA, LLRenderPass::PASS_FULLBRIGHT, LLRenderPass::PASS_SHINY };
-	U32 num_types = sizeof(types)/sizeof(U32);
+	U32 num_types = LL_ARRAY_SIZE(types);
 
 	GLuint stencil_mask = 0xFFFFFFFF;
 	//stencil in volumes
diff --git a/indra/newview/llmemoryview.cpp b/indra/newview/llmemoryview.cpp
index 2a8fa2bf3581cc73e6b3619825f87ff7e46987cd..97dc373b07b44d1a6f4c0358bc3bcf4318203f70 100644
--- a/indra/newview/llmemoryview.cpp
+++ b/indra/newview/llmemoryview.cpp
@@ -138,7 +138,7 @@ static const struct mtv_display_info mtv_display_table[] =
 
  	{ LLMemType::MTYPE_OTHER,			"Other",			&red0 },
 };
-static const int MTV_DISPLAY_NUM  = (sizeof(mtv_display_table)/sizeof(mtv_display_table[0]));
+static const int MTV_DISPLAY_NUM  = LL_ARRAY_SIZE(mtv_display_table);
 
 void LLMemoryView::draw()
 {
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 8b5cb942219422843be027657163be243e983031..41f8f3941a3b7ba1aa5ef6f19b38d46924dcad75 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -78,9 +78,6 @@
 #include "llweb.h"
 #include "llinventorymodel.h"
 #include "roles_constants.h"
-
-#define	kArraySize( _kArray ) ( sizeof( (_kArray) ) / sizeof( _kArray[0] ) )
-
 #include "lluictrlfactory.h"
 
 // Statics
@@ -504,17 +501,17 @@ BOOL LLPanelAvatarPicks::postBuild(void)
 
 BOOL LLPanelAvatarAdvanced::postBuild()
 {
-	for(size_t ii = 0; ii < kArraySize(mWantToCheck); ++ii)
+	for(size_t ii = 0; ii < LL_ARRAY_SIZE(mWantToCheck); ++ii)
 		mWantToCheck[ii] = NULL;
-	for(size_t ii = 0; ii < kArraySize(mSkillsCheck); ++ii)
+	for(size_t ii = 0; ii < LL_ARRAY_SIZE(mSkillsCheck); ++ii)
 		mSkillsCheck[ii] = NULL;
-	mWantToCount = (8>kArraySize(mWantToCheck))?kArraySize(mWantToCheck):8;
+	mWantToCount = (8>LL_ARRAY_SIZE(mWantToCheck))?LL_ARRAY_SIZE(mWantToCheck):8;
 	for(S32 tt=0; tt < mWantToCount; ++tt)
 	{	
 		std::string ctlname = llformat("chk%d", tt);
 		mWantToCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname);
 	}	
-	mSkillsCount = (6>kArraySize(mSkillsCheck))?kArraySize(mSkillsCheck):6;
+	mSkillsCount = (6>LL_ARRAY_SIZE(mSkillsCheck))?LL_ARRAY_SIZE(mSkillsCheck):6;
 
 	for(S32 tt=0; tt < mSkillsCount; ++tt)
 	{
@@ -1817,7 +1814,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
 				"AcctTypeCharterMember",
 				"AcctTypeEmployee"
 			};
-			caption_index = llclamp(caption_index, (U8)0, (U8)(sizeof(ACCT_TYPE)/sizeof(ACCT_TYPE[0])-1));
+			caption_index = llclamp(caption_index, (U8)0, (U8)(LL_ARRAY_SIZE(ACCT_TYPE)-1));
 			args["[ACCTTYPE]"] = self->mPanelSecondLife->getString(ACCT_TYPE[caption_index]);
 
 			std::string payment_text = " ";
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index ceca360967e8151d9e7fd65f51976430c7611bfa..cbf4a8740c06aa2eb4026487befcdbc63a34cc10 100644
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -195,6 +195,7 @@ BOOL LLPanelGroupGeneral::postBuild()
 		mSpinEnrollmentFee->setCommitCallback(onCommitAny);
 		mSpinEnrollmentFee->setCallbackUserData(this);
 		mSpinEnrollmentFee->setPrecision(0);
+		mSpinEnrollmentFee->resetDirty();
 	}
 
 	BOOL accept_notices = FALSE;
@@ -221,6 +222,7 @@ BOOL LLPanelGroupGeneral::postBuild()
 		mCtrlListGroup->setCallbackUserData(this);
 		mCtrlListGroup->set(list_in_profile);
 		mCtrlListGroup->setEnabled(data.mID.notNull());
+		mCtrlListGroup->resetDirty();
 	}
 
 	mActiveTitleLabel = getChild<LLTextBox>("active_title_label", recurse);
@@ -230,6 +232,7 @@ BOOL LLPanelGroupGeneral::postBuild()
 	{
 		mComboActiveTitle->setCommitCallback(onCommitTitle);
 		mComboActiveTitle->setCallbackUserData(this);
+		mComboActiveTitle->resetDirty();
 	}
 
 	mIncompleteMemberDataStr = getString("incomplete_member_data_str");
@@ -259,7 +262,7 @@ BOOL LLPanelGroupGeneral::postBuild()
 void LLPanelGroupGeneral::onFocusEdit(LLFocusableElement* ctrl, void* data)
 {
 	LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data;
-	self->mChanged = TRUE;
+	self->updateChanged();
 	self->notifyObservers();
 }
 
@@ -317,6 +320,7 @@ void LLPanelGroupGeneral::onCommitTitle(LLUICtrl* ctrl, void* data)
 	if (self->mGroupID.isNull() || !self->mAllowEdit) return;
 	LLGroupMgr::getInstance()->sendGroupTitleUpdate(self->mGroupID,self->mComboActiveTitle->getCurrentID());
 	self->update(GC_TITLES);
+	self->mComboActiveTitle->resetDirty();
 }
 
 // static
@@ -398,6 +402,7 @@ void LLPanelGroupGeneral::openProfile(void* data)
 
 bool LLPanelGroupGeneral::needsApply(std::string& mesg)
 { 
+	updateChanged();
 	mesg = getString("group_info_unchanged");
 	return mChanged || mGroupID.isNull();
 }
@@ -660,6 +665,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
 				mComboActiveTitle->setCurrentByID(LLUUID::null);
 			}
 		}
+
+		mComboActiveTitle->resetDirty();
 	}
 
 	// If this was just a titles update, we are done.
@@ -674,6 +681,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
 	{
 		mCtrlShowInGroupList->set(gdatap->mShowInList);
 		mCtrlShowInGroupList->setEnabled(mAllowEdit && can_change_ident);
+		mCtrlShowInGroupList->resetDirty();
+
 	}
 	if (mComboMature)
 	{
@@ -687,24 +696,29 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
 		}
 		mComboMature->setEnabled(mAllowEdit && can_change_ident);
 		mComboMature->setVisible( !gAgent.isTeen() );
+		mComboMature->resetDirty();
 	}
 	if (mCtrlOpenEnrollment) 
 	{
 		mCtrlOpenEnrollment->set(gdatap->mOpenEnrollment);
 		mCtrlOpenEnrollment->setEnabled(mAllowEdit && can_change_member_opts);
+		mCtrlOpenEnrollment->resetDirty();
 	}
 	if (mCtrlEnrollmentFee) 
 	{	
 		mCtrlEnrollmentFee->set(gdatap->mMembershipFee > 0);
 		mCtrlEnrollmentFee->setEnabled(mAllowEdit && can_change_member_opts);
+		mCtrlEnrollmentFee->resetDirty();
 	}
 	
 	if (mSpinEnrollmentFee)
 	{
 		S32 fee = gdatap->mMembershipFee;
 		mSpinEnrollmentFee->set((F32)fee);
-		mSpinEnrollmentFee->setEnabled( mAllowEdit 
-								&& (fee > 0) && can_change_member_opts);
+		mSpinEnrollmentFee->setEnabled( mAllowEdit &&
+						(fee > 0) &&
+						can_change_member_opts);
+		mSpinEnrollmentFee->resetDirty();
 	}
 	if ( mBtnJoinGroup )
 	{
@@ -733,8 +747,9 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
 		{
 			mCtrlReceiveNotices->setEnabled(mAllowEdit);
 		}
+		mCtrlReceiveNotices->resetDirty();
 	}
-	
+
 
 	if (mInsignia) mInsignia->setEnabled(mAllowEdit && can_change_ident);
 	if (mEditCharter) mEditCharter->setEnabled(mAllowEdit && can_change_ident);
@@ -750,11 +765,15 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
 		}
 		else
 		{
-			
 			mInsignia->setImageAssetID(mDefaultIconID);
 		}
 	}
-	if (mEditCharter) mEditCharter->setText(gdatap->mCharter);
+
+	if (mEditCharter)
+	{
+		mEditCharter->setText(gdatap->mCharter);
+		mEditCharter->resetDirty();
+	}
 	
 	if (mListVisibleMembers)
 	{
@@ -882,7 +901,7 @@ void LLPanelGroupGeneral::updateChanged()
 
 	mChanged = FALSE;
 
-	for( int i= 0; i< sizeof(check_list)/sizeof(*check_list); i++ )
+	for( int i= 0; i< LL_ARRAY_SIZE(check_list); i++ )
 	{
 		if( check_list[i] && check_list[i]->isDirty() )
 		{
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 46ced60b448570ff46d9e0431a9ea99519fc4ac0..bc5e8f2482e5f008ba70a821bfbda7d84e009679 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -546,8 +546,9 @@ void LLPanelLogin::show(const LLRect &rect,
 }
 
 // static
-void LLPanelLogin::setFields(const std::string& firstname, const std::string& lastname, const std::string& password,
-							 BOOL remember)
+void LLPanelLogin::setFields(const std::string& firstname,
+			     const std::string& lastname,
+			     const std::string& password)
 {
 	if (!sInstance)
 	{
@@ -581,8 +582,6 @@ void LLPanelLogin::setFields(const std::string& firstname, const std::string& la
 		pass.hex_digest(munged_password);
 		sInstance->mMungedPassword = munged_password;
 	}
-
-	sInstance->childSetValue("remember_check", remember);
 }
 
 
@@ -601,8 +600,9 @@ void LLPanelLogin::addServer(const std::string& server, S32 domain_name)
 }
 
 // static
-void LLPanelLogin::getFields(std::string &firstname, std::string &lastname, std::string &password,
-							BOOL &remember)
+void LLPanelLogin::getFields(std::string *firstname,
+			     std::string *lastname,
+			     std::string *password)
 {
 	if (!sInstance)
 	{
@@ -610,14 +610,13 @@ void LLPanelLogin::getFields(std::string &firstname, std::string &lastname, std:
 		return;
 	}
 
-	firstname = sInstance->childGetText("first_name_edit");
-	LLStringUtil::trim(firstname);
+	*firstname = sInstance->childGetText("first_name_edit");
+	LLStringUtil::trim(*firstname);
 
-	lastname = sInstance->childGetText("last_name_edit");
-	LLStringUtil::trim(lastname);
+	*lastname = sInstance->childGetText("last_name_edit");
+	LLStringUtil::trim(*lastname);
 
-	password = sInstance->mMungedPassword;
-	remember = sInstance->childGetValue("remember_check");
+	*password = sInstance->mMungedPassword;
 }
 
 // static
diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h
index 5dffaa8323ddfb3a48f3fda846d507498892e7bc..47d42da7f1aa5a3e9ad2f32f2a6284d3470ede51 100644
--- a/indra/newview/llpanellogin.h
+++ b/indra/newview/llpanellogin.h
@@ -59,14 +59,15 @@ class LLPanelLogin:
 		void (*callback)(S32 option, void* user_data), 
 		void* callback_data);
 
+	// Remember password checkbox is set via gSavedSettings "RememberPassword"
 	static void setFields(const std::string& firstname, const std::string& lastname, 
-		const std::string& password, BOOL remember);
+		const std::string& password);
 
 	static void addServer(const std::string& server, S32 domain_name);
 	static void refreshLocation( bool force_visible );
 
-	static void getFields(std::string& firstname, std::string& lastname,
-						  std::string& password, BOOL& remember);
+	static void getFields(std::string *firstname, std::string *lastname,
+						  std::string *password);
 
 	static BOOL isGridComboDirty();
 	static void getLocation(std::string &location);
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index 09cdfabfc178cc2203e72eb62926bbb3760b1446..ff3b9433f4833f1bfbff3f416c2eaab084256c91 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -236,14 +236,14 @@ BOOL LLPreviewGesture::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 					LLScrollListItem* line = NULL;
 					if (cargo_type == DAD_ANIMATION)
 					{
-						line = addStep("Animation");
+						line = addStep( STEP_ANIMATION );
 						LLGestureStepAnimation* anim = (LLGestureStepAnimation*)line->getUserdata();
 						anim->mAnimAssetID = item->getAssetUUID();
 						anim->mAnimName = item->getName();
 					}
 					else if (cargo_type == DAD_SOUND)
 					{
-						line = addStep("Sound");
+						line = addStep( STEP_SOUND );
 						LLGestureStepSound* sound = (LLGestureStepSound*)line->getUserdata();
 						sound->mSoundAssetID = item->getAssetUUID();
 						sound->mSoundName = item->getName();
@@ -847,18 +847,18 @@ void LLPreviewGesture::refresh()
 void LLPreviewGesture::initDefaultGesture()
 {
 	LLScrollListItem* item;
-	item = addStep("Animation");
+	item = addStep( STEP_ANIMATION );
 	LLGestureStepAnimation* anim = (LLGestureStepAnimation*)item->getUserdata();
 	anim->mAnimAssetID = ANIM_AGENT_HELLO;
 	anim->mAnimName = "Wave";
 	updateLabel(item);
 
-	item = addStep("Wait");
+	item = addStep( STEP_WAIT );
 	LLGestureStepWait* wait = (LLGestureStepWait*)item->getUserdata();
 	wait->mFlags = WAIT_FLAG_ALL_ANIM;
 	updateLabel(item);
 
-	item = addStep("Chat");
+	item = addStep( STEP_CHAT );
 	LLGestureStepChat* chat_step = (LLGestureStepChat*)item->getUserdata();
 	chat_step->mChatText = "Hello, avatar!";
 	updateLabel(item);
@@ -1597,38 +1597,44 @@ void LLPreviewGesture::onClickAdd(void* data)
 	LLScrollListItem* library_item = self->mLibraryList->getFirstSelected();
 	if (!library_item) return;
 
+	S32 library_item_index = self->mLibraryList->getFirstSelectedIndex();
+
 	const LLScrollListCell* library_cell = library_item->getColumn(0);
 	const std::string& library_text = library_cell->getValue().asString();
 
-	self->addStep(library_text);
+	if( library_item_index >= STEP_EOF )
+	{
+		llerrs << "Unknown step type: " << library_text << llendl;
+		return;
+	}
 
+	self->addStep( (EStepType)library_item_index );
 	self->mDirty = TRUE;
 	self->refresh();
 }
 
-LLScrollListItem* LLPreviewGesture::addStep(const std::string& library_text)
+LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type )
 {
+	// Order of enum EStepType MUST match the library_list element in floater_preview_gesture.xml
+
 	LLGestureStep* step = NULL;
-	if (!LLStringUtil::compareInsensitive(library_text, "Animation"))
-	{
-		step = new LLGestureStepAnimation();
-	}
-	else if (!LLStringUtil::compareInsensitive(library_text, "Sound"))
-	{
-		step = new LLGestureStepSound();
-	}
-	else if (!LLStringUtil::compareInsensitive(library_text, "Chat"))
+	switch( step_type)
 	{
-		step = new LLGestureStepChat();
-	}
-	else if (!LLStringUtil::compareInsensitive(library_text, "Wait"))
-	{
-		step = new LLGestureStepWait();
-	}
-	else
-	{
-		llerrs << "Unknown step type: " << library_text << llendl;;
-		return NULL;
+		case STEP_ANIMATION:
+			step = new LLGestureStepAnimation();
+			break;
+		case STEP_SOUND:
+			step = new LLGestureStepSound();
+			break;
+		case STEP_CHAT:
+			step = new LLGestureStepChat();
+			break;
+		case STEP_WAIT:
+			step = new LLGestureStepWait();
+			break;
+		default:
+			llerrs << "Unknown step type: " << (S32)step_type << llendl;
+			return NULL;
 	}
 
 	// Create an enabled item with this step
diff --git a/indra/newview/llpreviewgesture.h b/indra/newview/llpreviewgesture.h
index 91c214be62f4619b75757a295ad27741a3a230ba..c245c0e8da5c841d47697db9a7d96c282275dcf8 100644
--- a/indra/newview/llpreviewgesture.h
+++ b/indra/newview/llpreviewgesture.h
@@ -34,6 +34,7 @@
 #define LL_LLPREVIEWGESTURE_H
 
 #include "llpreview.h"
+#include "llmultigesture.h"
 
 class LLMultiGesture;
 class LLLineEditor;
@@ -109,7 +110,7 @@ class LLPreviewGesture : public LLPreview
 
 	// Add a step.  Pass the name of the step, like "Animation",
 	// "Sound", "Chat", or "Wait"
-	LLScrollListItem* addStep(const std::string& step_name);
+	LLScrollListItem* addStep(const enum EStepType step_type);
 
 	static void updateLabel(LLScrollListItem* item);
 
diff --git a/indra/newview/llresourcedata.h b/indra/newview/llresourcedata.h
index 260977579417e6d65a071e61cd11e41f24e99bec..46b79150bbf4c54cabbf45971a2ba19b8c30cd72 100644
--- a/indra/newview/llresourcedata.h
+++ b/indra/newview/llresourcedata.h
@@ -42,6 +42,7 @@ struct LLResourceData
 	LLAssetType::EType mPreferredLocation;
 	LLInventoryType::EType mInventoryType;
 	U32 mNextOwnerPerm;
+	S32 mExpectedUploadCost;
 	void *mUserData;
 };
 
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index ebbc49fbd6a83930cb37db0967b7f09743bf52a4..dc4b8134dca314a75130ca7bfef7d36927f5ddfa 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1896,7 +1896,7 @@ void pushVertsColorCoded(LLSpatialGroup* group, U32 mask)
 		LLColor4::green6
 	};
 		
-	static const U32 col_count = sizeof(colors)/sizeof(LLColor4);
+	static const U32 col_count = LL_ARRAY_SIZE(colors);
 
 	U32 col = 0;
 
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 6663b5ec191505030c7230b5cbab76f83d15ca4e..b4f8f6b71ecea179661f405190aadc94707e0e1f 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -232,8 +232,6 @@ EStartupState LLStartUp::gStartupState = STATE_FIRST;
 
 void login_show();
 void login_callback(S32 option, void* userdata);
-std::string load_password_from_disk();
-void save_password_to_disk(const char* hashed_password);
 bool is_hex_string(U8* str, S32 len);
 void show_first_run_dialog();
 bool first_run_dialog_callback(const LLSD& notification, const LLSD& response);
@@ -351,7 +349,6 @@ bool idle_startup()
 	static S32  location_which = START_LOCATION_ID_LAST;
 
 	static bool show_connect_box = true;
-	static BOOL remember_password = TRUE;
 
 	static bool stipend_since_login = false;
 
@@ -684,7 +681,6 @@ bool idle_startup()
 			char md5pass[33];               /* Flawfinder: ignore */
 			pass.hex_digest(md5pass);
 			password = md5pass;
-			remember_password = gSavedSettings.getBOOL("RememberPassword");
 			
 #ifdef USE_VIEWER_AUTH
 			show_connect_box = true;
@@ -697,9 +693,8 @@ bool idle_startup()
 		{
 			firstname = gSavedSettings.getString("FirstName");
 			lastname = gSavedSettings.getString("LastName");
-			password = load_password_from_disk();
+			password = LLStartUp::loadPasswordFromDisk();
 			gSavedSettings.setBOOL("RememberPassword", TRUE);
-			remember_password = TRUE;
 			
 #ifdef USE_VIEWER_AUTH
 			show_connect_box = true;
@@ -713,8 +708,7 @@ bool idle_startup()
 			// a valid grid is selected
 			firstname = gSavedSettings.getString("FirstName");
 			lastname = gSavedSettings.getString("LastName");
-			password = load_password_from_disk();
-			remember_password = gSavedSettings.getBOOL("RememberPassword");
+			password = LLStartUp::loadPasswordFromDisk();
 			show_connect_box = true;
 		}
 
@@ -753,7 +747,7 @@ bool idle_startup()
 			// Load all the name information out of the login view
 			// NOTE: Hits "Attempted getFields with no login view shown" warning, since we don't
 			// show the login view until login_show() is called below.  
-			// LLPanelLogin::getFields(firstname, lastname, password, remember_password);
+			// LLPanelLogin::getFields(firstname, lastname, password);
 
 			if (gNoRender)
 			{
@@ -765,7 +759,7 @@ bool idle_startup()
 			// Show the login dialog
 			login_show();
 			// connect dialog is already shown, so fill in the names
-			LLPanelLogin::setFields( firstname, lastname, password, remember_password );
+			LLPanelLogin::setFields( firstname, lastname, password);
 
 			LLPanelLogin::giveFocus();
 
@@ -834,7 +828,7 @@ bool idle_startup()
 		{
 			// TODO if not use viewer auth
 			// Load all the name information out of the login view
-			LLPanelLogin::getFields(firstname, lastname, password, remember_password);
+			LLPanelLogin::getFields(&firstname, &lastname, &password);
 			// end TODO
 	 
 			// HACK: Try to make not jump on login
@@ -846,16 +840,6 @@ bool idle_startup()
 			gSavedSettings.setString("FirstName", firstname);
 			gSavedSettings.setString("LastName", lastname);
 
-			if (remember_password)
-			{
-				   save_password_to_disk(password.c_str());
-			}
-			else
-			{
-				   save_password_to_disk(NULL);
-			}
-			gSavedSettings.setBOOL("RememberPassword", remember_password);
-
 			LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << LL_ENDL;
 			gDebugInfo["LoginName"] = firstname + " " + lastname;	
 		}
@@ -1362,15 +1346,17 @@ bool idle_startup()
 			gSavedSettings.setString("FirstName", firstname);
 			gSavedSettings.setString("LastName", lastname);
 
-			if (remember_password)
+			if (gSavedSettings.getBOOL("RememberPassword"))
 			{
-				   save_password_to_disk(password.c_str());
+				// Successful login means the password is valid, so save it.
+				LLStartUp::savePasswordToDisk(password);
 			}
 			else
 			{
-				   save_password_to_disk(NULL);
+				// Don't leave password from previous session sitting around
+				// during this login session.
+				LLStartUp::deletePasswordFromDisk();
 			}
-			gSavedSettings.setBOOL("RememberPassword", remember_password);
 
 			text = LLUserAuth::getInstance()->getResponse("agent_access");
 			if(!text.empty() && (text[0] == 'M'))
@@ -1563,7 +1549,7 @@ bool idle_startup()
 			// Pass the user information to the voice chat server interface.
 			gVoiceClient->userAuthorized(firstname, lastname, gAgentID);
 		}
-		else
+		else // if(successful_login)
 		{
 			if (gNoRender)
 			{
@@ -1578,8 +1564,6 @@ bool idle_startup()
 			reset_login();
 			gSavedSettings.setBOOL("AutoLogin", FALSE);
 			show_connect_box = true;
-			// Don't save an incorrect password to disk.
-			save_password_to_disk(NULL);
 		}
 		return FALSE;
 	}
@@ -2571,16 +2555,11 @@ void login_callback(S32 option, void *userdata)
 	{
 		// Make sure we don't save the password if the user is trying to clear it.
 		std::string first, last, password;
-		BOOL remember = TRUE;
-		LLPanelLogin::getFields(first, last, password, remember);
-		if (!remember)
+		LLPanelLogin::getFields(&first, &last, &password);
+		if (!gSavedSettings.getBOOL("RememberPassword"))
 		{
 			// turn off the setting and write out to disk
-			gSavedSettings.setBOOL("RememberPassword", FALSE);
 			gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
-
-			// stomp the saved password on disk
-			save_password_to_disk(NULL);
 		}
 
 		// Next iteration through main loop should shut down the app cleanly.
@@ -2598,8 +2577,18 @@ void login_callback(S32 option, void *userdata)
 	}
 }
 
-std::string load_password_from_disk()
+
+// static
+std::string LLStartUp::loadPasswordFromDisk()
 {
+	// Only load password if we also intend to save it (otherwise the user
+	// wonders what we're doing behind his back).  JC
+	BOOL remember_password = gSavedSettings.getBOOL("RememberPassword");
+	if (!remember_password)
+	{
+		return std::string("");
+	}
+
 	std::string hashed_password("");
 
 	// Look for legacy "marker" password from settings.ini
@@ -2651,41 +2640,45 @@ std::string load_password_from_disk()
 	return hashed_password;
 }
 
-void save_password_to_disk(const char* hashed_password)
+
+// static
+void LLStartUp::savePasswordToDisk(const std::string& hashed_password)
 {
 	std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
 													   "password.dat");
-	if (!hashed_password)
+	LLFILE* fp = LLFile::fopen(filepath, "wb");		/* Flawfinder: ignore */
+	if (!fp)
 	{
-		// No password, remove the file.
-		LLFile::remove(filepath);
+		return;
 	}
-	else
-	{
-		LLFILE* fp = LLFile::fopen(filepath, "wb");		/* Flawfinder: ignore */
-		if (!fp)
-		{
-			return;
-		}
-
-		// Encipher with MAC address
-		const S32 HASHED_LENGTH = 32;
-		U8 buffer[HASHED_LENGTH+1];
 
-		LLStringUtil::copy((char*)buffer, hashed_password, HASHED_LENGTH+1);
+	// Encipher with MAC address
+	const S32 HASHED_LENGTH = 32;
+	U8 buffer[HASHED_LENGTH+1];
 
-		LLXORCipher cipher(gMACAddress, 6);
-		cipher.encrypt(buffer, HASHED_LENGTH);
+	LLStringUtil::copy((char*)buffer, hashed_password.c_str(), HASHED_LENGTH+1);
 
-		if (fwrite(buffer, HASHED_LENGTH, 1, fp) != 1)
-		{
-			LL_WARNS("AppInit") << "Short write" << LL_ENDL;
-		}
+	LLXORCipher cipher(gMACAddress, 6);
+	cipher.encrypt(buffer, HASHED_LENGTH);
 
-		fclose(fp);
+	if (fwrite(buffer, HASHED_LENGTH, 1, fp) != 1)
+	{
+		LL_WARNS("AppInit") << "Short write" << LL_ENDL;
 	}
+
+	fclose(fp);
 }
 
+
+// static
+void LLStartUp::deletePasswordFromDisk()
+{
+	std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
+														  "password.dat");
+	LLFile::remove(filepath);
+}
+
+
 bool is_hex_string(U8* str, S32 len)
 {
 	bool rv = true;
@@ -2869,6 +2862,8 @@ bool update_dialog_callback(const LLSD& notification, const LLSD& response)
 	query_map["os"] = "mac";
 #elif LL_LINUX
 	query_map["os"] = "lnx";
+#elif LL_SOLARIS
+	query_map["os"] = "sol";
 #endif
 	// *TODO change userserver to be grid on both viewer and sim, since
 	// userserver no longer exists.
@@ -2952,7 +2947,7 @@ bool update_dialog_callback(const LLSD& notification, const LLSD& response)
 	// Run the auto-updater.
 	system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */
 
-#elif LL_LINUX
+#elif LL_LINUX || LL_SOLARIS
 	OSMessageBox("Automatic updating is not yet implemented for Linux.\n"
 		"Please download the latest version from www.secondlife.com.",
 		LLStringUtil::null, OSMB_OK);
diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h
index e455c4aed16b0da034d21bf8f6c03a804ac56a1b..fe347e9efe26c796f09be5c5177b8e1b5d94cf31 100644
--- a/indra/newview/llstartup.h
+++ b/indra/newview/llstartup.h
@@ -37,7 +37,6 @@
 
 // functions
 bool idle_startup();
-std::string load_password_from_disk();
 void release_start_screen();
 bool login_alert_done(const LLSD& notification, const LLSD& response);
 
@@ -99,6 +98,15 @@ class LLStartUp
 	static void loadInitialOutfit( const std::string& outfit_folder_name,
 								   const std::string& gender_name );
 
+	// Load MD5 of user's password from local disk file.
+	static std::string loadPasswordFromDisk();
+	
+	// Record MD5 of user's password for subsequent login.
+	static void savePasswordToDisk(const std::string& hashed_password);
+	
+	// Delete the saved password local disk file.
+	static void deletePasswordFromDisk();
+	
 	static bool dispatchURL();
 		// if we have a SLURL or sim string ("Ahern/123/45") that started
 		// the viewer, dispatch it
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index b1ad80cdd93612aabb79c0cb41b00f945ba6a257..450e5d83afc994f57f4fbcaeb538f3f5f20e089f 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -235,7 +235,7 @@ void LLTextureBar::draw()
 		{ "MIS", LLColor4::red }, // LAST_STATE+4
 		{ "---", LLColor4::white }, // LAST_STATE+5
 	};
-	const S32 fetch_state_desc_size = (S32)(sizeof(fetch_state_desc)/sizeof(fetch_state_desc[0]));
+	const S32 fetch_state_desc_size = (S32)LL_ARRAY_SIZE(fetch_state_desc);
 	S32 state =
 		mImagep->mNeedsCreateTexture ? LAST_STATE+1 :
 		mImagep->mFullyLoaded ? LAST_STATE+2 :
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index fe94863f2d568ec80004f5f4d3cd471dcef8bdc3..70fc78d2774b005f8e5b484f01d0d9d12a841a86 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -526,6 +526,14 @@ void LLViewerMedia::buildMediaManagerData( LLMediaManagerData* init_data )
 	std::string component_dir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) );
 	component_dir += gDirUtilp->getDirDelimiter();
 	component_dir += "mozilla-runtime-linux-i686";
+#elif LL_SOLARIS
+	std::string component_dir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) );
+	component_dir += gDirUtilp->getDirDelimiter();
+	#ifdef  __sparc
+		component_dir += "mozilla-solaris-sparc";
+	#else
+		component_dir += "mozilla-solaris-i686";
+	#endif
 #else
 	std::string component_dir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) );
 	component_dir += gDirUtilp->getDirDelimiter();
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 17f59595f670f6141afd6a8d8de57afffed37efa..e0b7b233ecd338a192b4bad5dd832d0e354f359a 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -285,9 +285,6 @@ typedef LLMemberListener<LLView> view_listener_t;
 void handle_leave_group(void *);
 
 // File Menu
-const char* upload_pick(void* data);
-void handle_upload(void* data);
-//void handle_upload_object(void* data);
 void handle_compress_image(void*);
 BOOL enable_save_as(void *);
 
@@ -654,7 +651,7 @@ void init_menus()
     gViewerWindow->setMenuBackgroundColor(false, 
         LLViewerLogin::getInstance()->isInProductionGrid());
 
-	// *TODO:Get the cost info from the server
+	// Assume L$10 for now, the server will tell us the real cost at login
 	const std::string upload_cost("10");
 	gMenuHolder->childSetLabelArg("Upload Image", "[COST]", upload_cost);
 	gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost);
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index ff8d717b12abb5ab4d4a94afdab98eeacc45b4fa..a6dede1e382761f393f7007486e465be75dab31d 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -274,6 +274,7 @@ class LLFileUploadSound : public view_listener_t
 		{
 			LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename);
 			LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_sound_preview.xml");
+			floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() ));
 		}
 		return true;
 	}
@@ -324,8 +325,14 @@ class LLFileUploadBulk : public view_listener_t
 			LLStringUtil::stripNonprintable(asset_name);
 			LLStringUtil::trim(asset_name);
 			
+			std::string display_name = LLStringUtil::null;
+			LLAssetStorage::LLStoreAssetCallback callback = NULL;
+			S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
+			void *userdata = NULL;
 			upload_new_resource(filename, asset_name, asset_name, 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE,
-				LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms());
+				LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
+					    display_name,
+					    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()
@@ -482,6 +489,7 @@ void handle_upload(void* data)
 	{
 		LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename);
 		LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_name_description.xml");
+		floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() ));
 	}
 }
 
@@ -517,15 +525,16 @@ void handle_compress_image(void*)
 }
 
 void upload_new_resource(const std::string& src_filename, std::string name,
-						 std::string desc, S32 compression_info,
-						 LLAssetType::EType destination_folder_type,
-						 LLInventoryType::EType inv_type,
-						 U32 next_owner_perms,
-						 U32 group_perms,
-						 U32 everyone_perms,
-						 const std::string& display_name,
-						 LLAssetStorage::LLStoreAssetCallback callback,
-						 void *userdata)
+			 std::string desc, S32 compression_info,
+			 LLAssetType::EType destination_folder_type,
+			 LLInventoryType::EType inv_type,
+			 U32 next_owner_perms,
+			 U32 group_perms,
+			 U32 everyone_perms,
+			 const std::string& display_name,
+			 LLAssetStorage::LLStoreAssetCallback callback,
+			 S32 expected_upload_cost,
+			 void *userdata)
 {	
 	// Generate the temporary UUID.
 	std::string filename = gDirUtilp->getTempFilename();
@@ -809,8 +818,8 @@ 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, compression_info, // tid
-							destination_folder_type, inv_type, next_owner_perms, group_perms, everyone_perms,
-							display_name, callback, userdata);
+				    destination_folder_type, inv_type, next_owner_perms, group_perms, everyone_perms,
+				    display_name, callback, expected_upload_cost, userdata);
 	}
 	else
 	{
@@ -829,8 +838,10 @@ void upload_new_resource(const std::string& src_filename, std::string name,
 void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
 {
 	LLResourceData* data = (LLResourceData*)user_data;
+	S32 expected_upload_cost = data ? data->mExpectedUploadCost : 0;
 	//LLAssetType::EType pref_loc = data->mPreferredLocation;
 	BOOL is_balance_sufficient = TRUE;
+
 	if(result >= 0)
 	{
 		LLAssetType::EType dest_loc = (data->mPreferredLocation == LLAssetType::AT_NONE) ? data->mAssetInfo.mType : data->mPreferredLocation;
@@ -841,20 +852,19 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt
 		{
 			// Charge the user for the upload.
 			LLViewerRegion* region = gAgent.getRegion();
-			S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
 
-			if(!(can_afford_transaction(upload_cost)))
+			if(!(can_afford_transaction(expected_upload_cost)))
 			{
 				LLFloaterBuyCurrency::buyCurrency(
 					llformat("Uploading %s costs",
 							 data->mAssetInfo.getName().c_str()), // *TODO: Translate
-					upload_cost);
+					expected_upload_cost);
 				is_balance_sufficient = FALSE;
 			}
 			else if(region)
 			{
 				// Charge user for upload
-				gStatusBar->debitBalance(upload_cost);
+				gStatusBar->debitBalance(expected_upload_cost);
 				
 				LLMessageSystem* msg = gMessageSystem;
 				msg->newMessageFast(_PREHASH_MoneyTransferRequest);
@@ -865,7 +875,9 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt
 				msg->addUUIDFast(_PREHASH_SourceID, gAgent.getID());
 				msg->addUUIDFast(_PREHASH_DestID, LLUUID::null);
 				msg->addU8("Flags", 0);
-				msg->addS32Fast(_PREHASH_Amount, upload_cost);
+				// we tell the sim how much we were expecting to pay so it
+				// can respond to any discrepancy
+				msg->addS32Fast(_PREHASH_Amount, expected_upload_cost);
 				msg->addU8Fast(_PREHASH_AggregatePermNextOwner, (U8)LLAggregatePermissions::AP_EMPTY);
 				msg->addU8Fast(_PREHASH_AggregatePermInventory, (U8)LLAggregatePermissions::AP_EMPTY);
 				msg->addS32Fast(_PREHASH_TransactionType, TRANS_UPLOAD_CHARGE);
@@ -921,22 +933,31 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt
 		LLStringUtil::stripNonprintable(asset_name);
 		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
-							0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE);
+				    0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE,
+				    PERM_NONE, PERM_NONE, PERM_NONE,
+				    display_name,
+				    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,
-						 std::string name,
-						 std::string desc, S32 compression_info,
-						 LLAssetType::EType destination_folder_type,
-						 LLInventoryType::EType inv_type,
-						 U32 next_owner_perms,
-						 U32 group_perms,
-						 U32 everyone_perms,
-						 const std::string& display_name,
-						 LLAssetStorage::LLStoreAssetCallback callback,
-						 void *userdata)
+			 std::string name,
+			 std::string desc, S32 compression_info,
+			 LLAssetType::EType destination_folder_type,
+			 LLInventoryType::EType inv_type,
+			 U32 next_owner_perms,
+			 U32 group_perms,
+			 U32 everyone_perms,
+			 const std::string& display_name,
+			 LLAssetStorage::LLStoreAssetCallback callback,
+			 S32 expected_upload_cost,
+			 void *userdata)
 {
 	if(gDisconnected)
 	{
@@ -985,6 +1006,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
 	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 == LLAssetType::AT_NONE) ? asset_type : destination_folder_type) << llendl;
 	lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl;
 	std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory");
@@ -1000,6 +1022,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
 		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);
@@ -1016,12 +1039,11 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
 			LLAssetType::AT_TEXTURE == asset_type ||
 			LLAssetType::AT_ANIMATION == asset_type)
 		{
-			S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
 			S32 balance = gStatusBar->getBalance();
-			if (balance < upload_cost)
+			if (balance < expected_upload_cost)
 			{
 				// insufficient funds, bail on this upload
-				LLFloaterBuyCurrency::buyCurrency("Uploading costs", upload_cost);
+				LLFloaterBuyCurrency::buyCurrency("Uploading costs", expected_upload_cost);
 				return;
 			}
 		}
@@ -1033,6 +1055,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
 		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);
diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h
index 5a7aa427b4a82db9382a1eeabc2f78df49f37b70..bf21292082bc53a3bc37c88072d33918725958e8 100644
--- a/indra/newview/llviewermenufile.h
+++ b/indra/newview/llviewermenufile.h
@@ -42,30 +42,32 @@ class LLTransactionID;
 void init_menu_file();
 
 void upload_new_resource(const std::string& src_filename, 
-						 std::string name,
-						 std::string desc, 
-						 S32 compression_info,
-						 LLAssetType::EType destination_folder_type,
-						 LLInventoryType::EType inv_type,
-						 U32 next_owner_perms = 0x0,	// PERM_NONE
-						 U32 group_perms = 0x0,	// PERM_NONE
-						 U32 everyone_perms = 0x0,	// PERM_NONE
-						 const std::string& display_name = LLStringUtil::null,
-						 LLAssetStorage::LLStoreAssetCallback callback = NULL,
-						 void *userdata = NULL);
+			 std::string name,
+			 std::string desc, 
+			 S32 compression_info,
+			 LLAssetType::EType destination_folder_type,
+			 LLInventoryType::EType inv_type,
+			 U32 next_owner_perms,
+			 U32 group_perms,
+			 U32 everyone_perms,
+			 const std::string& display_name,
+			 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,
-						 LLAssetType::EType destination_folder_type,
-						 LLInventoryType::EType inv_type,
-						 U32 next_owner_perms = 0x0,	// PERM_NONE
-						 U32 group_perms = 0x0,	// PERM_NONE
-						 U32 everyone_perms = 0x0,	// PERM_NONE
-						 const std::string& display_name = LLStringUtil::null,
-						 LLAssetStorage::LLStoreAssetCallback callback = NULL,
-						 void *userdata = NULL);
+			 LLAssetType::EType type,
+			 std::string name,
+			 std::string desc, 
+			 S32 compression_info,
+			 LLAssetType::EType destination_folder_type,
+			 LLInventoryType::EType inv_type,
+			 U32 next_owner_perms,
+			 U32 group_perms,
+			 U32 everyone_perms,
+			 const std::string& display_name,
+			 LLAssetStorage::LLStoreAssetCallback callback,
+			 S32 expected_upload_cost,
+			 void *userdata);
 
 #endif
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 08dbc5b3b8d2b94b867781e3a5b6e86cbdbb1111..c840557f018e0c6c3300ed27aee7d81522876264 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -73,6 +73,7 @@
 #include "lldrawpool.h"
 #include "llfirstuse.h"
 #include "llfloateractivespeakers.h"
+#include "llfloateranimpreview.h"
 #include "llfloaterbuycurrency.h"
 #include "llfloaterbuyland.h"
 #include "llfloaterchat.h"
@@ -133,7 +134,6 @@
 #include "pipeline.h"
 #include "llappviewer.h"
 #include "llfloaterworldmap.h"
-#include "llkeythrottle.h"
 #include "llviewerdisplay.h"
 #include "llkeythrottle.h"
 
@@ -227,6 +227,8 @@ bool friendship_offer_callback(const LLSD& notification, const LLSD& response)
 		break;
 	case 1:
 		// decline
+		// We no longer notify other viewers, but we DO still send
+		// the rejection to the simulator to delete the pending userop.
 		msg->newMessageFast(_PREHASH_DeclineFriendship);
 		msg->nextBlockFast(_PREHASH_AgentData);
 		msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
@@ -721,7 +723,7 @@ class LLOpenAgentOffer : public LLInventoryFetchObserver
 //instance of the AddedObserver for TaskOffers
 //and it never dies.  We do this because we don't know the UUID of 
 //task offers until they are accepted, so we don't wouldn't 
-//know what to watch for, so instead we just watch for all additions. -Gigs
+//know what to watch for, so instead we just watch for all additions.
 class LLOpenTaskOffer : public LLInventoryAddedObserver
 {
 protected:
@@ -797,7 +799,7 @@ class LLDiscardAgentOffer : public LLInventoryFetchComboObserver
 
 //Returns TRUE if we are OK, FALSE if we are throttled
 //Set check_only true if you want to know the throttle status 
-//without registering a hit -Gigs
+//without registering a hit
 bool check_offer_throttle(const std::string& from_name, bool check_only)
 {
 	static U32 throttle_count;
@@ -824,14 +826,14 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
 	{
 		LL_DEBUGS("Messaging") << "Throttle Not Expired, Count: " << throttle_count << LL_ENDL;
 		// When downloading the initial inventory we get a lot of new items
-		// coming in and can't tell that from spam.  JC
+		// coming in and can't tell that from spam.
 		if (LLStartUp::getStartupState() >= STATE_STARTED
 			&& throttle_count >= OFFER_THROTTLE_MAX_COUNT)
 		{
 			if (!throttle_logged)
 			{
 				// Use the name of the last item giver, who is probably the person
-				// spamming you. JC
+				// spamming you.
 				std::ostringstream message;
 				message << LLAppViewer::instance()->getSecondLifeTitle();
 				if (!from_name.empty())
@@ -879,10 +881,10 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
 		}
 		LLAssetType::EType asset_type = item->getType();
 
-		//if we are throttled, don't display them - Gigs
+		//if we are throttled, don't display them
 		if (check_offer_throttle(from_name, false))
 		{
-			// I'm not sure this is a good idea.  JC
+			// I'm not sure this is a good idea.
 			bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID();
 			//bool show_keep_discard = true;
 			switch(asset_type)
@@ -934,7 +936,7 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
 			return;
 		}
 
-		//Not sure about this check.  Could make it easy to miss incoming items. -Gigs
+		//Not sure about this check.  Could make it easy to miss incoming items.
 		//don't dick with highlight while the user is working
 		//if(inventory_has_focus && !user_is_away)
 		//	break;
@@ -1037,7 +1039,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
 	// This must be done here because:
 	// * callback may be called immediately,
 	// * adding the mute sends a message,
-	// * we can't build two messages at once.  JC
+	// * we can't build two messages at once.
 	if (2 == button)
 	{
 		gCacheName->get(mFromID, mFromGroup, inventory_offer_mute_callback, this);
@@ -1301,7 +1303,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
 	}
 
 	// Name cache callbacks don't store userdata, so can't save
-	// off the LLOfferInfo.  Argh.  JC
+	// off the LLOfferInfo.  Argh.
 	BOOL name_found = FALSE;
 	if (info->mFromGroup)
 	{
@@ -1948,6 +1950,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 					<< LLURI::mapToQueryString(query_string);
 
 			chat.mURL = link.str();
+			chat.mText = name + separator_string + message.substr(message_offset);
 
 			// Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because
 			// IMs from objcts don't open IM sessions.
@@ -2092,11 +2095,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 		}
 		break;
 
-	case IM_FRIENDSHIP_DECLINED:
-		args["NAME"] = name;
-		LLNotifications::instance().add("FriendshipDeclined", args);
-		break;
-
+	case IM_FRIENDSHIP_DECLINED_DEPRECATED:
 	default:
 		LL_WARNS("Messaging") << "Instant message calling for unknown dialog "
 				<< (S32)dialog << LL_ENDL;
@@ -2769,7 +2768,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
 	if (!avatarp)
 	{
 		// Could happen if you were immediately god-teleported away on login,
-		// maybe other cases.  Continue, but warn.  JC
+		// maybe other cases.  Continue, but warn.
 		LL_WARNS("Messaging") << "agent_movement_complete() with NULL avatarp." << LL_ENDL;
 	}
 
@@ -2809,7 +2808,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
 
 	if( is_teleport )
 	{
-		// Force the camera back onto the agent, don't animate. JC
+		// Force the camera back onto the agent, don't animate.
 		gAgent.setFocusOnAvatar(TRUE, FALSE);
 		gAgent.slamLookAt(look_at);
 		gAgent.updateCamera();
@@ -4261,7 +4260,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use
 {
 	if (gAgent.inPrelude())
 	{
-		// JC: In prelude, bumping is OK.  This dialog is rather confusing to 
+		// In prelude, bumping is OK.  This dialog is rather confusing to 
 		// newbies, so we don't show it.  Drop the packet on the floor.
 		return;
 	}
@@ -4336,7 +4335,11 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/)
 	LLGlobalEconomy::processEconomyData(msg, LLGlobalEconomy::Singleton::getInstance());
 
 	S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
+
+	LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is L$" << upload_cost << LL_ENDL;
+
 	LLFloaterImagePreview::setUploadAmount(upload_cost);
+	LLFloaterAnimPreview::setUploadAmount(upload_cost);
 
 	gMenuHolder->childSetLabelArg("Upload Image", "[COST]", llformat("%d", upload_cost));
 	gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", llformat("%d", upload_cost));
@@ -4521,14 +4524,26 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
 	msg->getStringFast(_PREHASH_Data, _PREHASH_ObjectOwner, owner_name);
 	msg->getS32Fast(_PREHASH_Data, _PREHASH_Questions, questions );
 
-	// don't display permission requests if this object is muted - JS.
+	// Special case. If the objects are owned by this agent, throttle per-object instead
+	// of per-owner. It's common for residents to reset a ton of scripts that re-request
+	// permissions, as with tier boxes. UUIDs can't be valid agent names and vice-versa,
+	// so we'll reuse the same namespace for both throttle types.
+	std::string throttle_name = owner_name;
+	std::string self_name;
+	gAgent.getName( self_name );
+	if( owner_name == self_name )
+	{
+		throttle_name = taskid.getString();
+	}
+	
+	// don't display permission requests if this object is muted
 	if (LLMuteList::getInstance()->isMuted(taskid)) return;
-
+	
 	// throttle excessive requests from any specific user's scripts
 	typedef LLKeyThrottle<std::string> LLStringThrottle;
 	static LLStringThrottle question_throttle( LLREQUEST_PERMISSION_THROTTLE_LIMIT, LLREQUEST_PERMISSION_THROTTLE_INTERVAL );
 
-	switch (question_throttle.noteAction(owner_name))
+	switch (question_throttle.noteAction(throttle_name))
 	{
 		case LLStringThrottle::THROTTLE_NEWLY_BLOCKED:
 			LL_INFOS("Messaging") << "process_script_question throttled"
@@ -5426,7 +5441,7 @@ void invalid_message_callback(LLMessageSystem* msg,
 }
 
 // Please do not add more message handlers here. This file is huge.
-// Put them in a file related to the functionality you are implementing. JC
+// Put them in a file related to the functionality you are implementing.
 
 void LLOfferInfo::forceResponse(InventoryOfferResponse response)
 {
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 1b4517372d9cbc8fb57291f8d07e20d39357b27a..07569a5e546f3ef978b64c07775fed00baa36bd2 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -58,6 +58,7 @@
 #include "llviewerwindow.h"		// *TODO: remove, only used for width/height
 #include "llworld.h"
 #include "llfeaturemanager.h"
+#include "llviewernetwork.h"
 #if LL_LCD_COMPILE
 #include "lllcd.h"
 #endif
@@ -662,7 +663,7 @@ void send_stats()
 	time(&ltime);
 	F32 run_time = F32(LLFrameTimer::getElapsedSeconds());
 
-	agent["start_time"] = ltime - run_time;
+	agent["start_time"] = S32(ltime - S32(run_time));
 
 	// The first stat set must have a 0 run time if it doesn't actually
 	// contain useful data in terms of FPS, etc.  We use half the
@@ -701,7 +702,11 @@ void send_stats()
 	system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB();
 	system["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();
 	system["cpu"] = gSysCPU.getCPUString();
-
+	std::string macAddressString = llformat("%02x-%02x-%02x-%02x-%02x-%02x",
+											gMACAddress[0],gMACAddress[1],gMACAddress[2],
+											gMACAddress[3],gMACAddress[4],gMACAddress[5]);
+	system["mac_address"] = macAddressString;
+	system["serial_number"] = LLAppViewer::instance()->getSerialNumber();
 	std::string gpu_desc = llformat(
 		"%-6s Class %d ",
 		gGLManager.mGLVendorShort.substr(0,6).c_str(),
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 597513ba0c4678f519e164e658854acfbe650dbf..4f2504fc172fdc2b6af50a659879db80f5d1068b 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3216,69 +3216,69 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
 				(is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute)
 				|| is_appearance != mNameAppearance)
 			{
-				char line[MAX_STRING];		/* Flawfinder: ignore */
+				std::string line;
 				if (!sRenderGroupTitles)
 				{
 					// If all group titles are turned off, stack first name
 					// on a line above last name
-					strncpy(line, firstname->getString(), MAX_STRING -1 );		/* Flawfinder: ignore */
-					line[MAX_STRING -1] = '\0';
-					strcat(line, "\n");
+					line += firstname->getString();
+					line += "\n";
 				}
 				else if (title && title->getString() && title->getString()[0] != '\0')
 				{
-					strncpy(line, title->getString(), MAX_STRING -1 );		/* Flawfinder: ignore */
-					line[MAX_STRING -1] = '\0';
-					strcat(line, "\n");		/* Flawfinder: ignore */
-					strncat(line, firstname->getString(), MAX_STRING - strlen(line) -1 );		/* Flawfinder: ignore */
+					line += title->getString();
+					LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR);
+					line += "\n";
+					line += firstname->getString();
 				}
 				else
 				{
-					strncpy(line, firstname->getString(), MAX_STRING -1 );		/* Flawfinder: ignore */
-					line[MAX_STRING -1] = '\0';
+					line += firstname->getString();
 				}
 
-				strcat(line, " ");		/* Flawfinder: ignore */
-				strncat(line, lastname->getString(), MAX_STRING - strlen(line) -1);		/* Flawfinder: ignore */
+				line += " ";
+				line += lastname->getString();
 				BOOL need_comma = FALSE;
 
 				if (is_away || is_muted || is_busy)
 				{
-					strcat(line, " (");		/* Flawfinder: ignore */
+					line += " (";
 					if (is_away)
 					{
-						strcat(line, "Away");		/* Flawfinder: ignore */
+						line += "Away";
 						need_comma = TRUE;
 					}
 					if (is_busy)
 					{
 						if (need_comma)
 						{
-							strcat(line, ", ");		/* Flawfinder: ignore */
+							line += ", ";
 						}
-						strcat(line, "Busy");		/* Flawfinder: ignore */
+						line += "Busy";
 						need_comma = TRUE;
 					}
 					if (is_muted)
 					{
 						if (need_comma)
 						{
-							strcat(line, ", ");		/* Flawfinder: ignore */
+							line += ", ";
 						}
-						strcat(line, "Muted");		/* Flawfinder: ignore */
+						line += "Muted";
 						need_comma = TRUE;
 					}
-					strcat(line,")");		/* Flawfinder: ignore */
+					line += ")";
 				}
 				if (is_appearance)
 				{
-					strcat(line, "\n(Editing Appearance)");		/* Flawfinder: ignore */
+					line += "\n";
+					line += "(Editing Appearance)";
 				}
 				mNameAway = is_away;
 				mNameBusy = is_busy;
 				mNameMute = is_muted;
 				mNameAppearance = is_appearance;
 				mTitle = title ? title->getString() : "";
+				LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR);
 				mNameString = utf8str_to_wstring(line);
 				new_name = TRUE;
 			}
@@ -3915,7 +3915,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
 	// Generate footstep sounds when feet hit the ground
 	//-------------------------------------------------------------------------
 	const LLUUID AGENT_FOOTSTEP_ANIMS[] = {ANIM_AGENT_WALK, ANIM_AGENT_RUN, ANIM_AGENT_LAND};
-	const S32 NUM_AGENT_FOOTSTEP_ANIMS = sizeof(AGENT_FOOTSTEP_ANIMS) / sizeof(LLUUID);
+	const S32 NUM_AGENT_FOOTSTEP_ANIMS = LL_ARRAY_SIZE(AGENT_FOOTSTEP_ANIMS);
 
 	if ( gAudiop && isAnyAnimationSignaled(AGENT_FOOTSTEP_ANIMS, NUM_AGENT_FOOTSTEP_ANIMS) )
 	{
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 6a6064e0a2d38e48885aad08b3bdfafb0f340d0b..1a4f28a8aa39ca766737cf04a50c5d6e60825db5 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -863,7 +863,7 @@ LLVoiceClient::LLVoiceClient()
 	// This now happens when init() is called instead.
 	mPump = NULL;
 	
-#if LL_DARWIN || LL_LINUX
+#if LL_DARWIN || LL_LINUX || LL_SOLARIS
 		// MBW -- XXX -- THIS DOES NOT BELONG HERE
 		// When the vivox daemon dies, the next write attempt on our socket generates a SIGPIPE, which kills us.
 		// This should cause us to ignore SIGPIPE and handle the error through proper channels.
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index 1cb5ee77543c3f4bcd0c66af0387ab2fb5be9e0b..ea9c00ae81504ba13f677dae58efadbce5b1e381 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -69,7 +69,7 @@ LLWLParamSet::LLWLParamSet(void) :
 		std::make_pair("gamma",					LLVector4(2.0f, 2.0f, 2.0f, 0.0f)),
 	};
 	std::map<std::string, LLVector4>::value_type const * endHardcodedPreset = 
-		hardcodedPreset + sizeof(hardcodedPreset)/sizeof(hardcodedPreset[0]);
+		hardcodedPreset + LL_ARRAY_SIZE(hardcodedPreset);
 
 	mParamValues.insert(hardcodedPreset, endHardcodedPreset);
 */
diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp
index e01e59574750f5083a719457ff974799b1908329..4d46ff19cc889d0419a8d0617f6d166e0217f63b 100644
--- a/indra/newview/llworldmap.cpp
+++ b/indra/newview/llworldmap.cpp
@@ -49,6 +49,13 @@
 
 const F32 REQUEST_ITEMS_TIMER =  10.f * 60.f; // 10 minutes
 
+// For DEV-17507, do lazy image loading in llworldmapview.cpp instead,
+// limiting requests to currently visible regions and minimizing the
+// number of textures being requested simultaneously.
+//
+// Uncomment IMMEDIATE_IMAGE_LOAD to restore the old behavior
+//
+//#define IMMEDIATE_IMAGE_LOAD
 LLItemInfo::LLItemInfo(F32 global_x, F32 global_y,
 					   const std::string& name, 
 					   LLUUID id,
@@ -611,13 +618,17 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**)
 			siminfo->mRegionFlags = region_flags;
 			siminfo->mWaterHeight = (F32) water_height;
 			siminfo->mMapImageID[agent_flags] = image_id;
+#ifdef IMMEDIATE_IMAGE_LOAD
 			siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE);
 			gGL.getTexUnit(0)->bind(siminfo->mCurrentImage.get());
 			siminfo->mCurrentImage->setClamp(TRUE, TRUE);
+#endif
 			
 			if (siminfo->mMapImageID[2].notNull())
 			{
+#ifdef IMMEDIATE_IMAGE_LOAD
 				siminfo->mOverlayImage = gImageList.getImage(siminfo->mMapImageID[2], MIPMAP_TRUE, FALSE);
+#endif
 			}
 			else
 			{
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index 685ca8bba5568ba4d9f981660d668410518e19c2..1cf8755e6266a45dfcb07e0fa93b6829edc2bf62 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -61,6 +61,7 @@
 #include "llviewerregion.h"
 #include "llviewerwindow.h"
 #include "llworldmap.h"
+#include "lltexturefetch.h"
 #include "llappviewer.h"				// Only for constants!
 #include "lltrans.h"
 
@@ -422,30 +423,24 @@ void LLWorldMapView::draw()
 	F32 sim_alpha = 1.f;
 
 	// Draw one image per region, centered on the camera position.
+	const S32 MAX_SIMULTANEOUS_TEX = 100;
+	const S32 MAX_REQUEST_PER_TICK = 5;
+	const S32 MIN_REQUEST_PER_TICK = 1;
+	S32 textures_requested_this_tick = 0;
+
 	for (LLWorldMap::sim_info_map_t::iterator it = LLWorldMap::getInstance()->mSimInfoMap.begin();
 		 it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
 	{
 		U64 handle = (*it).first;
 		LLSimInfo* info = (*it).second;
 
-		if (info->mCurrentImage.isNull())
-		{
-			info->mCurrentImage = gImageList.getImage(info->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE);
-		}
-		if (info->mOverlayImage.isNull() && info->mMapImageID[2].notNull())
-		{
-			info->mOverlayImage = gImageList.getImage(info->mMapImageID[2], MIPMAP_TRUE, FALSE);
-			gGL.getTexUnit(0)->bind(info->mOverlayImage.get());
-			info->mOverlayImage->setClamp(TRUE, TRUE);
-		}
-		
 		LLViewerImage* simimage = info->mCurrentImage;
 		LLViewerImage* overlayimage = info->mOverlayImage;
 
 		if (gMapScale < SIM_MAP_SCALE)
 		{
-			simimage->setBoostLevel(0);
-			if (overlayimage) overlayimage->setBoostLevel(0);
+			if (simimage != NULL) simimage->setBoostLevel(0);
+			if (overlayimage != NULL) overlayimage->setBoostLevel(0);
 			continue;
 		}
 		
@@ -476,6 +471,7 @@ void LLWorldMapView::draw()
 
 		bool sim_visible =
 			(gMapScale >= map_scale_cutoff) &&
+			(simimage != NULL) &&
 			(simimage->getHasGLTexture());
 
 		if (sim_visible)
@@ -502,11 +498,38 @@ void LLWorldMapView::draw()
 			right < 0.f ||
 			left > width )
 		{
-			simimage->setBoostLevel(0);
-			if (overlayimage) overlayimage->setBoostLevel(0);
+			if (simimage != NULL) simimage->setBoostLevel(0);
+			if (overlayimage != NULL) overlayimage->setBoostLevel(0);
 			continue;
 		}
 
+		if (info->mCurrentImage.isNull())
+		{
+			if ((textures_requested_this_tick < MIN_REQUEST_PER_TICK) ||
+				((LLAppViewer::getTextureFetch()->getNumRequests() < MAX_SIMULTANEOUS_TEX) &&
+				 (textures_requested_this_tick < MAX_REQUEST_PER_TICK)))
+			{
+				textures_requested_this_tick++;
+				info->mCurrentImage = gImageList.getImage(info->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE);
+				info->mCurrentImage->setClamp(TRUE, TRUE);
+				simimage = info->mCurrentImage;
+				gGL.getTexUnit(0)->bind(simimage);
+			}
+		}
+		if (info->mOverlayImage.isNull() && info->mMapImageID[2].notNull())
+		{
+			if ((textures_requested_this_tick < MIN_REQUEST_PER_TICK) ||
+				((LLAppViewer::getTextureFetch()->getNumRequests() < MAX_SIMULTANEOUS_TEX) &&
+				 (textures_requested_this_tick < MAX_REQUEST_PER_TICK)))
+			{
+				textures_requested_this_tick++;
+				info->mOverlayImage = gImageList.getImage(info->mMapImageID[2], MIPMAP_TRUE, FALSE);
+				info->mOverlayImage->setClamp(TRUE, TRUE);
+				overlayimage = info->mOverlayImage;
+				gGL.getTexUnit(0)->bind(overlayimage);
+			}
+		}
+
 		mVisibleRegions.push_back(handle);
 		// See if the agents need updating
 		if (current_time - info->mAgentsUpdateTime > AGENTS_UPDATE_TIME)
@@ -521,10 +544,13 @@ void LLWorldMapView::draw()
 		center_global.mdV[VY] += 128.0;
 
 		S32 draw_size = llround(gMapScale);
-		simimage->setBoostLevel(LLViewerImage::BOOST_MAP);
-		simimage->setKnownDrawSize(llround(draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(draw_size * LLUI::sGLScaleFactor.mV[VY]));
+		if (simimage != NULL)
+		{
+			simimage->setBoostLevel(LLViewerImage::BOOST_MAP);
+			simimage->setKnownDrawSize(llround(draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(draw_size * LLUI::sGLScaleFactor.mV[VY]));
+		}
 
-		if (overlayimage)
+		if (overlayimage != NULL)
 		{
 			overlayimage->setBoostLevel(LLViewerImage::BOOST_MAP);
 			overlayimage->setKnownDrawSize(llround(draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(draw_size * LLUI::sGLScaleFactor.mV[VY]));
@@ -537,7 +563,8 @@ void LLWorldMapView::draw()
 			// Draw using the texture.  If we don't clamp we get artifact at
 			// the edge.
 			LLGLSUIDefault gls_ui;
-			gGL.getTexUnit(0)->bind(simimage);
+			if (simimage != NULL)
+				gGL.getTexUnit(0)->bind(simimage);
 
 			gGL.setSceneBlendType(LLRender::BT_ALPHA);
 			F32 alpha = sim_alpha * info->mAlpha;
@@ -663,7 +690,8 @@ void LLWorldMapView::draw()
 			
 			// If map texture is still loading,
 			// display "Loading" placeholder text.
-			if (simimage->getDiscardLevel() != 1 &&
+			if ((simimage != NULL) &&
+				simimage->getDiscardLevel() != 1 &&
 				simimage->getDiscardLevel() != 0)
 			{
 				font->renderUTF8(
@@ -1658,43 +1686,59 @@ BOOL LLWorldMapView::handleMouseUp( S32 x, S32 y, MASK mask )
 	return FALSE;
 }
 
-void LLWorldMapView::updateBlock(S32 block_x, S32 block_y)
+U32 LLWorldMapView::updateBlock(S32 block_x, S32 block_y)
 {
+	U32 blocks_requested = 0;
 	S32 offset = block_x | (block_y * MAP_BLOCK_RES);
 	if (!LLWorldMap::getInstance()->mMapBlockLoaded[LLWorldMap::getInstance()->mCurrentMap][offset])
 	{
 // 		llinfos << "Loading Block (" << block_x << "," << block_y << ")" << llendl;
 		LLWorldMap::getInstance()->sendMapBlockRequest(block_x << 3, block_y << 3, (block_x << 3) + 7, (block_y << 3) + 7);
 		LLWorldMap::getInstance()->mMapBlockLoaded[LLWorldMap::getInstance()->mCurrentMap][offset] = TRUE;
+		blocks_requested++;
 	}
+	return blocks_requested;
 }
 
-void LLWorldMapView::updateVisibleBlocks()
+U32 LLWorldMapView::updateVisibleBlocks()
 {
 	if (gMapScale < SIM_MAP_SCALE)
 	{
 		// We don't care what is loaded if we're zoomed out
-		return;
+		return 0;
 	}
-	// check if we've loaded the 9 potentially visible zones
-	LLVector3d camera_global = gAgent.getCameraPositionGlobal();
 
+	LLVector3d camera_global = gAgent.getCameraPositionGlobal();
+	
+	F32 pixels_per_region = gMapScale;
+	const S32 width = getRect().getWidth();
+	const S32 height = getRect().getHeight();
 	// Convert pan to sim coordinates
-	S32 world_center_x = S32((-sPanX / gMapScale) + (camera_global.mdV[0] / REGION_WIDTH_METERS));
-	S32 world_center_y = S32((-sPanY / gMapScale) + (camera_global.mdV[1] / REGION_WIDTH_METERS));
-
+	S32 world_center_x_lo = S32(((-sPanX - width/2) / pixels_per_region) + (camera_global.mdV[0] / REGION_WIDTH_METERS));
+	S32 world_center_x_hi = S32(((-sPanX + width/2) / pixels_per_region) + (camera_global.mdV[0] / REGION_WIDTH_METERS));
+	S32 world_center_y_lo = S32(((-sPanY - height/2) / pixels_per_region) + (camera_global.mdV[1] / REGION_WIDTH_METERS));
+	S32 world_center_y_hi = S32(((-sPanY + height/2)/ pixels_per_region) + (camera_global.mdV[1] / REGION_WIDTH_METERS));
+	
 	// Find the corresponding 8x8 block
-	S32 world_block_x = world_center_x >> 3;
-	S32 world_block_y = world_center_y >> 3;
+	S32 world_block_x_lo = world_center_x_lo >> 3;
+	S32 world_block_x_hi = world_center_x_hi >> 3;
+	S32 world_block_y_lo = world_center_y_lo >> 3;
+	S32 world_block_y_hi = world_center_y_hi >> 3;
+	
+	U32 blocks_requested = 0;
+	const U32 max_blocks_requested = 9;
 
-	for (S32 block_x = llmax(world_block_x-1, 0); block_x <= llmin(world_block_x+1, MAP_BLOCK_RES-1); ++block_x)
+	for (S32 block_x = llmax(world_block_x_lo, 0); block_x <= llmin(world_block_x_hi, MAP_BLOCK_RES-1); ++block_x)
 	{
-		for (S32 block_y = llmax(world_block_y-1, 0); block_y <= llmin(world_block_y+1, MAP_BLOCK_RES-1); ++block_y)
+		for (S32 block_y = llmax(world_block_y_lo, 0); block_y <= llmin(world_block_y_hi, MAP_BLOCK_RES-1); ++block_y)
 		{
-			updateBlock(block_x, block_y);
+			blocks_requested += updateBlock(block_x, block_y);
+			if (blocks_requested >= max_blocks_requested)
+				return blocks_requested;
 		}
 	}
-}
+	return blocks_requested;
+} 
 
 BOOL LLWorldMapView::handleHover( S32 x, S32 y, MASK mask )
 {
diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h
index 566468fa0c80d4b6390b1029228f621db3226e10..980ddf9c730af06dd065682eb7e380f68ee8d0aa 100644
--- a/indra/newview/llworldmapview.h
+++ b/indra/newview/llworldmapview.h
@@ -127,8 +127,9 @@ class LLWorldMapView : public LLPanel
 	static void		clearLastClick() { sHandledLastClick = FALSE; }
 
 	// if the view changes, download additional sim info as needed
-	void			updateBlock(S32 block_x, S32 block_y);
-	void			updateVisibleBlocks();
+	// return value is number of blocks newly requested.
+	U32				updateBlock(S32 block_x, S32 block_y);
+	U32				updateVisibleBlocks();
 
 protected:
 	void			setDirectionPos( LLTextBox* text_box, F32 rotation );
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index 0a7dd17ef5863960bd75ed560ac749d92efbba6e..a2fd0f0d9c25f85b0a5230142c65eda743b703c8 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -414,7 +414,7 @@ void LLXMLRPCTransaction::Impl::setStatus(Status status,
 				
 			default:
 				// Usually this means that there's a problem with the login server,
-				// not with the client.  Direct user to status page. JC
+				// not with the client.  Direct user to status page.
 				mStatusMessage =
 					"Despite our best efforts, something unexpected has gone wrong. \n"
 					" \n"
diff --git a/indra/newview/res/bitmap2.bmp b/indra/newview/res/bitmap2.bmp
deleted file mode 100644
index 770b07558cf2e4c7ce98f08e1a0a7ce3099b84f6..0000000000000000000000000000000000000000
Binary files a/indra/newview/res/bitmap2.bmp and /dev/null differ
diff --git a/indra/newview/res/loginbackground.bmp b/indra/newview/res/loginbackground.bmp
deleted file mode 100644
index 288a0b03987b51f440e19130bd603a698f25d5ed..0000000000000000000000000000000000000000
Binary files a/indra/newview/res/loginbackground.bmp and /dev/null differ
diff --git a/indra/newview/res/resource.h b/indra/newview/res/resource.h
index 1a1ace82ae281aac76449dd3d75245809b11f192..da27e47dfbcd4849cb54ef3e16509e5ab9b5205b 100644
--- a/indra/newview/res/resource.h
+++ b/indra/newview/res/resource.h
@@ -36,17 +36,9 @@
 #define IDREMOVE                        3
 #define IDI_LL_ICON                     103
 #define IDC_GRABHAND                    104
-#define IDR_MENU1                       112
-#define IDD_DIALOG1                     113
-#define IDI_INSTALL_ICON                133
 #define IDC_CURSOR1                     134
 #define IDC_CURSOR2                     136
-#define IDB_BITMAP1                     138
-#define IDB_BITMAP2                     140
-#define IDB_BITMAP3                     144
 #define IDC_CURSOR3                     147
-#define IDB_BITMAP4                     148
-#define IDB_BITMAP5                     149
 #define IDB_LOGIN                       149
 #define IDC_CURSOR4                     153
 #define IDC_CURSOR5                     154
diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc
index b360871f209c5bb8378e279d6e93d1846a4e0edd..908c4e1da3cd1d3368fdcba9fc86fadc9beedcb1 100644
--- a/indra/newview/res/viewerRes.rc
+++ b/indra/newview/res/viewerRes.rc
@@ -62,7 +62,6 @@ END
 // Icon with lowest ID value placed first to ensure application icon
 // remains consistent on all systems.
 IDI_LL_ICON             ICON                    "ll_icon.ico"
-IDI_INSTALL_ICON        ICON                    "install_icon.ico"
 IDI_LCD_LL_ICON         ICON                    "icon1.ico"
 
 /////////////////////////////////////////////////////////////////////////////
@@ -70,55 +69,6 @@ IDI_LCD_LL_ICON         ICON                    "icon1.ico"
 // Dialog
 //
 
-CONNECTBOX DIALOGEX 32, 32, 187, 246
-STYLE DS_SETFONT | DS_SETFOREGROUND | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP |
-    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-FONT 8, "MS Sans Serif", 0, 0, 0x0
-BEGIN
-    CONTROL         149,IDC_STATIC,"Static",SS_BITMAP,0,0,187,246
-    EDITTEXT        IDC_EDIT_FIRSTNAME,9,180,80,13,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_LASTNAME,98,180,80,13,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_PASSWORD,9,210,80,13,ES_PASSWORD |
-                    ES_AUTOHSCROLL
-    CONTROL         "Remember password",IDC_REMEMBER_PASSWORD,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,9,229,80,10
-    DEFPUSHBUTTON   "Connect...",IDOK,98,210,80,13
-    CONTROL         "Full screen",IDC_FULL_SCREEN,"Button",BS_AUTOCHECKBOX |
-                    WS_TABSTOP,100,229,50,10
-    COMBOBOX        IDC_COMBO_SERVER,98,6,84,30,CBS_DROPDOWNLIST | CBS_SORT |
-                    WS_VSCROLL | WS_TABSTOP
-END
-
-CONNECTBOXIP DIALOG  32, 32, 282, 174
-STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP |
-    WS_VISIBLE
-FONT 8, "MS Sans Serif"
-BEGIN
-    LTEXT           "First name:",IDC_STATIC_FIRSTNAME,152,24,36,10,NOT
-                    WS_GROUP
-    EDITTEXT        IDC_EDIT_FIRSTNAME,152,37,58,13,ES_AUTOHSCROLL
-    LTEXT           "Last name:",IDC_STATIC_LASTNAME,218,24,38,10,NOT
-                    WS_GROUP
-    EDITTEXT        IDC_EDIT_LASTNAME,218,37,57,13,ES_AUTOHSCROLL
-    LTEXT           "Password:",IDC_STATIC_PASSWORD,152,55,38,10
-    EDITTEXT        IDC_EDIT_PASSWORD,152,71,123,13,ES_PASSWORD |
-                    ES_AUTOHSCROLL
-    CONTROL         "Remember password for next time",IDC_REMEMBER_PASSWORD,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,152,84,123,10
-    LTEXT           "Return to:",IDC_STATIC,152,97,32,8
-    CONTROL         "Last location",IDC_RADIO_LAST,"Button",
-                    BS_AUTORADIOBUTTON | WS_TABSTOP,152,109,56,10
-    CONTROL         "Home",IDC_RADIO_HOME,"Button",BS_AUTORADIOBUTTON |
-                    WS_TABSTOP,218,109,35,10
-    LTEXT           "Server:",IDC_STATIC_SERVER,152,119,38,10,NOT WS_GROUP
-    COMBOBOX        IDC_COMBO_SERVER,152,134,88,43,CBS_DROPDOWN | WS_VSCROLL |
-                    WS_TABSTOP
-    PUSHBUTTON      "Quit",IDCANCEL,152,152,50,14
-    DEFPUSHBUTTON   "Connect...",IDOK,225,152,50,14
-    CONTROL         140,IDB_BITMAP1,"Static",SS_BITMAP,8,7,133,157
-    LTEXT           "Connect to Second Life",IDC_STATIC,152,7,78,8
-END
-
 SPLASHSCREEN DIALOG  32, 32, 144, 34
 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE
 FONT 8, "MS Sans Serif"
@@ -136,35 +86,6 @@ END
 #ifdef APSTUDIO_INVOKED
 GUIDELINES DESIGNINFO
 BEGIN
-    "CONNECTBOX", DIALOG
-    BEGIN
-        LEFTMARGIN, 8
-        RIGHTMARGIN, 180
-        VERTGUIDE, 152
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 239
-        HORZGUIDE, 44
-        HORZGUIDE, 57
-        HORZGUIDE, 123
-    END
-
-    "CONNECTBOXIP", DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 275
-        VERTGUIDE, 152
-        VERTGUIDE, 218
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 166
-        HORZGUIDE, 12
-        HORZGUIDE, 17
-        HORZGUIDE, 24
-        HORZGUIDE, 50
-        HORZGUIDE, 55
-        HORZGUIDE, 84
-        HORZGUIDE, 105
-        HORZGUIDE, 119
-    END
 
     "SPLASHSCREEN", DIALOG
     BEGIN
@@ -178,20 +99,6 @@ END
 #endif    // APSTUDIO_INVOKED
 
 
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_MENU1 MENU
-BEGIN
-    POPUP "testmenu"
-    BEGIN
-        MENUITEM "test",                        ID_TESTMENU_TEST
-    END
-END
-
-
 /////////////////////////////////////////////////////////////////////////////
 //
 // Cursor
@@ -269,8 +176,6 @@ END
 // Bitmap
 //
 
-IDB_BITMAP2             BITMAP                  "bitmap2.bmp"
-IDB_LOGIN               BITMAP                  "loginbackground.bmp"
 #endif    // English (U.S.) resources
 /////////////////////////////////////////////////////////////////////////////
 
diff --git a/indra/newview/skins/default/xui/de/floater_preview_gesture.xml b/indra/newview/skins/default/xui/de/floater_preview_gesture.xml
index da385b72d6fde17c9ae4278f110b0a504bd80a19..327d0b70f1342056645de4859032fc8d5bf7db85 100644
--- a/indra/newview/skins/default/xui/de/floater_preview_gesture.xml
+++ b/indra/newview/skins/default/xui/de/floater_preview_gesture.xml
@@ -30,14 +30,12 @@
 	<text name="steps_label">
 		Schritte:
 	</text>
-	<!-- Revert translations as interim fix to VWR-9985 while the code is not properly internationalized
 	<scroll_list name="library_list">
 		Animation
 Ton
 Chat
 Warten
 	</scroll_list>
-	-->
 	<button label="Hinzufügen &gt;&gt;" name="add_btn"/>
 	<button label="Nach oben" name="up_btn"/>
 	<button label="Nach unten" name="down_btn"/>
diff --git a/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml b/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml
index 3f7d0973b976b727c379734f6141bd947d61b109..6c373030ad634f580f5ab1b6683809cac8524036 100644
--- a/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml
+++ b/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml
@@ -33,14 +33,12 @@
 	<text name="steps_label">
 		Étapes :
 	</text>
-	<!-- Revert translations as interim fix to VWR-9985 while the code is not properly internationalized
 	<scroll_list name="library_list">
 		Animation
 Son
 Chat
 Attendre
 	</scroll_list>
-	-->
 	<button label="Ajouter &gt;&gt;" name="add_btn" />
 	<button label="Monter" name="up_btn" />
 	<button label="Descendre" name="down_btn" />
diff --git a/indra/newview/skins/default/xui/ja/floater_preview_gesture.xml b/indra/newview/skins/default/xui/ja/floater_preview_gesture.xml
index 61665a124a375f276782b8925778dba8635e3cfe..177895f44ec1724907b4b552cd656aee45ff5642 100644
--- a/indra/newview/skins/default/xui/ja/floater_preview_gesture.xml
+++ b/indra/newview/skins/default/xui/ja/floater_preview_gesture.xml
@@ -30,14 +30,12 @@
 	<text name="steps_label">
 		手順:
 	</text>
-	<!-- Revert translations as interim fix to VWR-9985 while the code is not properly internationalized
 	<scroll_list name="library_list">
 		アニメーション
 サウンド
 チャット
 å¾…æ©Ÿ
 	</scroll_list>
-	-->
 	<button label="追加>>" name="add_btn"/>
 	<button label="上に移動" name="up_btn"/>
 	<button label="下に移動" name="down_btn"/>
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index be17f1f39059356ceef10b87cab15df5f29dd71b..f72e4a8b7c9222d6720d854b7d6188995bfce673 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -171,7 +171,7 @@ def construct(self):
                 '../../libraries/i686-win32/lib/release/llkdu.dll'), 
                   dst='llkdu.dll')
         except:
-            print "Skipping llkdu,.dll"
+            print "Skipping llkdu.dll"
         self.path(src="licenses-win32.txt", dst="licenses.txt")
 
         self.path("featuretable.txt")
@@ -578,13 +578,6 @@ def construct(self):
 
 
     def package_finish(self):
-        # stripping all the libs removes a few megabytes from the end-user package
-        for s,d in self.file_list:
-            if re.search("lib/lib.+\.so.*", d):
-                self.run_command('strip -S %s' % d)
-            if re.search("app_settings/mozilla-runtime-.*/lib.+\.so.*", d):
-                self.run_command('strip %s' % d)
-
         if 'installer_name' in self.args:
             installer_name = self.args['installer_name']
         else:
@@ -628,6 +621,17 @@ def package_finish(self):
 class Linux_i686Manifest(LinuxManifest):
     def construct(self):
         super(Linux_i686Manifest, self).construct()
+
+        # install either the libllkdu we just built, or a prebuilt one, in
+        # decreasing order of preference.  for linux package, this goes to bin/
+        try:
+            self.path(self.find_existing_file(
+                '../llkdu/libllkdu.so',
+                '../../libraries/i686-linux/lib_release_client/libllkdu.so'), 
+                  dst='bin/libllkdu.so')
+        except:
+            print "Skipping libllkdu.so - not found"
+
         self.path("secondlife-stripped","bin/do-not-directly-run-secondlife-bin")
         self.path("../linux_crash_logger/linux-crash-logger-stripped","linux-crash-logger.bin")
         self.path("linux_tools/launch_url.sh","launch_url.sh")
@@ -642,7 +646,7 @@ def construct(self):
         self.path("app_settings/mozilla-runtime-linux-i686")
 
         if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"):
-            self.path("libkdu_v42R.so")
+            self.path("libkdu_v42R.so", "libkdu.so")
             self.path("libfmod-3.75.so")
             self.path("libapr-1.so.0")
             self.path("libaprutil-1.so.0")
@@ -650,12 +654,10 @@ def construct(self):
             self.path("libcrypto.so.0.9.7")
             self.path("libexpat.so.1")
             self.path("libssl.so.0.9.7")
-            self.path("libstdc++.so.6")
             self.path("libuuid.so", "libuuid.so.1")
             self.path("libSDL-1.2.so.0")
             self.path("libELFIO.so")
-            self.path("libopenjpeg.so.2")
-            self.path("libllkdu.so", "../bin/libllkdu.so") # llkdu goes in bin for some reason
+            self.path("libopenjpeg.so.1.3.0", "libopenjpeg.so.1.3")
             self.path("libalut.so")
             self.path("libopenal.so", "libopenal.so.1")
             self.end_prefix("lib")
diff --git a/indra/win_crash_logger/llcrashloggerwindows.cpp b/indra/win_crash_logger/llcrashloggerwindows.cpp
index c938f209ff2bc592938811c6c91e066b779ce297..c9e01c8418ad590ca10895a203f70454b270dd66 100644
--- a/indra/win_crash_logger/llcrashloggerwindows.cpp
+++ b/indra/win_crash_logger/llcrashloggerwindows.cpp
@@ -259,8 +259,8 @@ bool LLCrashLoggerWindows::init(void)
 	if(!ok) return false;
 
 	/*
-	mbstowcs(gProductName, mProductName.c_str(), sizeof(gProductName)/sizeof(gProductName[0]));
-	gProductName[ sizeof(gProductName)/sizeof(gProductName[0]) - 1 ] = 0;
+	mbstowcs( gProductName, mProductName.c_str(), LL_ARRAY_SIZE(gProductName) );
+	gProductName[ LL_ARRY_SIZE(gProductName) - 1 ] = 0;
 	swprintf(gProductName, L"Second Life");
 	*/
 
diff --git a/install.xml b/install.xml
index 07b5f781442852e135e993f20d2cf5e4383295ae..ad559a0e9064301db0620b27fd788eea8c0c6426 100644
--- a/install.xml
+++ b/install.xml
@@ -153,9 +153,9 @@
           <key>linux</key>
           <map>
             <key>md5sum</key>
-            <string>aa111fae0ac550bba5e280275eb25904</string>
+            <string>946c2e106f14f7a1e521d4a14e0e146f</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/ares-1.4.0-linux-20080729.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/ares-1.4.0-linux-20081202.tar.bz2</uri>
           </map>
           <key>linux32</key>
           <map>
@@ -256,9 +256,9 @@
           <key>linux</key>
           <map>
             <key>md5sum</key>
-            <string>e6d4cd23f5df4c74072d5d0437ca999b</string>
+            <string>a88e8285b3d97a21bf43cc5f90e87eb9</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/curl-7.16.0-linux-20080812.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/curl-7.16.4-linux-20081202.tar.bz2</uri>
           </map>
           <key>linux32</key>
           <map>
@@ -460,9 +460,9 @@
           <key>linux</key>
           <map>
             <key>md5sum</key>
-            <string>07665d74d37c56fd884610ec80a1d19f</string>
+            <string>eeffb03bd6672b6e7751448e5306d874</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/freetype-2.1.5-linux-20080812.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/freetype-2.1.5-linux-20081201.tar.bz2</uri>
           </map>
           <key>linux32</key>
           <map>
@@ -694,7 +694,7 @@
         <key>copyright</key>
         <string>Copyright (c) 2003, Yves Piguet.</string>
         <key>description</key>
-        <string>An open-source JPEG-2000 library; a slower alternative to Kadaku. Used in the open source release </string>
+        <string>An open-source JPEG (JFIF) library</string>
         <key>license</key>
         <string>jpeglib</string>
         <key>packages</key>
@@ -709,9 +709,9 @@
           <key>linux</key>
           <map>
             <key>md5sum</key>
-            <string>41085a9915598bba0e6bcb0da23ff929</string>
+            <string>8aa8e01e0c21f60f0ede0ffb04e9214f</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jpeglib-6b-linux-20080812.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jpeglib-6b-linux-20081218.tar.bz2</uri>
           </map>
           <key>linux32</key>
           <map>
@@ -891,9 +891,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>linux</key>
           <map>
             <key>md5sum</key>
-            <string>0878662f8c1c695a82477f7b0c57a7af</string>
+            <string>8ccd6155e0236b78548125a8aabebf79</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libpng-1.2.18-linux-20080812.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libpng-1.2.33-linux-20081201.tar.bz2</uri>
           </map>
           <key>linux32</key>
           <map>
@@ -918,39 +918,6 @@ anguage Infrstructure (CLI) international standard</string>
           </map>
         </map>
       </map>
-      <key>libstdc++</key>
-      <map>
-        <key>copyright</key>
-        <string>Copyright (C) 2007 Free Software Foundation, Inc. &lt;http://fsf.org/&gt;</string>
-        <key>description</key>
-        <string>Bundled library.</string>
-        <key>license</key>
-        <string>gpl</string>
-        <key>packages</key>
-        <map>
-          <key>linux</key>
-          <map>
-            <key>md5sum</key>
-            <string>1464a75ec87ee28e3b4f7840e9af41e3</string>
-            <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libstdc++-6.0-linux-20080812.tar.bz2</uri>
-          </map>
-          <key>linux32</key>
-          <map>
-            <key>md5sum</key>
-            <string>1218347dd70c3b471530793d0fc09b69</string>
-            <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libstdc++-6.4.1-linux-i686-gcc-4.1-20080915.tar.bz2</uri>
-          </map>
-          <key>linux64</key>
-          <map>
-            <key>md5sum</key>
-            <string>9a191dc453017b19c5803b046d82f32a</string>
-            <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libstdc++-6.4.1-linux64-20080909.tar.bz2</uri>
-          </map>
-        </map>
-      </map>
       <key>libuuid</key>
       <map>
         <key>copyright</key>
@@ -1022,9 +989,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>linux</key>
           <map>
             <key>md5sum</key>
-            <string>344bfdb8448bbc4158a99300cf4e2b4b</string>
+            <string>6866c147730c83b7858765355df75047</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llmozlib-linux-20080922.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llmozlib-linux-20081218prfhk.tar.bz2</uri>
           </map>
           <key>linux32</key>
           <map>
@@ -1171,9 +1138,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>linux</key>
           <map>
             <key>md5sum</key>
-            <string>df1809565b87b1dc28e3ca70db6e7d46</string>
+            <string>6dc0536329a0aadf76e3054ffd4da61c</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/ogg-vorbis-1.03-1.1.2-linux-20080812.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/ogg-vorbis-1.2.0-linux-20081201.tar.bz2</uri>
           </map>
           <key>linux32</key>
           <map>
@@ -1301,9 +1268,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>linux</key>
           <map>
             <key>md5sum</key>
-            <string>c333219c88462b8b22c815cd2b700218</string>
+            <string>02af0dad64803e0d821bc09e6038682c</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.2-linux-20080812.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.3-linux-20081124b.tar.bz2</uri>
           </map>
           <key>linux32</key>
           <map>