38
38
import processing .app .helpers .PreferencesMap ;
39
39
import processing .app .helpers .filefilters .OnlyDirs ;
40
40
import processing .app .helpers .filefilters .OnlyFilesWithExtension ;
41
- import processing .app .javax .swing .filechooser .FileNameExtensionFilter ;import processing .app .packages .Library ;
41
+ import processing .app .javax .swing .filechooser .FileNameExtensionFilter ;
42
+ import processing .app .packages .Library ;
42
43
import processing .app .packages .LibraryList ;
43
44
import processing .app .tools .ZipDeflater ;
44
45
import processing .core .*;
@@ -1241,20 +1242,19 @@ public void rebuildBoardsMenu(JMenu toolsMenu, Editor editor) throws Exception {
1241
1242
for (TargetPackage targetPackage : packages .values ()) {
1242
1243
// For every package cycle through all platform
1243
1244
for (TargetPlatform targetPlatform : targetPackage .platforms ()) {
1244
- String platformLabel = targetPlatform .getPreferences ().get ("name" );
1245
- if (platformLabel == null || targetPlatform .getBoards ().isEmpty ()) {
1246
- continue ;
1247
- }
1248
1245
1249
1246
// Add a separator from the previous platform
1250
1247
if (!first )
1251
1248
boardsMenu .add (new JSeparator ());
1252
1249
first = false ;
1253
1250
1254
1251
// Add a title for each platform
1255
- JMenuItem separator = new JMenuItem (_ (platformLabel ));
1256
- separator .setEnabled (false );
1257
- boardsMenu .add (separator );
1252
+ String platformLabel = targetPlatform .getPreferences ().get ("name" );
1253
+ if (platformLabel != null && !targetPlatform .getBoards ().isEmpty ()) {
1254
+ JMenuItem menuLabel = new JMenuItem (_ (platformLabel ));
1255
+ menuLabel .setEnabled (false );
1256
+ boardsMenu .add (menuLabel );
1257
+ }
1258
1258
1259
1259
// Cycle through all boards of this platform
1260
1260
for (TargetBoard board : targetPlatform .getBoards ().values ()) {
@@ -1266,36 +1266,6 @@ public void rebuildBoardsMenu(JMenu toolsMenu, Editor editor) throws Exception {
1266
1266
boardsMenu .add (item );
1267
1267
boardsButtonGroup .add (item );
1268
1268
}
1269
-
1270
- // Cycle through all boards of referenced platforms
1271
- for (TargetPackage pack : packages .values ()) {
1272
- if (pack == targetPackage )
1273
- continue ;
1274
- for (TargetPlatform platf : pack .getPlatforms ().values ()) {
1275
- if (!platf .getId ().equals (targetPlatform .getId ()))
1276
- continue ;
1277
- boolean firstRefBoardBlock = true ;
1278
- for (TargetBoard board : platf .getBoards ().values ()) {
1279
- String ref = board .getReferencedPackageId ();
1280
- if (ref == null || !ref .equals (targetPackage .getId ()))
1281
- continue ;
1282
-
1283
- // Add a separator from the previous platform
1284
- if (firstRefBoardBlock )
1285
- boardsMenu .add (new JSeparator ());
1286
- firstRefBoardBlock = false ;
1287
-
1288
- JMenuItem item = createBoardMenusAndCustomMenus (
1289
- editor ,
1290
- menuItemsToClickAfterStartup ,
1291
- buttonGroupsMap ,
1292
- board , platf ,
1293
- pack );
1294
- boardsMenu .add (item );
1295
- boardsButtonGroup .add (item );
1296
- }
1297
- }
1298
- }
1299
1269
}
1300
1270
}
1301
1271
0 commit comments