Skip to content

Add "Manage libraries..." to the "Tools" menu too and add a shortcut for it. #6638

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

Merged
merged 5 commits into from Oct 30, 2017
Merged

Add "Manage libraries..." to the "Tools" menu too and add a shortcut for it. #6638

merged 5 commits into from Oct 30, 2017

Conversation

feikname
Copy link
Contributor

@feikname feikname commented Aug 19, 2017

Disclaimer: The original intent of this pull request was to move the "Manage Libraries..." item to the Tools Menu". The original text is available below.

This pull request adds the Menu+Shift+I shortcut for easy acess to the Library Manager, thus fixing #6335

It also adds the "Manage Libraries..." item to be available in the Tools menu, while also keeping the old entry.

The result can be seem in the last image of the original text.


Original:

Description from the commit message:

It's easier to access it there

Also, a shortcut was added to it: Ctrl + Shift + O

My original plan was for it to be "Control + Shift + K", but for some
reason it doesn't work on Xubuntu 17.04

This is my attempt at fixing #6335

If you think changing menu location is too big of a change, I can close this pull request and open a new one that only adds the shortcut.

Before:
image

Now:
image

@facchinm
Copy link
Member

facchinm commented Sep 4, 2017

Hi @feikname , the shortcut change is really needed but I can't find the relevant commit. Did you forget to push it?
I'd also be fine with moving the menu but I'd ask confirmation to @00alis about this topic.

@facchinm facchinm added the Waiting for feedback More information must be provided before we can proceed label Sep 4, 2017
@00alis
Copy link
Contributor

00alis commented Sep 4, 2017

I think we should not move it, but have it in both places, probably a lot of people are used to find it where it currently is. I agree that it could be useful under Tools too :)

@feikname
Copy link
Contributor Author

feikname commented Sep 4, 2017

@facchinm The shortcut addition was placed in the same commit as the one that moves the item:

JMenuItem item = newJMenuItemShift(tr("Manage Libraries..."), 'O'); // newJMenuItemShift is a wrapper function inside Editor.java for creating Ctrl Shift shortcuts in modern operating systems
item.addActionListener(e -> base.openLibraryManager("", ""));
toolsMenu.add(item);

@00alis I'd rather not have duplicate entries, but I will make a commit to re-add the "Manage Libraries..." item to it's old place soon.

Thank you guys for the feedback!

@feikname
Copy link
Contributor Author

feikname commented Sep 4, 2017

The new commit (ad84772) re-adds the item back into its old place.

Please let me know when this is ready to be merged, so I can squash the commits altogether.

@OtacilioN
Copy link

I really agree with @00alis, if we move it we will loose a lot of tutorials and documentations that says to users that you can find the Arduino Library Manager in the Sketch Menu.

But yeah, i do believe that the tools menu is right Menu for this tool, so instead moving i do believe that has no problem for the users duplicate this section in both menus, so we can acess even easier this part wich is so important.

And for finishing the idea in #6335 to make keyboard shortcut it is really necessary to make the Arduino Library Manager even more accessible.

@feikname
Copy link
Contributor Author

Good point, I didn't think about all the old tutorials.

So now that the entry is present in both its old place and the Tools menu, and the shortcut was added, I will rebase the commits.

The only thing left is to confirm if the Ctrl Shift O shortcut is okay.

@OtacilioN
Copy link

Crtl Shift I does something? Because I could be from 'I'nclude, wich renember libraries, maybe could be a better shortcut, but Crtl Shift O i dont see any problem in the Crtl Shift O

@facchinm facchinm added this to the Next milestone Sep 13, 2017
@feikname feikname changed the title Move "Manage libraries..." to the "Tools" menu Add "Manage libraries..." to the "Tools" menu too and add a shortcut for it. Sep 15, 2017
@feikname
Copy link
Contributor Author

feikname commented Sep 15, 2017

Okay, this pull request should be ready now.

I changed the shortcut from Menu+Shift+O to Menu+Shift+I because the former option seemed awfully similar to the Open File shortcut to me.

edit: I forgot to say I edited this with my phone, so I didn't really test it (my notebook died, unfortunately). Although this pull request makes simple changes only, if someone can test this on a real machine I'd be very grateful. (perhaps an ArduinoBot build?)

Copy link
Collaborator

@matthijskooijman matthijskooijman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks good to me. Still some remarks, though:

  • Your second commit contains (a lot of) whitespace fixes, which makes it hard to see what is actually changing in that commit. It is usually better if whitespace changes are in a separate commit (which only needs casual review).
  • All but the first lines in your commit messages seem indented, which makes them look a bit weird in github. It's not customary to indent any lines in a commit message.
  • Wouldn't it be consistent to also allow managing the installed boards from the tools menu?
  • You added the shortcut in only one of the two places, so it is shown only there. Can't you just add it in both places? Or will the command then execute twice?

@feikname
Copy link
Contributor Author

feikname commented Sep 15, 2017

  • True [fixed in latest forced push]
  • Also true [fixed in latest forced push]
  • I didn't even think about this, as I don't ever use the Board Manager. I think it can be easily added while we're at it (given that the code is trivial, I hope). Shortcut suggestions are welcome.
  • I have no idea, I will make a commit that adds it in both places soon. @matthijskooijman could you please test it after I've done it?

This duplicates the entry, so now "Manage Libraries..." is available
in both under the "Tools" menu and inside the "Sketch" -> "Include
Library" menu.

The reasons for this change are:
  - It makes sense for the entry to be there
  - It makes easier for the user to click on the entry

Aditionally, I added a comment about a issue I found with the
newJMenuItemShift function on Xubuntu 17.04 regarding the Ctrl+Shift+K
shortcut.
Please note that this commit actually adds the shortcut to its menu
entry under the "Tools" menu.

As a side effect, the shortcut tip is only shown in this entry and not
on the another one.

Menu usually means the Ctrl key on most modern systems.
@feikname
Copy link
Contributor Author

Can someone test bd4d9c5 please? I just need to know if the shortcut still works and if the tip is shown on both entries.

This commit adds the Menu+Shift+I shortcut to the remaining menu entry in Base.java.

When the shortcut is called, the menu entry from Base.java is the one that will be called.
@feikname
Copy link
Contributor Author

I did a forced push again, the pull request should be ready now.

You added the shortcut in only one of the two places, so it is shown only there. Can't you just add it in both places? Or will the command then execute twice?

Yes, it's possible. The b57d2fa commit (previously bd4d9c5, I only renamed it) does exactly that. The entry that gets called is the one from Base.java only.

Wouldn't it be consistent to also allow managing the installed boards from the tools menu?

IMO, it's already easily reachable, unlike the "Manage Libraries..." item. Maybe a shortcut could be added to it, but that's probably better to be included in another PR to keep things clean.

I see there's this commit in the ide-1.9.x-beta branch that was included from the previous state of this pull request. If you plan on merging the ide-1.9.x-beta branch completely, I recommend to change this before doing so.

@cmaglie cmaglie modified the milestones: Next, Release 1.8.6 Oct 30, 2017
@cmaglie cmaglie removed the Waiting for feedback More information must be provided before we can proceed label Oct 30, 2017
@cmaglie cmaglie merged commit a3f59fa into arduino:master Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants