Opened 8 years ago

Closed 8 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:


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)

NativeFileChooserSetSelectedFile.patch (648 bytes) - added by kolesar 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by kolesar

comment:1 Changed 8 years ago by Don-vip

Milestone: 16.02

comment:2 Changed 8 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 9590/josm:

fix #12394 - native file chooser was empty when setSelectedFile existed (patch by kolesar)

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.