diff options
Diffstat (limited to 'indra/newview/llpanellogin.cpp')
| -rw-r--r-- | indra/newview/llpanellogin.cpp | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index fe9145bf71..868e02f28b 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -188,7 +188,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, mUsernameLength(0), mPasswordLength(0), mLocationLength(0), - mShowFavorites(false) + mShowFavorites(false), + mAlertNotif(false) { setBackgroundVisible(false); setBackgroundOpaque(true); @@ -219,6 +220,11 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // STEAM-14: When user presses Enter with this field in focus, initiate login password_edit->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnect, false)); + childSetAction("connect_btn", onClickConnect, this); + + mLoginBtn = getChild<LLButton>("connect_btn"); + setDefaultBtn(mLoginBtn); + // change z sort of clickable text to be behind buttons sendChildToBack(getChildView("forgot_password_text")); sendChildToBack(getChildView("sign_up_text")); @@ -295,11 +301,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, onUpdateStartSLURL(start_slurl); // updates grid if needed } - childSetAction("connect_btn", onClickConnect, this); - - LLButton* def_btn = getChild<LLButton>("connect_btn"); - setDefaultBtn(def_btn); - std::string channel = LLVersionInfo::instance().getChannel(); std::string version = stringize(LLVersionInfo::instance().getShortVersion(), " (", LLVersionInfo::instance().getBuild(), ')'); @@ -327,6 +328,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLCheckBoxCtrl* remember_name = getChild<LLCheckBoxCtrl>("remember_name"); remember_name->setCommitCallback(boost::bind(&LLPanelLogin::onRememberUserCheck, this)); getChild<LLCheckBoxCtrl>("remember_password")->setCommitCallback(boost::bind(&LLPanelLogin::onRememberPasswordCheck, this)); + + mAlertListener = LLNotifications::instance().getChannel("Alerts")->connectChanged([this](const LLSD& notify){ return onUpdateNotification(notify); }); } void LLPanelLogin::addFavoritesToStartLocation() @@ -409,7 +412,7 @@ void LLPanelLogin::addFavoritesToStartLocation() gSavedSettings.setBOOL("RememberPassword", save_password); if (!save_password) { - getChild<LLButton>("connect_btn")->setEnabled(false); + mLoginBtn->setEnabled(false); } update_password_setting = false; } @@ -936,7 +939,7 @@ void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent ev // static void LLPanelLogin::onClickConnect(bool commit_fields) { - if (sInstance && sInstance->mCallback) + if (sInstance && sInstance->mCallback && !sInstance->mAlertNotif) { if (commit_fields) { @@ -1193,9 +1196,7 @@ void LLPanelLogin::updateServer() void LLPanelLogin::updateLoginButtons() { - LLButton* login_btn = getChild<LLButton>("connect_btn"); - - login_btn->setEnabled(mUsernameLength != 0 && mPasswordLength != 0); + mLoginBtn->setEnabled(mUsernameLength != 0 && mPasswordLength != 0 && !mAlertNotif); if (!mFirstLoginThisInstall) { @@ -1367,3 +1368,22 @@ std::string LLPanelLogin::getUserName(LLPointer<LLCredential> &cred) return "unknown"; } +bool LLPanelLogin::onUpdateNotification(const LLSD& notify) +{ + // disable Login button while alert notification is displayed + LLNotificationPtr notifyp = LLNotifications::instance().find(notify["id"].asUUID()); + if (notifyp && notifyp->getName() == "PromptOptionalUpdate") + { + std::string sigtype = notify["sigtype"].asString(); + if (sigtype == "add") + { + mAlertNotif = true; + } + else if (sigtype == "delete") + { + mAlertNotif = false; + } + updateLoginButtons(); + } + return false; +} |
