From e803061709eff6b80c0b498ba69c5b12d563f820 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 24 Mar 2020 20:37:12 +0100 Subject: [PATCH] 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. --- app/src/processing/app/Base.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index f0ed1be3d..e9ddc9e42 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1696,6 +1696,12 @@ public class Base { addProgrammersForPlatform(boardPlatform, programmerMenus, group); if (corePlatform != null) 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 menus, ButtonGroup group) {