Skip to content

Commit

Permalink
Added an OK button on the languages download dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
hbitteur committed Jan 12, 2025
1 parent e84a0d6 commit 669e893
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import static org.audiveris.omr.text.tesseract.TesseractOCR.LANGUAGE_FILE_EXT;
import org.audiveris.omr.ui.GuiActions;
import org.audiveris.omr.ui.util.Panel;
import org.audiveris.omr.ui.util.UserOpt;

import org.jdesktop.application.Application;
import org.jdesktop.application.ResourceMap;
Expand Down Expand Up @@ -247,9 +248,25 @@ public DownloadDialog (List<GHContent> remoteContent,
framePane.setLayout(new BorderLayout());

final JPanel panel = defineLayout(remoteCodes);
framePane.add(new JScrollPane(panel), BorderLayout.WEST);

final JOptionPane optionPane = new JOptionPane(
new JScrollPane(panel),
JOptionPane.PLAIN_MESSAGE,
JOptionPane.DEFAULT_OPTION,
null,
new Object[] { UserOpt.OK });
optionPane.addPropertyChangeListener(e -> {
final Object choice = optionPane.getValue();
if (choice == UserOpt.Cancel || choice == UserOpt.OK) {
dialog.setVisible(false);
dialog.dispose();
}
});

resources.injectComponents(dialog);

dialog.setContentPane(optionPane);
dialog.pack();
}

private JPanel defineLayout (List<String> remoteCodes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Resources for Languages
# -----------------------

LanguagesFrame.title = Downloading OCR languages
LanguagesFrame.title = Download of OCR languages

Check.title = OCR languages
Check.message = <html>Your collection of languages is empty!\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Resources for Languages
# -----------------------

LanguagesFrame.title = T\u00e9l\u00e9chargement des langages OCR
LanguagesFrame.title = T\u00e9l\u00e9chargement de langages OCR

Check.title = Langages OCR
Check.message = <html>Votre collection de langages est vide !\
Expand Down

0 comments on commit 669e893

Please sign in to comment.