Logger.getLogger(Model.class.getName()).log(Level.SEVERE, null, ex);
}
startupDialogModel.setStartupModel(applicationSettings.getStartupModel());
splashScreenModel.setStage("Initializing DB...");
JavaDBDataSource.getInstance().initDB();
DownloadDAO dao = DAOFactory.getInstance().getDownloadDAO();
splashScreenModel.setStage("Loading Downloads...");
List<Download> downloads1 = new ArrayList<Download>();
List<UUID> ids = dao.getIds();
splashScreenModel.setCurrent(0);
splashScreenModel.setSize(ids.size());
for(UUID id : ids) {
splashScreenModel.setMessage("Loading " + id);
downloads1.add(dao.getDownload(id));
splashScreenModel.setCurrent(splashScreenModel.getCurrent() + 1);
}
downloads.addAll(downloads1);
downloadSaver = new DownloadSaver(downloads);
mainWindowModel.setDownloadSaver(downloadSaver);