From dd2eff8da2b2508d5fc46492147e015d2455f957 Mon Sep 17 00:00:00 2001 From: callum Date: Thu, 7 Oct 2010 12:08:03 -0700 Subject: EXP-167: Quit On Login Page Activated - viewer code /default setting --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 8 ++++++++ indra/newview/llappviewer.h | 1 + indra/newview/llstartup.cpp | 10 +++++++++- 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d5cfc11c2c..142378b540 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6535,6 +6535,17 @@ Value 0.0 + QuitOnLoginActivated + + Comment + Quit if login page is activated (used when auto login is on and users must not be able to login manually) + Persist + 1 + Type + Boolean + Value + 0 + RadioLandBrushAction Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a9bdabe794..e6661e4c9a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2951,6 +2951,14 @@ void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions) LLNotificationsUtil::add(name, substitutions, LLSD(), finish_early_exit); } +// case where we need the viewer to exit without any need for notifications +void LLAppViewer::earlyExitNoNotify() +{ + llwarns << "app_early_exit with no notification: " << llendl; + gDoDisconnect = TRUE; + finish_early_exit( LLSD(), LLSD() ); +} + void LLAppViewer::forceExit(S32 arg) { removeMarkerFile(); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 56d88f07c8..b0f8c1dc3d 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -70,6 +70,7 @@ public: void userQuit(); // The users asks to quit. Confirm, then requestQuit() void earlyExit(const std::string& name, const LLSD& substitutions = LLSD()); // Display an error dialog and forcibly quit. + void LLAppViewer::earlyExitNoNotify(); // Do not display error dialog then forcibly quit. void forceExit(S32 arg); // exit() immediately (after some cleanup). void abortQuit(); // Called to abort a quit request. diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index c56cacd12b..1a42500ec4 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -706,7 +706,15 @@ bool idle_startup() if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) { 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 ( gSavedSettings.getBOOL("AutoLogin") && gSavedSettings.getBOOL("QuitOnLoginActivated") ) + { + // no requirement for notification here - just exit + LLAppViewer::instance()->earlyExitNoNotify(); + } + gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); timeout_count = 0; -- cgit v1.2.3