Only execute onSelectUser if the value of the combo box actually changed;

this prevents an issue of a manually entered password getting overridden after a failed login
meow-7.2.2
Ansariel 2015-07-30 11:34:11 +02:00
parent 700079f39a
commit 476bc646bf
2 changed files with 11 additions and 0 deletions

View File

@ -190,6 +190,7 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
LLComboBox* username_combo(getChild<LLComboBox>("username_combo"));
username_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectUser, this));
username_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onSelectUser, this));
mPreviousUsername = username_combo->getValue().asString();
LLSLURL start_slurl(LLStartUp::getStartSLURL());
if ( !start_slurl.isSpatial() ) // has a start been established by the command line or NextLoginLocation ?
@ -482,6 +483,7 @@ void FSPanelLogin::setFields(LLPointer<LLCredential> credential, bool from_start
username_combo->setTextEntry(login_id);
sInstance->mPasswordModified = TRUE;
}
sInstance->mPreviousUsername = username_combo->getValue().asString();
sInstance->addFavoritesToStartLocation();
// if the password exists in the credential, set the password field with
// a filler to get some stars
@ -1203,6 +1205,12 @@ void FSPanelLogin::onSelectUser()
}
LLComboBox* combo = sInstance->getChild<LLComboBox>("username_combo");
if (combo->getValue().asString() == sInstance->mPreviousUsername)
{
return;
}
LLSD combo_val = combo->getSelectedValue();
if (combo_val.isUndefined())
{
@ -1213,6 +1221,7 @@ void FSPanelLogin::onSelectUser()
sInstance->getChild<LLLineEditor>("password_edit")->clear();
}
sInstance->addFavoritesToStartLocation();
sInstance->mPreviousUsername = combo->getValue().asString();
return;
}

View File

@ -126,6 +126,8 @@ private:
static FSPanelLogin* sInstance;
static BOOL sCapslockDidNotification;
std::string mPreviousUsername;
};
#endif //FS_PANELLOGIN_H