diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2019-04-25 15:48:20 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2019-04-25 15:48:20 -0400 |
commit | 70aa89f708254c47766f4629e9131ea492829129 (patch) | |
tree | 084f9f1cfa32c11a519799616b70d4602a246cd1 /indra/newview/llpanellogin.cpp | |
parent | a2d4122de41ff161b7397ca663a41595cb9dbf2a (diff) |
SL-11049: Notice explicit --grid command-line switch and honor it.
LLPanelLogin's constructor checks both LLGridManager::getGrid() and
LLStartUp::getStartSLURL(). But by the time we get there, we've blurred the
distinction between explicit command-line arguments and defaults left over
from a previous run. Of course, if the grid implied by getStartSLURL() is the
same as the getGrid(), the distinction is irrelevant.
But if they differ, up until now, getStartSLURL() has always "won" -- even
when getGrid() was set by an explicit --grid switch whereas getStartSLURL()
was only left over from a previous run.
Notice that case and try to avoid overriding the explicitly-specified grid
with the grid from the default SLURL.
Diffstat (limited to 'indra/newview/llpanellogin.cpp')
-rw-r--r-- | indra/newview/llpanellogin.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 142dea83e2..0b674301f0 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -178,7 +178,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, mPasswordModified = FALSE; - LLPanelLogin::sInstance = this; + sInstance = this; LLView* login_holder = gViewerWindow->getLoginPanelHolder(); if (login_holder) @@ -234,29 +234,44 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, server_choice_combo->add(LLGridManager::getInstance()->getGridLabel(), current_grid, ADD_TOP); - server_choice_combo->selectFirstItem(); + server_choice_combo->selectFirstItem(); LLSLURL start_slurl(LLStartUp::getStartSLURL()); + // The StartSLURL might have been set either by an explicit command-line + // argument (CmdLineLoginLocation) or by default. + // current_grid might have been set either by an explicit command-line + // argument (CmdLineGridChoice) or by default. + // If the grid specified by StartSLURL is the same as current_grid, the + // distinction is moot. + // If we have an explicit command-line SLURL, use that. + // If we DON'T have an explicit command-line SLURL but we DO have an + // explicit command-line grid, which is different from the default SLURL's + // -- do NOT override the explicit command-line grid with the grid from + // the default SLURL! + bool force_grid{ start_slurl.getGrid() != current_grid && + gSavedSettings.getString("CmdLineLoginLocation").empty() && + ! gSavedSettings.getString("CmdLineGridChoice").empty() }; 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() ) + if ( defaultStart.isSpatial() && ! force_grid ) { LLStartUp::setStartSLURL(defaultStart); } else { - LL_INFOS("AppInit")<<"no valid LoginLocation, using home"<<LL_ENDL; + LL_INFOS("AppInit") << (force_grid? "--grid specified" : "no valid LoginLocation") + << ", using home" << LL_ENDL; LLSLURL homeStart(LLSLURL::SIM_LOCATION_HOME); LLStartUp::setStartSLURL(homeStart); } } - else + else if (! force_grid) { - LLPanelLogin::onUpdateStartSLURL(start_slurl); // updates grid if needed + onUpdateStartSLURL(start_slurl); // updates grid if needed } childSetAction("connect_btn", onClickConnect, this); @@ -380,7 +395,7 @@ void LLPanelLogin::setFocus(BOOL b) { if(b) { - LLPanelLogin::giveFocus(); + giveFocus(); } else { |