From 952aee3f49d9591473b0bc2029dd485dd70a4132 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 23 Mar 2022 20:34:31 +0200 Subject: SL-17064 Add a Remember Password checkbox to the first time login screen. --- indra/newview/llpanellogin.cpp | 49 +++++++------------ indra/newview/skins/default/xui/en/panel_login.xml | 2 +- .../skins/default/xui/en/panel_login_first.xml | 56 ++++++++++++++-------- 3 files changed, 53 insertions(+), 54 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index deb1a963a0..302ff40bbc 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -323,11 +323,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, username_combo->setReturnCallback(boost::bind(&LLPanelLogin::onClickConnect, this)); username_combo->setKeystrokeOnEsc(TRUE); - if (!mFirstLoginThisInstall) - { - LLCheckBoxCtrl* remember_name = getChild("remember_name"); - remember_name->setCommitCallback(boost::bind(&LLPanelLogin::onRememberUserCheck, this)); - } + + LLCheckBoxCtrl* remember_name = getChild("remember_name"); + remember_name->setCommitCallback(boost::bind(&LLPanelLogin::onRememberUserCheck, this)); } void LLPanelLogin::addFavoritesToStartLocation() @@ -527,21 +525,12 @@ void LLPanelLogin::populateFields(LLPointer credential, bool remem LL_WARNS() << "Attempted fillFields with no login view shown" << LL_ENDL; return; } - if (sInstance->mFirstLoginThisInstall) - { - LLUICtrl* remember_check = sInstance->getChild("remember_check"); - remember_check->setValue(remember_psswrd); - // no list to populate - setFields(credential); - } - else - { - sInstance->getChild("remember_name")->setValue(remember_user); - LLUICtrl* remember_password = sInstance->getChild("remember_password"); - remember_password->setValue(remember_user && remember_psswrd); - remember_password->setEnabled(remember_user); - sInstance->populateUserList(credential); - } + + sInstance->getChild("remember_name")->setValue(remember_user); + LLUICtrl* remember_password = sInstance->getChild("remember_password"); + remember_password->setValue(remember_user && remember_psswrd); + remember_password->setEnabled(remember_user); + sInstance->populateUserList(credential); } //static @@ -702,16 +691,9 @@ void LLPanelLogin::getFields(LLPointer& credential, } } credential = gSecAPIHandler->createCredential(LLGridManager::getInstance()->getGrid(), identifier, authenticator); - if (!sInstance->mFirstLoginThisInstall) - { - remember_psswrd = sInstance->getChild("remember_password")->getValue(); - remember_user = sInstance->getChild("remember_name")->getValue(); - } - else - { - remember_psswrd = sInstance->getChild("remember_check")->getValue(); - remember_user = remember_psswrd; // on panel_login_first "remember_check" is named as 'remember me' - } + + remember_psswrd = sInstance->getChild("remember_password")->getValue(); + remember_user = sInstance->getChild("remember_name")->getValue(); } @@ -1074,17 +1056,18 @@ void LLPanelLogin::onUserListCommit(void*) } // static -// At the moment only happens if !mFirstLoginThisInstall void LLPanelLogin::onRememberUserCheck(void*) { - if (sInstance && !sInstance->mFirstLoginThisInstall) + if (sInstance) { LLCheckBoxCtrl* remember_name(sInstance->getChild("remember_name")); LLCheckBoxCtrl* remember_psswrd(sInstance->getChild("remember_password")); LLComboBox* user_combo(sInstance->getChild("username_combo")); bool remember = remember_name->getValue().asBoolean(); - if (user_combo->getCurrentIndex() != -1 && !remember) + if (!sInstance->mFirstLoginThisInstall + && user_combo->getCurrentIndex() != -1 + && !remember) { remember = true; remember_name->setValue(true); diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index ade004f9d0..3aba80909a 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -145,7 +145,7 @@ follows="left|top" font="SansSerifMedium" text_color="EmphasisColor" - height="16" + height="24" left="408" bottom_delta="0" label="Remember password" diff --git a/indra/newview/skins/default/xui/en/panel_login_first.xml b/indra/newview/skins/default/xui/en/panel_login_first.xml index cdf07c8aef..d36c83d292 100644 --- a/indra/newview/skins/default/xui/en/panel_login_first.xml +++ b/indra/newview/skins/default/xui/en/panel_login_first.xml @@ -98,7 +98,7 @@ auto_resize="false" follows="left|right|top" name="widget_container" - width="532" + width="730" left="0" top="0" height="80"> @@ -106,7 +106,7 @@ allow_text_entry="true" follows="left|bottom" height="32" - left="2" + left="42" label="Username" combo_editor.font="SansSerifLarge" max_chars="128" @@ -126,7 +126,7 @@ follows="left|top" width="200" height="32" - left="220" + left="262" max_length_chars="16" name="password_edit" label="Password" @@ -145,42 +145,58 @@ label_color="White" font="SansSerifLarge" name="connect_btn" - left="432" - width="100" + left_pad="15" + width="120" height="32" top="0" /> + + Sign up + - + - Forgotten password - + height="24" + left="262" + bottom_delta="0" + label="Remember password" + word_wrap="down" + check_button.bottom="3" + name="remember_password" + width="198" /> - Sign up + Forgotten password