X-Git-Url: https://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Flauncher%2FMain.java;h=54238c8b86bf08e1fd872969e56d4f7aee6677ce;hb=e27d1404e9222796fb6097ab41cff873148b65c7;hp=6d552febfae8c16955cde0ad95480f32ef5bdc40;hpb=d459d7e12a3398344e021b1b12c94a8d647cb6c4;p=jvcard.git diff --git a/src/be/nikiroo/jvcard/launcher/Main.java b/src/be/nikiroo/jvcard/launcher/Main.java index 6d552fe..54238c8 100644 --- a/src/be/nikiroo/jvcard/launcher/Main.java +++ b/src/be/nikiroo/jvcard/launcher/Main.java @@ -15,6 +15,7 @@ import be.nikiroo.jvcard.Contact; import be.nikiroo.jvcard.Data; import be.nikiroo.jvcard.TypeInfo; import be.nikiroo.jvcard.launcher.CardResult.MergeCallback; +import be.nikiroo.jvcard.launcher.Optional.NotSupportedException; import be.nikiroo.jvcard.parsers.Format; import be.nikiroo.jvcard.remote.Command; import be.nikiroo.jvcard.remote.SimpleSocket; @@ -37,7 +38,7 @@ import be.nikiroo.jvcard.resources.enums.StringId; */ public class Main { static public final String APPLICATION_TITLE = "jVcard"; - static public final String APPLICATION_VERSION = "1.0-dev"; + static public final String APPLICATION_VERSION = "1.1-dev"; static private final int ERR_NO_FILE = 1; static private final int ERR_SYNTAX = 2; @@ -271,8 +272,11 @@ public class Main { } } - transService.updateFile(dir); // current lang TransBundle - new TransBundle().updateFile(dir); + new TransBundle().updateFile(dir); // default locale + for (String lang : TransBundle.getKnownLanguages()) { + new TransBundle(lang).updateFile(dir); + } + new ColorBundle().updateFile(dir); new DisplayBundle().updateFile(dir); new RemoteBundle().updateFile(dir); @@ -286,12 +290,12 @@ public class Main { case SERVER: { try { Optional.runServer(port); - } catch (Exception e) { - if (e instanceof IOException) { - ERR(StringId.CLI_ERR, StringId.CLI_ERR_CANNOT_START, - ERR_INTERNAL); - return; - } else if (e instanceof ClassNotFoundException) { + } catch (IOException e) { + ERR(StringId.CLI_ERR, StringId.CLI_ERR_CANNOT_START, + ERR_INTERNAL); + return; + } catch (NotSupportedException e) { + if (!e.isCompiledIn()) { ERR(StringId.CLI_ERR, StringId.CLI_ERR_NO_REMOTING, ERR_INTERNAL); return; @@ -392,12 +396,12 @@ public class Main { case CONTACT_MANAGER: { try { Optional.startTui(textMode, files); - } catch (Exception e) { - if (e instanceof IOException) { - ERR(StringId.CLI_ERR, StringId.CLI_ERR_CANNOT_START, - ERR_NO_FILE); - return; - } else if (e instanceof ClassNotFoundException) { + } catch (IOException e) { + ERR(StringId.CLI_ERR, StringId.CLI_ERR_CANNOT_START, + ERR_NO_FILE); + return; + } catch (NotSupportedException e) { + if (!e.isCompiledIn()) { ERR(StringId.CLI_ERR, StringId.CLI_ERR_NO_TUI, ERR_INTERNAL); return; } else { @@ -499,7 +503,7 @@ public class Main { } } catch (IOException ioe) { throw ioe; - } catch (Exception e) { + } catch (NotSupportedException e) { throw new IOException("Remoting support not available", e); }