1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-21 10:52:14 +01:00

Never leave programmers menu empty

When there are no programmers available for the current board, the
programmers menu would remain empty, which would prevent it from
unfolding and could make users think there was something wrong with the
menu.

Now, a disabled item with a message is added if no programmers are
available, which should make it more clear what is going on.

This is a followup for #9373.
This commit is contained in:
Matthijs Kooijman 2020-03-24 20:37:12 +01:00
parent a1d6da9dfe
commit e803061709

View File

@ -1696,6 +1696,12 @@ public class Base {
addProgrammersForPlatform(boardPlatform, programmerMenus, group); addProgrammersForPlatform(boardPlatform, programmerMenus, group);
if (corePlatform != null) if (corePlatform != null)
addProgrammersForPlatform(corePlatform, programmerMenus, group); addProgrammersForPlatform(corePlatform, programmerMenus, group);
if (programmerMenus.isEmpty()) {
JMenuItem item = new JMenuItem(tr("No programmers available for this board"));
item.setEnabled(false);
programmerMenus.add(item);
}
} }
public void addProgrammersForPlatform(TargetPlatform platform, List<JMenuItem> menus, ButtonGroup group) { public void addProgrammersForPlatform(TargetPlatform platform, List<JMenuItem> menus, ButtonGroup group) {