summaryrefslogtreecommitdiff
path: root/src/cuchaz/enigma/gui/Gui.java
diff options
context:
space:
mode:
authorGravatar jeff2014-08-28 10:43:48 -0400
committerGravatar jeff2014-08-28 10:43:48 -0400
commit3301d00ab1df7a0f88985d143787f9f3c2283e38 (patch)
tree4d1cbdafb4918966073d673f9c1349004d0ae3ee /src/cuchaz/enigma/gui/Gui.java
parentadded checks to find buggy mappings (diff)
downloadenigma-fork-3301d00ab1df7a0f88985d143787f9f3c2283e38.tar.gz
enigma-fork-3301d00ab1df7a0f88985d143787f9f3c2283e38.tar.xz
enigma-fork-3301d00ab1df7a0f88985d143787f9f3c2283e38.zip
added crash reporter
Diffstat (limited to 'src/cuchaz/enigma/gui/Gui.java')
-rw-r--r--src/cuchaz/enigma/gui/Gui.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/cuchaz/enigma/gui/Gui.java b/src/cuchaz/enigma/gui/Gui.java
index 3dcb4e2..e357382 100644
--- a/src/cuchaz/enigma/gui/Gui.java
+++ b/src/cuchaz/enigma/gui/Gui.java
@@ -28,6 +28,7 @@ import java.awt.event.WindowAdapter;
28import java.awt.event.WindowEvent; 28import java.awt.event.WindowEvent;
29import java.io.File; 29import java.io.File;
30import java.io.IOException; 30import java.io.IOException;
31import java.lang.Thread.UncaughtExceptionHandler;
31import java.util.Collection; 32import java.util.Collection;
32import java.util.Collections; 33import java.util.Collections;
33import java.util.Comparator; 34import java.util.Comparator;
@@ -176,6 +177,22 @@ public class Gui
176 177
177 public Gui( ) 178 public Gui( )
178 { 179 {
180 // init frame
181 m_frame = new JFrame( Constants.Name );
182 final Container pane = m_frame.getContentPane();
183 pane.setLayout( new BorderLayout() );
184
185 // install a global exception handler to the event thread
186 CrashDialog.init( m_frame );
187 Thread.setDefaultUncaughtExceptionHandler( new UncaughtExceptionHandler( )
188 {
189 @Override
190 public void uncaughtException( Thread thread, Throwable ex )
191 {
192 CrashDialog.show( ex );
193 }
194 } );
195
179 m_controller = new GuiController( this ); 196 m_controller = new GuiController( this );
180 197
181 // init file choosers 198 // init file choosers
@@ -184,11 +201,6 @@ public class Gui
184 m_exportFileChooser = new JFileChooser(); 201 m_exportFileChooser = new JFileChooser();
185 m_exportFileChooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY ); 202 m_exportFileChooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY );
186 203
187 // init frame
188 m_frame = new JFrame( Constants.Name );
189 final Container pane = m_frame.getContentPane();
190 pane.setLayout( new BorderLayout() );
191
192 // init obfuscated classes list 204 // init obfuscated classes list
193 m_obfClasses = new JList<String>(); 205 m_obfClasses = new JList<String>();
194 m_obfClasses.setSelectionMode( ListSelectionModel.SINGLE_SELECTION ); 206 m_obfClasses.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );