Commits

Paul ProductEngine committed 439df53 Merge

merge

  • Participants
  • Parent commits 938c81e, ee4d271

Comments (0)

Files changed (127)

 c5bdef3aaa2744626aef3c217ce29e1900d357b3 2.6.1-beta1
 9e4641f4a7870c0f565a25a2971368d5a29516a1 DRTVWR-41_2.6.0-beta2
 9e4641f4a7870c0f565a25a2971368d5a29516a1 2.6.0-beta2
+c9182ed77d427c759cfacf49a7b71a2e20d522aa DRTVWR-42_2.6.1-release
+c9182ed77d427c759cfacf49a7b71a2e20d522aa 2.6.1-release
 56b2778c743c2a964d82e1caf11084d76a87de2c 2.6.2-start
 42f32494bac475d0737799346f6831558ae8bf5d DRTVWR-39_2.6.0-release
 42f32494bac475d0737799346f6831558ae8bf5d 2.6.0-release
 d1203046bb653b763f835b04d184646949d8dd5c 2.6.2-beta1
 52b2263ab28f0976c689fd0b76c55a9eb027cdbf end-of-develop.py
 ec32f1045e7c2644015245df3a9933620aa194b8 2.6.3-start
+d7fcefabdf32bb61a9ea6d6037c1bb26190a85bc DRTVWR-47_2.6.3-beta1
+d7fcefabdf32bb61a9ea6d6037c1bb26190a85bc 2.6.3-beta1
+74cd32a06837b0c2cb793b2e8d4d82f5d49462b2 2.6.4-start
 viewer-pre-release.login_channel = "Second Life Release"
 viewer-pre-release.build_debug_release_separately = true
 viewer-pre-release.build_viewer_update_version_manager = true
-viewer-pre-release.release-viewer.jira = DRTVWR-42
+#viewer-pre-release.release-viewer.jira = DRTVWR-13
+
 # =======================================
 # brad
 # ========================================
 # oz
 # ================
 
-oz-viewer-devreview.build_debug_release_separately = true
-viewer-devreview.build_debug_release_separately = true
-oz_viewer-poreview.build_debug_release_separately = true
-oz-project-1.build_debug_release_separately = true
-oz-project-2.build_debug_release_separately = true
-oz-project-3.build_debug_release_separately = true
+oz_viewer-devreview.build_debug_release_separately = true
+oz_project-1.build_debug_release_separately = true
+oz_project-2.build_debug_release_separately = true
+oz_project-3.build_debug_release_separately = true
 
 # ========================================
 # enus

File doc/contributions.txt

 	VWR-592
 Ann Congrejo
 	CT-193
+Ansariel Hiller
+	STORM-1101
 Ardy Lay
 	VWR-19499
 	VWR-24917
 	STORM-1020
 	STORM-1064
 	STORM-960
+	STORM-1101
+	STORM-1108
+	STORM-1094
 	STORM-1077
 	STORM-953
 Kage Pixel
 Kunnis Basiat
 	VWR-82
 	VWR-102
+Lance Corrimal
+	VWR-25269
 Latif Khalifa
 	VWR-5370
 Lisa Lowe
 	VWR-13483
 	VWR-13947
 	VWR-24420
+	STORM-1147
 Thraxis Epsilon
 	SVC-371
 	VWR-383
 	STORM-674
 	STORM-776
 	STORM-825
+	STORM-1098
 	VWR-20741
 	VWR-20933
 Zai Lynch

File indra/llcommon/llversionviewer.h

 
 const S32 LL_VERSION_MAJOR = 2;
 const S32 LL_VERSION_MINOR = 6;
-const S32 LL_VERSION_PATCH = 4;
+const S32 LL_VERSION_PATCH = 5;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";

File indra/llimage/llimagedimensionsinfo.cpp

 
 bool LLImageDimensionsInfo::getImageDimensionsBmp()
 {
-	const S32 BMP_FILE_HEADER_SIZE = 14;
+	// Make sure the file is long enough.
+	const S32 DATA_LEN = 26; // BMP header (14) + DIB header size (4) + width (4) + height (4)
+	if (!checkFileLength(DATA_LEN))
+	{
+		llwarns << "Premature end of file" << llendl;
+		return false;
+	}
 
-	mInfile.seek(APR_CUR,BMP_FILE_HEADER_SIZE+4);
+	// Read BMP signature.
+	U8 signature[2];
+	mInfile.read((void*)signature, sizeof(signature)/sizeof(signature[0]));
+
+	// Make sure this is actually a BMP file.
+	// We only support Windows bitmaps (BM), according to LLImageBMP::updateData().
+	if (signature[0] != 'B' || signature[1] != 'M')
+	{
+		llwarns << "Not a BMP" << llendl;
+		return false;
+	}
+
+	// Read image dimensions.
+	mInfile.seek(APR_CUR, 16);
 	mWidth = read_reverse_s32();
 	mHeight = read_reverse_s32();
 
 {
 	const S32 TGA_FILE_HEADER_SIZE = 12;
 
+	// Make sure the file is long enough.
+	if (!checkFileLength(TGA_FILE_HEADER_SIZE + 1 /* width */ + 1 /* height */))
+	{
+		llwarns << "Premature end of file" << llendl;
+		return false;
+	}
+
+	// *TODO: Detect non-TGA files somehow.
 	mInfile.seek(APR_CUR,TGA_FILE_HEADER_SIZE);
 	mWidth = read_byte() | read_byte() << 8;
 	mHeight = read_byte() | read_byte() << 8;
 
 bool LLImageDimensionsInfo::getImageDimensionsPng()
 {
-	const S32 PNG_FILE_MARKER_SIZE = 8;
+	const S32 PNG_MAGIC_SIZE = 8;
 
-	mInfile.seek(APR_CUR,PNG_FILE_MARKER_SIZE + 8/*header offset+chunk length+chunk type*/);
+	// Make sure the file is long enough.
+	if (!checkFileLength(PNG_MAGIC_SIZE + 8 + sizeof(S32) * 2 /* width, height */))
+	{
+		llwarns << "Premature end of file" << llendl;
+		return false;
+	}
+
+	// Read PNG signature.
+	const U8 png_magic[PNG_MAGIC_SIZE] = {0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A};
+	U8 signature[PNG_MAGIC_SIZE];
+	mInfile.read((void*)signature, PNG_MAGIC_SIZE);
+
+	// Make sure it's a PNG file.
+	if (memcmp(signature, png_magic, PNG_MAGIC_SIZE) != 0)
+	{
+		llwarns << "Not a PNG" << llendl;
+		return false;
+	}
+
+	// Read image dimensions.
+	mInfile.seek(APR_CUR, 8 /* chunk length + chunk type */);
 	mWidth = read_s32();
 	mHeight = read_s32();
 
 		setLastError("Unable to open file for reading", mSrcFilename);
 		return false;
 	}
+
+	/* Make sure this is a JPEG file. */
+	const size_t JPEG_MAGIC_SIZE = 2;
+	const uint8_t jpeg_magic[JPEG_MAGIC_SIZE] = {0xFF, 0xD8};
+	uint8_t signature[JPEG_MAGIC_SIZE];
+
+	if (fread(signature, sizeof(signature), 1, fp) != 1)
+	{
+		llwarns << "Premature end of file" << llendl;
+		return false;
+	}
+	if (memcmp(signature, jpeg_magic, JPEG_MAGIC_SIZE) != 0)
+	{
+		llwarns << "Not a JPEG" << llendl;
+		return false;
+	}
+	fseek(fp, 0, SEEK_SET); // go back to start of the file
+
 	/* Init jpeg */
 	jpeg_error_mgr jerr;
 	jpeg_decompress_struct cinfo;
 	return !sJpegErrorEncountered;
 }
 
+bool LLImageDimensionsInfo::checkFileLength(S32 min_len)
+{
+	// Make sure the file is not shorter than min_len bytes.
+	// so that we don't have to check value returned by each read() or seek().
+	char* buf = new char[min_len];
+	int nread = mInfile.read(buf, min_len);
+	delete[] buf;
+	mInfile.seek(APR_SET, 0);
+	return nread == min_len;
+}

File indra/llimage/llimagedimensionsinfo.h

 		return read_byte() << 8 | read_byte();
 	}
 
