From 34ca69949fa1bc67caa8cd0f8ed85d924303567a Mon Sep 17 00:00:00 2001 From: callum Date: Mon, 11 Oct 2010 16:36:59 -0700 Subject: Reworked fix for EXP-167 Add option to quit instead of going back to login screen --- indra/newview/llstartup.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d9234425b8..9d66a7cd8a 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -232,6 +232,8 @@ static LLHost gFirstSim; static std::string gFirstSimSeedCap; static LLVector3 gAgentStartLookAt(1.0f, 0.f, 0.f); static std::string gAgentStartLocation = "safe"; +static bool mLoginStatePastUI = false; + boost::scoped_ptr LLStartUp::sStateWatcher(new LLEventStream("StartupState")); boost::scoped_ptr LLStartUp::sListener(new LLStartupListener()); @@ -707,9 +709,9 @@ bool idle_startup() { LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL; - // if auto login is on and setting to quit if the login page is activated - // is enabled, then go ahead and exit - if ( show_connect_box && gSavedSettings.getBOOL("AutoLogin") && gSavedSettings.getBOOL("QuitOnLoginActivated") ) + // if we've gone backwards in the login state machine, to this state where we show the UI + // AND the debug setting to exit in this case is true, then go ahead and bail quickly + if ( mLoginStatePastUI && gSavedSettings.getBOOL("QuitOnLoginActivated") ) { // no requirement for notification here - just exit LLAppViewer::instance()->earlyExitNoNotify(); @@ -792,6 +794,11 @@ bool idle_startup() if (STATE_LOGIN_WAIT == LLStartUp::getStartupState()) { + // when we get to this state, we've already been past the login UI + // (possiblely automatically) - flag this so we can test in the + // STATE_LOGIN_SHOW state if we've gone backwards + mLoginStatePastUI = true; + // Don't do anything. Wait for the login view to call the login_callback, // which will push us to the next state. @@ -818,6 +825,11 @@ bool idle_startup() gKeyboard->resetKeys(); } + // when we get to this state, we've already been past the login UI + // (possiblely automatically) - flag this so we can test in the + // STATE_LOGIN_SHOW state if we've gone backwards + mLoginStatePastUI = true; + // save the credentials std::string userid = "unknown"; if(gUserCredential.notNull()) -- cgit v1.2.3