diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/CheckForUpdateResult.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/CheckForUpdateResult.java index 1178f7dfbd96..4d5b99cb980d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/CheckForUpdateResult.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/CheckForUpdateResult.java @@ -34,8 +34,8 @@ public class CheckForUpdateResult { @NotNull private final Collection myNewChannels; - @Nullable - private final List allChannelsIds; + @NotNull + private final List myAllChannelIds; @Nullable private UpdateChannel myChannelToPropose; @@ -48,11 +48,11 @@ public class CheckForUpdateResult { public CheckForUpdateResult(@Nullable UpdateChannel updated, @Nullable BuildInfo newBuildInSelectedChannel, - List allChannelsIds) { + @NotNull List allChannelsIds) { this.newBuildInSelectedChannel = newBuildInSelectedChannel; myUpdatedChannel = updated; myNewChannels = new ArrayList(); - this.allChannelsIds = allChannelsIds; + this.myAllChannelIds = allChannelsIds; this.state = UpdateStrategy.State.LOADED; this.error = null; } @@ -60,7 +60,7 @@ public class CheckForUpdateResult { public CheckForUpdateResult(UpdateStrategy.State state, Exception e) { this.newBuildInSelectedChannel = null; myNewChannels = Collections.emptyList(); - this.allChannelsIds = null; + myAllChannelIds = Collections.emptyList(); this.myChannelToPropose = null; this.myUpdatedChannel = null; this.state = state; @@ -89,9 +89,9 @@ public class CheckForUpdateResult { return myNewChannels; } - @Nullable + @NotNull public List getAllChannelsIds() { - return allChannelsIds; + return myAllChannelIds; } @Nullable diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/NewChannelDialog.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/NewChannelDialog.java index 0387dd824cb5..bddf82add041 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/NewChannelDialog.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/NewChannelDialog.java @@ -15,11 +15,13 @@ */ package com.intellij.openapi.updateSettings.impl; +import com.intellij.ide.BrowserUtil; import com.intellij.openapi.application.ApplicationNamesInfo; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.ui.LicensingFacade; import javax.swing.*; +import java.awt.event.ActionEvent; /** * @author yole @@ -34,6 +36,21 @@ public class NewChannelDialog extends DialogWrapper { setTitle("New " + ApplicationNamesInfo.getInstance().getFullProductName() + " Version Available"); initInfo(); init(); + setOKButtonText("More Info..."); + setOKButtonMnemonic('M'); + setCancelButtonText("Ignore This Update"); + } + + @Override + protected Action[] createActions() { + Action remindLater = new AbstractAction("Remind Me Later") { + @Override + public void actionPerformed(ActionEvent e) { + UpdateSettings.getInstance().forgetChannelId(myChannel.getId()); + doCancelAction(); + } + }; + return new Action[] { getOKAction(), remindLater, getCancelAction() }; } @Override @@ -62,4 +79,10 @@ public class NewChannelDialog extends DialogWrapper { } myInformationText = builder.toString(); } + + @Override + protected void doOKAction() { + BrowserUtil.launchBrowser(myChannel.getHomePageUrl()); + super.doOKAction(); + } } diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/Product.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/Product.java index 8890f19d8a76..56ae855dc317 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/Product.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/Product.java @@ -69,4 +69,12 @@ public class Product { public String getName() { return myName; } + + public List getAllChannelIds() { + List result = new ArrayList(); + for (UpdateChannel channel : myChannels) { + result.add(channel.getId()); + } + return result; + } } diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java index bb193c4db42b..6c333e8fddd5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java @@ -92,15 +92,17 @@ public class UpdateSettings implements PersistentStateComponent, UserUp } @Override - public void setKnownChannelIds(List ids) { + public void setKnownChannelIds(@NotNull List ids) { myKnownUpdateChannels.clear(); - if (ids!=null){ - for (String id : ids) { - myKnownUpdateChannels.add(id); - } + for (String id : ids) { + myKnownUpdateChannels.add(id); } } + public void forgetChannelId(String id) { + myKnownUpdateChannels.remove(id); + } + @Override public List getIgnoredBuildNumbers() { return myIgnoredBuildNumbers; diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateStrategy.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateStrategy.java index 710516b33a93..a160212ada14 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateStrategy.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateStrategy.java @@ -20,7 +20,6 @@ import com.intellij.openapi.util.BuildNumber; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; -import java.util.Collections; import java.util.List; public class UpdateStrategy { @@ -61,7 +60,7 @@ public class UpdateStrategy { } } - CheckForUpdateResult result = new CheckForUpdateResult(updatedChannel, newBuild, Collections.emptyList()); + CheckForUpdateResult result = new CheckForUpdateResult(updatedChannel, newBuild, product.getAllChannelIds()); UpdateChannel channelToPropose = null; for (UpdateChannel channel : product.getChannels()) {