+	/// Check if the file is not shorter than min_len bytes.
+	bool checkFileLength(S32 min_len);
+
 protected:
 	LLAPRFile mInfile ;
 	std::string mSrcFilename;

File indra/llplugin/llpluginclassmedia.cpp

 	mStatusText.clear();
 	mProgressPercent = 0;	
 	mClickURL.clear();
+	mClickNavType.clear();
 	mClickTarget.clear();
 	mClickUUID.clear();
+	mStatusCode = 0;
 	
 	// media_time class
 	mCurrentTime = 0.0f;
 		else if(message_name == "click_nofollow")
 		{
 			mClickURL = message.getValue("uri");
+			mClickNavType = message.getValue("nav_type");
 			mClickTarget.clear();
 			mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW);
 		}
+		else if(message_name == "navigate_error_page")
+		{
+			mStatusCode = message.getValueS32("status_code");
+			mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_ERROR_PAGE);
+		}
 		else if(message_name == "cookie_set")
 		{
 			if(mOwner)
 	sendMessage(message);
 }
 
-void LLPluginClassMedia::set_status_redirect(int code, const std::string &url)
-{
-	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "set_status_redirect");
-
-	message.setValueS32("code", code);
-	message.setValue("url", url);
-
-	sendMessage(message);
-}
-
 void LLPluginClassMedia::setBrowserUserAgent(const std::string& user_agent)
 {
 	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "set_user_agent");

File indra/llplugin/llpluginclassmedia.h

 	void browse_reload(bool ignore_cache = false);
 	void browse_forward();
 	void browse_back();
-	void set_status_redirect(int code, const std::string &url);
 	void setBrowserUserAgent(const std::string& user_agent);
 	void proxyWindowOpened(const std::string &target, const std::string &uuid);
 	void proxyWindowClosed(const std::string &uuid);
 	// This is valid after MEDIA_EVENT_CLICK_LINK_HREF or MEDIA_EVENT_CLICK_LINK_NOFOLLOW
 	std::string getClickURL() const { return mClickURL; };
 
+	// This is valid after MEDIA_EVENT_CLICK_LINK_NOFOLLOW
+	std::string getClickNavType() const { return mClickNavType; };
+
 	// This is valid after MEDIA_EVENT_CLICK_LINK_HREF
 	std::string getClickTarget() const { return mClickTarget; };
 
 	// This is valid during MEDIA_EVENT_CLICK_LINK_HREF and MEDIA_EVENT_GEOMETRY_CHANGE
 	std::string getClickUUID() const { return mClickUUID; };
+
+	// This is valid after MEDIA_EVENT_NAVIGATE_ERROR_PAGE
+	S32 getStatusCode() const { return mStatusCode; };
 	
 	// These are valid during MEDIA_EVENT_GEOMETRY_CHANGE
 	S32 getGeometryX() const { return mGeometryX; };
 	int				mProgressPercent;
 	std::string		mLocation;
 	std::string		mClickURL;
+	std::string		mClickNavType;
 	std::string		mClickTarget;
 	std::string		mClickUUID;
 	S32				mGeometryX;
 	S32				mGeometryY;
 	S32				mGeometryWidth;
 	S32				mGeometryHeight;
+	S32				mStatusCode;
 	std::string		mAuthURL;
 	std::string		mAuthRealm;
 	std::string		mHoverText;

File indra/llplugin/llpluginclassmediaowner.h

 		MEDIA_EVENT_STATUS_TEXT_CHANGED,	// browser has updated the status text
 		MEDIA_EVENT_NAME_CHANGED,			// browser has updated the name of the media (typically <title> tag)
 		MEDIA_EVENT_LOCATION_CHANGED,		// browser location (URL) has changed (maybe due to internal navagation/frames/etc)
+		MEDIA_EVENT_NAVIGATE_ERROR_PAGE,	// browser navigated to a page that resulted in an HTTP error
 		MEDIA_EVENT_CLICK_LINK_HREF,		// I'm not entirely sure what the semantics of these two are
 		MEDIA_EVENT_CLICK_LINK_NOFOLLOW,
 		MEDIA_EVENT_CLOSE_REQUEST,			// The plugin requested its window be closed (currently hooked up to javascript window.close in webkit)
 		MEDIA_EVENT_PICK_FILE_REQUEST,		// The plugin wants the user to pick a file
 		MEDIA_EVENT_GEOMETRY_CHANGE,		// The plugin requested its window geometry be changed (per the javascript window interface)
-		
+	
 		MEDIA_EVENT_PLUGIN_FAILED_LAUNCH,	// The plugin failed to launch 
 		MEDIA_EVENT_PLUGIN_FAILED,			// The plugin died unexpectedly
 

File indra/llui/lliconctrl.h

 
 	void			setColor(const LLColor4& color) { mColor = color; }
 	void			setImage(LLPointer<LLUIImage> image) { mImagep = image; }
+	const LLPointer<LLUIImage> getImage() { return mImagep; }
 	
 private:
 	void setIconImageDrawSize() ;

File indra/llui/lllineeditor.cpp

 	else
 		mContextMenuHandle.markDead();
 }
+
+void LLLineEditor::setFont(const LLFontGL* font)
+{
+	mGLFont = font;
+}

File indra/llui/lllineeditor.h

 	const LLColor4& getTentativeFgColor() const { return mTentativeFgColor.get(); }
 
 	const LLFontGL* getFont() const { return mGLFont; }
+	void setFont(const LLFontGL* font);
 
 	void			setIgnoreArrowKeys(BOOL b)		{ mIgnoreArrowKeys = b; }
 	void			setIgnoreTab(BOOL b)			{ mIgnoreTab = b; }

File indra/llui/llmenugl.cpp

 		CURSOR_HEIGHT + MOUSE_CURSOR_PADDING * 2);
 	menu->translateIntoRectWithExclusion( menu_region_rect, mouse_rect, FALSE );
 	menu->getParent()->sendChildToFront(menu);
