File tree Expand file tree Collapse file tree 3 files changed +21
-17
lines changed Expand file tree Collapse file tree 3 files changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -943,10 +943,20 @@ protected void rebuildSketchbookMenu(JMenu menu) {
943943 }
944944
945945
946- public void rebuildImportMenu (JMenu importMenu ) {
947- //System.out.println("rebuilding import menu");
946+ public void rebuildImportMenu (JMenu importMenu , final Editor editor ) {
948947 importMenu .removeAll ();
949-
948+
949+ JMenuItem addLibraryMenuItem = new JMenuItem (_ ("Add Library..." ));
950+ addLibraryMenuItem .addActionListener (new ActionListener () {
951+ public void actionPerformed (ActionEvent e ) {
952+ Base .this .handleAddZipLibrary (editor );
953+ Base .this .onBoardOrPortChange ();
954+ Base .this .rebuildImportMenu (Editor .importMenu , editor );
955+ }
956+ });
957+ importMenu .add (addLibraryMenuItem );
958+ importMenu .addSeparator ();
959+
950960 // reset the set of libraries
951961 libraries = new HashSet <File >();
952962
@@ -998,7 +1008,7 @@ public void onBoardOrPortChange() {
9981008 }
9991009
10001010
1001- public void rebuildBoardsMenu (JMenu menu ) {
1011+ public void rebuildBoardsMenu (JMenu menu , final Editor editor ) {
10021012 //System.out.println("rebuilding boards menu");
10031013 menu .removeAll ();
10041014 ButtonGroup group = new ButtonGroup ();
Original file line number Diff line number Diff 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 from ZIP" ));
635- item .addActionListener (new ActionListener () {
636- public void actionPerformed (ActionEvent e ) {
637- base .handleAddZipLibrary (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
Original file line number Diff line number Diff line change 11
2- ARDUINO 1.0.5 - 2013.03.29
2+ ARDUINO 1.0.5 - 2013.04.08
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 file
21+
1822ARDUINO 1.0.4 - 2013.03.11
1923
2024[core]
You can’t perform that action at this time.
0 commit comments