Changeset 6532


Ignore:
Timestamp:
2004-01-16T15:49:47+13:00 (20 years ago)
Author:
jmt12
Message:

In a vain attempt to stop the 'modal warning dialog while exiting' bug, added a new data member to Gatherer to record any currently open dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r6392 r6532  
    5454import org.greenstone.gatherer.gui.Coloring;
    5555import org.greenstone.gatherer.gui.GUIManager;
     56import org.greenstone.gatherer.gui.ModalDialog;
    5657import org.greenstone.gatherer.gui.Splash;
    5758import org.greenstone.gatherer.gui.URLField;
     
    8889    static final private String SKIN_DEFINITION_FILE = "lib/greenaqua/greenaqua.xml";
    8990
     91    static public boolean always_show_exceptions = true;
    9092    /** Has the exit flag been set? <i>true</i> if so, <i>false</i> otherwise. */
    9193    public boolean exit = false;
     
    107109    /** A public reference to the Gatherer's configuration. */
    108110    static public Configuration config;
     111    /** The current modal dialog being shown on screen, if any. */
     112    static public ModalDialog current_modal = null;
    109113    /** A public reference to the Dictionary. */
    110114    static public Dictionary dictionary;
     
    474478    // Thanks to Walter Schatz from the java forums.
    475479    System.setProperty("java.util.prefs.syncInterval","2000000"); // One message every 600 hours!
     480
     481    // Override the exception handler with a new one which we can easily quiet the exceptions from.
     482    System.setProperty("sun.awt.exception.handler", "GLIExceptionHandler");
    476483
    477484    // Ensure platform specific LAF
     
    11111118    }
    11121119    }
     1120
     1121    static public class GLIExceptionHandler {
     1122    public void handle(Throwable thrown) {
     1123        if(always_show_exceptions || debug != null) {
     1124        thrown.printStackTrace();
     1125        }
     1126    }
     1127    }
    11131128}
Note: See TracChangeset for help on using the changeset viewer.