X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;fp=src%2Fjexer%2FTApplication.java;h=28e35091ded6e1ef006190574e945c0426c41057;hb=21460f442b7b21d02c6f80290acd901d9c5a8a0b;hp=e2c3cd685f3cfd41674a49da97565b8e94b309d7;hpb=4941d2d6184cb5d59c2932411a40631db8b429d1;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index e2c3cd6..28e3509 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -808,13 +808,26 @@ public class TApplication implements Runnable { } // Load the help system - try { - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - helpFile = new HelpFile(); - helpFile.load(loader.getResourceAsStream("help.xml")); - } catch (Exception e) { - new TExceptionDialog(this, e); - } + invokeLater(new Runnable() { + /* + * This isn't the best solution. But basically if a TApplication + * subclass constructor throws and needs to use TExceptionDialog, + * it may end up at the bottom of the window stack with a bunch + * of modal windows on top of it if said constructors spawn their + * windows also via invokeLater(). But if they don't do that, + * and instead just conventionally construct their windows, then + * this exception dialog will end up on top where it should be. + */ + public void run() { + try { + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + helpFile = new HelpFile(); + helpFile.load(loader.getResourceAsStream("help.xml")); + } catch (Exception e) { + new TExceptionDialog(TApplication.this, e); + } + } + }); } // ------------------------------------------------------------------------ @@ -3417,6 +3430,9 @@ public class TApplication implements Runnable { */ public final TMenu addEditMenu() { TMenu editMenu = addMenu(i18n.getString("editMenuTitle")); + editMenu.addDefaultItem(TMenu.MID_UNDO, false); + editMenu.addDefaultItem(TMenu.MID_REDO, false); + editMenu.addSeparator(); editMenu.addDefaultItem(TMenu.MID_CUT, false); editMenu.addDefaultItem(TMenu.MID_COPY, false); editMenu.addDefaultItem(TMenu.MID_PASTE, false);