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:
parent
bc58656153
commit
23b1d89219
1 changed files with 10 additions and 1 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue