diff options
| -rw-r--r-- | indra/newview/llappviewer.cpp | 78 | ||||
| -rw-r--r-- | indra/newview/llpanellogin.cpp | 104 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 12 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_login.xml | 6 | 
4 files changed, 57 insertions, 143 deletions
| diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5bd0a0d297..eb8d87e184 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2417,55 +2417,71 @@ namespace {  		LLUpdaterService().startChecking(install_if_ready);  	} -	void on_required_update_downloaded(LLSD const & data) +	void on_update_downloaded(LLSD const & data)  	{  		std::string notification_name; -		if(LLStartUp::getStartupState() <= STATE_LOGIN_WAIT) +		void (*apply_callback)(LLSD const &, LLSD const &) = NULL; + +		if(data["required"].asBoolean())  		{ -			// The user never saw the progress bar. -			notification_name = "RequiredUpdateDownloadedVerboseDialog"; +			apply_callback = &apply_update_ok_callback; +			if(LLStartUp::getStartupState() <= STATE_LOGIN_WAIT) +			{ +				// The user never saw the progress bar. +				notification_name = "RequiredUpdateDownloadedVerboseDialog"; +			} +			else +			{ +				notification_name = "RequiredUpdateDownloadedDialog"; +			}  		}  		else  		{ -			notification_name = "RequiredUpdateDownloadedDialog"; +			apply_callback = &apply_update_callback; +			if(LLStartUp::getStartupState() < STATE_STARTED) +			{ +				// CHOP-262 we need to use a different notification +				// method prior to login. +				notification_name = "DownloadBackgroundDialog"; +			} +			else +			{ +				notification_name = "DownloadBackgroundTip"; +			}  		} +  		LLSD substitutions;  		substitutions["VERSION"] = data["version"]; -		LLNotificationsUtil::add(notification_name, substitutions, LLSD(), &apply_update_ok_callback); -	} -	 -	void on_optional_update_downloaded(LLSD const & data) -	{ -		std::string notification_name; -		if(LLStartUp::getStartupState() < STATE_STARTED) -		{ -			// CHOP-262 we need to use a different notification -			// method prior to login. -			notification_name = "DownloadBackgroundDialog"; -		} -		else + +		// truncate version at the rightmost '.'  +		std::string version_short(data["version"]); +		size_t short_length = version_short.rfind('.'); +		if (short_length != std::string::npos)  		{ -			notification_name = "DownloadBackgroundTip"; +			version_short.resize(short_length);  		} -		LLSD substitutions; -		substitutions["VERSION"] = data["version"]; -		LLNotificationsUtil::add(notification_name, substitutions, LLSD(), apply_update_callback); -	} +		LLUIString relnotes_url("[RELEASE_NOTES_BASE_URL][CHANNEL_URL]/[VERSION_SHORT]"); +		relnotes_url.setArg("[VERSION_SHORT]", version_short); + +		// *TODO thread the update service's response through to this point +		std::string const & channel = LLVersionInfo::getChannel(); +		boost::shared_ptr<char> channel_escaped(curl_escape(channel.c_str(), channel.size()), &curl_free); + +		relnotes_url.setArg("[CHANNEL_URL]", channel_escaped.get()); +		relnotes_url.setArg("[RELEASE_NOTES_BASE_URL]", LLTrans::getString("RELEASE_NOTES_BASE_URL")); +		substitutions["RELEASE_NOTES_FULL_URL"] = relnotes_url.getString(); + +		LLNotificationsUtil::add(notification_name, substitutions, LLSD(), apply_callback); +	} +	      bool notify_update(LLSD const & evt)      {  		std::string notification_name;  		switch (evt["type"].asInteger())  		{  			case LLUpdaterService::DOWNLOAD_COMPLETE: -				if(evt["required"].asBoolean()) -				{ -					on_required_update_downloaded(evt); -				} -				else -				{ -					on_optional_update_downloaded(evt); -				} +				on_update_downloaded(evt);  				break;  			case LLUpdaterService::INSTALL_ERROR:  				LLNotificationsUtil::add("FailedUpdateInstall"); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index cf567fb208..302e4fa19d 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -73,7 +73,6 @@  #endif  // LL_WINDOWS  #include "llsdserialize.h" -#define USE_VIEWER_AUTH 0  const S32 BLACK_BORDER_HEIGHT = 160;  const S32 MAX_PASSWORD = 16; @@ -189,10 +188,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,  	buildFromFile( "panel_login.xml"); -#if USE_VIEWER_AUTH -	//leave room for the login menu bar -	setRect(LLRect(0, rect.getHeight()-18, rect.getWidth(), 0));  -#endif  	// Legacy login web page is hidden under the menu bar.  	// Adjust reg-in-client web browser widget to not be hidden.  	if (gSavedSettings.getBOOL("RegInClient")) @@ -204,7 +199,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,  		reshape(rect.getWidth(), rect.getHeight());  	} -#if !USE_VIEWER_AUTH  	getChild<LLLineEditor>("password_edit")->setKeystrokeCallback(onPassKey, this);  	// change z sort of clickable text to be behind buttons @@ -247,7 +241,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,  	LLTextBox* need_help_text = getChild<LLTextBox>("login_help");  	need_help_text->setClickedCallback(onClickHelp, NULL); -#endif      	// get the web browser control  	LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html"); @@ -274,15 +267,9 @@ void LLPanelLogin::reshapeBrowser()  	LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");  	LLRect rect = gViewerWindow->getWindowRectScaled();  	LLRect html_rect; -#if USE_VIEWER_AUTH -	html_rect.setCenterAndSize(  -		rect.getCenterX() - 2, rect.getCenterY(),  -		rect.getWidth() + 6, rect.getHeight()); -#else  	html_rect.setCenterAndSize(  		rect.getCenterX() - 2, rect.getCenterY() + 40,  		rect.getWidth() + 6, rect.getHeight() - 78 ); -#endif  	web_browser->setRect( html_rect );  	web_browser->reshape( html_rect.getWidth(), html_rect.getHeight(), TRUE );  	reshape( rect.getWidth(), rect.getHeight(), 1 ); @@ -305,7 +292,6 @@ void LLPanelLogin::setSiteIsAlive( bool alive )  	else  	// the site is not available (missing page, server down, other badness)  	{ -#if !USE_VIEWER_AUTH  		if ( web_browser )  		{  			// hide browser control (revealing default one) @@ -314,16 +300,6 @@ void LLPanelLogin::setSiteIsAlive( bool alive )  			// mark as unavailable  			mHtmlAvailable = FALSE;  		} -#else - -		if ( web_browser ) -		{	 -			web_browser->navigateToLocalPage( "loading-error" , "index.html" ); - -			// mark as available -			mHtmlAvailable = TRUE; -		} -#endif  	}  } @@ -363,7 +339,6 @@ void LLPanelLogin::draw()  		if ( mHtmlAvailable )  		{ -#if !USE_VIEWER_AUTH  			if (getChild<LLView>("login_widgets")->getVisible())  			{  				// draw a background box in black @@ -372,7 +347,6 @@ void LLPanelLogin::draw()  				// just the blue background to the native client UI  				mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight());  			} -#endif  		}  		else  		{ @@ -418,12 +392,6 @@ void LLPanelLogin::setFocus(BOOL b)  // static  void LLPanelLogin::giveFocus()  { -#if USE_VIEWER_AUTH -	if (sInstance) -	{ -		sInstance->setFocus(TRUE); -	} -#else  	if( sInstance )  	{  		// Grab focus and move cursor to first blank input field @@ -452,17 +420,18 @@ void LLPanelLogin::giveFocus()  			edit->selectAll();  		}  	} -#endif  }  // static  void LLPanelLogin::showLoginWidgets()  { +	// *NOTE: Mani - This may or may not be obselete code. +	// It seems to be part of the defunct? reg-in-client project.  	sInstance->getChildView("login_widgets")->setVisible( true);  	LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");  	sInstance->reshapeBrowser();  	// *TODO: Append all the usual login parameters, like first_login=Y etc. -	std::string splash_screen_url = sInstance->getString("real_url"); +	std::string splash_screen_url = LLGridManager::getInstance()->getLoginPage();  	web_browser->navigateTo( splash_screen_url, "text/html" );  	LLUICtrl* username_edit = sInstance->getChild<LLUICtrl>("username_edit");  	username_edit->setFocus(TRUE); @@ -832,73 +801,6 @@ void LLPanelLogin::loadLoginPage()  	curl_free(curl_grid);  	gViewerWindow->setMenuBackgroundColor(false, !LLGridManager::getInstance()->isInProductionGrid());  	gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor()); - - -#if USE_VIEWER_AUTH -	LLURLSimString::sInstance.parse(); - -	std::string location; -	std::string region; -	std::string password; -	 -	if (LLURLSimString::parse()) -	{ -		std::ostringstream oRegionStr; -		location = "specify"; -		oRegionStr << LLURLSimString::sInstance.mSimName << "/" << LLURLSimString::sInstance.mX << "/" -			 << LLURLSimString::sInstance.mY << "/" -			 << LLURLSimString::sInstance.mZ; -		region = oRegionStr.str(); -	} -	else -	{ -		location = gSavedSettings.getString("LoginLocation"); -	} -	 -	std::string username; - -    if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3) -    { -        LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); -		username = cmd_line_login[0].asString() + " " + cmd_line_login[1]; -        password = cmd_line_login[2].asString(); -    } -    	 -	 -	char* curl_region = curl_escape(region.c_str(), 0); - -	oStr <<"username=" << username << -		 "&location=" << location <<	"®ion=" << curl_region; -	 -	curl_free(curl_region); - -	if (!password.empty()) -	{ -		oStr << "&password=" << password; -	} -	else if (!(password = load_password_from_disk()).empty()) -	{ -		oStr << "&password=$1$" << password; -	} -	if (gAutoLogin) -	{ -		oStr << "&auto_login=TRUE"; -	} -	if (gSavedSettings.getBOOL("ShowStartLocation")) -	{ -		oStr << "&show_start_location=TRUE"; -	}	 -	if (gSavedSettings.getBOOL("RememberPassword")) -	{ -		oStr << "&remember_password=TRUE"; -	}	 -#ifndef	LL_RELEASE_FOR_DOWNLOAD -	oStr << "&show_grid=TRUE"; -#else -	if (gSavedSettings.getBOOL("ForceShowGrid")) -		oStr << "&show_grid=TRUE"; -#endif -#endif  	LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html"); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index eecbeeb8dc..b0bb93c13a 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2906,20 +2906,20 @@ or you can install it now.     icon="notify.tga"     name="DownloadBackgroundTip"     type="notify"> -We have downloaded and update to your [APP_NAME] installation. -Version [VERSION] +We have downloaded an update to your [APP_NAME] installation. +Version [VERSION] [[RELEASE_NOTES_FULL_URL] Information about this update]      <usetemplate       name="okcancelbuttons" -     notext="Wait" -     yestext="Restart Now"/> +     notext="Later..." +     yestext="Install now and restart [APP_NAME]"/>    </notification>    <notification   icon="alertmodal.tga"   name="DownloadBackgroundDialog"   type="alertmodal"> -We have downloaded and update to your [APP_NAME] installation. -Version [VERSION] +We have downloaded an update to your [APP_NAME] installation. +Version [VERSION] [[RELEASE_NOTES_FULL_URL] Information about this update]      <usetemplate       name="okcancelbuttons"       notext="Later..." diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 89feba7c3c..00ab17d4a2 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -11,11 +11,7 @@ top="600"       name="create_account_url">         http://join.secondlife.com/  </panel.string> -<panel.string -     name="real_url" translate="false"> -       http://secondlife.com/app/login/ -</panel.string> -    <string name="reg_in_client_url" translate="false"> +<string name="reg_in_client_url" translate="false">       http://secondlife.eniac15.lindenlab.com/reg-in-client/  </string>  <panel.string | 
