finish getting pdex files to install, now with actual feedback

This commit is contained in:
Ben Fry
2021-08-06 20:12:41 -04:00
parent 40998a7da5
commit cb37d059b8
2 changed files with 20 additions and 14 deletions

View File

@@ -1358,23 +1358,28 @@ public class Base {
"only be installed from trusted sources.");
if (result == JOptionPane.YES_OPTION) {
try {
editor.statusNotice("Installing " + baseName + "...");
editor.startIndeterminate();
editor.statusNotice("Installing " + baseName + "...");
editor.startIndeterminate();
// do the work of the actual install
LocalContribution contrib =
AvailableContribution.install(this, new File(path));
new Thread(() -> {
try {
// do the work of the actual install
LocalContribution contrib =
AvailableContribution.install(this, new File(path));
editor.stopIndeterminate();
editor.statusEmpty();
EventQueue.invokeLater(() -> {
editor.stopIndeterminate();
if (contrib == null) {
Messages.showWarning("Error During Installation", "Could not install contrib from " + path);
if (contrib != null) {
editor.statusEmpty();
} else {
editor.statusError("Could not install " + path);
}
});
} catch (IOException e) {
EventQueue.invokeLater(() -> Messages.showWarning("Exception During Installation", "Could not install contrib from " + path, e));
}
} catch (IOException e) {
Messages.showWarning("Exception During Installation", "Could not install contrib from " + path, e);
}
}).start();
}
}
});

View File

@@ -26,7 +26,8 @@ X update to JDK 11.0.12+7
X rewrite download handler to just use a simple <get>
_ remove the rest of the jre downloader code
X initial code to install a contrib from a pdex file
_ test to make sure it's behaving properly
X test to make sure it's behaving properly
X finish getting pdex files to install, now with actual feedback
o handleNew() returns an Editor object
o unlikely to break anything, but it is a signature change
X nope, nevermind, not gonna do it