From baa15c73d0dd18be4e9cf3bf18a558139dd6cc73 Mon Sep 17 00:00:00 2001 From: Zoinkwiz <29153234+Zoinkwiz@users.noreply.github.com> Date: Tue, 14 Apr 2026 10:33:55 +0100 Subject: [PATCH] fix: Remove unneeded UI step --- .../maker/HelperConstructEditorPanel.java | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/src/main/java/com/questhelper/maker/HelperConstructEditorPanel.java b/src/main/java/com/questhelper/maker/HelperConstructEditorPanel.java index 3975b12ea..57312c55f 100644 --- a/src/main/java/com/questhelper/maker/HelperConstructEditorPanel.java +++ b/src/main/java/com/questhelper/maker/HelperConstructEditorPanel.java @@ -511,26 +511,6 @@ public final class HelperConstructEditorPanel extends JPanel return; } - Object[] options = {"Paste JSON", "Load JSON file...", "Cancel"}; - int sourceChoice = JOptionPane.showOptionDialog( - this, - "Choose import source:", - title, - JOptionPane.DEFAULT_OPTION, - JOptionPane.PLAIN_MESSAGE, - null, - options, - options[1]); - if (sourceChoice == 2 || sourceChoice == JOptionPane.CLOSED_OPTION) - { - return; - } - if (sourceChoice == 1) - { - importJsonFromFile(mode); - return; - } - JTextArea textArea = new JTextArea(14, 44); textArea.setLineWrap(true); textArea.setWrapStyleWord(true); @@ -564,25 +544,6 @@ public final class HelperConstructEditorPanel extends JPanel showImportResult(result); } - private void importJsonFromFile(HelperConstructManager.ImportMode mode) - { - JFileChooser fc = new JFileChooser(); - if (fc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) - { - return; - } - try - { - String json = Files.readString(fc.getSelectedFile().toPath()); - HelperConstructManager.ImportDraftResult result = helperConstructManager.importFromJson(json, mode); - showImportResult(result); - } - catch (IOException ex) - { - JOptionPane.showMessageDialog(this, ex.getMessage(), "Read failed", JOptionPane.ERROR_MESSAGE); - } - } - private void showImportResult(HelperConstructManager.ImportDraftResult result) { if (result.isSuccess())