Modify

#6733 closed defect (fixed)

[patch] File Open dialog incorrectly accepts folder selection

Reported by: Don-vip Owned by: team
Priority: trivial Component: Core
Version: latest Keywords: JFileChooser
Cc:

Description (last modified by richlv)

The JOSM "File, Open" dialog accepts a folder as selected object(s) whereas only files are processed.
This prevents for example to paste a folder path in its file name text area in order to quickly display a folder's contents before selecting a specific file. Instead, the folder is selected by the JFileChooser and JOSM tries to read the folder contents.

Please find attached the patch.

Attachments (1)

patch.diff (657 bytes) - added by Don-vip 22 months ago.

Download all attachments as: .zip

Change History (9)

Changed 22 months ago by Don-vip

comment:1 Changed 22 months ago by stoecker

  • Resolution set to wontfix
  • Status changed from new to closed

The JOSM open file dialog accepts directories, as when a directory is selected it loads all images from it. This patch would destroy that feature.

comment:2 Changed 22 months ago by bastiK

It should probably also open all other files it finds in the folder, but this is a different issue.

comment:3 Changed 22 months ago by stoecker

I thought so also before, but whereas a lot of images is normal, e.g. loading a lot off GPX files surely kills josm, so I think current method is better :-)

comment:4 Changed 22 months ago by Don-vip

Could it be at least an internal property ? I don't care about this images autoloading, I personally select them all when I want to load all of them... But I definitely want to paste a folder's path in the text input field in order to display its contents without having to reach it by clicking all the way through the explorer :( It's really a non conventional usage to allow folder selection when you want to open files, I find this behaviour very disturbing.

comment:5 Changed 11 months ago by richlv

  • Description modified (diff)
  • Resolution wontfix deleted
  • Status changed from closed to reopened

reopening so this is not forgotten :)

if the entered text in the address/location field is a directory, josm should first display it's contents.

ability to open all files in a directory should be provided by selecting that directory in the file listing, then specifically 'opening' it.

reasoning :

  1. all other software does it that way :)
  2. usecase : i have directory where i store gps traces and images. so occasionally i want to quickly get to that location to open one gps trace. i enter the path, hit 'enter'... and josm tries to open some 20gb of images.

comment:6 Changed 11 months ago by AlfonZ

I found that using Ctrl+Enter instead of Enter does the trick (opening pasted folder for further selection, versus accepting that folder and searching for images within it).
I'm not sure if this works on all platforms though.

Identification: JOSM/1.5 (5405 SVN en)
Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) Client VM
Operating system: Windows XP

comment:7 Changed 11 months ago by bastiK

When integrating the AgPifoJ, I wasn't too comfortable with this either. I thought, that some people might have problems with double click and select a folder and click "open" as a workaround. This wouldn't work of course. But since there were no complaints for months, I left it this way.

However, in addition to the usability problems described by Don-vip, I noticed, that many people don't know the photo-mapping feature in JOSM. Or they have heard of it, but they have no idea how to actually load their photos into JOSM.

So my suggestion:

  • Apply the patch
  • Add an additional menu entry File > Import Photos..., that is the same as File > Open..., but restricted to images, and with the current recursive folder opening feature.

comment:8 Changed 10 months ago by Don-vip

  • Resolution set to fixed
  • Status changed from reopened to closed

In 5438/josm:

fix #6733 - File Open dialog incorrectly accepts folder selection

Major rework of how the JFileChooser are created in JOSM

  • Simple need: use DiskAccessAction.createAndOpenFileChooser methods
  • Complex need: use directly the new class JFileChooserManager

Concerning the directory selection for geottaged images, this is still possible via:

  • right-click on GPX layer -> Import Photos

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.