-
-
-
 }
 
 ///============================================================================

File indra/llwindow/llwindowwin32.cpp

 	//-----------------------------------------------------------------------
 
 	DEVMODE dev_mode;
+	::ZeroMemory(&dev_mode, sizeof(DEVMODE));
+	dev_mode.dmSize = sizeof(DEVMODE);
 	DWORD current_refresh;
 	if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode))
 	{
 {
 	GLuint	pixel_format;
 	DEVMODE dev_mode;
+	::ZeroMemory(&dev_mode, sizeof(DEVMODE));
+	dev_mode.dmSize = sizeof(DEVMODE);
 	DWORD	current_refresh;
 	DWORD	dw_ex_style;
 	DWORD	dw_style;
 	{
 		mSupportedResolutions = new LLWindowResolution[MAX_NUM_RESOLUTIONS];
 		DEVMODE dev_mode;
+		::ZeroMemory(&dev_mode, sizeof(DEVMODE));
+		dev_mode.dmSize = sizeof(DEVMODE);
 
 		mNumSupportedResolutions = 0;
 		for (S32 mode_num = 0; mNumSupportedResolutions < MAX_NUM_RESOLUTIONS; mode_num++)
 BOOL LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh)
 {
 	DEVMODE dev_mode;
-	dev_mode.dmSize = sizeof(dev_mode);
+	::ZeroMemory(&dev_mode, sizeof(DEVMODE));
+	dev_mode.dmSize = sizeof(DEVMODE);
 	BOOL success = FALSE;
 
 	// Don't change anything if we don't have to

File indra/media_plugins/webkit/media_plugin_webkit.cpp

 
 	////////////////////////////////////////////////////////////////////////////////
 	// virtual
+	void onNavigateErrorPage(const EventType& event)
+	{
+		LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_error_page");
+		message.setValueS32("status_code", event.getIntValue());
+		sendMessage(message);
+	}
+	
+	////////////////////////////////////////////////////////////////////////////////
+	// virtual
 	void onLocationChange(const EventType& event)
 	{
 		if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE)
 	{
 		LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow");
 		message.setValue("uri", event.getEventUri());
+#if LLQTWEBKIT_API_VERSION >= 7
+		message.setValue("nav_type", event.getNavigationType());
+#else
+		message.setValue("nav_type", "clicked");
+#endif
 		sendMessage(message);
 	}
 	

File indra/newview/app_settings/CA.pem

File contents unchanged.

File indra/newview/app_settings/settings.xml

   <map>
     <key>Comment</key>
     <string>Specifies that you have not logged in with the viewer since you performed a clean install</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>Boolean</string>
-    <key>Value</key>
-    <integer>1</integer>
-  </map>
-  <key>FirstSelectedDisabledPopups</key>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>FirstSelectedDisabledPopups</key>
     <map>
       <key>Comment</key>
       <string>Return false if there is not disabled popup selected in the list of floater preferences popups</string>
     <key>ShowNetStats</key>
     <map>
       <key>Comment</key>
-      <string>Show the Search Bar in the Status Overlay</string>
+      <string>Show the Status Indicators for the Viewer and Network Usage in the Status Overlay</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>WaterFogColor</key>
+    <map>
+      <key>Comment</key>
+      <string>Water fog color</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Color4</string>
+      <key>Value</key>
+      <array>
+        <real>0.0863</real>
+        <real>0.168</real>
+        <real>0.212</real>
+        <real>0</real>
+      </array>
+    </map>
+    <key>WaterFogDensity</key>
+    <map>
+      <key>Comment</key>
+      <string>Water fog density</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>16.0</real>
+    </map>
     <key>WaterGLFogDensityScale</key>
     <map>
       <key>Comment</key>
       <key>Value</key>
       <integer>1</integer>
     </map>
+    <key>GenericErrorPageURL</key>
+    <map>
+      <key>Comment</key>
+      <string>URL to set as a property on LLMediaControl to navigate to if the a page completes with a 400-499 HTTP status code</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/agni/404.html</string>
+    </map>
+    <key>DestinationsAndAvatarsVisibility</key>
+    <map>
+      <key>Comment</key>
+      <string>Whether destination panel or avatar picker are open (0=destination guide, 1=avatar picker, default=nothing)</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
 </map>
 </llsd>

File indra/newview/app_settings/settings_minimal.xml

         <key>Type</key>
             <string>String</string>
         <key>Value</key>
-            <string>http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/damballah/howto/index.html?topic=[TOPIC]</string>
+            <string>http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/agni/howto/index.html?topic=[TOPIC]</string>
         </map>
     <key>PreferredMaturity</key>
         <map>
       <key>Type</key>
       <string>String</string>
       <key>Value</key>
-      <string>http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/damballah/guide.html</string>
+      <string>http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/agni/guide.html</string>
     </map>
     <key>AvatarPickerURL</key>
     <map>
       <key>Type</key>
       <string>String</string>
       <key>Value</key>
-      <string>http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/damballah/avatars.html</string>
+      <string>http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/agni/avatars.html</string>
     </map>
     <key>LogInventoryDecline</key>
     <map>

File indra/newview/llagentlistener.cpp

 		params.append(event_data["x"]);
 		params.append(event_data["y"]);
 		params.append(event_data["z"]);
-		LLCommandDispatcher::dispatch("teleport", params, LLSD(), NULL, true);
+		LLCommandDispatcher::dispatch("teleport", params, LLSD(), NULL, "clicked", true);
 		// *TODO - lookup other LLCommandHandlers for "agent", "classified", "event", "group", "floater", "parcel", "login", login_refresh", "balance", "chat"
 		// should we just compose LLCommandHandler and LLDispatchListener?
 	}
 								  LLVector3(event_data["x"].asReal(), 
 											event_data["y"].asReal(), 
 											event_data["z"].asReal())).getSLURLString();
-		LLURLDispatcher::dispatch(url, NULL, false);
+		LLURLDispatcher::dispatch(url, "clicked", NULL, false);
 	}
 }
 

File indra/newview/llappviewer.cpp

 #include "llvoicechannel.h"
 #include "llvoavatarself.h"
 #include "llsidetray.h"
-#include "llfeaturemanager.h"
 #include "llurlmatch.h"
 #include "lltextutil.h"
 #include "lllogininstance.h"
 	
 	//
 	// Various introspection concerning the libs we're using - particularly
-        // the libs involved in getting to a full login screen.
+	// the libs involved in getting to a full login screen.
 	//
 	LL_INFOS("InitInfo") << "J2C Engine is: " << LLImageJ2C::getEngineInfo() << LL_ENDL;
 	LL_INFOS("InitInfo") << "libcurl version is: " << LLCurl::getVersionString() << LL_ENDL;
     
 }
 
