From 320c8be7b8ae93bd50a1c21c2e3627c4b612f2ee Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Tue, 23 Apr 2013 12:41:06 +0200 Subject: [PATCH] Run console progresses from EDT. --- .../python/console/PydevConsoleRunner.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/python/src/com/jetbrains/python/console/PydevConsoleRunner.java b/python/src/com/jetbrains/python/console/PydevConsoleRunner.java index d09bf4201e05..e0563bbd5c3b 100644 --- a/python/src/com/jetbrains/python/console/PydevConsoleRunner.java +++ b/python/src/com/jetbrains/python/console/PydevConsoleRunner.java @@ -157,16 +157,21 @@ public class PydevConsoleRunner extends AbstractConsoleRunnerWithHistoryasList(e), getTitle(), null); - } + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + ProgressManager.getInstance().run(new Task.Backgroundable(getProject(), "Connecting to console", false) { + public void run(@NotNull final ProgressIndicator indicator) { + indicator.setText("Connecting to console..."); + try { + initAndRun(myStatementsToExecute); + } + catch (ExecutionException e) { + LOG.warn("Error running console", e); + ExecutionHelper.showErrors(myProject, Arrays.asList(e), getTitle(), null); + } + } + }); } }); }