X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Ftui%2FTuiLauncherJexer.java;fp=src%2Fbe%2Fnikiroo%2Fjvcard%2Ftui%2FTuiLauncherJexer.java;h=b79488cdd00601ef7db46bf55827f580c1eddef9;hp=445fc787895543a3ec9485436f35dc513181e847;hb=c8398c23a885b1b7b78fba35a423c7136fb975cf;hpb=10dd1e387d6a1834596ae70f48cf905d7b302131 diff --git a/src/be/nikiroo/jvcard/tui/TuiLauncherJexer.java b/src/be/nikiroo/jvcard/tui/TuiLauncherJexer.java index 445fc78..b79488c 100644 --- a/src/be/nikiroo/jvcard/tui/TuiLauncherJexer.java +++ b/src/be/nikiroo/jvcard/tui/TuiLauncherJexer.java @@ -4,8 +4,9 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.List; +import jexer.TAction; import jexer.TApplication; -import jexer.TWindow; +import be.nikiroo.jvcard.tui.windows.TuiBrowserWindow; import be.nikiroo.jvcard.tui.windows.TuiFileListWindow; /** @@ -14,6 +15,10 @@ import be.nikiroo.jvcard.tui.windows.TuiFileListWindow; * @author niki */ public class TuiLauncherJexer extends TApplication { + /** + * Application is in fullscreen mode, no windows. + */ + static public final boolean FULLSCREEN = true; /** * @param textMode @@ -30,8 +35,28 @@ public class TuiLauncherJexer extends TApplication { addFileMenu(); addWindowMenu(); - @SuppressWarnings("unused") - TWindow w = new TuiFileListWindow(this, files); + // TODO investigate why that is + if (backend(textMode) == BackendType.SWING) { + new Thread(new Runnable() { + @Override + public void run() { + showMainWindow(files); + } + }).start(); + } else { + showMainWindow(files); + } + } + + private void showMainWindow(final List files) { + TuiBrowserWindow main = new TuiFileListWindow(TuiLauncherJexer.this, + files); + main.addCloseListener(new TAction() { + @Override + public void DO() { + TuiLauncherJexer.this.exit(false); + } + }); } /**