Skip to content

Commit cb37d05

Browse files
committed
finish getting pdex files to install, now with actual feedback
1 parent 40998a7 commit cb37d05

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

app/src/processing/app/Base.java

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,23 +1358,28 @@ public Editor handleOpen(String path) {
13581358
"only be installed from trusted sources.");
13591359

13601360
if (result == JOptionPane.YES_OPTION) {
1361-
try {
1362-
editor.statusNotice("Installing " + baseName + "...");
1363-
editor.startIndeterminate();
1364-
1365-
// do the work of the actual install
1366-
LocalContribution contrib =
1367-
AvailableContribution.install(this, new File(path));
1368-
1369-
editor.stopIndeterminate();
1370-
editor.statusEmpty();
1371-
1372-
if (contrib == null) {
1373-
Messages.showWarning("Error During Installation", "Could not install contrib from " + path);
1361+
editor.statusNotice("Installing " + baseName + "...");
1362+
editor.startIndeterminate();
1363+
1364+
new Thread(() -> {
1365+
try {
1366+
// do the work of the actual install
1367+
LocalContribution contrib =
1368+
AvailableContribution.install(this, new File(path));
1369+
1370+
EventQueue.invokeLater(() -> {
1371+
editor.stopIndeterminate();
1372+
1373+
if (contrib != null) {
1374+
editor.statusEmpty();
1375+
} else {
1376+
editor.statusError("Could not install " + path);
1377+
}
1378+
});
1379+
} catch (IOException e) {
1380+
EventQueue.invokeLater(() -> Messages.showWarning("Exception During Installation", "Could not install contrib from " + path, e));
13741381
}
1375-
} catch (IOException e) {
1376-
Messages.showWarning("Exception During Installation", "Could not install contrib from " + path, e);
1377-
}
1382+
}).start();
13781383
}
13791384
}
13801385
});

todo.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ X update to JDK 11.0.12+7
2626
X rewrite download handler to just use a simple <get>
2727
_ remove the rest of the jre downloader code
2828
X initial code to install a contrib from a pdex file
29-
_ test to make sure it's behaving properly
29+
X test to make sure it's behaving properly
30+
X finish getting pdex files to install, now with actual feedback
3031
o handleNew() returns an Editor object
3132
o unlikely to break anything, but it is a signature change
3233
X nope, nevermind, not gonna do it

0 commit comments

Comments
 (0)