Makes sure extension is used when saving with FileDialog

This commit is contained in:
Jean-Denis Boivin
2017-02-11 17:05:54 -05:00
committed by GitHub
parent 85f7497c83
commit 1be6fbd1b7

View File

@@ -75,6 +75,13 @@ class FileDialog {
var path:String = cast result; var path:String = cast result;
// Makes sure the filename ends with extension
if (type == SAVE && filter != null && !StringTools.endsWith (path, "." + filter) ) {
path += "." + filter;
}
if (path != null) { if (path != null) {
onSelect.dispatch (path); onSelect.dispatch (path);
@@ -205,4 +212,4 @@ class FileDialog {
} }
} }