+//
+// This function decides whether the client machine meets the minimum requirements to
+// run in a maximized window, per the consensus of davep, boa and nyx on 3/30/2011.
+//
+bool LLAppViewer::meetsRequirementsForMaximizedStart()
+{
+	bool maximizedOk = (LLFeatureManager::getInstance()->getGPUClass() >= GPU_CLASS_2);
+
+	const U32 one_gigabyte_kb = 1024 * 1024;
+	maximizedOk &= (gSysMemory.getPhysicalMemoryKB() >= one_gigabyte_kb);
+
+	return maximizedOk;
+}
+
 bool LLAppViewer::initWindow()
 {
 	LL_INFOS("AppInit") << "Initializing window..." << LL_ENDL;
 	const S32 NEVER_SUBMIT_REPORT = 2;
 	bool use_watchdog = false;
 	int watchdog_enabled_setting = gSavedSettings.getS32("WatchdogEnabled");
-	if(watchdog_enabled_setting == -1){
+	if(watchdog_enabled_setting == -1)
+	{
 		use_watchdog = !LLFeatureManager::getInstance()->isFeatureAvailable("WatchdogDisabled");
 	}
 	else
 		LLAppViewer::instance()->forceErrorLLError();
 	}
 
+	//
+	// Determine if the window should start maximized on initial run based
+	// on graphics capability
+	//
+	if (gSavedSettings.getBOOL("FirstLoginThisInstall") && meetsRequirementsForMaximizedStart())
+	{
+		LL_INFOS("AppInit") << "This client met the requirements for a maximized initial screen." << LL_ENDL;
+		gSavedSettings.setBOOL("WindowMaximized", TRUE);
+	}
+
+	if (gSavedSettings.getBOOL("WindowMaximized"))
+	{
+		gViewerWindow->mWindow->maximize();
+	}
+
 	LLUI::sWindow = gViewerWindow->getWindow();
 
 	// Show watch cursor

File indra/newview/llappviewer.h

 
 	virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this.
 
+	virtual bool meetsRequirementsForMaximizedStart(); // Used on first login to decide to launch maximized
 
 private:
 

File indra/newview/llappviewerlinux.cpp

 	std::string url = slurl;
 	LLMediaCtrl* web = NULL;
 	const bool trusted_browser = false;
-	if (LLURLDispatcher::dispatch(url, web, trusted_browser))
+	if (LLURLDispatcher::dispatch(url, "", web, trusted_browser))
 	{
 		// bring window to foreground, as it has just been "launched" from a URL
 		// todo: hmm, how to get there from here?

File indra/newview/llappviewermacosx.cpp

 		
 		LLMediaCtrl* web = NULL;
 		const bool trusted_browser = false;
-		LLURLDispatcher::dispatch(url, web, trusted_browser);
+		LLURLDispatcher::dispatch(url, "", web, trusted_browser);
 	}
 	
 	return(result);

File indra/newview/llavataractions.cpp

 //static
 bool LLAvatarActions::canCall()
 {
-		return LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking();
+	return LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking();
 }
 
 // static
 	make_ui_sound("UISndStartIM");
 }
 
+static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name)
+{
+	llinfos << "opening web profile for " << av_name.mUsername << llendl;		
+	std::string url = getProfileURL(av_name.mUsername);
+
+	// PROFILES: open in webkit window
+	LLWeb::loadWebURLInternal(url, "", agent_id.asString());
+}
+
 // static
 void LLAvatarActions::showProfile(const LLUUID& id)
 {
 	if (id.notNull())
 	{
-		LLSD params;
-		params["id"] = id;
-		params["open_tab_name"] = "panel_profile";
-
-		// PROFILES: open in webkit window
-		std::string full_name;
-		if (gCacheName->getFullName(id,full_name))
-		{
-			std::string agent_name = LLCacheName::buildUsername(full_name);
-			llinfos << "opening web profile for " << agent_name << llendl;		
-			std::string url = getProfileURL(agent_name);
-			LLWeb::loadWebURLInternal(url, "", id.asString());
-		}
-		else
-		{
-			llwarns << "no name info for agent id " << id << llendl;
-		}
-#if 0
-		//Show own profile
-		if(gAgent.getID() == id)
-		{
-			LLSideTray::getInstance()->showPanel("panel_me", params);
-		}
-		//Show other user profile
-		else
-		{
-			LLSideTray::getInstance()->showPanel("panel_profile_view", params);
-		}
-#endif
+		LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_show_profile, _1, _2));
 	}
 }
 

File indra/newview/llavatarpropertiesprocessor.cpp

 
 void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props)
 {
+	if (!gAgent.isInitialized() || (gAgent.getID() == LLUUID::null))
+	{
+		llwarns << "Sending avatarinfo update DENIED - invalid agent" << llendl;
+		return;
+	}
+
 	llinfos << "Sending avatarinfo update" << llendl;
 
 	// This value is required by sendAvatarPropertiesUpdate method.
 
 	LLMessageSystem *msg = gMessageSystem;
 
-	msg->newMessageFast(_PREHASH_AvatarPropertiesUpdate);
-	msg->nextBlockFast(_PREHASH_AgentData);
-	msg->addUUIDFast(	_PREHASH_AgentID,		gAgent.getID() );
-	msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
-	msg->nextBlockFast(_PREHASH_PropertiesData);
+	msg->newMessageFast	(_PREHASH_AvatarPropertiesUpdate);
+	msg->nextBlockFast	(_PREHASH_AgentData);
+	msg->addUUIDFast		(_PREHASH_AgentID,		gAgent.getID() );
+	msg->addUUIDFast		(_PREHASH_SessionID,	gAgent.getSessionID() );
+	msg->nextBlockFast	(_PREHASH_PropertiesData);
 
-	msg->addUUIDFast(	_PREHASH_ImageID,	avatar_props->image_id);
-	msg->addUUIDFast(	_PREHASH_FLImageID,		avatar_props->fl_image_id);
-	msg->addStringFast(	_PREHASH_AboutText,		avatar_props->about_text);
-	msg->addStringFast(	_PREHASH_FLAboutText,	avatar_props->fl_about_text);
+	msg->addUUIDFast		(_PREHASH_ImageID,		avatar_props->image_id);
+	msg->addUUIDFast		(_PREHASH_FLImageID,	avatar_props->fl_image_id);
+	msg->addStringFast	(_PREHASH_AboutText,	avatar_props->about_text);
+	msg->addStringFast	(_PREHASH_FLAboutText,	avatar_props->fl_about_text);
 
 	msg->addBOOL(_PREHASH_AllowPublish, avatar_props->allow_publish);
 	msg->addBOOL(_PREHASH_MaturePublish, mature);
 	msg->addString(_PREHASH_ProfileURL, avatar_props->profile_url);
+
 	gAgent.sendReliableMessage();
 }
 

File indra/newview/llbreastmotion.cpp

  * @file llbreastmotion.cpp
  * @brief Implementation of LLBreastMotion class.
  *
- * $LicenseInfo:firstyear=2001&license=viewergpl$
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
  * 
- * Copyright (c) 2001-2009, Linden Research, Inc.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
  * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
 

File indra/newview/llbreastmotion.h

  * @file llbreastmotion.h
  * @brief Implementation of LLBreastMotion class.
  *
- * $LicenseInfo:firstyear=2001&license=viewergpl$
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
  * 
- * Copyright (c) 2001-2009, Linden Research, Inc.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
  * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
 

