From 1be6fbd1b79ea7222bff3f588c83c6bc1c9e482d Mon Sep 17 00:00:00 2001 From: Jean-Denis Boivin Date: Sat, 11 Feb 2017 17:05:54 -0500 Subject: [PATCH] Makes sure extension is used when saving with FileDialog --- lime/ui/FileDialog.hx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lime/ui/FileDialog.hx b/lime/ui/FileDialog.hx index 26eb109b4..07aa6c1bf 100644 --- a/lime/ui/FileDialog.hx +++ b/lime/ui/FileDialog.hx @@ -75,6 +75,13 @@ class FileDialog { 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) { onSelect.dispatch (path); @@ -205,4 +212,4 @@ class FileDialog { } -} \ No newline at end of file +}