Skip to content

Commit d860c90

Browse files
feiknamecmaglie
authored andcommitted
Show "Manage Libraries" item in the Tools menu too
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.
1 parent 4a80f50 commit d860c90

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app/src/processing/app/Editor.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -731,16 +731,16 @@ private JMenu buildToolsMenu() {
731731

732732
addInternalTools(toolsMenu);
733733

734-
JMenuItem item = newJMenuItemShift(tr("Serial Monitor"), 'M');
734+
JMenuItem item = new JMenuItem(tr("Manage Libraries..."));
735+
item.addActionListener(e -> base.openLibraryManager("", ""));
736+
toolsMenu.add(item);
737+
738+
item = newJMenuItemShift(tr("Serial Monitor"), 'M');
735739
item.addActionListener(e -> handleSerial());
736740
toolsMenu.add(item);
737741

738742
item = newJMenuItemShift(tr("Serial Plotter"), 'L');
739-
item.addActionListener(new ActionListener() {
740-
public void actionPerformed(ActionEvent e) {
741-
handlePlotter();
742-
}
743-
});
743+
item.addActionListener(e -> handlePlotter());
744744
toolsMenu.add(item);
745745

746746
addTools(toolsMenu, BaseNoGui.getToolsFolder());
@@ -1476,6 +1476,7 @@ static public JMenuItem newJMenuItem(String title, int what) {
14761476
/**
14771477
* Like newJMenuItem() but adds shift as a modifier for the key command.
14781478
*/
1479+
// Control + Shift + K seems to not be working on linux (Xubuntu 17.04, 2017-08-19)
14791480
static public JMenuItem newJMenuItemShift(String title, int what) {
14801481
JMenuItem menuItem = new JMenuItem(title);
14811482
menuItem.setAccelerator(KeyStroke.getKeyStroke(what, SHORTCUT_KEY_MASK | ActionEvent.SHIFT_MASK));

0 commit comments

Comments
 (0)