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:
parent
dcb08b005b
commit
0691153b51
@ -91,11 +91,20 @@ public class CurrentRocket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void saveOpenRocketDocument() throws IOException {
|
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();
|
OpenRocketSaver saver = new OpenRocketSaver();
|
||||||
StorageOptions options = new StorageOptions();
|
StorageOptions options = new StorageOptions();
|
||||||
options.setCompressionEnabled(true);
|
options.setCompressionEnabled(true);
|
||||||
options.setSimulationTimeSkip(StorageOptions.SIMULATION_DATA_ALL);
|
options.setSimulationTimeSkip(StorageOptions.SIMULATION_DATA_ALL);
|
||||||
saver.save(new File(fileUri.getPath()),rocketDocument,options);
|
saver.save(new File(filename),rocketDocument,options);
|
||||||
isModified = false;
|
isModified = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user