1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

"Add library" moved into "Import library" menu

Conflicts:
	app/src/processing/app/Base.java
	app/src/processing/app/Editor.java
This commit is contained in:
Cristian Maglie 2013-04-06 12:55:39 +02:00
parent eda3bd8767
commit 1866050e07
3 changed files with 21 additions and 17 deletions

View File

@ -943,10 +943,20 @@ public class Base {
}
public void rebuildImportMenu(JMenu importMenu) {
//System.out.println("rebuilding import menu");
public void rebuildImportMenu(JMenu importMenu, final Editor editor) {
importMenu.removeAll();
JMenuItem addLibraryMenuItem = new JMenuItem(_("Add Library..."));
addLibraryMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Base.this.handleAddZipLibrary(editor);
Base.this.onBoardOrPortChange();
Base.this.rebuildImportMenu(Editor.importMenu, editor);
}
});
importMenu.add(addLibraryMenuItem);
importMenu.addSeparator();
// reset the set of libraries
libraries = new HashSet<File>();
@ -998,7 +1008,7 @@ public class Base {
}
public void rebuildBoardsMenu(JMenu menu) {
public void rebuildBoardsMenu(JMenu menu, final Editor editor) {
//System.out.println("rebuilding boards menu");
menu.removeAll();
ButtonGroup group = new ButtonGroup();

View File

@ -627,20 +627,10 @@ public class Editor extends JFrame implements RunnerListener {
if (importMenu == null) {
importMenu = new JMenu(_("Import Library..."));
base.rebuildImportMenu(importMenu);
base.rebuildImportMenu(importMenu, this);
}
sketchMenu.add(importMenu);
item = new JMenuItem(_("Add Library from ZIP"));
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
base.handleAddZipLibrary(Editor.this);
base.onBoardOrPortChange();
base.rebuildImportMenu(Editor.importMenu);
}
});
sketchMenu.add(item);
item = newJMenuItem(_("Show Sketch Folder"), 'K');
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -690,7 +680,7 @@ public class Editor extends JFrame implements RunnerListener {
if (boardsMenu == null) {
boardsMenu = new JMenu(_("Board"));
base.rebuildBoardsMenu(boardsMenu);
base.rebuildBoardsMenu(boardsMenu, this);
}
menu.add(boardsMenu);

View File

@ -1,5 +1,5 @@
ARDUINO 1.0.5 - 2013.03.29
ARDUINO 1.0.5 - 2013.04.08
[core]
@ -15,6 +15,10 @@ ARDUINO 1.0.5 - 2013.03.29
* Upgrades to WiFi firmwares
[ide]
* Backport from 1.5: install Library from file
ARDUINO 1.0.4 - 2013.03.11
[core]