From dc934629919bdcaea72c78e5291263914fb958ec Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 11 May 2009 20:05:46 +0000 Subject: svn merge -r113003:119136 svn+ssh://svn.lindenlab.com/svn/linden/branches/login-api/login-api-2 svn+ssh://svn.lindenlab.com/svn/linden/branches/login-api/login-api-3 --- indra/newview/llfloatertos.cpp | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'indra/newview/llfloatertos.cpp') diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 764a6a3498..c79e96a5e5 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -36,8 +36,6 @@ // viewer includes #include "llagent.h" -#include "llappviewer.h" -#include "llstartup.h" #include "llviewerstats.h" #include "llviewertexteditor.h" #include "llviewerwindow.h" @@ -58,11 +56,13 @@ LLFloaterTOS* LLFloaterTOS::sInstance = NULL; // static -LLFloaterTOS* LLFloaterTOS::show(ETOSType type, const std::string & message) +LLFloaterTOS* LLFloaterTOS::show(ETOSType type, + const std::string & message, + const YesNoCallback& callback) { if( !LLFloaterTOS::sInstance ) { - LLFloaterTOS::sInstance = new LLFloaterTOS(type, message); + LLFloaterTOS::sInstance = new LLFloaterTOS(type, message, callback); } if (type == TOS_TOS) @@ -78,12 +78,15 @@ LLFloaterTOS* LLFloaterTOS::show(ETOSType type, const std::string & message) } -LLFloaterTOS::LLFloaterTOS(ETOSType type, const std::string & message) +LLFloaterTOS::LLFloaterTOS(ETOSType type, + const std::string & message, + const YesNoCallback& callback) : LLModalDialog( std::string(" "), 100, 100 ), mType(type), mMessage(message), mWebBrowserWindowId( 0 ), - mLoadCompleteCount( 0 ) + mLoadCompleteCount( 0 ), + mCallback(callback) { } @@ -235,25 +238,12 @@ void LLFloaterTOS::onContinue( void* userdata ) { LLFloaterTOS* self = (LLFloaterTOS*) userdata; llinfos << "User agrees with TOS." << llendl; - if (self->mType == TOS_TOS) - { - gAcceptTOS = TRUE; - } - else - { - gAcceptCriticalMessage = TRUE; - } - // Testing TOS dialog - #if ! LL_RELEASE_FOR_DOWNLOAD - if ( LLStartUp::getStartupState() == STATE_LOGIN_WAIT ) + if(self->mCallback) { - LLStartUp::setStartupState( STATE_LOGIN_SHOW ); + self->mCallback(true); } - else - #endif - LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); // Go back and finish authentication self->closeFloater(); // destroys this object } @@ -262,8 +252,12 @@ void LLFloaterTOS::onCancel( void* userdata ) { LLFloaterTOS* self = (LLFloaterTOS*) userdata; llinfos << "User disagrees with TOS." << llendl; - LLNotifications::instance().add("MustAgreeToLogIn", LLSD(), LLSD(), login_alert_done); - LLStartUp::setStartupState( STATE_LOGIN_SHOW ); + + if(self->mCallback) + { + self->mCallback(false); + } + self->mLoadCompleteCount = 0; // reset counter for next time we come to TOS self->closeFloater(); // destroys this object } -- cgit v1.2.3