From d678b93449ce3897b9d291c807937f4b70b5e177 Mon Sep 17 00:00:00 2001 From: lantzelot-swe <75668734+lantzelot-swe@users.noreply.github.com> Date: Wed, 29 Dec 2021 22:59:30 +0100 Subject: [PATCH] feat: adds PCUAE wiki to help menu --- src/main/java/se/lantz/gui/MenuManager.java | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/java/se/lantz/gui/MenuManager.java b/src/main/java/se/lantz/gui/MenuManager.java index 477edc1..9eb77b6 100644 --- a/src/main/java/se/lantz/gui/MenuManager.java +++ b/src/main/java/se/lantz/gui/MenuManager.java @@ -119,6 +119,7 @@ public class MenuManager private JMenuItem installViceModeItem; private JMenuItem helpItem; + private JMenuItem pcuaeWikiItem; private JMenuItem aboutItem; private JMenuItem newVersionItem; @@ -237,6 +238,7 @@ public class MenuManager helpMenu = new JMenu("Help"); helpMenu.setMnemonic('H'); helpMenu.add(getHelpItem()); + helpMenu.add(getPcuaeWikiItem()); helpMenu.add(getCheckVersionItem()); helpMenu.add(getAboutItem()); } @@ -805,6 +807,28 @@ public class MenuManager }); return helpItem; } + + private JMenuItem getPcuaeWikiItem() + { + pcuaeWikiItem = new JMenuItem("PCUAE wiki"); + KeyStroke keyStrokeToImportGames = KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0); + pcuaeWikiItem.setAccelerator(keyStrokeToImportGames); + pcuaeWikiItem.setMnemonic('p'); + pcuaeWikiItem.addActionListener(e -> { + try + { + Desktop.getDesktop().browse(new URI("https://projectcarouselusb.online/help-2")); + } + catch (IOException | URISyntaxException ex) + { + JOptionPane.showMessageDialog(MainWindow.getInstance(), + "Could not open PCUAE wiki", + "Help missing", + JOptionPane.ERROR_MESSAGE); + } + }); + return pcuaeWikiItem; + } private JMenuItem getAboutItem() {