If the filename doesn't end in .ork, append .ork to indicate the saved file is ork format. This application doesn't attempt to save Rocsim files.

This commit is contained in:
Kevin Ruland 2012-07-03 02:55:46 +00:00
parent dcb08b005b
commit 0691153b51

View File

@ -91,11 +91,20 @@ public class CurrentRocket {
}
public void saveOpenRocketDocument() throws IOException {
// Translate the fileUri if it happens to be a .rkt file.
String filename = fileUri.getPath();
if ( ! filename.endsWith(".ork") ) {
filename = filename.concat(".ork");
}
OpenRocketSaver saver = new OpenRocketSaver();
StorageOptions options = new StorageOptions();
options.setCompressionEnabled(true);
options.setSimulationTimeSkip(StorageOptions.SIMULATION_DATA_ALL);
saver.save(new File(fileUri.getPath()),rocketDocument,options);
saver.save(new File(filename),rocketDocument,options);
isModified = false;
}