Skip to content

Commit

Permalink
FileChooser: Fix user-entered-filename case.
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjon3377 committed Oct 18, 2020
1 parent 132dfc1 commit 32300c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/lovelace/util/jvm/FileChooser.ceylon
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ shared class FileChooser {
if (nonempty retval) {
log.trace("Saving the file(s) the user chose via Swing");
storedFile = retval;
} else if (exists selectedFile = chooser.selectedFile) {
log.trace("Saving the singular file the user chose via Swing");
storedFile = Singleton(fileToPath(selectedFile));
} else {
log.info("User pressed approve but selected no files");
storedFile = null;
Expand All @@ -189,6 +192,9 @@ shared class FileChooser {
if (nonempty retval) {
log.trace("Saving the file(s) the user chose via AWT");
storedFile = retval;
} else if (exists selectedFile = chooser.file) {
log.trace("Saving the singular file the user chose via AWT");
storedFile = Singleton(PathWrapper(selectedFile));
} else {
log.debug("User failed to choose?");
log.debug("Returned iterable was ``retval`` (``type(retval)``");
Expand Down

0 comments on commit 32300c5

Please sign in to comment.