From bb20ce047a2e20866b9532c441c7433b1973ba5b Mon Sep 17 00:00:00 2001 From: gegy1000 Date: Sat, 23 Feb 2019 19:42:00 +0200 Subject: Fix #110 and remap indices with matched bridge method names --- .../java/cuchaz/enigma/gui/elements/MenuBar.java | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'src/main/java/cuchaz/enigma/gui/elements') diff --git a/src/main/java/cuchaz/enigma/gui/elements/MenuBar.java b/src/main/java/cuchaz/enigma/gui/elements/MenuBar.java index 14ad53d..d7be1a9 100644 --- a/src/main/java/cuchaz/enigma/gui/elements/MenuBar.java +++ b/src/main/java/cuchaz/enigma/gui/elements/MenuBar.java @@ -5,7 +5,6 @@ import cuchaz.enigma.config.Themes; import cuchaz.enigma.gui.Gui; import cuchaz.enigma.gui.dialog.AboutDialog; import cuchaz.enigma.gui.dialog.SearchDialog; -import cuchaz.enigma.throwables.MappingParseException; import cuchaz.enigma.translation.mapping.serde.MappingFormat; import javax.swing.*; @@ -68,15 +67,9 @@ public class MenuBar extends JMenuBar { openMenu.add(item); item.addActionListener(event -> { if (this.gui.enigmaMappingsFileChooser.showOpenDialog(this.gui.getFrame()) == JFileChooser.APPROVE_OPTION) { - try { - File selectedFile = this.gui.enigmaMappingsFileChooser.getSelectedFile(); - MappingFormat format = selectedFile.isDirectory() ? MappingFormat.ENIGMA_DIRECTORY : MappingFormat.ENIGMA_FILE; - this.gui.getController().openMappings(format, selectedFile.toPath()); - } catch (IOException ex) { - throw new Error(ex); - } catch (MappingParseException ex) { - JOptionPane.showMessageDialog(this.gui.getFrame(), ex.getMessage()); - } + File selectedFile = this.gui.enigmaMappingsFileChooser.getSelectedFile(); + MappingFormat format = selectedFile.isDirectory() ? MappingFormat.ENIGMA_DIRECTORY : MappingFormat.ENIGMA_FILE; + this.gui.getController().openMappings(format, selectedFile.toPath()); } }); this.openEnigmaMappingsMenu = item; @@ -87,13 +80,7 @@ public class MenuBar extends JMenuBar { this.gui.tinyMappingsFileChooser.setVisible(true); File file = new File(this.gui.tinyMappingsFileChooser.getDirectory() + File.separator + this.gui.tinyMappingsFileChooser.getFile()); if (file.exists()) { - try { - this.gui.getController().openMappings(MappingFormat.TINY_FILE, file.toPath()); - } catch (IOException ex) { - throw new Error(ex); - } catch (MappingParseException ex) { - JOptionPane.showMessageDialog(this.gui.getFrame(), ex.getMessage()); - } + this.gui.getController().openMappings(MappingFormat.TINY_FILE, file.toPath()); } }); this.openTinyMappingsMenu = item; -- cgit v1.2.3