check for update: no need to start plugin hosts checking when connectivity problems exist (IDEA-97529)

This commit is contained in:
anna
2012-12-14 15:31:21 +01:00
parent 7662d31115
commit 7af34f3d5d
@@ -52,15 +52,19 @@ public class CheckForUpdateAction extends AnAction implements DumbAware {
indicator.setIndeterminate(true);
final CheckForUpdateResult result = UpdateChecker.checkForUpdates(instance, true);
if (result.getState() == UpdateStrategy.State.CONNECTION_ERROR) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
UpdateChecker.showConnectionErrorDialog();
}
});
return;
}
final List<PluginDownloader> updatedPlugins = UpdateChecker.updatePlugins(true, hostsConfigurable, indicator);
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
if (result.getState() == UpdateStrategy.State.CONNECTION_ERROR) {
UpdateChecker.showConnectionErrorDialog();
return;
}
instance.saveLastCheckedInfo();
UpdateChecker.showUpdateResult(result, updatedPlugins, true, enableLink, true);
}