From 6f96fb8a39cd8dadff3602eec8a26ed2a7d1fca8 Mon Sep 17 00:00:00 2001 From: activityworkshop Date: Thu, 10 Mar 2016 19:54:51 +0100 Subject: [PATCH] Version 18.3, February 2016 --- README.md | 2 +- tim/prune/GpsPrune.java | 43 +++++++++++++++++++++--- tim/prune/config/Config.java | 2 ++ tim/prune/copyright.txt | 2 +- tim/prune/function/SaveConfig.java | 7 ++++ tim/prune/lang/prune-texts_fr.properties | 12 +++++-- tim/prune/readme.txt | 15 ++++++--- tim/prune/save/GpxExporter.java | 13 ++++--- tim/prune/save/KmlExporter.java | 2 +- tim/prune/save/xml/XmlUtils.java | 2 +- 10 files changed, 79 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 373a992..0c5eb63 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,5 @@ GpsPrune is a map-based application for viewing, editing and converting coordina It's a cross-platform java application, and its home page is at http://gpsprune.activityworkshop.net . -Here on github you'll find all the sources from version 1 to the current version 18.2, and in the wiki at https://github.com/activityworkshop/GpsPrune/wiki there's the beginning of a translation effort for anyone to contribute. +Here on github you'll find all the sources from version 1 to the current version 18.3, and in the wiki at https://github.com/activityworkshop/GpsPrune/wiki there's the beginning of a translation effort for anyone to contribute. Currently just the Spanish translations are online, to see whether it's a workable idea or not. Please help with this if you can. diff --git a/tim/prune/GpsPrune.java b/tim/prune/GpsPrune.java index 3a112b5..2708fc0 100644 --- a/tim/prune/GpsPrune.java +++ b/tim/prune/GpsPrune.java @@ -36,9 +36,9 @@ import tim.prune.gui.profile.ProfileChart; public class GpsPrune { /** Version number of application, used in about screen and for version check */ - public static final String VERSION_NUMBER = "18.2"; + public static final String VERSION_NUMBER = "18.3"; /** Build number, just used for about screen */ - public static final String BUILD_NUMBER = "336a"; + public static final String BUILD_NUMBER = "336b"; /** Static reference to App object */ private static App APP = null; @@ -233,7 +233,7 @@ public class GpsPrune try { ArrayList icons = new ArrayList(); - String[] resolutions = {"_16", "_20", "_32", "_64", "_128"}; + String[] resolutions = {"_16", "_20", "_22", "_24", "_32", "_36", "_48", "_64", "_72", "_96", "_128"}; for (String r : resolutions) { icons.add(IconManager.getImageIcon(IconManager.WINDOW_ICON + r + ".png").getImage()); } @@ -255,7 +255,10 @@ public class GpsPrune // finish off and display frame frame.pack(); - frame.setSize(650, 450); + if (!setFrameBoundsFromConfig(frame)) + { + frame.setSize(650, 450); + } frame.setVisible(true); // Set position of map/profile splitter midSplit.setDividerLocation(0.75); @@ -270,6 +273,38 @@ public class GpsPrune APP.loadDataFiles(inDataFiles); } + + /** + * Set the frame bounds using the saved config setting + * @param inFrame frame to set the bounds of + * @return true on success + */ + private static boolean setFrameBoundsFromConfig(JFrame inFrame) + { + // Try to get bounds from config + String bounds = Config.getConfigString(Config.KEY_WINDOW_BOUNDS); + try + { + String[] boundValues = bounds.split("x"); + if (boundValues.length == 4) + { + int[] elems = new int[4]; + for (int i=0; i<4; i++) { + elems[i] = Integer.parseInt(boundValues[i]); + } + // Make sure width and height aren't stupid + elems[2] = Math.max(elems[2], 400); + elems[3] = Math.max(elems[3], 300); + inFrame.setBounds(elems[0], elems[1], elems[2], elems[3]); + return true; + } + } + catch (NullPointerException npe) {} // if no entry found in config + catch (NumberFormatException nfe) {} // if string couldn't be parsed + return false; + } + + /** * Try to guess whether it's a mistyped parameter or a mistyped filename * @param inParam command line argument diff --git a/tim/prune/config/Config.java b/tim/prune/config/Config.java index 8921332..d2d49c6 100644 --- a/tim/prune/config/Config.java +++ b/tim/prune/config/Config.java @@ -63,6 +63,8 @@ public abstract class Config public static final String KEY_MAPSOURCE_LIST = "prune.mapsourcelist"; /** Key for show map flag */ public static final String KEY_SHOW_MAP = "prune.showmap"; + /** Key for window position */ + public static final String KEY_WINDOW_BOUNDS = "prune.windowbounds"; /** Key for path to disk cache */ public static final String KEY_DISK_CACHE = "prune.diskcache"; /** Key for working online flag */ diff --git a/tim/prune/copyright.txt b/tim/prune/copyright.txt index f5bd232..e623180 100644 --- a/tim/prune/copyright.txt +++ b/tim/prune/copyright.txt @@ -1,4 +1,4 @@ -The source code of GpsPrune is copyright 2006-2015 activityworkshop.net +The source code of GpsPrune is copyright 2006-2016 activityworkshop.net and is distributed under the terms of the Gnu GPL version 2. Portions of the package jpeg.drew (if included in this package) were taken diff --git a/tim/prune/function/SaveConfig.java b/tim/prune/function/SaveConfig.java index 7d730d1..c229437 100644 --- a/tim/prune/function/SaveConfig.java +++ b/tim/prune/function/SaveConfig.java @@ -4,6 +4,7 @@ import java.awt.BorderLayout; import java.awt.Component; import java.awt.FlowLayout; import java.awt.GridLayout; +import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -158,6 +159,12 @@ public class SaveConfig extends GenericFunction */ private void saveConfig(File inSaveFile) { + // Set current window position in config + Rectangle currBounds = _app.getFrame().getBounds(); + String windowBounds = "" + currBounds.x + "x" + currBounds.y + "x" + + currBounds.width + "x" + currBounds.height; + Config.setConfigString(Config.KEY_WINDOW_BOUNDS, windowBounds); + // TODO: Check for null inSaveFile, then just call finish() ? FileOutputStream outStream = null; try diff --git a/tim/prune/lang/prune-texts_fr.properties b/tim/prune/lang/prune-texts_fr.properties index 5714803..6c0f2a2 100644 --- a/tim/prune/lang/prune-texts_fr.properties +++ b/tim/prune/lang/prune-texts_fr.properties @@ -368,9 +368,12 @@ dialog.gpsies.activity.motorbiking=Moto dialog.gpsies.activity.snowshoe=Raquette dialog.gpsies.activity.sailing=Volle dialog.gpsies.activity.skating=Skating +dialog.mapillary.nonefound=Aucun foto trouv\u00e9 dialog.wikipedia.column.name=Nom de l'article dialog.wikipedia.column.distance=Distance dialog.wikipedia.nonefound=Aucune points trouv\u00e9e +dialog.wikipedia.gallery=Galerie +dialog.geocaching.nonefound=Aucun g\u00e9ocaches trouv\u00e9e dialog.correlate.notimestamps=Les points n'ont pas d'indication de temps, il n'est pas possible de les corr\u00e9ler. dialog.correlate.nouncorrelatedphotos=Il n'y a pas de photos non-corr\u00e9l\u00e9es.\nVoulez-vous continuer ? dialog.correlate.nouncorrelatedaudios=Il n'y a pas d'audios non-corr\u00e9l\u00e9s.\nVoulez-vous continuer ? @@ -520,6 +523,8 @@ dialog.colourer.type.byvertspeed=Selon vitesse verticale dialog.colourer.type.bygradient=Selon la pente dialog.colourer.type.bydate=Selon la date dialog.colourer.maxcolours=Nombre de couleurs maximum +dialog.colourer.start=Couleur au d\u00e9but +dialog.colourer.end=Couleur \u00e0 la fin dialog.setlanguage.firstintro=Vous pouvez s\u00e9lectionner l'une des langues disponibles,

