@@ -1436,17 +1436,16 @@ public void actionPerformed(ActionEvent actionevent) {
1436
1436
boardMenu .add (new JSeparator ());
1437
1437
1438
1438
// Generate custom menus for all platforms
1439
- Set <String > customMenusTitles = new LinkedHashSet <>();
1440
1439
for (TargetPackage targetPackage : BaseNoGui .packages .values ()) {
1441
1440
for (TargetPlatform targetPlatform : targetPackage .platforms ()) {
1442
- customMenusTitles .addAll (targetPlatform .getCustomMenus ().values ());
1441
+ for (String customMenuTitle : targetPlatform .getCustomMenus ().values ()) {
1442
+ JMenu customMenu = new JMenu (tr (customMenuTitle ));
1443
+ customMenu .putClientProperty ("platform" , targetPlatform .getId ());
1444
+ customMenu .putClientProperty ("removeOnWindowDeactivation" , true );
1445
+ boardsCustomMenus .add (customMenu );
1446
+ }
1443
1447
}
1444
1448
}
1445
- for (String customMenuTitle : customMenusTitles ) {
1446
- JMenu customMenu = new JMenu (tr (customMenuTitle ));
1447
- customMenu .putClientProperty ("removeOnWindowDeactivation" , true );
1448
- boardsCustomMenus .add (customMenu );
1449
- }
1450
1449
1451
1450
List <JMenuItem > menuItemsToClickAfterStartup = new LinkedList <>();
1452
1451
@@ -1532,7 +1531,7 @@ public void actionPerformed(ActionEvent actionevent) {
1532
1531
PreferencesMap customMenus = targetPlatform .getCustomMenus ();
1533
1532
for (final String menuId : customMenus .keySet ()) {
1534
1533
String title = customMenus .get (menuId );
1535
- JMenu menu = getBoardCustomMenu (tr (title ));
1534
+ JMenu menu = getBoardCustomMenu (tr (title ), targetPlatform . getId () );
1536
1535
1537
1536
if (board .hasMenu (menuId )) {
1538
1537
PreferencesMap boardCustomMenu = board .getMenuLabels (menuId );
@@ -1595,9 +1594,9 @@ private static boolean ifThereAreVisibleItemsOn(JMenu menu) {
1595
1594
return false ;
1596
1595
}
1597
1596
1598
- private JMenu getBoardCustomMenu (String label ) throws Exception {
1597
+ private JMenu getBoardCustomMenu (String label , String platform ) throws Exception {
1599
1598
for (JMenu menu : boardsCustomMenus ) {
1600
- if (label .equals (menu .getText ())) {
1599
+ if (label .equals (menu .getText ()) && platform . equals ( menu . getClientProperty ( "platform" )) ) {
1601
1600
return menu ;
1602
1601
}
1603
1602
}
0 commit comments