File indra/newview/llcommanddispatcherlistener.cpp

         trusted_browser = params["trusted"].asBoolean();
     }
     LLCommandDispatcher::dispatch(params["cmd"], params["params"], params["query"], NULL,
-                                  trusted_browser);
+                                  "clicked", trusted_browser);
 }
 
 void LLCommandDispatcherListener::enumerate(const LLSD& params) const

File indra/newview/llcommandhandler.cpp

 // system includes
 #include <boost/tokenizer.hpp>
 
-#define THROTTLE_PERIOD    5    // required secs between throttled commands
+#define THROTTLE_PERIOD    5    // required seconds between throttled commands
 
 static LLCommandDispatcherListener sCommandDispatcherListener;
 
 				  const LLSD& params,
 				  const LLSD& query_map,
 				  LLMediaCtrl* web,
+				  const std::string& nav_type,
 				  bool trusted_browser);
 
 private:
 										const LLSD& params,
 										const LLSD& query_map,
 										LLMediaCtrl* web,
+										const std::string& nav_type,
 										bool trusted_browser)
 {
 	static bool slurl_blocked = false;
 			return true;
 
 		case LLCommandHandler::UNTRUSTED_THROTTLE:
+			// if users actually click on a link, we don't need to throttle it
+			// (throttling mechanism is used to prevent an avalanche of clicks via
+			// javascript
+			if ( nav_type == "clicked" )
+			{
+				break;
+			}
+
 			cur_time = LLTimer::getElapsedSeconds();
 			if (cur_time < last_throttle_time + THROTTLE_PERIOD)
 			{
 				// block request from external browser if it happened
-				// within THROTTLE_PERIOD secs of the last command
+				// within THROTTLE_PERIOD seconds of the last command
 				LL_WARNS_ONCE("SLURL") << "Throttled SLURL command from untrusted browser" << LL_ENDL;
 				if (! slurl_throttled)
 				{
 								   const LLSD& params,
 								   const LLSD& query_map,
 								   LLMediaCtrl* web,
+								   const std::string& nav_type,
 								   bool trusted_browser)
 {
 	return LLCommandHandlerRegistry::instance().dispatch(
-		cmd, params, query_map, web, trusted_browser);
+		cmd, params, query_map, web, nav_type, trusted_browser);
 }
 
 static std::string lookup(LLCommandHandler::EUntrustedAccess value);

File indra/newview/llcommandhandler.h

 						 const LLSD& params,
 						 const LLSD& query_map,
 						 LLMediaCtrl* web,
+						 const std::string& nav_type,
 						 bool trusted_browser);
 		// Execute a command registered via the above mechanism,
 		// passing string parameters.

File indra/newview/llexpandabletextbox.cpp

 {
 	LLTextEditor::reshape(width, height, called_from_parent);
 
-	if (getTextPixelHeight() > getRect().getHeight())
-	{
-		showExpandText();
-	}
+	hideOrShowExpandTextAsNeeded();
 }
 
 void LLExpandableTextBox::LLTextBoxEx::setText(const LLStringExplicit& text,const LLStyle::Params& input_params)
 	mExpanderVisible = false;
 	LLTextEditor::setText(text, input_params);
 
-	// text contents have changed, segments are cleared out
-	// so hide the expander and determine if we need it
-	//mExpanderVisible = false;
-	if (getTextPixelHeight() > getRect().getHeight())
-	{
-		showExpandText();
-	}
-	else
-	{
-		hideExpandText();
-	}
+	hideOrShowExpandTextAsNeeded();
 }
 
 
 	return getTextBoundingRect().getHeight();
 }
 
+void LLExpandableTextBox::LLTextBoxEx::hideOrShowExpandTextAsNeeded()
+{
+	// Restore the text box contents to calculate the text height properly,
+	// otherwise if a part of the text is hidden under "More" link
+	// getTextPixelHeight() returns only the height of currently visible text
+	// including the "More" link. See STORM-250.
+	hideExpandText();
+
+	// Show the expander a.k.a. "More" link if we need it, depending on text
+	// contents height. If not, keep it hidden.
+	if (getTextPixelHeight() > getRect().getHeight())
+	{
+		showExpandText();
+	}
+}
+
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////

File indra/newview/llexpandabletextbox.h

 		 */
 		void hideExpandText();
 
+		/**
+		 * Shows the "More" link if the text is too high to be completely
+		 * visible without expanding the text box. Hides that link otherwise.
+		 */
+		void hideOrShowExpandTextAsNeeded();
+
 	protected:
 
 		LLTextBoxEx(const Params& p);

File indra/newview/llfirstuse.cpp

 {
 	// fire off 2 notifications and rely on filtering to select the relevant one
 	firstUseNotification("FirstNotMoving", enable, "HintMove", LLSD(), LLSD().with("target", "move_btn").with("direction", "top"));
-	firstUseNotification("FirstNotMoving", enable, "HintMoveArrows", LLSD(), LLSD().with("target", "bottom_tray").with("direction", "top").with("hint_image", "arrow_keys.png").with("down_arrow", ""));
+	firstUseNotification("FirstNotMoving", enable, "HintMoveClick", LLSD(), LLSD()
+		.with("target", "nav_bar")
+		.with("direction", "bottom")
+		.with("hint_image", "click_to_move.png")
+		.with("up_arrow", ""));
 }
 
 // static

