@@ -1357,7 +1357,7 @@ public void rebuildRecentBoardsMenu() throws Exception {
1357
1357
buttonGroupsMap ,
1358
1358
board , board .getContainerPlatform (), board .getContainerPlatform ().getContainerPackage ());
1359
1359
boardMenu .insert (item , 3 );
1360
- item .setAccelerator (KeyStroke .getKeyStroke ('0 ' + index ,
1360
+ item .setAccelerator (KeyStroke .getKeyStroke ('1 ' + index ,
1361
1361
Toolkit .getDefaultToolkit ().getMenuShortcutKeyMask () |
1362
1362
ActionEvent .SHIFT_MASK ));
1363
1363
recentBoardsButtonGroup .add (item );
@@ -1503,18 +1503,14 @@ public void actionPerformed(ActionEvent actionevent) {
1503
1503
boardsCustomMenus .add (customMenu );
1504
1504
}
1505
1505
1506
- menuItemsToClickAfterStartup = new LinkedList <>();
1506
+ List < JMenuItem > _menuItemsToClickAfterStartup = new LinkedList <>();
1507
1507
boardsButtonGroup = new ButtonGroup ();
1508
1508
recentBoardsButtonGroup = new ButtonGroup ();
1509
1509
buttonGroupsMap = new HashMap <>();
1510
1510
1511
- if (BaseNoGui .getRecentlyUsedBoards () != null ) {
1512
- JMenuItem recentLabel = new JMenuItem (tr ("Recently used boards" ));
1513
- recentLabel .setEnabled (false );
1514
- boardMenu .add (recentLabel );
1515
- rebuildRecentBoardsMenu ();
1516
- //rebuildRecentBoardsMenu(null);
1517
- }
1511
+ JMenuItem recentLabel = new JMenuItem (tr ("Recently used boards" ));
1512
+ recentLabel .setEnabled (false );
1513
+ boardMenu .add (recentLabel );
1518
1514
1519
1515
// Cycle through all packages
1520
1516
for (TargetPackage targetPackage : BaseNoGui .packages .values ()) {
@@ -1536,7 +1532,7 @@ public void actionPerformed(ActionEvent actionevent) {
1536
1532
for (TargetBoard board : targetPlatform .getBoards ().values ()) {
1537
1533
if (board .getPreferences ().get ("hide" ) != null )
1538
1534
continue ;
1539
- JMenuItem item = createBoardMenusAndCustomMenus (boardsCustomMenus , menuItemsToClickAfterStartup ,
1535
+ JMenuItem item = createBoardMenusAndCustomMenus (boardsCustomMenus , _menuItemsToClickAfterStartup ,
1540
1536
buttonGroupsMap ,
1541
1537
board , targetPlatform , targetPackage );
1542
1538
boardMenu .add (item );
@@ -1545,14 +1541,16 @@ public void actionPerformed(ActionEvent actionevent) {
1545
1541
}
1546
1542
}
1547
1543
1548
- if (menuItemsToClickAfterStartup .isEmpty ()) {
1549
- menuItemsToClickAfterStartup .add (selectFirstEnabledMenuItem (boardMenu ));
1544
+ if (_menuItemsToClickAfterStartup .isEmpty ()) {
1545
+ _menuItemsToClickAfterStartup .add (selectFirstEnabledMenuItem (boardMenu ));
1550
1546
}
1551
1547
1552
- for (JMenuItem menuItemToClick : menuItemsToClickAfterStartup ) {
1548
+ for (JMenuItem menuItemToClick : _menuItemsToClickAfterStartup ) {
1553
1549
menuItemToClick .setSelected (true );
1554
1550
menuItemToClick .getAction ().actionPerformed (new ActionEvent (this , -1 , "" ));
1555
1551
}
1552
+
1553
+ menuItemsToClickAfterStartup = _menuItemsToClickAfterStartup ;
1556
1554
}
1557
1555
1558
1556
private JRadioButtonMenuItem createBoardMenusAndCustomMenus (
0 commit comments