[ui] distinguishes IDE and plugin updates (IDEA-169473)

This commit is contained in:
Roman Shevchenko
2017-04-06 20:58:50 +02:00
parent e02e84f9ae
commit ce598ae801
6 changed files with 31 additions and 13 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package com.intellij.openapi.updateSettings.impl;
import com.intellij.idea.ActionsBundle;
import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
@@ -33,10 +34,14 @@ public class CheckForUpdateAction extends AnAction implements DumbAware {
else {
e.getPresentation().setVisible(!SystemInfo.isMacSystemMenu || !ActionPlaces.MAIN_MENU.equals(place));
}
if (!UpdateSettings.getInstance().isPlatformUpdateEnabled()) {
e.getPresentation().setDescription(ActionsBundle.message("action.CheckForUpdate.description.plugins"));
}
}
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
UpdateChecker.updateAndShowResult(e.getProject(), null);
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,7 +53,13 @@ class NoUpdatesDialog extends AbstractUpdateDialog {
private JEditorPane myMessageArea;
public NoUpdatesPanel() {
myNothingToUpdateLabel.setText(IdeBundle.message("updates.no.updates.message", ApplicationInfo.getInstance().getVersionName()));
if (UpdateSettings.getInstance().isPlatformUpdateEnabled()) {
String app = ApplicationInfo.getInstance().getVersionName();
myNothingToUpdateLabel.setText(IdeBundle.message("updates.no.updates.message", app));
}
else {
myNothingToUpdateLabel.setText(IdeBundle.message("updates.no.updates.plugins.message"));
}
configureMessageArea(myMessageArea);
}
}
@@ -42,7 +42,6 @@ import com.intellij.openapi.util.BuildNumber
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import com.intellij.util.SystemProperties
import com.intellij.util.containers.ContainerUtil
import com.intellij.util.containers.MultiMap
import com.intellij.util.io.HttpRequests
@@ -69,7 +68,6 @@ object UpdateChecker {
val NOTIFICATIONS = NotificationGroup(IdeBundle.message("update.notifications.title"), NotificationDisplayType.STICKY_BALLOON, true)
private val DISABLED_UPDATE = "disabled_update.txt"
private val NO_PLATFORM_UPDATE = "ide.no.platform.update"
private var ourDisabledToUpdatePlugins: MutableSet<String>? = null
private val ourAdditionalRequestOptions = hashMapOf<String, String>()
@@ -156,7 +154,7 @@ object UpdateChecker {
}
private fun checkPlatformUpdate(settings: UpdateSettings): CheckForUpdateResult {
if (SystemProperties.getBooleanProperty(NO_PLATFORM_UPDATE, false)) {
if (!settings.isPlatformUpdateEnabled) {
return CheckForUpdateResult(UpdateStrategy.State.NOTHING_LOADED, null)
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import com.intellij.openapi.components.*;
import com.intellij.openapi.updateSettings.UpdateStrategyCustomization;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.SmartList;
import com.intellij.util.SystemProperties;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.net.NetUtils;
import com.intellij.util.xmlb.annotations.CollectionBean;
@@ -27,8 +28,8 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -61,8 +62,13 @@ public class UpdateSettings implements PersistentStateComponent<UpdateSettings.S
return ServiceManager.getService(UpdateSettings.class);
}
private final boolean myPlatformUpdateEnabled = !SystemProperties.getBooleanProperty("ide.no.platform.update", false);
private State myState = new State();
public boolean isPlatformUpdateEnabled() {
return myPlatformUpdateEnabled;
}
@NotNull
@Override
public State getState() {
@@ -986,7 +986,8 @@ action.Help.KeymapReference.description=Open PDF file with the default keymap re
action.Help.JetBrainsTV.text=_Demos and Screencasts
action.Help.JetBrainsTV.description=View short live demos introducing features of JetBrains products.
action.CheckForUpdate.text=_Check for Updates...
action.CheckForUpdate.description=Check for available update
action.CheckForUpdate.description=Checks for available IDE and plugin updates
action.CheckForUpdate.description.plugins=Checks for available plugin updates
action.About.text=_About
action.About.description=Show information about the IDE
group.OtherMenu.text=Other
@@ -918,12 +918,12 @@ unscramble.unscrambled.threaddump.tab=<Threads>
unscramble.unscrambled.deadlock.tab=<Deadlock>
updates.checking.progress=Checking for Updates
updates.checking.platform=Checking for platform updates
updates.checking.platform=Checking for IDE updates
updates.checking.plugins=Checking for plugin updates
updates.error.connection.title=Connection Error
updates.error.connection.failed=Connection failed ({0}). Please check network connection and try again.
updates.error.plugin.description.failed=Failed to load plugin descriptions from: \"{0}\"
update.notifications.title=Platform and Plugin Updates
update.notifications.title=IDE and Plugin Updates
updates.channel.bundled.key=The new version has an expiration date and does not require a license.
updates.paid.upgrade=You can evaluate the new version for {0} days, or buy it online.
updates.fallback.build=You have a perpetual fallback license for the new version.
@@ -933,7 +933,9 @@ 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 <a href="update">update</a>: {1}
updates.external.error.message=Failed to check for updates to {0}: {1}
updates.plugins.ready.message=The following plugin{0,choice,1# is|2#s are} ready to <a href=\"update\">update</a>: {1}
updates.no.updates.message=You already have the latest version of {0} installed.
updates.no.updates.message=You already have the latest version of {0} and plugins installed.
updates.no.updates.plugins.message=<html>You already have the latest version of plugins installed.<br> \
IDE updates are managed externally and weren't checked.</html>
updates.plugins.ready.header=<html><b>Plugins from configured hosts are ready to update.</b><br> \
Check plugins you want to update.</html>
updates.configure.label=To configure automatic update settings, see the <b><a href=\"updates\">Updates</a></b> dialog of your IDE {0}.