diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/AbstractUpdateDialog.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/AbstractUpdateDialog.java index a719954e0920..a0bc57dfa76c 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/AbstractUpdateDialog.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/AbstractUpdateDialog.java @@ -38,8 +38,6 @@ import java.awt.*; public abstract class AbstractUpdateDialog extends DialogWrapper { private final boolean myEnableLink; - protected String myLicenseInfo = null; - protected AbstractUpdateDialog(boolean enableLink) { super(true); myEnableLink = enableLink; diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInfo.kt b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInfo.kt index c02f38318e61..936b5c5dd696 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInfo.kt +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInfo.kt @@ -48,6 +48,7 @@ class UpdateChannel(node: Element) { val status: ChannelStatus = ChannelStatus.fromCode(node.getAttributeValue("status")) val licensing: String = node.getAttributeValue("licensing", LICENSING_PRODUCTION) val homePageUrl: String? = node.getAttributeValue("url") + val evalDays: Int = node.getAttributeValue("evalDays")?.toInt() ?: 30 val builds: List = node.getChildren("build").map { BuildInfo(it) } override fun toString() = id diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInfoDialog.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInfoDialog.java index c99e04ce2c84..8c946311e3a0 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInfoDialog.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInfoDialog.java @@ -37,6 +37,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.io.File; import java.io.IOException; @@ -56,6 +57,9 @@ class UpdateInfoDialog extends AbstractUpdateDialog { private final PatchInfo myPatch; private final boolean myWriteProtected; + private String myLicenseInfo = null; + private Color myLicenseInfoColor = null; + UpdateInfoDialog(@NotNull UpdateChannel channel, @NotNull BuildInfo newBuild, @Nullable PatchInfo patch, @@ -88,12 +92,20 @@ class UpdateInfoDialog extends AbstractUpdateDialog { } else { Date buildDate = build.getReleaseDate(); - Date expiration = facade.getLicenseExpirationDate(); - if (buildDate != null && facade.isPerpetualForProduct(buildDate)) { - myLicenseInfo = IdeBundle.message("updates.fallback.build"); - } - else if (expiration != null && expiration.after(new Date())) { - myLicenseInfo = IdeBundle.message("updates.subscription.active.till", DateFormatUtil.formatAboutDialogDate(expiration)); + if (buildDate != null) { + if (!facade.isApplicableForProduct(buildDate)) { + myLicenseInfo = IdeBundle.message("updates.paid.upgrade", channel.getEvalDays()); + myLicenseInfoColor = JBColor.RED; + } + else if (facade.isPerpetualForProduct(buildDate)) { + myLicenseInfo = IdeBundle.message("updates.fallback.build"); + } + else { + Date expiration = facade.getLicenseExpirationDate(); + myLicenseInfo = expiration != null + ? IdeBundle.message("updates.interim.build", DateFormatUtil.formatAboutDialogDate(expiration)) + : IdeBundle.message("updates.interim.build.endless"); + } } } } @@ -255,7 +267,7 @@ class UpdateInfoDialog extends AbstractUpdateDialog { } if (myLicenseInfo != null) { - configureMessageArea(myLicenseArea, myLicenseInfo, null, null); + configureMessageArea(myLicenseArea, myLicenseInfo, myLicenseInfoColor, null); } } } diff --git a/platform/platform-impl/src/com/intellij/ui/LicensingFacade.java b/platform/platform-impl/src/com/intellij/ui/LicensingFacade.java index 4cc49749ac9b..377dd050371f 100644 --- a/platform/platform-impl/src/com/intellij/ui/LicensingFacade.java +++ b/platform/platform-impl/src/com/intellij/ui/LicensingFacade.java @@ -38,6 +38,8 @@ public abstract class LicensingFacade { public abstract boolean isEvaluationLicense(); + public abstract boolean isApplicableForProduct(@NotNull Date productBuildDate); + public abstract boolean isPerpetualForProduct(@NotNull Date productBuildDate); @Nullable diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index 4d0415780810..7377f305ada4 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -913,8 +913,10 @@ updates.error.plugin.description.failed=Failed to load plugin descriptions from: update.notifications.title=Platform and Plugin Updates update.notifications.group=Platform and Plugin Updates updates.channel.bundled.key=The new version has an expiration date and does not require a license key. +updates.paid.upgrade=You can evaluate the new version for {0} days, or buy an upgrade online. updates.fallback.build=You have perpetual fallback license for the new version. -updates.subscription.active.till=Your subscription is active until {0}. +updates.interim.build=You can use the new version until your subscription expires on {0}. +updates.interim.build.endless=You can use the new version until your subscription expires. updates.ready.message={0} is ready to update. updates.external.progress=Fetching available updates for external components updates.external.ready.message=The following component{0,choice,1# is|2#s are} ready to update: {1}