@@ -1383,7 +1383,7 @@ public void rebuildRecentBoardsMenu() throws Exception {
1383
1383
buttonGroupsMap ,
1384
1384
board , board .getContainerPlatform (), board .getContainerPlatform ().getContainerPackage ());
1385
1385
boardMenu .insert (item , 3 );
1386
- item .setAccelerator (KeyStroke .getKeyStroke ('0 ' + index ,
1386
+ item .setAccelerator (KeyStroke .getKeyStroke ('1 ' + index ,
1387
1387
Toolkit .getDefaultToolkit ().getMenuShortcutKeyMask () |
1388
1388
ActionEvent .SHIFT_MASK ));
1389
1389
recentBoardsButtonGroup .add (item );
@@ -1528,18 +1528,14 @@ public void actionPerformed(ActionEvent actionevent) {
1528
1528
}
1529
1529
}
1530
1530
1531
- menuItemsToClickAfterStartup = new LinkedList <>();
1531
+ List < JMenuItem > _menuItemsToClickAfterStartup = new LinkedList <>();
1532
1532
boardsButtonGroup = new ButtonGroup ();
1533
1533
recentBoardsButtonGroup = new ButtonGroup ();
1534
1534
buttonGroupsMap = new HashMap <>();
1535
1535
1536
- if (BaseNoGui .getRecentlyUsedBoards () != null ) {
1537
- JMenuItem recentLabel = new JMenuItem (tr ("Recently used boards" ));
1538
- recentLabel .setEnabled (false );
1539
- boardMenu .add (recentLabel );
1540
- rebuildRecentBoardsMenu ();
1541
- //rebuildRecentBoardsMenu(null);
1542
- }
1536
+ JMenuItem recentLabel = new JMenuItem (tr ("Recently used boards" ));
1537
+ recentLabel .setEnabled (false );
1538
+ boardMenu .add (recentLabel );
1543
1539
1544
1540
// Cycle through all packages
1545
1541
for (TargetPackage targetPackage : BaseNoGui .packages .values ()) {
@@ -1561,7 +1557,7 @@ public void actionPerformed(ActionEvent actionevent) {
1561
1557
for (TargetBoard board : targetPlatform .getBoards ().values ()) {
1562
1558
if (board .getPreferences ().get ("hide" ) != null )
1563
1559
continue ;
1564
- JMenuItem item = createBoardMenusAndCustomMenus (boardsCustomMenus , menuItemsToClickAfterStartup ,
1560
+ JMenuItem item = createBoardMenusAndCustomMenus (boardsCustomMenus , _menuItemsToClickAfterStartup ,
1565
1561
buttonGroupsMap ,
1566
1562
board , targetPlatform , targetPackage );
1567
1563
boardMenu .add (item );
@@ -1570,14 +1566,16 @@ public void actionPerformed(ActionEvent actionevent) {
1570
1566
}
1571
1567
}
1572
1568
1573
- if (menuItemsToClickAfterStartup .isEmpty ()) {
1574
- menuItemsToClickAfterStartup .add (selectFirstEnabledMenuItem (boardMenu ));
1569
+ if (_menuItemsToClickAfterStartup .isEmpty ()) {
1570
+ _menuItemsToClickAfterStartup .add (selectFirstEnabledMenuItem (boardMenu ));
1575
1571
}
1576
1572
1577
- for (JMenuItem menuItemToClick : menuItemsToClickAfterStartup ) {
1573
+ for (JMenuItem menuItemToClick : _menuItemsToClickAfterStartup ) {
1578
1574
menuItemToClick .setSelected (true );
1579
1575
menuItemToClick .getAction ().actionPerformed (new ActionEvent (this , -1 , "" ));
1580
1576
}
1577
+
1578
+ menuItemsToClickAfterStartup = _menuItemsToClickAfterStartup ;
1581
1579
}
1582
1580
1583
1581
private String getPlatformUniqueId (TargetPlatform platform ) {
0 commit comments