DownloadDialog.autostartIfNeeded();
}
private void handleAutosave() {
if (AutosaveTask.PROP_AUTOSAVE_ENABLED.get()) {
AutosaveTask autosaveTask = new AutosaveTask();
List<File> unsavedLayerFiles = autosaveTask.getUnsavedLayersFiles();
if (!unsavedLayerFiles.isEmpty()) {
ExtendedDialog dialog = new ExtendedDialog(
Main.parent,
tr("Unsaved osm data"),
new String[] {tr("Restore"), tr("Cancel"), tr("Discard")}
);
dialog.setContent(
trn("JOSM found {0} unsaved osm data layer. ",
"JOSM found {0} unsaved osm data layers. ", unsavedLayerFiles.size(), unsavedLayerFiles.size()) +
tr("It looks like JOSM crashed last time. Would you like to restore the data?"));
dialog.setButtonIcons(new String[] {"ok", "cancel", "dialogs/delete"});
int selection = dialog.showDialog().getValue();
if (selection == 1) {
autosaveTask.recoverUnsavedLayers();
} else if (selection == 3) {
autosaveTask.discardUnsavedLayers();
}
}
autosaveTask.schedule();
}
}