use of com.intellij.openapi.application.ex.ApplicationInfoEx in project intellij-community by JetBrains.
the class ReportProblemAction method launchBrowser.
public static void launchBrowser(@Nullable Project project) {
final ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
boolean eap = appInfo.isEAP();
String urlTemplate = appInfo.getEAPFeedbackUrl();
urlTemplate = urlTemplate.replace("$BUILD", eap ? appInfo.getBuild().asStringWithoutProductCode() : appInfo.getBuild().asString()).replace("$TIMEZONE", System.getProperty("user.timezone")).replace("$EVAL", isEvaluationLicense() ? "true" : "false").replace("$DESCR", SendFeedbackAction.getDescription());
BrowserUtil.browse(urlTemplate, project);
}
use of com.intellij.openapi.application.ex.ApplicationInfoEx in project smali by JesusFreke.
the class ITNProxy method createParameters.
public static Map<String, String> createParameters(ErrorBean error) {
Map<String, String> params = ContainerUtil.newLinkedHashMap(40);
params.put("protocol.version", "1");
params.put("os.name", SystemProperties.getOsName());
params.put("java.version", SystemProperties.getJavaVersion());
params.put("java.vm.vendor", SystemProperties.getJavaVmVendor());
ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
ApplicationNamesInfo namesInfo = ApplicationNamesInfo.getInstance();
Application application = ApplicationManager.getApplication();
params.put("app.name", namesInfo.getProductName());
params.put("app.name.full", namesInfo.getFullProductName());
params.put("app.name.version", appInfo.getVersionName());
params.put("app.eap", Boolean.toString(appInfo.isEAP()));
params.put("app.internal", Boolean.toString(application.isInternal()));
params.put("app.build", appInfo.getBuild().asString());
params.put("app.version.major", appInfo.getMajorVersion());
params.put("app.version.minor", appInfo.getMinorVersion());
params.put("app.build.date", format(appInfo.getBuildDate()));
params.put("app.build.date.release", format(appInfo.getMajorReleaseBuildDate()));
params.put("app.compilation.timestamp", IdeaLogger.getOurCompilationTimestamp());
UpdateSettings updateSettings = UpdateSettings.getInstance();
params.put("update.channel.status", updateSettings.getSelectedChannelStatus().getCode());
params.put("update.ignored.builds", StringUtil.join(updateSettings.getIgnoredBuildNumbers(), ","));
params.put("plugin.name", error.getPluginName());
params.put("plugin.version", error.getPluginVersion());
params.put("last.action", error.getLastAction());
params.put("previous.exception", error.getPreviousException() == null ? null : Integer.toString(error.getPreviousException()));
params.put("error.message", error.getMessage());
params.put("error.stacktrace", error.getStackTrace());
params.put("error.description", error.getDescription());
params.put("assignee.id", error.getAssigneeId() == null ? null : Integer.toString(error.getAssigneeId()));
for (Attachment attachment : error.getAttachments()) {
params.put("attachment.name", attachment.getName());
params.put("attachment.value", attachment.getEncodedBytes());
}
return params;
}
use of com.intellij.openapi.application.ex.ApplicationInfoEx in project intellij-community by JetBrains.
the class PermanentInstallationID method calculateInstallationId.
private static String calculateInstallationId() {
final ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance();
final Preferences oldPrefs = Preferences.userRoot();
// compatibility with previous versions
final String oldValue = appInfo.isVendorJetBrains() ? oldPrefs.get(OLD_USER_ON_MACHINE_ID_KEY, null) : null;
final String companyName = appInfo.getShortCompanyName();
final Preferences prefs = Preferences.userRoot().node(StringUtil.isEmptyOrSpaces(companyName) ? "jetbrains" : companyName.toLowerCase(Locale.US));
String installationId = prefs.get(INSTALLATION_ID_KEY, null);
if (StringUtil.isEmptyOrSpaces(installationId)) {
installationId = !StringUtil.isEmptyOrSpaces(oldValue) ? oldValue : UUID.randomUUID().toString();
prefs.put(INSTALLATION_ID_KEY, installationId);
}
if (!appInfo.isVendorJetBrains()) {
return installationId;
}
// for Windows attempt to use PermanentUserId, so that DotNet products and IDEA would use the same ID.
if (SystemInfo.isWindows) {
final String appdata = System.getenv("APPDATA");
if (appdata != null) {
final File dir = new File(appdata, "JetBrains");
if (dir.exists() || dir.mkdirs()) {
final File permanentIdFile = new File(dir, "PermanentUserId");
try {
String fromFile = "";
if (permanentIdFile.exists()) {
fromFile = loadFromFile(permanentIdFile).trim();
}
if (!fromFile.isEmpty()) {
if (!fromFile.equals(installationId)) {
installationId = fromFile;
prefs.put(INSTALLATION_ID_KEY, installationId);
}
} else {
writeToFile(permanentIdFile, installationId);
}
} catch (IOException ignored) {
}
}
}
}
// make sure values in older location and in the new location are the same
if (!installationId.equals(oldValue)) {
oldPrefs.put(OLD_USER_ON_MACHINE_ID_KEY, installationId);
}
return installationId;
}
use of com.intellij.openapi.application.ex.ApplicationInfoEx in project intellij-community by JetBrains.
the class SendFeedbackAction method launchBrowser.
public static void launchBrowser(@Nullable Project project) {
final ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
boolean eap = appInfo.isEAP();
String urlTemplate = eap ? appInfo.getEAPFeedbackUrl() : appInfo.getReleaseFeedbackUrl();
urlTemplate = urlTemplate.replace("$BUILD", eap ? appInfo.getBuild().asStringWithoutProductCode() : appInfo.getBuild().asString()).replace("$TIMEZONE", System.getProperty("user.timezone")).replace("$EVAL", isEvaluationLicense() ? "true" : "false").replace("$DESCR", getDescription());
BrowserUtil.browse(urlTemplate, project);
}
use of com.intellij.openapi.application.ex.ApplicationInfoEx in project intellij-community by JetBrains.
the class AboutPopup method show.
public static void show(@Nullable Window window, boolean showDebugInfo) {
ApplicationInfoEx appInfo = (ApplicationInfoEx) ApplicationInfo.getInstance();
final PopupPanel panel = new PopupPanel(new BorderLayout());
Icon image = IconLoader.getIcon(appInfo.getAboutImageUrl());
if (appInfo.showLicenseeInfo()) {
final InfoSurface infoSurface = new InfoSurface(image, showDebugInfo);
infoSurface.setPreferredSize(new Dimension(image.getIconWidth(), image.getIconHeight()));
panel.setInfoSurface(infoSurface);
} else {
panel.add(new JLabel(image), BorderLayout.NORTH);
}
RelativePoint location;
if (window != null) {
Rectangle r = window.getBounds();
location = new RelativePoint(window, new Point((r.width - image.getIconWidth()) / 2, (r.height - image.getIconHeight()) / 2));
} else {
Rectangle r = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getBounds();
location = new RelativePoint(new Point((r.width - image.getIconWidth()) / 2, (r.height - image.getIconHeight()) / 2));
}
ourPopup = JBPopupFactory.getInstance().createComponentPopupBuilder(panel, panel).setRequestFocus(true).setFocusable(true).setResizable(false).setMovable(false).setModalContext(false).setShowShadow(true).setShowBorder(false).setCancelKeyEnabled(true).setCancelOnClickOutside(true).setCancelOnOtherWindowOpen(true).createPopup();
Disposer.register(ourPopup, new Disposable() {
@Override
public void dispose() {
ourPopup = null;
}
});
ourPopup.show(location);
}
Aggregations