1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Projucer: made the login form remember the last username

This commit is contained in:
jules 2016-04-08 11:06:34 +01:00
parent bc58656153
commit 23b1d89219

View file

@ -55,7 +55,9 @@ public:
addAndMakeVisible (passwordEditor);
initialiseTextField (userIDEditor, userIDLabel);
addAndMakeVisible (userIDEditor);
userIDEditor.setText (ProjucerLicences::getInstance()->getLoginName());
String userName = ProjucerLicences::getInstance()->getLoginName();
userIDEditor.setText (userName.isEmpty() ? getLastUserName() : userName);
initialiseLabel (errorLabel, Font::plain, ProjucerDialogLookAndFeel::getErrorTextColour());
addChildComponent (errorLabel);
@ -205,6 +207,8 @@ private:
void loginButtonClicked()
{
loginName = userIDEditor.getText();
getGlobalProperties().setValue ("lastUserName", loginName);
password = passwordEditor.getText();
if (! isValidEmail (loginName) || password.isEmpty())
@ -237,6 +241,11 @@ private:
rememberLogin = rememberLoginCheckbox.getToggleState();
}
String getLastUserName() const
{
return getGlobalProperties().getValue ("lastUserName");
}
void handleInvalidLogin()
{
if (!isValidEmail (loginName))