ou bien un fichier de langue \u00e0 utiliser. dialog.setlanguage.secondintro=Vous devez sauvegarder vos param\u00e8tres puis

red\u00e9marrer GpsPrune pour changer de langue. dialog.setlanguage.language=Langue @@ -572,7 +577,11 @@ dialog.weather.creditnotice=Ces donn\u00e9es sont fournies par openweathermap.or dialog.deletebydate.nodate=Sans horodatage dialog.deletebydate.column.keep=Garder dialog.deletebydate.column.delete=Supprimer +dialog.setaltitudetolerance.text.metres=Limite (m\u00e8tres) pour les petites diff\u00e9rences d'altitude +dialog.setaltitudetolerance.text.feet=Limite (pieds) pour les petites diff\u00e9rences d'altitude dialog.autoplay.duration=Dur\u00e9e (sec) +dialog.autoplay.usetimestamps=Utiliser information de temps +dialog.autoplay.rewind=Retour au d\u00e9but dialog.autoplay.pause=Pause dialog.autoplay.play=Jouer @@ -622,9 +631,8 @@ confirm.correlateaudios.multi=fichiers audio ont \u00e9t\u00e9 corr\u00e9l\u00e9 # Tips tip.title=Astuce tip.useamapcache=By setting up a disk cache (Pr\u00e9f\u00e9rences -> Enregistrer les cartes sur le disque)\nyou can speed up the display and reduce network traffic. -tip.learntimeparams=The results will be more accurate if you use\nTrace -> Learn time estimation parameters\non your recorded tracks. +tip.learntimeparams=The results will be more accurate if you use\nTrace -> Apprentissage de l'estimation\non your recorded tracks. tip.downloadsrtm=You can speed this up by calling\nEn ligne -> T\u00e9l\u00e9charger les donn\u00e9es SRTM\nto save the data in your map cache. -tip.usesrtmfor3d=This track doesn't have altitudes.\nYou can use the SRTM functions to get approximate\naltitudes for the 3d view. tip.manuallycorrelateone=En corr\u00e9lant manuellement au moins une photo, le d\u00e9calage de temps peut \u00eatre calcul\u00e9 pour vous. # Buttons diff --git a/tim/prune/readme.txt b/tim/prune/readme.txt index d9ff49f..e507292 100644 --- a/tim/prune/readme.txt +++ b/tim/prune/readme.txt @@ -1,11 +1,11 @@ -GpsPrune version 18.2 +GpsPrune version 18.3 ===================== GpsPrune is an application for viewing, editing and managing coordinate data from GPS systems, including format conversion, charting, 3d visualisation, audio and photo correlation, and online resource lookup. Full details can be found at http://gpsprune.activityworkshop.net/ -GpsPrune is copyright 2006-2015 activityworkshop.net and distributed under the terms of the Gnu GPL version 2. +GpsPrune is copyright 2006-2016 activityworkshop.net and distributed under the terms of the Gnu GPL version 2. You may freely use the software, and may help others to freely use it too. For further information on your rights and how they are protected, see the included license.txt file. @@ -17,7 +17,7 @@ Running ======= To run GpsPrune from the jar file, simply call it from a command prompt or shell: - java -jar gpsprune_18.2.jar + java -jar gpsprune_18.3.jar If the jar file is saved in a different directory, you will need to include the path. Depending on your system settings, you may be able to click or double-click on the jar file @@ -25,9 +25,16 @@ in a file manager window to execute it. A shortcut, menu item, alias, desktop i or other link can of course be made should you wish. To specify a language other than the default, use an additional parameter, eg: - java -jar gpsprune_18.2.jar --lang=DE + java -jar gpsprune_18.3.jar --lang=DE +New with version 18.3 +===================== +The following fixes and additions were made since version 18.2: + - Fix for saving track names and descriptions containing ampersands in xml formats (thanks, Joe!) + - Additional window icon sizes (thanks, Sebastic!) + - Remember window size + New with version 18.2 ===================== The following fixes and additions were made since version 18.1: diff --git a/tim/prune/save/GpxExporter.java b/tim/prune/save/GpxExporter.java index ff2c98f..9363616 100644 --- a/tim/prune/save/GpxExporter.java +++ b/tim/prune/save/GpxExporter.java @@ -347,11 +347,11 @@ public class GpxExporter extends GenericFunction implements Runnable final String gpxHeader = getGpxHeaderString(inGpxCachers); final boolean isVersion1_1 = (gpxHeader.toUpperCase().indexOf("GPX/1/1") > 0); inWriter.write(gpxHeader); - // Name field - String trackName = (inName != null && !inName.equals("")) ? inName : "GpsPruneTrack"; - writeNameAndDescription(inWriter, inName, inDesc, isVersion1_1); + // name and description + String trackName = (inName != null && !inName.equals("")) ? XmlUtils.fixCdata(inName) : "GpsPruneTrack"; + String desc = (inDesc != null && !inDesc.equals("")) ? XmlUtils.fixCdata(inDesc) : "Export from GpsPrune"; + writeNameAndDescription(inWriter, trackName, desc, isVersion1_1); - int i = 0; DataPoint point = null; final boolean exportTrackpoints = inSaveFlags[0]; final boolean exportWaypoints = inSaveFlags[1]; @@ -368,7 +368,7 @@ public class GpxExporter extends GenericFunction implements Runnable // Loop over waypoints final int numPoints = inInfo.getTrack().getNumPoints(); int numSaved = 0; - for (i=0; i=selStart && i<=selEnd)) @@ -423,7 +423,6 @@ public class GpxExporter extends GenericFunction implements Runnable private static void writeNameAndDescription(OutputStreamWriter inWriter, String inName, String inDesc, boolean inIsVersion1_1) throws IOException { - String desc = (inDesc != null && !inDesc.equals("")) ? inDesc : "Export from GpsPrune"; // Position of name and description fields needs to be different for GPX1.0 and GPX1.1 if (inIsVersion1_1) { @@ -439,7 +438,7 @@ public class GpxExporter extends GenericFunction implements Runnable } if (inIsVersion1_1) {inWriter.write('\t');} inWriter.write("\t"); - inWriter.write(desc); + inWriter.write(inDesc); inWriter.write("\n"); if (inIsVersion1_1) { diff --git a/tim/prune/save/KmlExporter.java b/tim/prune/save/KmlExporter.java index 1de5fad..bb1d5a3 100644 --- a/tim/prune/save/KmlExporter.java +++ b/tim/prune/save/KmlExporter.java @@ -483,7 +483,7 @@ public class KmlExporter extends GenericFunction implements Runnable inWriter.write("\n\t"); if (_descriptionField != null && _descriptionField.getText() != null && !_descriptionField.getText().equals("")) { - inWriter.write(_descriptionField.getText()); + inWriter.write(XmlUtils.fixCdata(_descriptionField.getText())); } else { inWriter.write("Export from GpsPrune"); diff --git a/tim/prune/save/xml/XmlUtils.java b/tim/prune/save/xml/XmlUtils.java index 3943d07..643ebb0 100644 --- a/tim/prune/save/xml/XmlUtils.java +++ b/tim/prune/save/xml/XmlUtils.java @@ -37,7 +37,7 @@ public abstract class XmlUtils // Remove all instances of end block result = result.replaceAll(CDATA_END, ""); // Now check whether cdata block is required - if (!XmlUtils.hasIllegalCharacter(result)) { + if (!hasIllegalCharacter(result)) { return result; } return CDATA_START + result + CDATA_END; -- 2.43.0