mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] backgroundable patch downloading progress (IDEA-46819)
This commit is contained in:
+15
-2
@@ -13,6 +13,7 @@ import com.intellij.openapi.application.ex.ApplicationEx;
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx;
|
||||
import com.intellij.openapi.application.impl.ApplicationImpl;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.progress.PerformInBackgroundOption;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
@@ -186,7 +187,7 @@ class UpdateInfoDialog extends AbstractUpdateDialog {
|
||||
return; // update cancelled
|
||||
}
|
||||
|
||||
new Task.Modal(null, IdeBundle.message("update.notifications.title"), true) {
|
||||
new Task.Backgroundable(null, IdeBundle.message("update.notifications.title"), true, PerformInBackgroundOption.DEAF) {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
String[] command;
|
||||
@@ -217,7 +218,19 @@ class UpdateInfoDialog extends AbstractUpdateDialog {
|
||||
|
||||
ApplicationEx app = ApplicationManagerEx.getApplicationEx();
|
||||
if (ApplicationManager.getApplication().isRestartCapable()) {
|
||||
app.invokeLater(() -> ((ApplicationImpl)app).exit(true, true, true, command));
|
||||
if (indicator.isShowing()) {
|
||||
app.invokeLater(() -> ((ApplicationImpl)app).exit(true, true, true, command));
|
||||
}
|
||||
else {
|
||||
String title = IdeBundle.message("update.notifications.title");
|
||||
String message = IdeBundle.message("update.ready.message");
|
||||
UpdateChecker.NOTIFICATIONS.createNotification(title, message, NotificationType.INFORMATION, new NotificationListener.Adapter() {
|
||||
@Override
|
||||
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
|
||||
app.invokeLater(() -> ((ApplicationImpl)app).exit(true, true, true, command));
|
||||
}
|
||||
}).notify(null);
|
||||
}
|
||||
}
|
||||
else {
|
||||
showPatchInstructions(command);
|
||||
|
||||
@@ -988,6 +988,7 @@ update.sni.disabled.message=We wanted your IDE to receive upgrades over a secure
|
||||
You can enable it again in <a href="disable">settings</a> after setting the property to 'true'.
|
||||
update.apply.manually.message=Unfortunately, the IDE is not capable of an automatic update on your system.\n \
|
||||
Please quit the IDE and apply the patch manually by launching this script:\n{0}.
|
||||
update.ready.message=The IDE is ready for update. <a href="#">Restart</a>?
|
||||
|
||||
hierarchy.method.next.occurence.name=Go to next method
|
||||
hierarchy.method.prev.occurence.name=Go to previous method
|
||||
|
||||
Reference in New Issue
Block a user