File indra/newview/llfloaterhelpbrowser.cpp

 {
 	mBrowser = getChild<LLMediaCtrl>("browser");
 	mBrowser->addObserver(this);
+	mBrowser->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
 
 	childSetAction("open_browser", onClickOpenWebBrowser, this);
 

File indra/newview/llfloaterpreference.cpp

 	mGotPersonalInfo(false),
 	mOriginalIMViaEmail(false),
 	mLanguageChanged(false),
+	mAvatarDataInitialized(false),
 	mDoubleClickActionDirty(false),
 	mFavoritesRecordMayExist(false)
 {
 	if ( APT_PROPERTIES == type )
 	{
 		const LLAvatarData* pAvatarData = static_cast<const LLAvatarData*>( pData );
-		if( pAvatarData && gAgent.getID() == pAvatarData->avatar_id )
+		if (pAvatarData && (gAgent.getID() == pAvatarData->avatar_id) && (pAvatarData->avatar_id != LLUUID::null))
 		{
 			storeAvatarProperties( pAvatarData );
 			processProfileProperties( pAvatarData );
 
 void LLFloaterPreference::storeAvatarProperties( const LLAvatarData* pAvatarData )
 {
-	mAvatarProperties.avatar_id		= gAgent.getID();
-	mAvatarProperties.image_id		= pAvatarData->image_id;
-	mAvatarProperties.fl_image_id   = pAvatarData->fl_image_id;
-	mAvatarProperties.about_text	= pAvatarData->about_text;
-	mAvatarProperties.fl_about_text = pAvatarData->fl_about_text;
-	mAvatarProperties.profile_url   = pAvatarData->profile_url;
-	mAvatarProperties.flags		    = pAvatarData->flags;
-	mAvatarProperties.allow_publish	= pAvatarData->flags & AVATAR_ALLOW_PUBLISH;
+	if (LLStartUp::getStartupState() == STATE_STARTED)
+	{
+		mAvatarProperties.avatar_id		= pAvatarData->avatar_id;
+		mAvatarProperties.image_id		= pAvatarData->image_id;
+		mAvatarProperties.fl_image_id   = pAvatarData->fl_image_id;
+		mAvatarProperties.about_text	= pAvatarData->about_text;
+		mAvatarProperties.fl_about_text = pAvatarData->fl_about_text;
+		mAvatarProperties.profile_url   = pAvatarData->profile_url;
+		mAvatarProperties.flags		    = pAvatarData->flags;
+		mAvatarProperties.allow_publish	= pAvatarData->flags & AVATAR_ALLOW_PUBLISH;
+
+		mAvatarDataInitialized = true;
+	}
 }
 
 void LLFloaterPreference::processProfileProperties(const LLAvatarData* pAvatarData )
 
 void LLFloaterPreference::saveAvatarProperties( void )
 {
-	mAvatarProperties.allow_publish = getChild<LLUICtrl>("online_searchresults")->getValue();
-	if ( mAvatarProperties.allow_publish )
+	const BOOL allowPublish = getChild<LLUICtrl>("online_searchresults")->getValue();
+
+	if (allowPublish)
 	{
 		mAvatarProperties.flags |= AVATAR_ALLOW_PUBLISH;
 	}
-	
-	LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate( &mAvatarProperties );
+
+	//
+	// NOTE: We really don't want to send the avatar properties unless we absolutely
+	//       need to so we can avoid the accidental profile reset bug, so, if we're
+	//       logged in, the avatar data has been initialized and we have a state change
+	//       for the "allow publish" flag, then set the flag to its new value and send
+	//       the properties update.
+	//
+	// NOTE: The only reason we can not remove this update altogether is because of the
+	//       "allow publish" flag, the last remaining profile setting in the viewer
+	//       that doesn't exist in the web profile.
+	//
+	if ((LLStartUp::getStartupState() == STATE_STARTED) && mAvatarDataInitialized && (allowPublish != mAvatarProperties.allow_publish))
+	{
+		mAvatarProperties.allow_publish = allowPublish;
+
+		LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate( &mAvatarProperties );
+	}
 }
 
-
 BOOL LLFloaterPreference::postBuild()
 {
 	gSavedSettings.getControl("PlainTextChatHistory")->getSignal()->connect(boost::bind(&LLIMFloater::processChatHistoryStyleUpdate, _2));
 		mOriginalHideOnlineStatus = true;
 	}
 	
+	getChild<LLUICtrl>("online_searchresults")->setEnabled(TRUE);
+
 	getChildView("include_im_in_chat_history")->setEnabled(TRUE);
 	getChildView("show_timestamps_check_im")->setEnabled(TRUE);
 	getChildView("friends_online_notify_checkbox")->setEnabled(TRUE);
 		bool enable = hasDirtyChilds();
 
 		button_apply->setEnabled(enable);
-
 	}
 }
 bool LLPanelPreferenceGraphics::hasDirtyChilds()

File indra/newview/llfloaterpreference.h

 	bool mGotPersonalInfo;
 	bool mOriginalIMViaEmail;
 	bool mLanguageChanged;
+	bool mAvatarDataInitialized;
 	
 	bool mOriginalHideOnlineStatus;
 	// Record of current user's favorites may be stored in file on disk.

File indra/newview/llfloaterwebcontent.cpp

File contents unchanged.

File indra/newview/llhints.cpp

 	LLRect text_bounds = hint_text.getTextBoundingRect();
 	S32 delta_height = text_bounds.getHeight() - hint_text.getRect().getHeight();
 	reshape(getRect().getWidth(), getRect().getHeight() + delta_height);
+	hint_text.reshape(hint_text.getRect().getWidth(), hint_text.getRect().getHeight() + delta_height);
+//	hint_text.translate(0, -delta_height);
 	return TRUE;
 }
 
 		alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeInTime, 0.f, 1.f);
 	}
 	
+	LLIconCtrl* hint_icon = findChild<LLIconCtrl>("hint_image");
+
+	if (hint_icon)
+	{
+		LLUIImagePtr hint_image = hint_icon->getImage();
+		S32 image_height = hint_image.isNull() ? 0 : hint_image->getHeight();
+		S32 image_width = hint_image.isNull() ? 0 : hint_image->getWidth();
+
+		LLView* layout_stack = hint_icon->getParent()->getParent();
+		S32 delta_height = image_height - layout_stack->getRect().getHeight();
+		hint_icon->getParent()->reshape(image_width, hint_icon->getParent()->getRect().getHeight());
+		layout_stack->reshape(layout_stack->getRect().getWidth(), image_height);
+		layout_stack->translate(0, -delta_height);
+
+		LLRect hint_rect = getLocalRect();
+		reshape(hint_rect.getWidth(), hint_rect.getHeight() + delta_height);
+	}
+
 	{	LLViewDrawContext context(alpha); 
 
 		if (mTarget.empty())

File indra/newview/llimfloater.cpp

 #include "llrootview.h"
 #include "llspeakers.h"
 #include "llsidetray.h"
+#include "llviewerchat.h"
 
 
 static const S32 RECT_PADDING_NOT_INIT = -1;
 	mInputEditor->setMaxTextLength(1023);
 	// enable line history support for instant message bar
 	mInputEditor->setEnableLineHistory(TRUE);
-	
+
+	LLFontGL* font = LLViewerChat::getChatFont();
+	mInputEditor->setFont(font);	
 	
 	mInputEditor->setFocusReceivedCallback( boost::bind(onInputEditorFocusReceived, _1, this) );
 	mInputEditor->setFocusLostCallback( boost::bind(onInputEditorFocusLost, _1, this) );
 
 void LLIMFloater::processChatHistoryStyleUpdate(const LLSD& newvalue)
 {
+	LLFontGL* font = LLViewerChat::getChatFont();
 	LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel");
 	for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin();
 		 iter != inst_list.end(); ++iter)
 		if (floater)
 		{
 			floater->updateChatHistoryStyle();
+			floater->mInputEditor->setFont(font);
 		}
 	}
 

