From d56d9f5792fe30eb0657e685bf8c9b0f8bfc916d Mon Sep 17 00:00:00 2001 From: Jonathan Lovelace Date: Wed, 3 Jun 2020 21:29:06 -0400 Subject: [PATCH] NotesPanel: Beep when 'save' or 'revert' fails Due to there not being a current selection that can have notes. --- .../viewer/drivers/worker_mgmt/NotesPanel.ceylon | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/strategicprimer/viewer/drivers/worker_mgmt/NotesPanel.ceylon b/source/strategicprimer/viewer/drivers/worker_mgmt/NotesPanel.ceylon index f5b46e24d4..6d78ae95f9 100644 --- a/source/strategicprimer/viewer/drivers/worker_mgmt/NotesPanel.ceylon +++ b/source/strategicprimer/viewer/drivers/worker_mgmt/NotesPanel.ceylon @@ -23,6 +23,9 @@ import lovelace.util.common { as, silentListener } +import java.awt { + Toolkit +} final class NotesPanel extends BorderedPanel satisfies UnitMemberListener&PlayerChangeListener { JTextArea notesArea = JTextArea(); @@ -40,13 +43,17 @@ final class NotesPanel extends BorderedPanel satisfies UnitMemberListener&Player void saveNotes() { if (exists local = current) { local.notes[player] = notesArea.text.trimmed; - } // FIXME: Else beep + } else { + Toolkit.defaultToolkit.beep(); + } } notesApplyButton.addActionListener(silentListener(saveNotes)); void revertNotes() { if (exists local = current) { notesArea.text = local.notes.get(player) else ""; - } // FIXME: Else beep + } else { + Toolkit.defaultToolkit.beep(); + } } notesRevertButton.addActionListener(silentListener(revertNotes)); shared actual void memberSelected(UnitMember? previousSelection, UnitMember? selected) {