summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2020-01-09 03:05:00 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2020-01-09 03:05:00 +0200
commit1e59ac11e2ca7bac9f91cda71733715a3f960042 (patch)
tree99ee16c470b7bcb5943d084062cc0180280cb437
parentc090cd32b8f6d0321d3785cf4a6f7edcd3936e87 (diff)
SL-12533 Switching between grids on login page does not always switch the remembered user list
-rw-r--r--indra/newview/llpanellogin.cpp31
1 files changed, 25 insertions, 6 deletions
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 00172277bc..2cc5ea72d6 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -762,11 +762,8 @@ BOOL LLPanelLogin::areCredentialFieldsDirty()
}
else
{
- std::string username = sInstance->getChild<LLUICtrl>("username_combo")->getValue().asString();
- LLStringUtil::trim(username);
- std::string password = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString();
LLComboBox* combo = sInstance->getChild<LLComboBox>("username_combo");
- if(combo && combo->isDirty())
+ if (combo && combo->getCurrentIndex() == -1 && combo->isDirty())
{
return true;
}
@@ -1155,8 +1152,30 @@ void LLPanelLogin::updateServer()
try
{
// if they've selected another grid, we should load the credentials
- // for that grid and set them to the UI.
- if(!sInstance->areCredentialFieldsDirty())
+ // for that grid and set them to the UI. But if there were any modifications to
+ // fields, modifications should carry over.
+ // Not sure if it should carry over password but it worked like this before login changes
+ // Example: you started typing in and found that your are under wrong grid,
+ // you switch yet don't lose anything
+ if (sInstance->areCredentialFieldsDirty())
+ {
+ // save modified creds
+ LLComboBox* user_combo = sInstance->getChild<LLComboBox>("username_combo");
+ LLLineEditor* pswd_edit = sInstance->getChild<LLLineEditor>("password_edit");
+ std::string username = user_combo->getSimple();
+ LLStringUtil::trim(username);
+ std::string password = pswd_edit->getValue().asString();
+
+ // populate dropbox and setFields
+ // Note: following call is related to initializeLoginInfo()
+ LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(LLGridManager::getInstance()->getGrid());
+ sInstance->populateUserList(credential);
+
+ // restore creds
+ user_combo->setTextEntry(username);
+ pswd_edit->setValue(password);
+ }
+ else
{
// populate dropbox and setFields
// Note: following call is related to initializeLoginInfo()