File indra/newview/llinventorybridge.cpp

 					if (LLWearableType::getAllowMultiwear(mWearableType))
 					{
 						items.push_back(std::string("Wearable Add"));
-						if (gAgentWearables.getWearableCount(mWearableType) > 0)
+						if (gAgentWearables.getWearableCount(mWearableType) >= LLAgentWearables::MAX_CLOTHING_PER_TYPE)
 						{
 							disabled_items.push_back(std::string("Wearable Add"));
 						}

File indra/newview/llmediactrl.cpp

 #include "llslurl.h"
 #include "lluictrlfactory.h"	// LLDefaultChildRegistry
 #include "llkeyboard.h"
+#include "llviewermenu.h"
 
 // linden library includes
 #include "llfocusmgr.h"
 	texture_height("texture_height", 1024),
 	caret_color("caret_color"),
 	initial_mime_type("initial_mime_type"),
+	error_page_url("error_page_url"),
 	media_id("media_id"),
 	trusted_content("trusted_content", false),
 	focus_on_click("focus_on_click", true)
 	mTextureHeight ( 1024 ),
 	mClearCache(false),
 	mHomePageMimeType(p.initial_mime_type),
+	mErrorPageURL(p.error_page_url),
 	mTrusted(p.trusted_content),
 	mWindowShade(NULL),
-	mHoverTextChanged(false)
+	mHoverTextChanged(false),
+	mContextMenu(NULL)
 {
 	{
 		LLColor4 color = p.caret_color().get();
 
 LLMediaCtrl::~LLMediaCtrl()
 {
-
 	if (mMediaSource)
 	{
 		mMediaSource->remObserver( this );
 BOOL LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask )
 {
 	if (LLPanel::handleRightMouseDown(x, y, mask)) return TRUE;
-	convertInputCoords(x, y);
+
+	S32 media_x = x, media_y = y;
+	convertInputCoords(media_x, media_y);
 
 	if (mMediaSource)
-		mMediaSource->mouseDown(x, y, mask, 1);
+		mMediaSource->mouseDown(media_x, media_y, mask, 1);
 	
 	gFocusMgr.setMouseCapture( this );
 
 		setFocus( TRUE );
 	}
 
+	if (mContextMenu)
+	{
+		mContextMenu->show(x, y);
+		LLMenuGL::showPopup(this, mContextMenu, x, y);
+	}
+
 	return TRUE;
 }
 
 //
 BOOL LLMediaCtrl::postBuild ()
 {
+	mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
+		"menu_media_ctrl.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
 	setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2));
 	return TRUE;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 //
-void LLMediaCtrl::set404RedirectUrl( std::string redirect_url )
-{
-	if(mMediaSource && mMediaSource->hasMedia())
-		mMediaSource->getMediaPlugin()->set_status_redirect( 404, redirect_url );
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//
-void LLMediaCtrl::clr404RedirectUrl()
-{
-	if(mMediaSource && mMediaSource->hasMedia())
-		mMediaSource->getMediaPlugin()->set_status_redirect(404, "");
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//
 void LLMediaCtrl::clearCache()
 {
 	if(mMediaSource)
 	}
 }
 
+void LLMediaCtrl::setErrorPageURL(const std::string& url)
+{
+	mErrorPageURL = url;
+}
+
+const std::string& LLMediaCtrl::getErrorPageURL()
+{
+	return mErrorPageURL;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 //
 bool LLMediaCtrl::setCaretColor(unsigned int red, unsigned int green, unsigned int blue)
 		};
 		break;
 
+		case MEDIA_EVENT_NAVIGATE_ERROR_PAGE:
+		{
+			LL_DEBUGS("Media") <<  "Media event:  MEDIA_EVENT_NAVIGATE_ERROR_PAGE" << LL_ENDL;
+			if ( mErrorPageURL.length() > 0 )
+			{
+				navigateTo(mErrorPageURL, "text/html");
+			};
+		};
+		break;
+
 		case MEDIA_EVENT_CLICK_LINK_HREF:
 		{
 			LL_DEBUGS("Media") <<  "Media event:  MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << self->getClickTarget() << "\", uri is " << self->getClickURL() << LL_ENDL;

File indra/newview/llmediactrl.h

 
 class LLViewBorder;
 class LLUICtrlFactory;
+class LLContextMenu;
 
 ////////////////////////////////////////////////////////////////////////////////
 //
 
 		Optional<std::string>	initial_mime_type;
 		Optional<std::string>	media_id;
+		Optional<std::string>	error_page_url;
 		
 		Params();
 	};
 
 		void setTarget(const std::string& target);
 
-		// set/clear URL to visit when a 404 page is reached
-		void set404RedirectUrl( std::string redirect_url );
-		void clr404RedirectUrl();
-		
+		void setErrorPageURL(const std::string& url);
+		const std::string& getErrorPageURL();
+
 		// Clear the browser cache when the instance gets loaded
 		void clearCache();
 
 		std::string mHomePageUrl;
 		std::string mHomePageMimeType;
 		std::string mCurrentNavUrl;
+		std::string mErrorPageURL;
 		std::string mTarget;
 		bool mIgnoreUIScale;
 		bool mAlwaysRefresh;
 		bool mClearCache;
 		class LLWindowShade* mWindowShade;
 		bool mHoverTextChanged;
+		LLContextMenu* mContextMenu;
 };
 
 #endif // LL_LLMediaCtrl_H

File indra/newview/llnavigationbar.cpp

 #include "llviewercontrol.h"
 #include "llfloatermediabrowser.h"
 #include "llweb.h"
+#include "llhints.h"
 
 #include "llinventorymodel.h"
 #include "lllandmarkactions.h"
 	LLTeleportHistory::getInstance()->setHistoryChangedCallback(
 			boost::bind(&LLNavigationBar::onTeleportHistoryChanged, this));
 
+	LLHints::registerHintTarget("nav_bar", LLView::getHandle());
+
 	return TRUE;
 }
 

File indra/newview/llpaneleditwearable.cpp

 
 void LLPanelEditWearable::changeCamera(U8 subpart)
 {
+	// Don't change the camera if this type doesn't have a camera switch.
+	// Useful for wearables like physics that don't have an associated physical body part.
+	if (LLWearableType::getDisableCameraSwitch(mWearablePtr->getType()))
+	{
+		return;
+	}
         const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mWearablePtr->getType());
         if (!wearable_entry)
         {

File indra/newview/llpanellogin.cpp

 	}
 	updateLocationCombo(false);
 
-	gSavedSettings.getControl("SessionSettingsFile")->getSignal()->connect(boost::bind(&onModeChange));
+	LLUICtrl& mode_combo = getChildRef<LLUICtrl>("mode_combo");
+	mode_combo.setValue(gSavedSettings.getString("SessionSettingsFile"));
+	mode_combo.setCommitCallback(boost::bind(&LLPanelLogin::onModeChange, this, getChild<LLUICtrl>("mode_combo")->getValue(), _2));
 
 	LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
 	server_choice_combo->setCommitCallback(onSelectServer, NULL);
 	sInstance->getChildView("forgot_password_text")->setVisible( system_grid);
 }
 
-//static
-void LLPanelLogin::onModeChange()
+void LLPanelLogin::onModeChange(const LLSD& original_value, const LLSD& new_value)
 {
-	LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(&onModeChangeConfirm, _1, _2));
+	if (original_value.asString() != new_value.asString())
+	{
+		LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(&LLPanelLogin::onModeChangeConfirm, this, original_value, new_value, _1, _2));
+	}
 }
 
