@@ -1367,7 +1367,7 @@ public void rebuildRecentBoardsMenu() throws Exception {
1367
1367
buttonGroupsMap ,
1368
1368
board , board .getContainerPlatform (), board .getContainerPlatform ().getContainerPackage ());
1369
1369
boardMenu .insert (item , 3 );
1370
- item .setAccelerator (KeyStroke .getKeyStroke ('0 ' + index ,
1370
+ item .setAccelerator (KeyStroke .getKeyStroke ('1 ' + index ,
1371
1371
Toolkit .getDefaultToolkit ().getMenuShortcutKeyMask () |
1372
1372
ActionEvent .SHIFT_MASK ));
1373
1373
recentBoardsButtonGroup .add (item );
@@ -1513,18 +1513,14 @@ public void actionPerformed(ActionEvent actionevent) {
1513
1513
boardsCustomMenus .add (customMenu );
1514
1514
}
1515
1515
1516
- menuItemsToClickAfterStartup = new LinkedList <>();
1516
+ List < JMenuItem > _menuItemsToClickAfterStartup = new LinkedList <>();
1517
1517
boardsButtonGroup = new ButtonGroup ();
1518
1518
recentBoardsButtonGroup = new ButtonGroup ();
1519
1519
buttonGroupsMap = new HashMap <>();
1520
1520
1521
- if (BaseNoGui .getRecentlyUsedBoards () != null ) {
1522
- JMenuItem recentLabel = new JMenuItem (tr ("Recently used boards" ));
1523
- recentLabel .setEnabled (false );
1524
- boardMenu .add (recentLabel );
1525
- rebuildRecentBoardsMenu ();
1526
- //rebuildRecentBoardsMenu(null);
1527
- }
1521
+ JMenuItem recentLabel = new JMenuItem (tr ("Recently used boards" ));
1522
+ recentLabel .setEnabled (false );
1523
+ boardMenu .add (recentLabel );
1528
1524
1529
1525
// Cycle through all packages
1530
1526
for (TargetPackage targetPackage : BaseNoGui .packages .values ()) {
@@ -1546,7 +1542,7 @@ public void actionPerformed(ActionEvent actionevent) {
1546
1542
for (TargetBoard board : targetPlatform .getBoards ().values ()) {
1547
1543
if (board .getPreferences ().get ("hide" ) != null )
1548
1544
continue ;
1549
- JMenuItem item = createBoardMenusAndCustomMenus (boardsCustomMenus , menuItemsToClickAfterStartup ,
1545
+ JMenuItem item = createBoardMenusAndCustomMenus (boardsCustomMenus , _menuItemsToClickAfterStartup ,
1550
1546
buttonGroupsMap ,
1551
1547
board , targetPlatform , targetPackage );
1552
1548
boardMenu .add (item );
@@ -1555,14 +1551,16 @@ public void actionPerformed(ActionEvent actionevent) {
1555
1551
}
1556
1552
}
1557
1553
1558
- if (menuItemsToClickAfterStartup .isEmpty ()) {
1559
- menuItemsToClickAfterStartup .add (selectFirstEnabledMenuItem (boardMenu ));
1554
+ if (_menuItemsToClickAfterStartup .isEmpty ()) {
1555
+ _menuItemsToClickAfterStartup .add (selectFirstEnabledMenuItem (boardMenu ));
1560
1556
}
1561
1557
1562
- for (JMenuItem menuItemToClick : menuItemsToClickAfterStartup ) {
1558
+ for (JMenuItem menuItemToClick : _menuItemsToClickAfterStartup ) {
1563
1559
menuItemToClick .setSelected (true );
1564
1560
menuItemToClick .getAction ().actionPerformed (new ActionEvent (this , -1 , "" ));
1565
1561
}
1562
+
1563
+ menuItemsToClickAfterStartup = _menuItemsToClickAfterStartup ;
1566
1564
}
1567
1565
1568
1566
private JRadioButtonMenuItem createBoardMenusAndCustomMenus (
0 commit comments