X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2FGpsPrune.java;h=dd907653c10eec569035e6074d6c90df3565862f;hb=88f2c3647ed9e055090484f01a959d4581f85e7d;hp=a444a02c9960b5fc41e35ebc245c9c914b0aa413;hpb=f1b92378a792131ac8fb33a869405851d5b2d1f7;p=GpsPrune.git diff --git a/tim/prune/GpsPrune.java b/tim/prune/GpsPrune.java index a444a02..dd90765 100644 --- a/tim/prune/GpsPrune.java +++ b/tim/prune/GpsPrune.java @@ -28,16 +28,16 @@ import tim.prune.gui.profile.ProfileChart; /** * GpsPrune is a tool to visualize, edit, convert and prune GPS data * Please see the included readme.txt or http://activityworkshop.net - * This software is copyright activityworkshop.net 2006-2011 and made available through the Gnu GPL version 2. + * This software is copyright activityworkshop.net 2006-2014 and made available through the Gnu GPL version 2. * For license details please see the included license.txt. * GpsPrune is the main entry point to the application, including initialisation and launch */ public class GpsPrune { /** Version number of application, used in about screen and for version check */ - public static final String VERSION_NUMBER = "13.4"; + public static final String VERSION_NUMBER = "16.3"; /** Build number, just used for about screen */ - public static final String BUILD_NUMBER = "244c"; + public static final String BUILD_NUMBER = "303c"; /** Static reference to App object */ private static App APP = null; @@ -87,7 +87,7 @@ public class GpsPrune { // Check if a data file has been given File f = new File(arg); - if (f.exists() && f.canRead()) { + if (f.exists() && f.isFile() && f.canRead()) { dataFiles.add(f); } else @@ -98,8 +98,9 @@ public class GpsPrune } } } - if (showUsage) { - System.out.println("Possible parameters:" + if (showUsage) + { + System.out.println("GpsPrune - a tool for editing GPS data.\nPossible parameters:" + "\n --configfile= used to specify a configuration file" + "\n --lang= used to specify language code such as DE" + "\n --langfile= used to specify an alternative language file\n"); @@ -233,6 +234,9 @@ public class GpsPrune } catch (Exception e) {} // ignore + // Set up drag-and-drop handler to accept dropped files + frame.setTransferHandler(new FileDropHandler(APP)); + // finish off and display frame frame.pack(); frame.setSize(650, 450); @@ -258,8 +262,11 @@ public class GpsPrune private static String makeUnknownParameterString(String inParam) { File file = new File(inParam); - if (file.exists()) { - return (file.canRead() ? "Something wrong with file" : "Cannot read file") + " '" + inParam + "'"; + if (file.exists()) + { + if (file.isDirectory()) return "'" + inParam + "' is a directory"; + if (!file.canRead()) return "Cannot read file '" + inParam + "'"; + return "Something wrong with file '" + inParam + "'"; } do {