-//static
-void LLPanelLogin::onModeChangeConfirm(const LLSD& notification, const LLSD& response)
+void LLPanelLogin::onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response)
 {
 	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
 	switch (option)
 	{
 	case 0:
-		LLAppViewer::instance()->requestQuit();
+		gSavedSettings.getControl("SessionSettingsFile")->set(new_value);
+		LLAppViewer::instance()->forceQuit();
 		break;
 	case 1:
-		// do nothing
+		// revert to original value
+		getChild<LLUICtrl>("mode_combo")->setValue(original_value);
 		break;
 	default:
 		break;

File indra/newview/llpanellogin.h

 	static void onServerComboLostFocus(LLFocusableElement*);
 	static void updateServerCombo();
 	static void updateStartSLURL();
-	static void onModeChange();
-	static void onModeChangeConfirm(const LLSD& notification, const LLSD& response);
+	void onModeChange(const LLSD& original_value, const LLSD& new_value);
+	void onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response);
 	
 	static void updateLoginPanelLinks();
 

File indra/newview/llpanelme.cpp

 {
 	LLPanelProfile::postBuild();
 
-	getTabContainer()[PANEL_PROFILE]->childSetAction("edit_profile_btn", boost::bind(&LLPanelMe::onEditProfileClicked, this), this);
-
 	return TRUE;
 }
 
 	if (NULL == mEditPanel)
 	{
 		mEditPanel = new LLPanelMyProfileEdit();
-		mEditPanel->childSetAction("save_btn", boost::bind(&LLPanelMe::onSaveChangesClicked, this), this);
+
+		// Note: Remove support for editing profile through this method.
+		//       All profile editing should go through the web.
+		//mEditPanel->childSetAction("save_btn", boost::bind(&LLPanelMe::onSaveChangesClicked, this), this);
+
 		mEditPanel->childSetAction("cancel_btn", boost::bind(&LLPanelMe::onCancelClicked, this), this);
 	}
 }
 	togglePanel(mEditPanel, getAvatarId()); // open
 }
 
-void LLPanelMe::onSaveChangesClicked()
-{
-	LLAvatarData data = LLAvatarData();
-	data.avatar_id = gAgent.getID();
-	data.image_id = mEditPanel->getChild<LLTextureCtrl>(PICKER_SECOND_LIFE)->getImageAssetID();
-	data.fl_image_id = mEditPanel->getChild<LLTextureCtrl>(PICKER_FIRST_LIFE)->getImageAssetID();
-	data.about_text = mEditPanel->getChild<LLUICtrl>("sl_description_edit")->getValue().asString();
-	data.fl_about_text = mEditPanel->getChild<LLUICtrl>("fl_description_edit")->getValue().asString();
-	data.profile_url = mEditPanel->getChild<LLUICtrl>("homepage_edit")->getValue().asString();
-	data.allow_publish = mEditPanel->getChild<LLUICtrl>("show_in_search_checkbox")->getValue();
-
-	LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate(&data);
-	togglePanel(mEditPanel); // close
-	onOpen(getAvatarId());
-}
-
 void LLPanelMe::onCancelClicked()
 {
 	togglePanel(mEditPanel); // close

File indra/newview/llpanelme.h

 	void buildEditPanel();
 
 	void onEditProfileClicked();
-	void onSaveChangesClicked();
 	void onCancelClicked();
 
 	LLPanelMyProfileEdit *  mEditPanel;

File indra/newview/llphysicsmotion.cpp

-/** 
- * @file llphysicsmotion.cpp
- * @brief Implementation of LLPhysicsMotion class.
- *
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- * 
- * Copyright (c) 2001-2009, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- * $/LicenseInfo$
- */
-
-//-----------------------------------------------------------------------------
-// Header Files
-//-----------------------------------------------------------------------------
-#include "llviewerprecompiledheaders.h"
-#include "linden_common.h"
-
-#include "m3math.h"
-#include "v3dmath.h"
-
-#include "llphysicsmotion.h"
-#include "llcharacter.h"
-#include "llviewercontrol.h"
-#include "llviewervisualparam.h"
-#include "llvoavatarself.h"
-
-typedef std::map<std::string, std::string> controller_map_t;
-typedef std::map<std::string, F32> default_controller_map_t;
-
-#define MIN_REQUIRED_PIXEL_AREA_BREAST_MOTION 0.f;
-
-inline F64 llsgn(const F64 a)
-{
-        if (a >= 0)
-                return 1;
-        return -1;
-}
-
-/* 
-   At a high level, this works by setting temporary parameters that are not stored
-   in the avatar's list of params, and are not conveyed to other users.  We accomplish
-   this by creating some new temporary driven params inside avatar_lad that are then driven
-   by the actual params that the user sees and sets.  For example, in the old system,
-   the user sets a param called breast bouyancy, which controls the Z value of the breasts.
-   In our new system, the user still sets the breast bouyancy, but that param is redefined
-   as a driver param so that affects a new temporary driven param that the bounce is applied
-   to.
-*/
-
-class LLPhysicsMotion
-{
-public:
-        /*
-          param_driver_name: The param that controls the params that are being affected by the physics.
-          joint_name: The joint that the body part is attached to.  The joint is
-          used to determine the orientation (rotation) of the body part.
-
-          character: The avatar that this physics affects.
-
-          motion_direction_vec: The direction (in world coordinates) that determines the
-          motion.  For example, (0,0,1) is up-down, and means that up-down motion is what
-          determines how this joint moves.
-
-          controllers: The various settings (e.g. spring force, mass) that determine how
-          the body part behaves.
-        */
-        LLPhysicsMotion(const std::string &param_driver_name, 
-                        const std::string &joint_name,
-                        LLCharacter *character,
-                        const LLVector3 &motion_direction_vec,
-                        const controller_map_t &controllers) :
-                mParamDriverName(param_driver_name),
-                mJointName(joint_name),
-                mMotionDirectionVec(motion_direction_vec),
-                mParamDriver(NULL),
-                mParamControllers(controllers),
-                mCharacter(character),
-                mLastTime(0),
-                mPosition_local(0),
-                mVelocityJoint_local(0),
-                mPositionLastUpdate_local(0)
-        {
-                mJointState = new LLJointState;
-        }
-
-        BOOL initialize();
-
-        ~LLPhysicsMotion() {}
-
-        BOOL onUpdate(F32 time);
-
-        LLPointer<LLJointState> getJointState() 
-        {
-                return mJointState;
-        }
-protected:
-        F32 getParamValue(const std::string& controller_key)
-        {
-                const controller_map_t::const_iterator& entry = mParamControllers.find(controller_key);
-                if (entry == mParamControllers.end())
-                {
-                        return sDefaultController[controller_key];
-                }
-                const std::string& param_name = (*entry).second.c_str();
-                return mCharacter->getVisualParamWeight(param_name.c_str());
-        }
-        void setParamValue(LLViewerVisualParam *param,
-                           const F32 new_value_local);
-
-        F32 toLocal(const LLVector3 &world);
-        F32 calculateVelocity_local(const F32 time_delta);
-        F32 calculateAcceleration_local(F32 velocity_local,
-                                        const F32 time_delta);
-private:
-        const std::string mParamDriverName;
-        const std::string mParamControllerName;
-        const LLVector3 mMotionDirectionVec;
-        const std::string mJointName;
-
-        F32 mPosition_local;
-        F32 mVelocityJoint_local; // How fast the joint is moving
-        F32 mAccelerationJoint_local; // Acceleration on the joint