Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1154 from MGlolenstine/master
Browse files Browse the repository at this point in the history
Added initialDirectory to chooseFile
  • Loading branch information
edvin authored Jan 30, 2020
2 parents 8e49230 + da04949 commit 3357cdc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/tornadofx/Dialogs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ enum class FileChooserMode { None, Single, Multi, Save }
*
* If the user cancels, the returnedfile list will be empty.
*/
fun chooseFile(title: String? = null, filters: Array<out FileChooser.ExtensionFilter>, mode: FileChooserMode = Single, owner: Window? = null, op: FileChooser.() -> Unit = {}): List<File> {
fun chooseFile(title: String? = null, filters: Array<out FileChooser.ExtensionFilter>, initialDirectory: File? = null, mode: FileChooserMode = Single, owner: Window? = null, op: FileChooser.() -> Unit = {}): List<File> {
val chooser = FileChooser()
if (title != null) chooser.title = title
chooser.extensionFilters.addAll(filters)
chooser.initialDirectory = initialDirectory
op(chooser)
return when (mode) {
Single -> {
Expand Down

0 comments on commit 3357cdc

Please sign in to comment.