summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatertos.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2009-05-11 20:05:46 +0000
committerNat Goodspeed <nat@lindenlab.com>2009-05-11 20:05:46 +0000
commitdc934629919bdcaea72c78e5291263914fb958ec (patch)
tree0ac81213f607d9a3a133481758fa2274fe986aa3 /indra/newview/llfloatertos.cpp
parent3800c0df910c83e987184d541b868168fc2b5bec (diff)
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
Diffstat (limited to 'indra/newview/llfloatertos.cpp')
-rw-r--r--indra/newview/llfloatertos.cpp40
1 files changed, 17 insertions, 23 deletions
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
}