Commit 6aaf2124 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/modules/Common/Form/Buttons/FileChooserButton): better file handling

parent 80f964b2
...@@ -71,16 +71,24 @@ TextField { ...@@ -71,16 +71,24 @@ TextField {
id: fileDialog id: fileDialog
folder: { folder: {
if (!textField.selectedFile.length) { var selectedFile = textField.selectedFile
if (!selectedFile.length) {
return '' return ''
} }
return Utils.getUriFromSystemPath(Utils.dirname(textField.selectedFile)) return Utils.getUriFromSystemPath(
textField.selectFolder
? selectedFile
: Utils.dirname(selectedFile)
)
} }
onAccepted: { onAccepted: {
textField.selectedFile = Utils.getSystemPathFromUri(fileUrl) var selectedFile = Utils.getSystemPathFromUri(fileUrl)
textField.accepted(textField.selectedFile)
textField.selectedFile = selectedFile
textField.accepted(selectedFile)
} }
onRejected: textField.rejected() onRejected: textField.rejected()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment