@@ -1383,7 +1383,7 @@ public void rebuildRecentBoardsMenu() throws Exception {
13831383 buttonGroupsMap ,
13841384 board , board .getContainerPlatform (), board .getContainerPlatform ().getContainerPackage ());
13851385 boardMenu .insert (item , 3 );
1386- item .setAccelerator (KeyStroke .getKeyStroke ('0 ' + index ,
1386+ item .setAccelerator (KeyStroke .getKeyStroke ('1 ' + index ,
13871387 Toolkit .getDefaultToolkit ().getMenuShortcutKeyMask () |
13881388 ActionEvent .SHIFT_MASK ));
13891389 recentBoardsButtonGroup .add (item );
@@ -1528,18 +1528,14 @@ public void actionPerformed(ActionEvent actionevent) {
15281528 }
15291529 }
15301530
1531- menuItemsToClickAfterStartup = new LinkedList <>();
1531+ List < JMenuItem > _menuItemsToClickAfterStartup = new LinkedList <>();
15321532 boardsButtonGroup = new ButtonGroup ();
15331533 recentBoardsButtonGroup = new ButtonGroup ();
15341534 buttonGroupsMap = new HashMap <>();
15351535
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 );
15431539
15441540 // Cycle through all packages
15451541 for (TargetPackage targetPackage : BaseNoGui .packages .values ()) {
@@ -1561,7 +1557,7 @@ public void actionPerformed(ActionEvent actionevent) {
15611557 for (TargetBoard board : targetPlatform .getBoards ().values ()) {
15621558 if (board .getPreferences ().get ("hide" ) != null )
15631559 continue ;
1564- JMenuItem item = createBoardMenusAndCustomMenus (boardsCustomMenus , menuItemsToClickAfterStartup ,
1560+ JMenuItem item = createBoardMenusAndCustomMenus (boardsCustomMenus , _menuItemsToClickAfterStartup ,
15651561 buttonGroupsMap ,
15661562 board , targetPlatform , targetPackage );
15671563 boardMenu .add (item );
@@ -1570,14 +1566,16 @@ public void actionPerformed(ActionEvent actionevent) {
15701566 }
15711567 }
15721568
1573- if (menuItemsToClickAfterStartup .isEmpty ()) {
1574- menuItemsToClickAfterStartup .add (selectFirstEnabledMenuItem (boardMenu ));
1569+ if (_menuItemsToClickAfterStartup .isEmpty ()) {
1570+ _menuItemsToClickAfterStartup .add (selectFirstEnabledMenuItem (boardMenu ));
15751571 }
15761572
1577- for (JMenuItem menuItemToClick : menuItemsToClickAfterStartup ) {
1573+ for (JMenuItem menuItemToClick : _menuItemsToClickAfterStartup ) {
15781574 menuItemToClick .setSelected (true );
15791575 menuItemToClick .getAction ().actionPerformed (new ActionEvent (this , -1 , "" ));
15801576 }
1577+
1578+ menuItemsToClickAfterStartup = _menuItemsToClickAfterStartup ;
15811579 }
15821580
15831581 private String getPlatformUniqueId (TargetPlatform platform ) {
0 commit comments