Modify

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)

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

Download all attachments as: .zip

Change History (3)

comment:1 by Don-vip, 9 years ago

Milestone: 16.02

comment:2 by Don-vip, 9 years ago

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
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.