Skip to content

Refresh the available list of libraries whenever the Import Library menu is expanded #1783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

remoun
Copy link

@remoun remoun commented Jan 3, 2014

This way the Arduino IDE doesn't need to be restarted whenever a user drops a new library directory into Documents/Arduino/libraries or the sketchbook's libraries folder.

Note: I'm not sure how slow the rebuildImportMenu call can get if there are tons of libraries, but I expect it won't be so bad, since it's just a few stat() calls. Perhaps we could guard it with a setting (preferably defaulting to true [rebuild]) if it proves too slow.

remoun added 3 commits January 3, 2014 01:13
This fixes having to restart the app whenever a new library is added to
the path (i.e. in the sketchbook or Processing directory).
@matthijskooijman
Copy link
Collaborator

Another thing that comes to mind is that IIRC the IDE sometimes shows a popup when a library is invalid (or does it only print to stderr?). In this case, you might never get to open the import menu if a popup is shown (which probably prevents you from using the import menu)? Not sure if this is actually the case, but it's at least something to double-check.

I had a quick look at the commits, they look good to me.

@remoun
Copy link
Author

remoun commented Jan 3, 2014

Good catch. Looking at the code, it doesn't seem too bad, only when filenames are invalid*.

I also verified it; a dialog does pop up, but that doesn't stop the menu from appearing (without the bad lib names). So it's just a bit noisy, but it's (a) a corner case [when filenames are invalid], (b) it's clear about which library names are invalid, so (c) it's easy to remedy that error condition.

  • An error dialog happens when a library fails to import, but that only happens

@remoun
Copy link
Author

remoun commented Jan 3, 2014

I added a note about it (see 25acf30).

@cmaglie cmaglie added feature request A request to make an enhancement (not a bug fix) Component: IDE user interface The Arduino IDE's user interface and removed Component: IDE The Arduino IDE labels Apr 15, 2015
@ffissore ffissore self-assigned this May 11, 2015
@ffissore
Copy link
Contributor

Sorry for the late reply. A side effect of introducing Boards/Lib managers with IDE 1.6.2 is that both cores and libraries get refreshed as soon as one of the Manager gets closed. Plus, filesystem monitoring and background library parsing are expensive, on windows especially because of antivirus software.

@ffissore ffissore closed this May 19, 2015
@ffissore ffissore modified the milestone: Release 1.6.5 May 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE user interface The Arduino IDE's user interface feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants