Opened 9 years ago
Closed 9 years ago
#12394 closed defect (fixed)
[patch] native file chooser was empty when setSelectedFile existed
Reported by: | kolesar | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 16.02 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
Native file chooser behaved differently from Swing file chooser. When setSelectedFile was called with a filename that already existed it was displaying with no selected directory.
This affected #12392 that offered default filename for saving and was working fine with Swing file chooser. Also affected MapPaintDialog save function that did the same. In tested JOSM version you can check this bug by saving a style using suggested filename and then saving it again. Second time (when file created last time still exists) dialog is empty.
NativeFileChooser.setSelectedFile() called .setDirectory(file.getAbsolutePath())
but this path still contained the file name that confused java.awt.FileDialog. Replaced with .setDirectory(file.getParent())
that gives path without filename.
Also made setSelectedFile(File file) null-safe similar to Swing method.
Attachments (1)
Change History (3)
by , 9 years ago
Attachment: | NativeFileChooserSetSelectedFile.patch added |
---|
comment:1 by , 9 years ago
Milestone: | → 16.02 |
---|
comment:2 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In 9590/josm: