Canceling self check timer when opening boards/libs manager

This commit is contained in:
Federico Fissore 2015-08-04 09:10:40 +02:00
parent f9612bcdbd
commit c61c39f5d9
2 changed files with 8 additions and 10 deletions

View File

@ -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

View File

@ -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;
}