mirror of
https://github.com/esp8266/Arduino.git
synced 2025-10-16 22:27:59 +03:00
ContributedPlatform.getResolvedTools returns a copy of the original list (otherwise violating inner state)
This commit is contained in:
@@ -28,10 +28,6 @@
|
||||
*/
|
||||
package cc.arduino.packages.contributions.ui;
|
||||
|
||||
import java.awt.Dialog;
|
||||
import java.awt.Frame;
|
||||
import java.util.Collection;
|
||||
|
||||
import cc.arduino.packages.contributions.ContributedPlatform;
|
||||
import cc.arduino.packages.contributions.ContributionInstaller;
|
||||
import cc.arduino.packages.contributions.ContributionsIndexer;
|
||||
@@ -40,6 +36,9 @@ import cc.arduino.ui.InstallerJDialog;
|
||||
import cc.arduino.ui.InstallerTableCell;
|
||||
import cc.arduino.utils.Progress;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Collection;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class ContributionManagerUI extends InstallerJDialog {
|
||||
|
||||
@@ -122,8 +121,9 @@ public class ContributionManagerUI extends InstallerJDialog {
|
||||
|
||||
@Override
|
||||
public void onCancelPressed() {
|
||||
if (installerThread != null)
|
||||
if (installerThread != null) {
|
||||
installerThread.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,6 +142,7 @@ public class ContributionManagerUI extends InstallerJDialog {
|
||||
}
|
||||
}
|
||||
});
|
||||
installerThread.setUncaughtExceptionHandler(new ContributionUncaughtExceptionHandler(this));
|
||||
installerThread.start();
|
||||
}
|
||||
|
||||
@@ -162,6 +163,7 @@ public class ContributionManagerUI extends InstallerJDialog {
|
||||
}
|
||||
}
|
||||
});
|
||||
installerThread.setUncaughtExceptionHandler(new ContributionUncaughtExceptionHandler(this));
|
||||
installerThread.start();
|
||||
}
|
||||
|
||||
@@ -179,12 +181,13 @@ public class ContributionManagerUI extends InstallerJDialog {
|
||||
}
|
||||
}
|
||||
});
|
||||
installerThread.setUncaughtExceptionHandler(new ContributionUncaughtExceptionHandler(this));
|
||||
installerThread.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when indexes are updated
|
||||
*
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected void onIndexesUpdated() throws Exception {
|
||||
|
@@ -0,0 +1,22 @@
|
||||
package cc.arduino.packages.contributions.ui;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
import static processing.app.I18n._;
|
||||
|
||||
public class ContributionUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
|
||||
|
||||
private final Component parent;
|
||||
|
||||
public ContributionUncaughtExceptionHandler(Component parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uncaughtException(Thread t, Throwable e) {
|
||||
e.printStackTrace();
|
||||
JOptionPane.showMessageDialog(parent, _(e.getMessage()), "Error", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user