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