()
| 345 | } |
| 346 | |
| 347 | static public String getSketchbookPath() { |
| 348 | // Get the sketchbook path, and make sure it's set properly |
| 349 | String sketchbookPath = PreferencesData.get("sketchbook.path"); |
| 350 | |
| 351 | // If a value is at least set, first check to see if the folder exists. |
| 352 | // If it doesn't, warn the user that the sketchbook folder is being reset. |
| 353 | if (sketchbookPath != null) { |
| 354 | File sketchbookFolder; |
| 355 | if (getPortableFolder() != null && !new File(sketchbookPath).isAbsolute()) { |
| 356 | sketchbookFolder = new File(getPortableFolder(), sketchbookPath); |
| 357 | } else { |
| 358 | sketchbookFolder = absoluteFile(sketchbookPath); |
| 359 | } |
| 360 | if (!sketchbookFolder.exists()) { |
| 361 | showWarning(tr("Sketchbook folder disappeared"), |
| 362 | tr("The sketchbook folder no longer exists.\n" + |
| 363 | "Arduino will switch to the default sketchbook\n" + |
| 364 | "location, and create a new sketchbook folder if\n" + |
| 365 | "necessary. Arduino will then stop talking about\n" + |
| 366 | "himself in the third person."), null); |
| 367 | sketchbookPath = null; |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | return sketchbookPath; |
| 372 | } |
| 373 | |
| 374 | public static TargetBoard getTargetBoard() { |
| 375 | TargetPlatform targetPlatform = getTargetPlatform(); |
no test coverage detected