diff options
Diffstat (limited to 'indra/newview/lllogininstance.cpp')
-rw-r--r-- | indra/newview/lllogininstance.cpp | 100 |
1 files changed, 48 insertions, 52 deletions
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index d866db1829..33e051bfab 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -214,6 +214,9 @@ void MandatoryUpdateMachine::start(void) case LLUpdaterService::CHECKING_FOR_UPDATE: setCurrentState(new CheckingForUpdate(*this)); break; + case LLUpdaterService::TEMPORARY_ERROR: + setCurrentState(new Error(*this)); + break; case LLUpdaterService::DOWNLOADING: setCurrentState(new WaitingForDownload(*this)); break; @@ -289,6 +292,7 @@ bool MandatoryUpdateMachine::CheckingForUpdate::onEvent(LLSD const & event) case LLUpdaterService::DOWNLOADING: mMachine.setCurrentState(new WaitingForDownload(mMachine)); break; + case LLUpdaterService::TEMPORARY_ERROR: case LLUpdaterService::UP_TO_DATE: case LLUpdaterService::TERMINAL: case LLUpdaterService::FAILURE: @@ -324,7 +328,7 @@ MandatoryUpdateMachine::Error::Error(MandatoryUpdateMachine & machine): void MandatoryUpdateMachine::Error::enter(void) { llinfos << "entering error" << llendl; - LLNotificationsUtil::add("FailedUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2)); + LLNotificationsUtil::add("FailedRequiredUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2)); } @@ -468,7 +472,6 @@ LLLoginInstance::LLLoginInstance() : mLoginModule(new LLLogin()), mNotifications(NULL), mLoginState("offline"), - mUserInteraction(true), mSkipOptionalUpdate(false), mAttemptComplete(false), mTransferRate(0.0f), @@ -637,64 +640,57 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) LLSD response = event["data"]; std::string reason_response = response["reason"].asString(); std::string message_response = response["message"].asString(); - if(mUserInteraction) + // For the cases of critical message or TOS agreement, + // start the TOS dialog. The dialog response will be handled + // by the LLLoginInstance::handleTOSResponse() callback. + // The callback intiates the login attempt next step, either + // to reconnect or to end the attempt in failure. + if(reason_response == "tos") { - // For the cases of critical message or TOS agreement, - // start the TOS dialog. The dialog response will be handled - // by the LLLoginInstance::handleTOSResponse() callback. - // The callback intiates the login attempt next step, either - // to reconnect or to end the attempt in failure. - if(reason_response == "tos") - { - LLSD data(LLSD::emptyMap()); - data["message"] = message_response; - data["reply_pump"] = TOS_REPLY_PUMP; - gViewerWindow->setShowProgress(FALSE); - LLFloaterReg::showInstance("message_tos", data); - LLEventPumps::instance().obtain(TOS_REPLY_PUMP) - .listen(TOS_LISTENER_NAME, - boost::bind(&LLLoginInstance::handleTOSResponse, - this, _1, "agree_to_tos")); - } - else if(reason_response == "critical") - { - LLSD data(LLSD::emptyMap()); - data["message"] = message_response; - data["reply_pump"] = TOS_REPLY_PUMP; - if(response.has("error_code")) - { - data["error_code"] = response["error_code"]; - } - if(response.has("certificate")) - { - data["certificate"] = response["certificate"]; - } - - gViewerWindow->setShowProgress(FALSE); - LLFloaterReg::showInstance("message_critical", data); - LLEventPumps::instance().obtain(TOS_REPLY_PUMP) - .listen(TOS_LISTENER_NAME, - boost::bind(&LLLoginInstance::handleTOSResponse, - this, _1, "read_critical")); - } - else if(reason_response == "update" || gSavedSettings.getBOOL("ForceMandatoryUpdate")) + LLSD data(LLSD::emptyMap()); + data["message"] = message_response; + data["reply_pump"] = TOS_REPLY_PUMP; + gViewerWindow->setShowProgress(FALSE); + LLFloaterReg::showInstance("message_tos", data); + LLEventPumps::instance().obtain(TOS_REPLY_PUMP) + .listen(TOS_LISTENER_NAME, + boost::bind(&LLLoginInstance::handleTOSResponse, + this, _1, "agree_to_tos")); + } + else if(reason_response == "critical") + { + LLSD data(LLSD::emptyMap()); + data["message"] = message_response; + data["reply_pump"] = TOS_REPLY_PUMP; + if(response.has("error_code")) { - gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); - updateApp(true, message_response); + data["error_code"] = response["error_code"]; } - else if(reason_response == "optional") + if(response.has("certificate")) { - updateApp(false, message_response); + data["certificate"] = response["certificate"]; } - else - { - attemptComplete(); - } + + gViewerWindow->setShowProgress(FALSE); + LLFloaterReg::showInstance("message_critical", data); + LLEventPumps::instance().obtain(TOS_REPLY_PUMP) + .listen(TOS_LISTENER_NAME, + boost::bind(&LLLoginInstance::handleTOSResponse, + this, _1, "read_critical")); } - else // no user interaction + else if(reason_response == "update" || gSavedSettings.getBOOL("ForceMandatoryUpdate")) { - attemptComplete(); + gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); + updateApp(true, message_response); } + else if(reason_response == "optional") + { + updateApp(false, message_response); + } + else + { + attemptComplete(); + } } void LLLoginInstance::handleLoginSuccess(const LLSD& event) |