return;
}
if (!checkPreUploadConditions(layer, apiData))
return;
final UploadDialog dialog = UploadDialog.getUploadDialog();
// If we simply set the changeset comment here, it would be
// overridden by subsequent events in EDT that are caused by
// dialog creation. The current solution is to queue this operation
// after these events.
// TODO: find better way to initialize the comment field
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
final HashMap<String, String> tags = new HashMap<>(layer.data.getChangeSetTags());
if (!tags.containsKey("source")) {
tags.put("source", dialog.getLastChangesetSourceFromHistory());
}
if (!tags.containsKey("comment")) {
tags.put("comment", dialog.getLastChangesetCommentFromHistory());
}
dialog.setDefaultChangesetTags(tags);
}
});
dialog.setUploadedPrimitives(apiData);
dialog.setVisible(true);
if (dialog.isCanceled())
return;
dialog.rememberUserInput();
for (UploadHook hook : lateUploadHooks) {
if (!hook.checkUpload(apiData))
return;
}