@@ -158,7 +158,7 @@ public boolean test(SketchController sketch) {
158
158
159
159
static volatile AbstractMonitor serialMonitor ;
160
160
static AbstractMonitor serialPlotter ;
161
-
161
+
162
162
final EditorHeader header ;
163
163
EditorStatus status ;
164
164
EditorConsole console ;
@@ -248,7 +248,7 @@ public void windowDeactivated(WindowEvent e) {
248
248
249
249
//PdeKeywords keywords = new PdeKeywords();
250
250
//sketchbook = new Sketchbook(this);
251
-
251
+
252
252
buildMenuBar ();
253
253
254
254
// For rev 0120, placing things inside a JPanel
@@ -399,8 +399,7 @@ public boolean importData(JComponent src, Transferable transferable) {
399
399
statusNotice (tr ("One file added to the sketch." ));
400
400
401
401
} else {
402
- statusNotice (
403
- I18n .format (tr ("{0} files added to the sketch." ), successful ));
402
+ statusNotice (I18n .format (tr ("{0} files added to the sketch." ), successful ));
404
403
}
405
404
return true ;
406
405
}
@@ -732,16 +731,16 @@ private JMenu buildToolsMenu() {
732
731
733
732
addInternalTools (toolsMenu );
734
733
735
- JMenuItem item = newJMenuItemShift (tr ("Serial Monitor" ), 'M' );
734
+ JMenuItem item = newJMenuItemShift (tr ("Manage Libraries..." ), 'O' );
735
+ item .addActionListener (e -> base .openLibraryManager ("" , "" ));
736
+ toolsMenu .add (item );
737
+
738
+ item = newJMenuItemShift (tr ("Serial Monitor" ), 'M' );
736
739
item .addActionListener (e -> handleSerial ());
737
740
toolsMenu .add (item );
738
741
739
742
item = newJMenuItemShift (tr ("Serial Plotter" ), 'L' );
740
- item .addActionListener (new ActionListener () {
741
- public void actionPerformed (ActionEvent e ) {
742
- handlePlotter ();
743
- }
744
- });
743
+ item .addActionListener (e -> handlePlotter ());
745
744
toolsMenu .add (item );
746
745
747
746
addTools (toolsMenu , BaseNoGui .getToolsFolder ());
@@ -947,14 +946,14 @@ private String findClassInZipFile(String base, File file) {
947
946
} finally {
948
947
if (zipFile != null ) {
949
948
try {
950
- zipFile .close ();
951
- } catch (IOException e ) {
952
- // noop
953
- }
954
- }
955
- }
956
- return null ;
957
- }
949
+ zipFile .close ();
950
+ } catch (IOException e ) {
951
+ // noop
952
+ }
953
+ }
954
+ }
955
+ return null ;
956
+ }
958
957
959
958
public void updateKeywords (PdeKeywords keywords ) {
960
959
for (EditorTab tab : tabs )
@@ -1476,6 +1475,7 @@ static public JMenuItem newJMenuItem(String title, int what) {
1476
1475
/**
1477
1476
* Like newJMenuItem() but adds shift as a modifier for the key command.
1478
1477
*/
1478
+ // Control + Shift + K seems to not be working on linux (Xubuntu 17.04, 2017-08-19)
1479
1479
static public JMenuItem newJMenuItemShift (String title , int what ) {
1480
1480
JMenuItem menuItem = new JMenuItem (title );
1481
1481
menuItem .setAccelerator (KeyStroke .getKeyStroke (what , SHORTCUT_KEY_MASK | ActionEvent .SHIFT_MASK ));
@@ -2096,18 +2096,19 @@ private boolean serialPrompt() {
2096
2096
names [i ] = portMenu .getItem (i ).getText ();
2097
2097
}
2098
2098
2099
+ // FIXME: This is horribly unreadable
2099
2100
String result = (String )
2100
- JOptionPane .showInputDialog (this ,
2101
- I18n .format (
2102
- tr ("Serial port {0} not found.\n " +
2103
- "Retry the upload with another serial port?" ),
2104
- PreferencesData .get ("serial.port" )
2105
- ),
2106
- "Serial port not found" ,
2107
- JOptionPane .PLAIN_MESSAGE ,
2108
- null ,
2109
- names ,
2110
- 0 );
2101
+ JOptionPane .showInputDialog (this ,
2102
+ I18n .format (
2103
+ tr ("Serial port {0} not found.\n " +
2104
+ "Retry the upload with another serial port?" ),
2105
+ PreferencesData .get ("serial.port" )
2106
+ ),
2107
+ "Serial port not found" ,
2108
+ JOptionPane .PLAIN_MESSAGE ,
2109
+ null ,
2110
+ names ,
2111
+ 0 );
2111
2112
if (result == null ) return false ;
2112
2113
selectSerialPort (result );
2113
2114
base .onBoardOrPortChange ();
@@ -2321,7 +2322,7 @@ public void handleSerial() {
2321
2322
return ;
2322
2323
}
2323
2324
}
2324
-
2325
+
2325
2326
if (serialMonitor != null ) {
2326
2327
// The serial monitor already exists
2327
2328
@@ -2351,14 +2352,14 @@ public void handleSerial() {
2351
2352
}
2352
2353
2353
2354
serialMonitor = new MonitorFactory ().newMonitor (port );
2354
-
2355
+
2355
2356
if (serialMonitor == null ) {
2356
2357
String board = port .getPrefs ().get ("board" );
2357
2358
String boardName = BaseNoGui .getPlatform ().resolveDeviceByBoardID (BaseNoGui .packages , board );
2358
2359
statusError (I18n .format (tr ("Serial monitor is not supported on network ports such as {0} for the {1} in this release" ), PreferencesData .get ("serial.port" ), boardName ));
2359
2360
return ;
2360
2361
}
2361
-
2362
+
2362
2363
Base .setIcon (serialMonitor );
2363
2364
2364
2365
// If currently uploading, disable the monitor (it will be later
@@ -2418,7 +2419,7 @@ public void handleSerial() {
2418
2419
} while (serialMonitor .requiresAuthorization () && !success );
2419
2420
2420
2421
}
2421
-
2422
+
2422
2423
public void handlePlotter () {
2423
2424
if (serialMonitor != null ) {
2424
2425
if (serialMonitor .isClosed ()) {
@@ -2428,7 +2429,7 @@ public void handlePlotter() {
2428
2429
return ;
2429
2430
}
2430
2431
}
2431
-
2432
+
2432
2433
if (serialPlotter != null ) {
2433
2434
// The serial plotter already exists
2434
2435
0 commit comments