preload data files

This commit is contained in:
Reinhard Pointner 2016-10-16 17:34:10 +08:00
parent 8c4c9a46ba
commit 9b13064e62
1 changed files with 7 additions and 15 deletions

View File

@ -44,7 +44,6 @@ import net.filebot.cli.ArgumentBean;
import net.filebot.cli.ArgumentProcessor;
import net.filebot.format.ExpressionFormat;
import net.filebot.mac.MacAppUtilities;
import net.filebot.media.MediaDetection;
import net.filebot.ui.FileBotMenuBar;
import net.filebot.ui.GettingStartedStage;
import net.filebot.ui.MainFrame;
@ -159,6 +158,13 @@ public class Main {
// preload media.types (when loaded during DnD it will freeze the UI for a few hundred milliseconds)
MediaTypes.getDefault();
// JavaFX is used for ProgressMonitor and GettingStartedDialog
try {
initJavaFX();
} catch (Throwable e) {
log.log(Level.SEVERE, "Failed to initialize JavaFX. Please install JavaFX.", e);
}
// check if application help should be shown
if (!"skip".equals(System.getProperty("application.help"))) {
try {
@ -176,20 +182,6 @@ public class Main {
debug.log(Level.WARNING, "Failed to check for updates", e);
}
}
// JavaFX is used for ProgressMonitor and GettingStartedDialog
try {
initJavaFX();
} catch (Throwable e) {
log.log(Level.SEVERE, "Failed to initialize JavaFX. Please install JavaFX.", e);
}
// preload data files
try {
MediaDetection.warmupCachedResources();
} catch (Throwable e) {
debug.log(Level.WARNING, "Failed cache resources", e);
}
}
private static void startUserInterface(ArgumentBean args) {