summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/gui/GuiController.java
diff options
context:
space:
mode:
authorGravatar gegy10002019-02-23 19:42:00 +0200
committerGravatar gegy10002019-02-23 19:42:00 +0200
commitbb20ce047a2e20866b9532c441c7433b1973ba5b (patch)
treeed9f5bd596e43a1fffeef0b174c5370c039a9b62 /src/main/java/cuchaz/enigma/gui/GuiController.java
parentTweak inheritance and implementation tree generation (diff)
downloadenigma-fork-bb20ce047a2e20866b9532c441c7433b1973ba5b.tar.gz
enigma-fork-bb20ce047a2e20866b9532c441c7433b1973ba5b.tar.xz
enigma-fork-bb20ce047a2e20866b9532c441c7433b1973ba5b.zip
Fix #110 and remap indices with matched bridge method names
Diffstat (limited to 'src/main/java/cuchaz/enigma/gui/GuiController.java')
-rw-r--r--src/main/java/cuchaz/enigma/gui/GuiController.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/GuiController.java b/src/main/java/cuchaz/enigma/gui/GuiController.java
index 45c6131..15211e0 100644
--- a/src/main/java/cuchaz/enigma/gui/GuiController.java
+++ b/src/main/java/cuchaz/enigma/gui/GuiController.java
@@ -32,6 +32,7 @@ import cuchaz.enigma.translation.representation.entry.MethodEntry;
32import cuchaz.enigma.utils.ReadableToken; 32import cuchaz.enigma.utils.ReadableToken;
33 33
34import javax.annotation.Nullable; 34import javax.annotation.Nullable;
35import javax.swing.*;
35import java.awt.event.ItemEvent; 36import java.awt.event.ItemEvent;
36import java.io.File; 37import java.io.File;
37import java.io.IOException; 38import java.io.IOException;
@@ -80,16 +81,22 @@ public class GuiController {
80 this.gui.onCloseJar(); 81 this.gui.onCloseJar();
81 } 82 }
82 83
83 public void openMappings(MappingFormat format, Path path) throws IOException, MappingParseException { 84 public void openMappings(MappingFormat format, Path path) {
84 EntryTree<EntryMapping> mappings = format.read(path); 85 ProgressDialog.runInThread(this.gui.getFrame(), progress -> {
85 deobfuscator.setMappings(mappings); 86 try {
87 EntryTree<EntryMapping> mappings = format.read(path, progress);
88 deobfuscator.setMappings(mappings, progress);
86 89
87 gui.setMappingsFile(path); 90 gui.setMappingsFile(path);
88 loadedMappingFormat = format; 91 loadedMappingFormat = format;
89 loadedMappingPath = path; 92 loadedMappingPath = path;
90 93
91 refreshClasses(); 94 refreshClasses();
92 refreshCurrentClass(); 95 refreshCurrentClass();
96 } catch (MappingParseException e) {
97 JOptionPane.showMessageDialog(this.gui.getFrame(), e.getMessage());
98 }
99 });
93 } 100 }
94 101
95 public void saveMappings(Path path) { 102 public void saveMappings(Path path) {