mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 14:43:57 +01:00
Export Result and Save Backup handle no file selection (#3370)
* Export Result and Save Backup handle no file selection, New Point in curve not marked Endpoint * Revert endpoint defaullt change * Change to Option[File] from Save Dialog * Explicit no return from cases
This commit is contained in:
parent
bc79a24f53
commit
bb838624ce
@ -34,10 +34,14 @@ private class FileMenu() {
|
||||
initialDirectory = new File(Properties.userHome)
|
||||
initialFileName = "bitcoin-s-backup.zip"
|
||||
}
|
||||
val chosenFile = fileChooser.showSaveDialog(null)
|
||||
ConsoleCli.exec(ZipDataDir(chosenFile.toPath),
|
||||
GlobalData.consoleCliConfig)
|
||||
()
|
||||
val chosenFileOpt = Option(fileChooser.showSaveDialog(null))
|
||||
chosenFileOpt match {
|
||||
case Some(chosenFile) =>
|
||||
ConsoleCli.exec(ZipDataDir(chosenFile.toPath),
|
||||
GlobalData.consoleCliConfig)
|
||||
()
|
||||
case None => // User canceled in dialog
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,9 +124,13 @@ class DLCPane(glassPane: VBox)(implicit ec: ExecutionContext) {
|
||||
selectedExtensionFilter = txtExtensionFilter
|
||||
initialDirectory = new File(Properties.userHome)
|
||||
}
|
||||
val chosenFile = fileChooser.showSaveDialog(null)
|
||||
Files.write(chosenFile.toPath, resultTextArea.text.value.getBytes)
|
||||
()
|
||||
val chosenFileOpt = Option(fileChooser.showSaveDialog(null))
|
||||
chosenFileOpt match {
|
||||
case Some(chosenFile) =>
|
||||
Files.write(chosenFile.toPath, resultTextArea.text.value.getBytes)
|
||||
()
|
||||
case None => // User canceled in dialog
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user