Cleanup (outdated checks dropped)

This commit is contained in:
Roman Shevchenko
2016-04-11 19:48:16 +02:00
parent 3e5e7d8a3e
commit 7df2a638ea
3 changed files with 7 additions and 16 deletions
@@ -33,7 +33,6 @@ import com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.PluginsAdve
import com.intellij.openapi.util.BuildNumber;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.util.Alarm;
import com.intellij.util.text.DateFormatUtil;
import org.jetbrains.annotations.NotNull;
@@ -64,12 +63,12 @@ public class UpdateCheckerComponent implements ApplicationComponent {
public UpdateCheckerComponent(@NotNull Application app, @NotNull UpdateSettings settings) {
mySettings = settings;
updateDefaultChannel(app);
updateDefaultChannel();
checkSecureConnection(app);
scheduleOnStartCheck(app);
}
private void updateDefaultChannel(Application app) {
private void updateDefaultChannel() {
ChannelStatus current = mySettings.getSelectedChannelStatus();
LOG.info("channel: " + current.getCode());
boolean eap = ApplicationInfoEx.getInstanceEx().isEAP();
@@ -90,17 +89,16 @@ public class UpdateCheckerComponent implements ApplicationComponent {
}
}
private void checkSecureConnection(final Application app) {
private void checkSecureConnection(Application app) {
if (mySettings.isSecureConnection() && !mySettings.canUseSecureConnection()) {
mySettings.setSecureConnection(false);
boolean tooOld = !SystemInfo.isJavaVersionAtLeast("1.7");
String title = IdeBundle.message("update.notifications.title");
String message = IdeBundle.message(tooOld ? "update.sni.not.available.message" : "update.sni.disabled.message");
String message = IdeBundle.message("update.sni.disabled.message");
UpdateChecker.NOTIFICATIONS.createNotification(title, message, NotificationType.WARNING, new NotificationListener.Adapter() {
@Override
protected void hyperlinkActivated(@NotNull Notification notification1, @NotNull HyperlinkEvent e) {
notification1.expire();
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
notification.expire();
app.invokeLater(new Runnable() {
@Override
public void run() {
@@ -30,7 +30,6 @@ import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.updateSettings.UpdateStrategyCustomization;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.CollectionComboBoxModel;
import com.intellij.ui.JBColor;
@@ -97,9 +96,7 @@ public class UpdateSettingsConfigurable extends BaseConfigurable implements Sear
@Override
public void apply() throws ConfigurationException {
if (myPanel.myUseSecureConnection.isSelected() && !NetUtils.isSniEnabled()) {
boolean tooOld = !SystemInfo.isJavaVersionAtLeast("1.7");
String message = IdeBundle.message(tooOld ? "update.sni.not.available.error" : "update.sni.disabled.error");
throw new ConfigurationException(message);
throw new ConfigurationException(IdeBundle.message("update.sni.disabled.error"));
}
boolean wasEnabled = mySettings.isCheckNeeded();
@@ -949,11 +949,7 @@ update.plugins.update.action=&Update
update.restart.plugins.update.action=&Update and Restart
update.shutdown.plugins.update.action=&Update and Shutdown
update.channel.enforced=Update channel switched to ''{0}''
update.sni.not.available.error=Secure connection is not supported on Java 6
update.sni.disabled.error=Secure connection is impossible with 'jsse.enableSNIExtension' property set to false
update.sni.not.available.message=We wanted your IDE to receive upgrades over a secure connection. \
Unfortunately, this doesn't work on Java 6, so the option was disabled. \
You can enabled it again in <a href="disable">settings</a> after upgrading the JRE.
update.sni.disabled.message=We wanted your IDE to receive upgrades over a secure connection. \
Unfortunately, this doesn't work with the 'jsse.enableSNIExtension' property set to 'false', so the option was disabled. \
You can enabled it again in <a href="disable">settings</a> after setting the property to 'true'.