Browse Source

Made the error message text in OnlineUnlockStatus customisable

tags/2021-05-28
jules 7 years ago
parent
commit
2733b4c9a6
2 changed files with 25 additions and 12 deletions
  1. +22
    -12
      modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp
  2. +3
    -0
      modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.h

+ 22
- 12
modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp View File

@@ -418,8 +418,7 @@ OnlineUnlockStatus::UnlockResult OnlineUnlockStatus::handleXmlReply (XmlElement
r.urlToLaunch = xml.getStringAttribute ("url").trim();
if (r.errorMessage.isEmpty() && r.informativeMessage.isEmpty() && r.urlToLaunch.isEmpty() && ! r.succeeded)
r.errorMessage = TRANS ("Unexpected or corrupted reply from XYZ").replace ("XYZ", getWebsiteName()) + "...\n\n"
+ TRANS("Please try again in a few minutes, and contact us for support if this message appears again.");
r.errorMessage = getMessageForUnexpectedReply();
return r;
}
@@ -428,20 +427,31 @@ OnlineUnlockStatus::UnlockResult OnlineUnlockStatus::handleFailedConnection()
{
UnlockResult r;
r.succeeded = false;
r.errorMessage = getMessageForConnectionFailure (areMajorWebsitesAvailable());
return r;
}
r.errorMessage = TRANS("Couldn't connect to XYZ").replace ("XYZ", getWebsiteName()) + "...\n\n";
String OnlineUnlockStatus::getMessageForConnectionFailure (bool isInternetConnectionWorking)
{
String message = TRANS("Couldn't connect to XYZ").replace ("XYZ", getWebsiteName()) + "...\n\n";
if (areMajorWebsitesAvailable())
r.errorMessage << TRANS("Your internet connection seems to be OK, but our webserver "
"didn't respond... This is most likely a temporary problem, so try "
"again in a few minutes, but if it persists, please contact us for support!");
if (isInternetConnectionWorking)
message << TRANS("Your internet connection seems to be OK, but our webserver "
"didn't respond... This is most likely a temporary problem, so try "
"again in a few minutes, but if it persists, please contact us for support!");
else
r.errorMessage << TRANS("No internet sites seem to be accessible from your computer.. Before trying again, "
"please check that your network is working correctly, and make sure "
"that any firewall/security software installed on your machine isn't "
"blocking your web connection.");
message << TRANS("No internet sites seem to be accessible from your computer.. Before trying again, "
"please check that your network is working correctly, and make sure "
"that any firewall/security software installed on your machine isn't "
"blocking your web connection.");
return r;
return message;
}
String OnlineUnlockStatus::getMessageForUnexpectedReply()
{
return TRANS ("Unexpected or corrupted reply from XYZ").replace ("XYZ", getWebsiteName()) + "...\n\n"
+ TRANS("Please try again in a few minutes, and contact us for support if this message appears again.");
}
OnlineUnlockStatus::UnlockResult OnlineUnlockStatus::attemptWebserverUnlock (const String& email,


+ 3
- 0
modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.h View File

@@ -127,6 +127,9 @@ public:
*/
virtual void userCancelled();
virtual String getMessageForConnectionFailure (bool isInternetConnectionWorking);
virtual String getMessageForUnexpectedReply();
//==============================================================================
// The following methods can be called by your app:


Loading…
Cancel
Save