Skip to content

Commit

Permalink
Merge pull request #17 from pawlowska/create-acq-directory
Browse files Browse the repository at this point in the history
Create acq directory
  • Loading branch information
dscho committed May 8, 2015
2 parents add4ddf + 3eb9e3f commit 5513921
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/main/java/spim/SPIMAcquisition.java
Original file line number Diff line number Diff line change
Expand Up @@ -1712,8 +1712,20 @@ public int compare(File f1, File f2) {
output = new File(acqSaveDir.getText());

if(!output.isDirectory()) {
JOptionPane.showMessageDialog(null, "You must specify a directory.");
return;
int result = JOptionPane.showConfirmDialog(null,
"The specified root directory does not exist. Create it?", "Directory not found.",
JOptionPane.YES_NO_OPTION);
if (result == JOptionPane.YES_OPTION) {
output.mkdirs();
if (!output.canWrite()) {
ReportingUtils.showError(
"Unable to save data to selected location: check that location exists.\nAcquisition canceled.");
return;
}
} else {
ReportingUtils.showMessage("Acquisition canceled.");
return;
}
}

if(output.list().length != 0) {
Expand Down

0 comments on commit 5513921

Please sign in to comment.