summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatertos.cpp
diff options
context:
space:
mode:
authorbrad kittenbrink <brad@lindenlab.com>2009-08-04 15:34:34 -0700
committerbrad kittenbrink <brad@lindenlab.com>2009-08-04 15:34:34 -0700
commit33cc363a6813bf6c1268fa85747d1d403e00f8e5 (patch)
treed30696b245c4b5eb70575582d0dd9ddc4b20e5c7 /indra/newview/llfloatertos.cpp
parentdc62495da6e5c153c0df57fdbce6b0f40c0208f2 (diff)
parent89434ef6e64462041368ab26e049011fc84ae1e3 (diff)
Merged in latest viewer-2.0.0-3 up through svn r129410. LLFloaterTOS needs some post-merge cleanup.
Diffstat (limited to 'indra/newview/llfloatertos.cpp')
-rw-r--r--indra/newview/llfloatertos.cpp56
1 files changed, 10 insertions, 46 deletions
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index d75640ccb4..40bd6360ed 100644
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -52,40 +52,9 @@
#include "message.h"
-// static
-LLFloaterTOS* LLFloaterTOS::sInstance = NULL;
-
-// static
-LLFloaterTOS* LLFloaterTOS::show(ETOSType type,
- const std::string & message,
- const YesNoCallback& callback)
-{
- if( !LLFloaterTOS::sInstance )
- {
- LLFloaterTOS::sInstance = new LLFloaterTOS(type, message, callback);
- }
-
- if (type == TOS_TOS)
- {
- LLUICtrlFactory::getInstance()->buildFloater(LLFloaterTOS::sInstance, "floater_tos.xml");
- }
- else
- {
- LLUICtrlFactory::getInstance()->buildFloater(LLFloaterTOS::sInstance, "floater_critical.xml");
- }
-
- sInstance->startModal();
-
- return LLFloaterTOS::sInstance;
-}
-
-
-LLFloaterTOS::LLFloaterTOS(ETOSType type,
- const std::string & message,
- const YesNoCallback& callback)
-: LLModalDialog( std::string(" "), 100, 100 ),
- mType(type),
- mMessage(message),
+LLFloaterTOS::LLFloaterTOS(const LLSD& message)
+: LLModalDialog( message, 100, 100 ),
+ mMessage(message.asString()),
mWebBrowserWindowId( 0 ),
mLoadCompleteCount( 0 ),
mCallback(callback)
@@ -144,8 +113,8 @@ BOOL LLFloaterTOS::postBuild()
childSetAction("Continue", onContinue, this);
childSetAction("Cancel", onCancel, this);
childSetCommitCallback("agree_chk", updateAgree, this);
-
- if ( mType != TOS_TOS )
+
+ if (hasChild("tos_text"))
{
// this displays the critical message
LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
@@ -182,17 +151,14 @@ BOOL LLFloaterTOS::postBuild()
void LLFloaterTOS::setSiteIsAlive( bool alive )
{
// only do this for TOS pages
- if ( mType == TOS_TOS )
+ if (hasChild("tos_html"))
{
LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html");
// if the contents of the site was retrieved
if ( alive )
{
- if ( web_browser )
- {
- // navigate to the "real" page
- web_browser->navigateTo( getString( "real_url" ) );
- };
+ // navigate to the "real" page
+ web_browser->navigateTo( getString( "real_url" ) );
}
else
{
@@ -200,8 +166,8 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
// but if the page is unavailable, we need to do this now
LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
tos_agreement->setEnabled( true );
- };
- };
+ }
+ }
}
LLFloaterTOS::~LLFloaterTOS()
@@ -216,8 +182,6 @@ LLFloaterTOS::~LLFloaterTOS()
// tell the responder we're not here anymore
if ( gResponsePtr )
gResponsePtr->setParent( 0 );
-
- LLFloaterTOS::sInstance = NULL;
}
// virtual