mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
UpdateChecker.showUpdateResult()
This commit is contained in:
@@ -215,12 +215,7 @@ public class IdeaApplication {
|
||||
app.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (checkForUpdateResult.hasNewBuildInSelectedChannel()) {
|
||||
UpdateChecker.showUpdateInfoDialog(true, checkForUpdateResult.getUpdatedChannel(), updatedPlugins);
|
||||
}
|
||||
else if (updatedPlugins != null) {
|
||||
UpdateChecker.showNoUpdatesDialog(true, updatedPlugins, showConfirmation);
|
||||
}
|
||||
UpdateChecker.showUpdateResult(checkForUpdateResult, updatedPlugins, showConfirmation, true, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+2
-9
@@ -56,15 +56,8 @@ public class CheckForUpdateAction extends AnAction implements DumbAware {
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.hasNewBuildInSelectedChannel()) {
|
||||
//information about new channel could be there
|
||||
UpdateSettings.getInstance().LAST_TIME_CHECKED = System.currentTimeMillis();
|
||||
UpdateChecker.showUpdateInfoDialog(enableLink, result.getUpdatedChannel(), updatedPlugins);
|
||||
}
|
||||
else {
|
||||
//information about new channel could be there
|
||||
UpdateChecker.showNoUpdatesDialog(enableLink, updatedPlugins, true);
|
||||
}
|
||||
UpdateSettings.getInstance().LAST_TIME_CHECKED = System.currentTimeMillis();
|
||||
UpdateChecker.showUpdateResult(result, updatedPlugins, true, enableLink, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+15
-10
@@ -307,6 +307,21 @@ public final class UpdateChecker {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void showUpdateResult(CheckForUpdateResult checkForUpdateResult,
|
||||
List<PluginDownloader> updatedPlugins,
|
||||
boolean showConfirmation,
|
||||
boolean enableLink,
|
||||
final boolean alwaysShowResults) {
|
||||
if (checkForUpdateResult.hasNewBuildInSelectedChannel()) {
|
||||
new UpdateInfoDialog(true, checkForUpdateResult.getUpdatedChannel(), updatedPlugins, enableLink).show();
|
||||
}
|
||||
else if (updatedPlugins != null || alwaysShowResults) {
|
||||
NoUpdatesDialog dialog = new NoUpdatesDialog(true, updatedPlugins, enableLink);
|
||||
dialog.setShowConfirmation(showConfirmation);
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
private static Document loadVersionInfo(final String url) throws Exception {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("enter: loadVersionInfo(UPDATE_URL='" + url + "' )");
|
||||
@@ -374,16 +389,6 @@ public final class UpdateChecker {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public static void showNoUpdatesDialog(boolean enableLink, final List<PluginDownloader> updatePlugins, boolean showConfirmation) {
|
||||
NoUpdatesDialog dialog = new NoUpdatesDialog(true, updatePlugins, enableLink);
|
||||
dialog.setShowConfirmation(showConfirmation);
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public static void showUpdateInfoDialog(boolean enableLink, final UpdateChannel channel, final List<PluginDownloader> updatePlugins) {
|
||||
new UpdateInfoDialog(true, channel, updatePlugins, enableLink).show();
|
||||
}
|
||||
|
||||
public static boolean install(List<PluginDownloader> downloaders) {
|
||||
boolean installed = false;
|
||||
for (PluginDownloader downloader : downloaders) {
|
||||
|
||||
Reference in New Issue
Block a user