From 5f1230e911623d77dbc3353819bed338c514f671 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 9 Aug 2012 11:52:48 -0700 Subject: MAINT-1342: correct initial login location handling, clarify the two related persistent settings --- indra/newview/app_settings/settings.xml | 4 +- indra/newview/llappviewer.cpp | 27 +++++++----- indra/newview/llpanellogin.cpp | 50 +++++++++++++++++++--- indra/newview/llstartup.cpp | 35 +++++++++------ indra/newview/llstartup.h | 2 +- .../newview/skins/default/xui/en/notifications.xml | 2 +- indra/newview/tests/lllogininstance_test.cpp | 1 + 7 files changed, 88 insertions(+), 33 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2af71d98b8..1bf773bb9e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5023,7 +5023,7 @@ LoginLocation Comment - Login location ('last', 'home') + Default Login location ('last', 'home') preference Persist 1 Type @@ -6123,7 +6123,7 @@ NextLoginLocation Comment - Location to log into by default. + Location to log into for this session - set from command line or the login panel, cleared following a successfull login. Persist 1 Type diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 63737c78d0..cb69048c60 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2665,14 +2665,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")) { // @@ -2720,12 +2712,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: "<("start_location_combo"); updateLocationSelectorsVisibility(); // separate so that it can be called from preferences @@ -182,6 +176,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 '"<("login")->setDefaultBtn("connect_btn"); @@ -645,8 +662,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? { @@ -668,8 +688,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:"<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"<setCurrentByIndex(1); // home location + break; } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a28d8d3546..218c35029e 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2823,22 +2823,33 @@ bool LLStartUp::dispatchURL() void LLStartUp::setStartSLURL(const LLSLURL& slurl) { - sStartSLURL = slurl; - LL_DEBUGS("AppInit")< fail -Your last location is not currently available. +Your requested location is not currently available. You have been moved into a nearby region. 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" -- cgit v1.2.3 From 9a4a6163ff8d146c0b357c3f9b68254f7025f862 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 14 Aug 2012 17:26:07 -0400 Subject: tag merge of DRTVWR-193 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 9985ff4c25..74b0f34b40 100644 --- a/.hgtags +++ b/.hgtags @@ -349,3 +349,4 @@ ab2ffc547c8a8950ff187c4f6c95e5334fab597b 3.3.4-beta5 28e100d0379a2b0710c57647a28fc5239d3d7b99 3.3.4-release a8b3eca451a9eaab59987efb0ab1c4217e3f2dcc DRTVWR-182 1f27cdfdc54246484f8afbbe42ce48e954175cbd 3.4.0-beta1 +e9732c739c8a72a590216951505ea9c76a526a84 DRTVWR-193 -- cgit v1.2.3