summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorbrad kittenbrink <brad@lindenlab.com>2009-08-06 18:54:22 -0700
committerbrad kittenbrink <brad@lindenlab.com>2009-08-06 18:54:22 -0700
commit469836c4c7e8810502a89ce291bbd64548f0c70c (patch)
tree4dfa1bdb781010c20d67bb5b7f9941e0fd5fb584 /indra
parentc9ee582c12bbdcfe7f37459f947872e3ef462560 (diff)
parente6c9f944380d3a9b6562cf580e8c43a69c060dfd (diff)
Merged in partial rollback of LLFloaterTOS post-merge fixes.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloatertos.cpp5
-rw-r--r--indra/newview/llfloatertos.h3
-rw-r--r--indra/newview/lllogininstance.cpp21
-rw-r--r--indra/newview/tests/lllogininstance_test.cpp24
4 files changed, 22 insertions, 31 deletions
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index 9859d34284..11f35bedad 100644
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -240,8 +240,3 @@ void LLFloaterTOS::onNavigateComplete( const EventType& eventIn )
tos_agreement->setEnabled( true );
};
}
-
-void LLFloaterTOS::setTOSCallback(LLFloaterTOS::YesNoCallback const & callback)
-{
- mCallback = callback;
-}
diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h
index 0b15c24bc8..0be440d92b 100644
--- a/indra/newview/llfloatertos.h
+++ b/indra/newview/llfloatertos.h
@@ -66,9 +66,6 @@ public:
virtual void onNavigateComplete( const EventType& eventIn );
- // *TODO - consider getting rid of this in favor of using an event pump. -brad
- void setTOSCallback(YesNoCallback const & callback);
-
private:
std::string mMessage;
int mWebBrowserWindowId;
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index 3c59cb83cd..428bed7b72 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -222,19 +222,26 @@ bool LLLoginInstance::handleLoginFailure(const LLSD& event)
// to reconnect or to end the attempt in failure.
if(reason_response == "tos")
{
- LLFloaterTOS * tos =
+ LLFloaterTOS * tos =
LLFloaterReg::showTypedInstance<LLFloaterTOS>("message_tos", LLSD(message_response));
-
- tos->setTOSCallback(boost::bind(&LLLoginInstance::handleTOSResponse,
+ /*
+ LLFloaterTOS::show(LLFloaterTOS::TOS_TOS,
+ message_response,
+ boost::bind(&LLLoginInstance::handleTOSResponse,
this, _1, "agree_to_tos"));
+ */
}
else if(reason_response == "critical")
{
- LLFloaterTOS * tos =
+ LLFloaterTOS * tos =
LLFloaterReg::showTypedInstance<LLFloaterTOS>("message_critical",LLSD(message_response));
-
- tos->setTOSCallback(boost::bind(&LLLoginInstance::handleTOSResponse,
- this, _1, "read_critical"));
+ /*
+ LLFloaterTOS::show(LLFloaterTOS::TOS_CRITICAL_MESSAGE,
+ message_response,
+ boost::bind(&LLLoginInstance::handleTOSResponse,
+ this, _1, "read_critical")
+ );
+ */
}
else if(reason_response == "update" || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
{
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
index d3080d6e4a..5af8acebaf 100644
--- a/indra/newview/tests/lllogininstance_test.cpp
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -91,23 +91,15 @@ LLURLSimString LLURLSimString::sInstance;
bool LLURLSimString::parse() { return true; }
//-----------------------------------------------------------------------------
-#include "llfloaterreg.h"
#include "../llfloatertos.h"
-static std::string gTOSType;
+static LLFloaterTOS::ETOSType gTOSType;
static LLFloaterTOS::YesNoCallback gTOSCallback;
-
-void LLFloaterTOS::setTOSCallback(YesNoCallback const & callback)
+LLFloaterTOS* LLFloaterTOS::show(LLFloaterTOS::ETOSType type,
+ const std::string & message,
+ const YesNoCallback& callback)
{
+ gTOSType = type;
gTOSCallback = callback;
-}
-
-//static
-LLFloater* LLFloaterReg::showInstance(const std::string & name,
- const LLSD & key,
- BOOL focus)
-{
- gTOSType = name;
- gTOSCallback = LLFloaterTOS::YesNoCallback();
return NULL;
}
@@ -190,7 +182,7 @@ namespace tut
gLoginCreds.clear();
gDisconnectCalled = false;
- gTOSType = ""; // Set to invalid value.
+ // gTOSType = -1; // Set to invalid value.
gTOSCallback = 0; // clear the callback.
@@ -279,7 +271,7 @@ namespace tut
response["data"]["reason"] = "tos";
gTestPump.post(response);
- ensure_equals("TOS Dialog type", gTOSType, "message_tos");
+ ensure_equals("TOS Dialog type", gTOSType, LLFloaterTOS::TOS_TOS);
ensure("TOS callback given", gTOSCallback != 0);
gTOSCallback(false); // Call callback denying TOS.
ensure("No TOS, failed auth", logininstance->authFailure());
@@ -305,7 +297,7 @@ namespace tut
response["data"]["reason"] = "critical"; // Change response to "critical message"
gTestPump.post(response);
- ensure_equals("TOS Dialog type", gTOSType, "message_critical");
+ ensure_equals("TOS Dialog type", gTOSType, LLFloaterTOS::TOS_CRITICAL_MESSAGE);
ensure("TOS callback given", gTOSCallback != 0);
gTOSCallback(true);
ensure_equals("Accepted read critical message", gLoginCreds["params"]["read_critical"].asBoolean(), true);