mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-29 10:24:12 +01:00
Canceling self check timer when opening boards/libs manager
This commit is contained in:
parent
f9612bcdbd
commit
c61c39f5d9
@ -1259,6 +1259,9 @@ public class Base {
|
||||
}
|
||||
|
||||
public void openLibraryManager(String dropdownItem) {
|
||||
if (selfCheckTimer != null) {
|
||||
selfCheckTimer.cancel();
|
||||
}
|
||||
@SuppressWarnings("serial")
|
||||
LibraryManagerUI managerUI = new LibraryManagerUI(activeEditor, BaseNoGui.getPlatform()) {
|
||||
@Override
|
||||
@ -1285,7 +1288,9 @@ public class Base {
|
||||
}
|
||||
|
||||
public void openBoardsManager(final String filterText, String dropdownItem) throws Exception {
|
||||
// Create dialog for contribution manager
|
||||
if (selfCheckTimer != null) {
|
||||
selfCheckTimer.cancel();
|
||||
}
|
||||
@SuppressWarnings("serial")
|
||||
ContributionManagerUI managerUI = new ContributionManagerUI(activeEditor, BaseNoGui.getPlatform()) {
|
||||
@Override
|
||||
|
@ -322,15 +322,8 @@ public class ContributionInstaller {
|
||||
File tmpFile = new File(outputFile.getAbsolutePath() + ".tmp");
|
||||
downloader.download(url, tmpFile, progress, statusText);
|
||||
|
||||
// Replace old index with the updated one
|
||||
if (outputFile.exists()) {
|
||||
if (!outputFile.delete()) {
|
||||
throw new Exception("An error occurred while updating platforms index! I can't delete file " + outputFile);
|
||||
}
|
||||
}
|
||||
if (!tmpFile.renameTo(outputFile)) {
|
||||
throw new Exception("An error occurred while updating platforms index! I can't rename file " + tmpFile);
|
||||
}
|
||||
Files.deleteIfExists(outputFile.toPath());
|
||||
Files.move(tmpFile.toPath(), outputFile.toPath());
|
||||
|
||||
return outputFile;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user