Permalink
Browse files
#5657 Fix trial warning label and serial key serialisation
- Loading branch information...
Showing
with
20 additions
and
12 deletions.
-
+11
−8
src/gui/src/MainWindow.cpp
-
+9
−4
src/lib/shared/SerialKey.cpp
|
|
@@ -1061,15 +1061,18 @@ void MainWindow::setEdition(Edition edition) |
|
|
void MainWindow::beginTrial(bool isExpiring)
|
|
|
{
|
|
|
if (isExpiring) {
|
|
|
- QString expiringNotice = "<html><head/><body><p><span style=\""
|
|
|
- "font-weight:600;\">%1</span> days of "
|
|
|
- "your Synergy Pro trial remain. <a href="
|
|
|
- "\"http://symless.com/pricing?src=gui\">"
|
|
|
- "<span style=\"text-decoration: underline;"
|
|
|
- " color:#0000ff;\">Buy now!</span></a>"
|
|
|
- "</p></body></html>";
|
|
|
+ QString expiringNotice ("<html><head/><body><p><span style=\""
|
|
|
+ "font-weight:600;\">%1</span> days of "
|
|
|
+ "your %2 trial remain. <a href="
|
|
|
+ "\"http://symless.com/synergy/trial/thanks?id=%3\">"
|
|
|
+ "<span style=\"text-decoration: underline;"
|
|
|
+ " color:#0000ff;\">Buy now!</span></a>"
|
|
|
+ "</p></body></html>");
|
|
|
expiringNotice = expiringNotice.arg
|
|
|
- (m_LicenseManager->serialKey().daysLeft(::time(0)));
|
|
|
+ (m_LicenseManager->serialKey().daysLeft(::time(0))).arg
|
|
|
+ (LicenseManager::getEditionName(m_LicenseManager->activeEdition())).arg
|
|
|
+ (QString::fromStdString(m_LicenseManager->serialKey().toString()));
|
|
|
+
|
|
|
this->m_trialLabel->setText(expiringNotice);
|
|
|
this->m_trialWidget->show();
|
|
|
}
|
|
|
|
|
|
@@ -126,15 +126,20 @@ std::string |
|
|
SerialKey::toString() const
|
|
|
{
|
|
|
std::ostringstream oss;
|
|
|
- oss << "v2;";
|
|
|
- oss << (isTrial() ? "trial" : "lifetime") << ";";
|
|
|
+ oss << "{";
|
|
|
+ if (isTrial()) {
|
|
|
+ oss << "v2;trial;";
|
|
|
+ } else {
|
|
|
+ oss << "v1;";
|
|
|
+ }
|
|
|
oss << editionString() << ";";
|
|
|
oss << m_name << ";";
|
|
|
oss << m_userLimit << ";";
|
|
|
oss << m_email << ";";
|
|
|
oss << m_company << ";";
|
|
|
- oss << m_warnTime << ";";
|
|
|
- oss << m_expireTime;
|
|
|
+ oss << (isTrial() ? m_warnTime : 0) << ";";
|
|
|
+ oss << (isTrial() ? m_expireTime : 0);
|
|
|
+ oss << "}";
|
|
|
return hexEncode(oss.str());
|
|
|
}
|
|
|
|
|
|
|
0 comments on commit
020b797