IDEA-348585 Show jcef-version in about dialog

GitOrigin-RevId: 0ae37cd5a184760ceb478e6e4204a53cee36447f
This commit is contained in:
Artem Bochkarev
2024-03-20 03:42:21 +00:00
committed by intellij-monorepo-bot
parent 83795a175e
commit b4b3d29eed
2 changed files with 19 additions and 2 deletions
@@ -297,6 +297,7 @@ about.box.jre=Runtime version: {0} {1}
about.box.vm=VM: {0} by {1}
about.box.powered.by=Powered by <hyperlink>open-source software</hyperlink>
about.box.copyright=Copyright \u00A9 {0}\u2013{1} <hyperlink>{2}</hyperlink>
about.box.jcef=JCEF {0}.{1}.{2}
title.warning=Warning
@@ -34,10 +34,13 @@ import com.intellij.openapi.vfs.DiskQueryRelay;
import com.intellij.ui.*;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.ui.jcef.JBCefApp;
import com.intellij.ui.scale.JBUIScale;
import com.intellij.ui.scale.ScaleContext;
import com.intellij.util.PlatformUtils;
import com.intellij.util.ui.*;
import com.jetbrains.cef.JCefAppConfig;
import com.jetbrains.cef.JCefVersionDetails;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -172,9 +175,12 @@ public final class AboutDialog extends DialogWrapper {
Properties properties = System.getProperties();
String javaVersion = properties.getProperty("java.runtime.version", properties.getProperty("java.version", "unknown"));
String arch = properties.getProperty("os.arch", "");
String jreInfo = IdeBundle.message("about.box.jre", javaVersion, arch);
String jcefSuffix = getJcefVersion();
if (jcefSuffix != null && !jcefSuffix.isEmpty())
jcefSuffix = " (" + jcefSuffix + ")";
String jreInfo = IdeBundle.message("about.box.jre", javaVersion, arch) + jcefSuffix;
lines.add(jreInfo);
myInfo.add(MessageFormat.format("Runtime version: {0} {1}", javaVersion, arch));
myInfo.add(MessageFormat.format("Runtime version: {0} {1}", javaVersion, arch) + jcefSuffix);
String vmVersion = properties.getProperty("java.vm.name", "unknown");
String vmVendor = properties.getProperty("java.vendor", "unknown");
@@ -387,4 +393,14 @@ public final class AboutDialog extends DialogWrapper {
if (!PlatformUtils.isJetBrainsClient()) return ApplicationNamesInfo.getInstance().getFullProductName();
return IdeBundle.message("dialog.message.jetbrains.client.for.ide", ApplicationNamesInfo.getInstance().getFullProductName());
}
private static String getJcefVersion() {
if (JBCefApp.isSupported()) {
try {
JCefVersionDetails version = JCefAppConfig.getVersionDetails();
return IdeBundle.message("about.box.jcef", version.cefVersion.major, version.cefVersion.api, version.cefVersion.patch);
} catch (JCefVersionDetails.VersionUnavailableException e) {}
}
return "";
}
}