Skip to content

Commit e803061

Browse files
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.
1 parent a1d6da9 commit e803061

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: app/src/processing/app/Base.java

+6
Original file line numberDiff line numberDiff line change
@@ -1696,6 +1696,12 @@ public void rebuildProgrammerMenu() {
16961696
addProgrammersForPlatform(boardPlatform, programmerMenus, group);
16971697
if (corePlatform != null)
16981698
addProgrammersForPlatform(corePlatform, programmerMenus, group);
1699+
1700+
if (programmerMenus.isEmpty()) {
1701+
JMenuItem item = new JMenuItem(tr("No programmers available for this board"));
1702+
item.setEnabled(false);
1703+
programmerMenus.add(item);
1704+
}
16991705
}
17001706

17011707
public void addProgrammersForPlatform(TargetPlatform platform, List<JMenuItem> menus, ButtonGroup group) {

0 commit comments

Comments
 (0)