Modify

Opened 3 years ago

Closed 3 years ago

#12369 closed enhancement (fixed)

[patch] default extension for saving files read from preferences

Reported by: kolesar Owned by: team
Priority: normal Milestone: 16.02
Component: Core Version:
Keywords: Cc:

Description

Sometimes disk is almost full and I'm unable to save a huge dataset to a compressed .osm file. Of course I have to upgrade my disk to a larger one but that will be full again with uncompressed data. XML data compresses well, gzip does not take noticeable CPU time. Therefore I store my edits and traces compressed by gzip.

I have to type .osm.gz or gpx.gz extension into save dialog every time. This patch allows to set default extension at preferences:

    save.extension.osm
    save.extension.gpx

Default values are "osm" and "gpx", default compression can be set by changing them to "osm.gz" and "gpx.gz".

Note: osm and gpx file filters are different. There are three rows for osm (uncompressed, gzip and bzip2) and a single line for gpx (that has compressed variants). I did not modify this but note that they need unification.

I did not create user interface for these settings because there was no appropriate page for them in the preferences dialog. I have a recent lesson from ticket #12357 to not blow core with functions. These settings are hidden enough.

Attachments (3)

DefaultExtensionReadFromPreferences.patch (3.9 KB) - added by kolesar 3 years ago.
SaveExtensionOsmPreferences.patch (1.9 KB) - added by kolesar 3 years ago.
SaveExtensionCheckFileFilter.patch (796 bytes) - added by kolesar 3 years ago.

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by kolesar

comment:1 Changed 3 years ago by bastiK

Resolution: fixed
Status: newclosed

In 9461/josm:

applied #12369 - default extension for saving files read from preferences (patch by kolesar)

comment:2 Changed 3 years ago by bastiK

Thanks! The disadvantage of Einstein preferences is that only few people discover them. So we use it mainly in place of a hardcoded constant (as you did) or to offer continued support for a deprecated feature (i.e. make it hard to find on purpose).

comment:3 Changed 3 years ago by bastiK

Milestone: 16.02

comment:4 Changed 3 years ago by bastiK

In 9466/josm:

see #12370, see #12369 - fix problems with default file extension (patch by kolesar)
[patch] adapted osm file filter to other file types

comment:5 Changed 3 years ago by kolesar

Resolution: fixed
Status: closedreopened

Moved reading preferences from save action to construct. See #12454 that loads default values to Einstein preferences list before they were read by the action.

comment:6 Changed 3 years ago by bastiK

Could you update the patch?

Changed 3 years ago by kolesar

comment:7 Changed 3 years ago by kolesar

I have added a condition check to SaveActionBase for a situation that was handled before: create a new layer, draw something, set Swing file chooser, save layer, choose GeoJSON filter at the bottom of file chooser, give a name without extension. Tested version saves as GeoJSON with .geojson extension, versions that set custom extension for OSM layer save this file as OSM with given extension.

This case did not appear on native file chooser or when extension was given. Old versions worked because they did not supply an extension for saving OSM layer.

Attached fix that checks if default extension matches the selected file filter. If not, then uses the default extension of selected file filter. Please commit this patch together with SaveExtensionOsmPreferences.patch submitted a few days ago.

Changed 3 years ago by kolesar

comment:8 Changed 3 years ago by bastiK

Resolution: fixed
Status: reopenedclosed

In 9721/josm:

applied #12369 - default extension for saving files read from preferences: fixes (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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.