File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1539,11 +1539,16 @@ public void actionPerformed(ActionEvent actionevent) {
1539
1539
@ SuppressWarnings ("serial" )
1540
1540
Action subAction = new AbstractAction (tr (boardCustomMenu .get (customMenuOption ))) {
1541
1541
public void actionPerformed (ActionEvent e ) {
1542
- PreferencesData .set ("custom_" + menuId , ((TargetBoard ) getValue ("board" )).getId () + "_" + getValue ("custom_menu_option" ));
1542
+ PreferencesData .set ("custom_" + menuId , ((List < TargetBoard > ) getValue ("board" )). get ( 0 ).getId () + "_" + getValue ("custom_menu_option" ));
1543
1543
onBoardOrPortChange ();
1544
1544
}
1545
1545
};
1546
- subAction .putValue ("board" , board );
1546
+ List <TargetBoard > boards = (List <TargetBoard >) subAction .getValue ("board" );
1547
+ if (boards == null ) {
1548
+ boards = new ArrayList <TargetBoard >();
1549
+ }
1550
+ boards .add (board );
1551
+ subAction .putValue ("board" , boards );
1547
1552
subAction .putValue ("custom_menu_option" , customMenuOption );
1548
1553
1549
1554
if (!buttonGroupsMap .containsKey (menuId )) {
@@ -1571,7 +1576,9 @@ private void filterVisibilityOfSubsequentBoardMenus(List<JMenu> boardsCustomMenu
1571
1576
JMenu menu = boardsCustomMenus .get (i );
1572
1577
for (int m = 0 ; m < menu .getItemCount (); m ++) {
1573
1578
JMenuItem menuItem = menu .getItem (m );
1574
- menuItem .setVisible (menuItem .getAction ().getValue ("board" ).equals (board ));
1579
+ for (TargetBoard t_board : (List <TargetBoard >)menuItem .getAction ().getValue ("board" )) {
1580
+ menuItem .setVisible (t_board .equals (board ));
1581
+ }
1575
1582
}
1576
1583
menu .setVisible (ifThereAreVisibleItemsOn (menu ));
1577
1584
You can’t perform that action at this time.
0 commit comments