@@ -1367,7 +1367,7 @@ public void rebuildRecentBoardsMenu() throws Exception {
13671367 buttonGroupsMap ,
13681368 board , board .getContainerPlatform (), board .getContainerPlatform ().getContainerPackage ());
13691369 boardMenu .insert (item , 3 );
1370- item .setAccelerator (KeyStroke .getKeyStroke ('0 ' + index ,
1370+ item .setAccelerator (KeyStroke .getKeyStroke ('1 ' + index ,
13711371 Toolkit .getDefaultToolkit ().getMenuShortcutKeyMask () |
13721372 ActionEvent .SHIFT_MASK ));
13731373 recentBoardsButtonGroup .add (item );
@@ -1513,18 +1513,14 @@ public void actionPerformed(ActionEvent actionevent) {
15131513 boardsCustomMenus .add (customMenu );
15141514 }
15151515
1516- menuItemsToClickAfterStartup = new LinkedList <>();
1516+ List < JMenuItem > _menuItemsToClickAfterStartup = new LinkedList <>();
15171517 boardsButtonGroup = new ButtonGroup ();
15181518 recentBoardsButtonGroup = new ButtonGroup ();
15191519 buttonGroupsMap = new HashMap <>();
15201520
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 );
15281524
15291525 // Cycle through all packages
15301526 for (TargetPackage targetPackage : BaseNoGui .packages .values ()) {
@@ -1546,7 +1542,7 @@ public void actionPerformed(ActionEvent actionevent) {
15461542 for (TargetBoard board : targetPlatform .getBoards ().values ()) {
15471543 if (board .getPreferences ().get ("hide" ) != null )
15481544 continue ;
1549- JMenuItem item = createBoardMenusAndCustomMenus (boardsCustomMenus , menuItemsToClickAfterStartup ,
1545+ JMenuItem item = createBoardMenusAndCustomMenus (boardsCustomMenus , _menuItemsToClickAfterStartup ,
15501546 buttonGroupsMap ,
15511547 board , targetPlatform , targetPackage );
15521548 boardMenu .add (item );
@@ -1555,14 +1551,16 @@ public void actionPerformed(ActionEvent actionevent) {
15551551 }
15561552 }
15571553
1558- if (menuItemsToClickAfterStartup .isEmpty ()) {
1559- menuItemsToClickAfterStartup .add (selectFirstEnabledMenuItem (boardMenu ));
1554+ if (_menuItemsToClickAfterStartup .isEmpty ()) {
1555+ _menuItemsToClickAfterStartup .add (selectFirstEnabledMenuItem (boardMenu ));
15601556 }
15611557
1562- for (JMenuItem menuItemToClick : menuItemsToClickAfterStartup ) {
1558+ for (JMenuItem menuItemToClick : _menuItemsToClickAfterStartup ) {
15631559 menuItemToClick .setSelected (true );
15641560 menuItemToClick .getAction ().actionPerformed (new ActionEvent (this , -1 , "" ));
15651561 }
1562+
1563+ menuItemsToClickAfterStartup = _menuItemsToClickAfterStartup ;
15661564 }
15671565
15681566 private JRadioButtonMenuItem createBoardMenusAndCustomMenus (
0 commit comments