summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-08-14 18:41:25 -0400
committerOz Linden <oz@lindenlab.com>2012-08-14 18:41:25 -0400
commit981190cf3151f436d370b841b1baa5a2a607b94d (patch)
tree99b85f7f3ce1c1824246a56d2d4ee2c357d97df4
parent3e3e695341cf11cbcba1eb71f08bdc8e23808a6f (diff)
parentc2e2a49d9baa950242bddc1be14f1d3c79943bf2 (diff)
merge back beta fixes
-rw-r--r--.hgtags1
-rw-r--r--indra/newview/app_settings/settings.xml4
-rw-r--r--indra/newview/llappviewer.cpp27
-rw-r--r--indra/newview/llpanellogin.cpp50
-rw-r--r--indra/newview/llstartup.cpp35
-rw-r--r--indra/newview/llstartup.h2
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml2
-rw-r--r--indra/newview/tests/lllogininstance_test.cpp1
8 files changed, 89 insertions, 33 deletions
diff --git a/.hgtags b/.hgtags
index 011fc505f5..a86e9eafa8 100644
--- a/.hgtags
+++ b/.hgtags
@@ -354,6 +354,7 @@ a8b3eca451a9eaab59987efb0ab1c4217e3f2dcc DRTVWR-182
81f6b745ef27f5915fd07f988fdec9944f2bb73e DRTVWR-186
cc953f00956be52cc64c30637bbeec310eea603f DRTVWR-181
9ee9387789701d597130f879d9011a4958753862 DRTVWR-189
+e9732c739c8a72a590216951505ea9c76a526a84 DRTVWR-193
33a2fc7a910ae29ff8b4850316ed7fbff9f64d33 DRTVWR-195
421126293dcbde918e0da027ca0ab9deb5b4fbf2 DRTVWR-192
4b2c52aecb7a75de31dbb12d9f5b9a251d8707be DRTVWR-191
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 9e2c529eb3..adfab91cd2 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5023,7 +5023,7 @@
<key>LoginLocation</key>
<map>
<key>Comment</key>
- <string>Login location ('last', 'home')</string>
+ <string>Default Login location ('last', 'home') preference</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -6123,7 +6123,7 @@
<key>NextLoginLocation</key>
<map>
<key>Comment</key>
- <string>Location to log into by default.</string>
+ <string>Location to log into for this session - set from command line or the login panel, cleared following a successfull login.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 2464050f7b..f5de4fe344 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2668,14 +2668,6 @@ bool LLAppViewer::initConfiguration()
}
}
- // If automatic login from command line with --login switch
- // init StartSLURL location. In interactive login, LLPanelLogin
- // will take care of it.
- if ((clp.hasOption("login") || clp.hasOption("autologin")) && !clp.hasOption("url") && !clp.hasOption("slurl"))
- {
- LLStartUp::setStartSLURL(LLSLURL(gSavedSettings.getString("LoginLocation")));
- }
-
if (!gSavedSettings.getBOOL("AllowMultipleViewers"))
{
//
@@ -2723,12 +2715,27 @@ bool LLAppViewer::initConfiguration()
}
}
- // need to do this here - need to have initialized global settings first
+ // NextLoginLocation is set from the command line option
std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" );
if ( !nextLoginLocation.empty() )
{
+ LL_DEBUGS("AppInit")<<"set start from NextLoginLocation: "<<nextLoginLocation<<LL_ENDL;
LLStartUp::setStartSLURL(LLSLURL(nextLoginLocation));
- };
+ }
+ else if ( ( clp.hasOption("login") || clp.hasOption("autologin"))
+ && !clp.hasOption("url")
+ && !clp.hasOption("slurl"))
+ {
+ // If automatic login from command line with --login switch
+ // init StartSLURL location.
+ std::string start_slurl_setting = gSavedSettings.getString("LoginLocation");
+ LL_DEBUGS("AppInit") << "start slurl setting '" << start_slurl_setting << "'" << LL_ENDL;
+ LLStartUp::setStartSLURL(LLSLURL(start_slurl_setting));
+ }
+ else
+ {
+ // the login location will be set by the login panel (see LLPanelLogin)
+ }
gLastRunVersion = gSavedSettings.getString("LastRunVersion");
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 6bd174186a..3bb3e5cf47 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -146,12 +146,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
// change z sort of clickable text to be behind buttons
sendChildToBack(getChildView("forgot_password_text"));
-
- if(LLStartUp::getStartSLURL().getType() != LLSLURL::LOCATION)
- {
- LLSLURL slurl(gSavedSettings.getString("LoginLocation"));
- LLStartUp::setStartSLURL(slurl);
- }
LLComboBox* location_combo = getChild<LLComboBox>("start_location_combo");
updateLocationSelectorsVisibility(); // separate so that it can be called from preferences
@@ -183,6 +177,29 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
ADD_TOP);
server_choice_combo->selectFirstItem();
+ LLSLURL start_slurl(LLStartUp::getStartSLURL());
+ if ( !start_slurl.isSpatial() ) // has a start been established by the command line or NextLoginLocation ?
+ {
+ // no, so get the preference setting
+ std::string defaultStartLocation = gSavedSettings.getString("LoginLocation");
+ LL_INFOS("AppInit")<<"default LoginLocation '"<<defaultStartLocation<<"'"<<LL_ENDL;
+ LLSLURL defaultStart(defaultStartLocation);
+ if ( defaultStart.isSpatial() )
+ {
+ LLStartUp::setStartSLURL(defaultStart);
+ }
+ else
+ {
+ LL_INFOS("AppInit")<<"no valid LoginLocation, using home"<<LL_ENDL;
+ LLSLURL homeStart(LLSLURL::SIM_LOCATION_HOME);
+ LLStartUp::setStartSLURL(homeStart);
+ }
+ }
+ else
+ {
+ LLPanelLogin::onUpdateStartSLURL(start_slurl); // updates grid if needed
+ }
+
childSetAction("connect_btn", onClickConnect, this);
getChild<LLPanel>("links_login_panel")->setDefaultBtn("connect_btn");
@@ -643,8 +660,11 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
* specify a particular grid; in those cases we want to change the grid
* and the grid selector to match the new value.
*/
- if ( LLSLURL::LOCATION == new_start_slurl.getType() )
+ enum LLSLURL::SLURL_TYPE new_slurl_type = new_start_slurl.getType();
+ switch ( new_slurl_type )
{
+ case LLSLURL::LOCATION:
+ {
std::string slurl_grid = LLGridManager::getInstance()->getGrid(new_start_slurl.getGrid());
if ( ! slurl_grid.empty() ) // is that a valid grid?
{
@@ -666,8 +686,24 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
{
// the grid specified by the slurl is not known
LLNotificationsUtil::add("InvalidLocationSLURL");
+ LL_WARNS("AppInit")<<"invalid LoginLocation:"<<new_start_slurl.asString()<<LL_ENDL;
location_combo->setTextEntry(LLStringUtil::null);
}
+ }
+ break;
+
+ case LLSLURL::HOME_LOCATION:
+ location_combo->setCurrentByIndex(1); // home location
+ break;
+
+ case LLSLURL::LAST_LOCATION:
+ location_combo->setCurrentByIndex(0); // last location
+ break;
+
+ default:
+ LL_WARNS("AppInit")<<"invalid login slurl, using home"<<LL_ENDL;
+ location_combo->setCurrentByIndex(1); // home location
+ break;
}
}
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index a833eb8e16..b27eef6464 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2839,22 +2839,33 @@ bool LLStartUp::dispatchURL()
void LLStartUp::setStartSLURL(const LLSLURL& slurl)
{
- sStartSLURL = slurl;
- LL_DEBUGS("AppInit")<<slurl.asString()<<LL_ENDL;
+ LL_DEBUGS("AppInit")<<slurl.asString()<<LL_ENDL;
- switch(slurl.getType())
- {
- case LLSLURL::HOME_LOCATION:
- case LLSLURL::LAST_LOCATION:
- case LLSLURL::LOCATION:
- gSavedSettings.setString("LoginLocation", LLSLURL::SIM_LOCATION_HOME);
+ if ( slurl.isSpatial() )
+ {
+ std::string new_start = slurl.getSLURLString();
+ LL_DEBUGS("AppInit")<<new_start<<LL_ENDL;
+ sStartSLURL = slurl;
LLPanelLogin::onUpdateStartSLURL(slurl); // updates grid if needed
- break;
- default:
- break;
- }
+
+ // remember that this is where we wanted to log in...if the login fails,
+ // the next attempt will default to the same place.
+ gSavedSettings.setString("NextLoginLocation", new_start);
+ // following a successful login, this is cleared
+ // and the default reverts to LoginLocation
+ }
+ else
+ {
+ LL_WARNS("AppInit")<<"Invalid start SLURL (ignored): "<<slurl.asString()<<LL_ENDL;
+ }
}
+// static
+LLSLURL& LLStartUp::getStartSLURL()
+{
+ return sStartSLURL;
+}
+
/**
* Read all proxy configuration settings and set up both the HTTP proxy and
* SOCKS proxy as needed.
diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h
index 3754aaf966..760e38890b 100644
--- a/indra/newview/llstartup.h
+++ b/indra/newview/llstartup.h
@@ -111,7 +111,7 @@ public:
static void postStartupState();
static void setStartSLURL(const LLSLURL& slurl);
- static LLSLURL& getStartSLURL() { return sStartSLURL; }
+ static LLSLURL& getStartSLURL();
static bool startLLProxy(); // Initialize the SOCKS 5 proxy
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 7da676dae8..c0c04da2d0 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -2893,7 +2893,7 @@ You have been moved into a nearby region.
name="AvatarMovedLast"
type="alertmodal">
<tag>fail</tag>
-Your last location is not currently available.
+Your requested location is not currently available.
You have been moved into a nearby region.
</notification>
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
index b7e81c4199..7705b4c567 100644
--- a/indra/newview/tests/lllogininstance_test.cpp
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -60,6 +60,7 @@ static LLEventStream gTestPump("test_pump");
#include "../llslurl.h"
#include "../llstartup.h"
LLSLURL LLStartUp::sStartSLURL;
+LLSLURL& LLStartUp::getStartSLURL() { return sStartSLURL; }
#include "lllogin.h"