From ada7b410633f59e065a8fff9b82b4bea33c56e81 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Thu, 9 Apr 2015 14:47:58 +0200 Subject: [PATCH 1/2] Print library name when installing library via library manager --- .../arduino/contributions/libraries/LibraryInstaller.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arduino-core/src/cc/arduino/contributions/libraries/LibraryInstaller.java b/arduino-core/src/cc/arduino/contributions/libraries/LibraryInstaller.java index a90f2f0656d..ac87f7372b5 100644 --- a/arduino-core/src/cc/arduino/contributions/libraries/LibraryInstaller.java +++ b/arduino-core/src/cc/arduino/contributions/libraries/LibraryInstaller.java @@ -106,7 +106,7 @@ public void install(ContributedLibrary lib, ContributedLibrary replacedLib) thro // Step 1: Download library try { - downloader.download(lib, progress, _("Downloading library.")); + downloader.download(lib, progress, _("Downloading library: \"" + lib.getName() + "\"")); } catch (InterruptedException e) { // Download interrupted... just exit return; @@ -117,7 +117,7 @@ public void install(ContributedLibrary lib, ContributedLibrary replacedLib) thro // all the temporary folders and abort installation. // Step 2: Unpack library on the correct location - progress.setStatus(_("Installing library...")); + progress.setStatus(_("Installing library: \"" + lib.getName() + "\"")); onProgress(progress); File libsFolder = indexer.getSketchbookLibrariesFolder(); File tmpFolder = FileUtils.createTempFolderIn(libsFolder); @@ -148,7 +148,7 @@ public void remove(ContributedLibrary lib) throws IOException { final MultiStepProgress progress = new MultiStepProgress(2); // Step 1: Remove library - progress.setStatus(_("Removing library...")); + progress.setStatus(_("Removing library: \"" + lib.getName() + "\"")); onProgress(progress); FileUtils.recursiveDelete(lib.getInstalledFolder()); progress.stepDone(); From 26ae4d13b880c78dc579ed5528ee20f2404d531e Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Thu, 9 Apr 2015 14:56:24 +0200 Subject: [PATCH 2/2] Don't throw exception if library is already installed --- .../cc/arduino/contributions/libraries/LibraryInstaller.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arduino-core/src/cc/arduino/contributions/libraries/LibraryInstaller.java b/arduino-core/src/cc/arduino/contributions/libraries/LibraryInstaller.java index ac87f7372b5..2bae0ac405e 100644 --- a/arduino-core/src/cc/arduino/contributions/libraries/LibraryInstaller.java +++ b/arduino-core/src/cc/arduino/contributions/libraries/LibraryInstaller.java @@ -97,9 +97,10 @@ public void updateIndex() throws Exception { rescanLibraryIndex(progress); } - public void install(ContributedLibrary lib, ContributedLibrary replacedLib) throws Exception { + public void install(ContributedLibrary lib, ContributedLibrary replacedLib) { if (lib.isInstalled()) { - throw new Exception(_("Library is already installed!")); + System.out.println(_("Library is already installed: \"" + lib.getName() + "\"")); + return; } final MultiStepProgress progress = new MultiStepProgress(3);