Skip to content

Commit 1cdf75d

Browse files
committed
"Add library" moved into "Import library" menu
1 parent 8eab205 commit 1cdf75d

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

app/src/processing/app/Base.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -944,10 +944,20 @@ protected void rebuildSketchbookMenu(JMenu menu) {
944944
}
945945

946946

947-
public void rebuildImportMenu(JMenu importMenu) {
948-
//System.out.println("rebuilding import menu");
947+
public void rebuildImportMenu(JMenu importMenu, final Editor editor) {
949948
importMenu.removeAll();
950-
949+
950+
JMenuItem addLibraryMenuItem = new JMenuItem(_("Add Library..."));
951+
addLibraryMenuItem.addActionListener(new ActionListener() {
952+
public void actionPerformed(ActionEvent e) {
953+
Base.this.handleAddLibrary(editor);
954+
Base.this.onBoardOrPortChange();
955+
Base.this.rebuildImportMenu(Editor.importMenu, editor);
956+
}
957+
});
958+
importMenu.add(addLibraryMenuItem);
959+
importMenu.addSeparator();
960+
951961
// reset the set of libraries
952962
libraries = new HashSet<File>();
953963

@@ -999,7 +1009,7 @@ public void onBoardOrPortChange() {
9991009
}
10001010

10011011

1002-
public void rebuildBoardsMenu(JMenu menu) {
1012+
public void rebuildBoardsMenu(JMenu menu, final Editor editor) {
10031013
//System.out.println("rebuilding boards menu");
10041014
menu.removeAll();
10051015
ButtonGroup group = new ButtonGroup();

app/src/processing/app/Editor.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -627,20 +627,10 @@ public void actionPerformed(ActionEvent e) {
627627

628628
if (importMenu == null) {
629629
importMenu = new JMenu(_("Import Library..."));
630-
base.rebuildImportMenu(importMenu);
630+
base.rebuildImportMenu(importMenu, this);
631631
}
632632
sketchMenu.add(importMenu);
633633

634-
item = new JMenuItem(_("Add Library..."));
635-
item.addActionListener(new ActionListener() {
636-
public void actionPerformed(ActionEvent e) {
637-
base.handleAddLibrary(Editor.this);
638-
base.onBoardOrPortChange();
639-
base.rebuildImportMenu(Editor.importMenu);
640-
}
641-
});
642-
sketchMenu.add(item);
643-
644634
item = newJMenuItem(_("Show Sketch Folder"), 'K');
645635
item.addActionListener(new ActionListener() {
646636
public void actionPerformed(ActionEvent e) {
@@ -690,7 +680,7 @@ public void actionPerformed(ActionEvent e) {
690680

691681
if (boardsMenu == null) {
692682
boardsMenu = new JMenu(_("Board"));
693-
base.rebuildBoardsMenu(boardsMenu);
683+
base.rebuildBoardsMenu(boardsMenu, this);
694684
}
695685
menu.add(boardsMenu);
696686

build/shared/revisions.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
ARDUINO 1.0.5 - 2013.03.29
2+
ARDUINO 1.0.5 - 2013.05.15
33

44
[core]
55

@@ -15,6 +15,10 @@ ARDUINO 1.0.5 - 2013.03.29
1515

1616
* Upgrades to WiFi firmwares
1717

18+
[ide]
19+
20+
* Backport from 1.5: install Library from .zip file or folder
21+
1822
ARDUINO 1.0.4 - 2013.03.11
1923

2024
[core]

0 commit comments

Comments
 (0)