System.exit(1);
}
}
ConfigurationFileResource backup_resource = new ConfigurationFileResource(DEFAULT_CONFIGFILE);
ConfigurationResource empty_resource = new ConfigurationDefaultResource();
Messenger reporter = new MessageReporterDialog();
EditorConfig cfg = readEditorConfig(reporter);
if (cfgfile == null)
cfgfile = cfg.getWorkingFile();
Configuration pipesetup = null;
boolean file_modified = false;
if (cfgfile != null && cfg.getWorkingFile() != null && cfgfile.equals(cfg.getWorkingFile()) && DEFAULT_CONFIGFILE.lastModified() > cfgfile.lastModified())
{
int recover = JOptionPane.showConfirmDialog(null,
"There may be unsaved changes to this file. Try to recover?",
"Recover",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (recover == JOptionPane.YES_OPTION)
{
try {
pipesetup = backup_resource.read();
file_modified = true;
} catch (Throwable e) {
}
}
}
if (pipesetup == null && cfgfile != null)
pipesetup = parseConfigurationFile(cfg, cfgfile, reporter);
if (pipesetup == null)
{
try {
pipesetup = backup_resource.read();
} catch (Throwable e) {
e.printStackTrace();
reporter.warn("Unable to load backup pipeline setup: "+e.getMessage());
}
}
if (pipesetup == null)
{
try {
pipesetup = empty_resource.read();
} catch (Throwable e) {
reporter.warn("Unable to load empty pipeline setup: "+e.toString());
}
}