|
|
|
@@ -82,15 +82,15 @@ struct TracktionMarketplaceUnlockForm::OverlayComp : public Component, |
|
|
|
|
|
|
|
if (result.errorMessage.isNotEmpty())
|
|
|
|
{
|
|
|
|
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
|
|
|
|
TRANS("Registration Failed"),
|
|
|
|
result.errorMessage);
|
|
|
|
AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon,
|
|
|
|
TRANS("Registration Failed"),
|
|
|
|
result.errorMessage);
|
|
|
|
}
|
|
|
|
else if (result.informativeMessage.isNotEmpty())
|
|
|
|
{
|
|
|
|
AlertWindow::showMessageBox (AlertWindow::InfoIcon,
|
|
|
|
TRANS("Registration Complete!"),
|
|
|
|
result.informativeMessage);
|
|
|
|
AlertWindow::showMessageBoxAsync (AlertWindow::InfoIcon,
|
|
|
|
TRANS("Registration Complete!"),
|
|
|
|
result.informativeMessage);
|
|
|
|
}
|
|
|
|
else if (result.urlToLaunch.isNotEmpty())
|
|
|
|
{
|
|
|
|
@@ -99,7 +99,7 @@ struct TracktionMarketplaceUnlockForm::OverlayComp : public Component, |
|
|
|
}
|
|
|
|
|
|
|
|
if (result.succeeded)
|
|
|
|
form.cancel();
|
|
|
|
form.dismiss();
|
|
|
|
else
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
@@ -120,7 +120,8 @@ static juce_wchar getDefaultPasswordChar() noexcept |
|
|
|
}
|
|
|
|
|
|
|
|
TracktionMarketplaceUnlockForm::TracktionMarketplaceUnlockForm (TracktionMarketplaceStatus& s,
|
|
|
|
const String& userInstructions)
|
|
|
|
const String& userInstructions,
|
|
|
|
bool hasCancelButton)
|
|
|
|
: status (s),
|
|
|
|
message (String(), userInstructions),
|
|
|
|
passwordBox (String(), getDefaultPasswordChar()),
|
|
|
|
@@ -139,7 +140,9 @@ TracktionMarketplaceUnlockForm::TracktionMarketplaceUnlockForm (TracktionMarketp |
|
|
|
addAndMakeVisible (emailBox);
|
|
|
|
addAndMakeVisible (passwordBox);
|
|
|
|
addAndMakeVisible (registerButton);
|
|
|
|
addAndMakeVisible (cancelButton);
|
|
|
|
|
|
|
|
if (hasCancelButton)
|
|
|
|
addAndMakeVisible (cancelButton);
|
|
|
|
|
|
|
|
registerButton.addListener (this);
|
|
|
|
cancelButton.addListener (this);
|
|
|
|
@@ -174,21 +177,31 @@ void TracktionMarketplaceUnlockForm::resized() |
|
|
|
Rectangle<int> buttonArea (r.removeFromBottom (buttonHeight));
|
|
|
|
registerButton.changeWidthToFitText (buttonHeight);
|
|
|
|
cancelButton.changeWidthToFitText (buttonHeight);
|
|
|
|
|
|
|
|
const int gap = 20;
|
|
|
|
buttonArea = buttonArea.withSizeKeepingCentre (registerButton.getWidth() + gap + cancelButton.getWidth(), buttonHeight);
|
|
|
|
buttonArea = buttonArea.withSizeKeepingCentre (registerButton.getWidth()
|
|
|
|
+ (cancelButton.isVisible() ? gap + cancelButton.getWidth() : 0),
|
|
|
|
buttonHeight);
|
|
|
|
registerButton.setBounds (buttonArea.removeFromLeft (registerButton.getWidth()));
|
|
|
|
buttonArea.removeFromLeft (gap);
|
|
|
|
cancelButton.setBounds (buttonArea);
|
|
|
|
|
|
|
|
r.removeFromBottom (20);
|
|
|
|
|
|
|
|
// (force use of a default system font to make sure it has the password blob character)
|
|
|
|
Font font (Font::getDefaultTypefaceForFont (Font (Font::getDefaultSansSerifFontName(),
|
|
|
|
Font::getDefaultStyle(),
|
|
|
|
5.0f)));
|
|
|
|
|
|
|
|
const int boxHeight = 24;
|
|
|
|
passwordBox.setBounds (r.removeFromBottom (boxHeight));
|
|
|
|
passwordBox.setInputRestrictions (64);
|
|
|
|
passwordBox.setFont (font);
|
|
|
|
|
|
|
|
r.removeFromBottom (30);
|
|
|
|
emailBox.setBounds (r.removeFromBottom (boxHeight));
|
|
|
|
passwordBox.setInputRestrictions (256);
|
|
|
|
emailBox.setInputRestrictions (512);
|
|
|
|
emailBox.setFont (font);
|
|
|
|
|
|
|
|
r.removeFromBottom (30);
|
|
|
|
|
|
|
|
@@ -225,7 +238,7 @@ void TracktionMarketplaceUnlockForm::buttonClicked (Button* b) |
|
|
|
if (b == ®isterButton)
|
|
|
|
attemptRegistration();
|
|
|
|
else if (b == &cancelButton)
|
|
|
|
cancel();
|
|
|
|
dismiss();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TracktionMarketplaceUnlockForm::attemptRegistration()
|
|
|
|
@@ -252,7 +265,7 @@ void TracktionMarketplaceUnlockForm::attemptRegistration() |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TracktionMarketplaceUnlockForm::cancel()
|
|
|
|
void TracktionMarketplaceUnlockForm::dismiss()
|
|
|
|
{
|
|
|
|
delete this;
|
|
|
|
}
|