X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2Fsearch%2FGenericDownloaderFunction.java;fp=tim%2Fprune%2Ffunction%2Fsearch%2FGenericDownloaderFunction.java;h=fa8d4c33d90bf43838f19f039d9b510226fccf51;hp=403a0efb69d28b7d8296ea71db65592edf5ccdf7;hb=92dad5df664287acb51728e9ea599f150765d34a;hpb=81843c3d8d0771bf00d0f26034a13aa515465c78 diff --git a/tim/prune/function/search/GenericDownloaderFunction.java b/tim/prune/function/search/GenericDownloaderFunction.java index 403a0ef..fa8d4c3 100644 --- a/tim/prune/function/search/GenericDownloaderFunction.java +++ b/tim/prune/function/search/GenericDownloaderFunction.java @@ -29,7 +29,7 @@ import tim.prune.function.gpsies.TrackListModel; /** * Function to load track information from any source, - * subclassed for special cases gpsies or wikipedia + * subclassed for special cases like gpsies, wikipedia or OSM */ public abstract class GenericDownloaderFunction extends GenericFunction implements Runnable { @@ -116,16 +116,18 @@ public abstract class GenericDownloaderFunction extends GenericFunction implemen if (!e.getValueIsAdjusting()) { final int numSelected = _trackTable.getSelectedRowCount(); + boolean foundUrl = false; if (numSelected > 0) { setDescription(_trackListModel.getTrack(_trackTable.getSelectedRow()).getDescription()); _descriptionBox.setCaretPosition(0); + foundUrl = _trackListModel.getTrack(_trackTable.getSelectedRow()).getWebUrl() != null; } else { _descriptionBox.setText(""); } _loadButton.setEnabled(numSelected > 0); - _showButton.setEnabled(numSelected == 1); + _showButton.setEnabled(numSelected == 1 && foundUrl); } } });