System.exit(1);
}
logger = LogController.getLogger(Main.class);
// 4) Load config
final ClientConfiguration config = ClientConfiguration.getInstance();
setDefaultLocale(config);
lang = ResourceBundle.getBundle("com/art/anette/client/ui/resources/lang");
// 5) Now that we i18n we can check some more issues.
if (!SystemTray.isSupported()) {
ProgressUtils.errorMessage(lang.getString("NoTray"));
System.exit(1);
}
if (!TimeZone.getDefault().useDaylightTime()) {
showTimezoneInfo(logger);
ProgressUtils.infoMessage(lang.getString("NoDaylightTime"));
}
if ("OpenJDK 64-Bit Server VM".equals(System.getProperty("java.vm.name"))) {
ProgressUtils.errorMessage(lang.getString("BadVM1"));
System.exit(1);
}
// 6) Install EDT Checker
if ("true".equals(System.getProperty("anetteCheckEDT", "true"))) {
RepaintManager.setCurrentManager(new CheckThreadViolationRepaintManager());
} else {
logger.info("Don't install EDT check by user request");
}
// 7) Install checker for slow event processing
if ("true".equals(System.getProperty("anetteCheckSlowEvents", "true"))) {
EventDispatchThreadHangMonitor.initMonitoring();
} else {
logger.info("Don't install check for slow event processing by user request");
}
// 8) Set the timezone
adjustTimezone(logger);
try {
NetworkControl.getInstance().initSSL();
} catch (SSLException ex) {
logger.severe("SSL Failure", ex);
ProgressUtils.errorMessage("SSLFailed");
System.exit(1);
}
final BasicController basicControl = BasicController.getInstance();
// nicht registriert oder eingeloggt
if ("".equals(config.getProperty("user.email")) || "".equals(config.getProperty("user.password"))) {
showWelcomeDialog(config, basicControl, "", "");
} else {
try {
final ProgressUtils.Monitor monitor = ProgressUtils.createProgress(lang.getString("ProgressLoggingIn"));
basicControl.login(new LoginRequest(config.getProperty("user.email"), config.getProperty("user.password")));
monitor.finish();
} catch (NetworkException ex) {
logger.warning("Connection Failure", ex);
ProgressUtils.errorMessage(lang.getString("ConnectionFailed"), ex.getMessage());
showWelcomeDialog(config, basicControl, config.getProperty("user.email"), config.getProperty("user.password"));
} catch (LoginFailedException ex) {
ProgressUtils.errorMessage(String.format(lang.getString("LoginFailed"), ex.getMessage()));
logger.info("Login Failure", ex);
showWelcomeDialog(config, basicControl, config.getProperty("user.email"), config.getProperty("user.password"));
}
}
// nun eingeloggt; starte Hauptfenster
if (basicControl.isLoggedIn()) {