FIXUP: Don't show preview data sets when expert mode is not checked

This fixes #99.

This also changes the default classpath for the JRE, so that it
hopefully just works on different machines.

The minimum JOSM version is also bumped to the current stable.

Signed-off-by: Taylor Smock <tsmock@fb.com>
pull/1/head
Taylor Smock 2020-10-07 07:27:58 -06:00
rodzic db4416ad60
commit 10e3ad76a7
4 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/AdoptOpenJDK 8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>

Wyświetl plik

@ -1,9 +1,9 @@
# The minimum JOSM version this plugin is compatible with (can be any numeric version
plugin.main.version = 16846
plugin.main.version = 17084
# The JOSM version this plugin is currently compiled against
# Please make sure this version is available at https://josm.openstreetmap.de/download
# The special values "latest" and "tested" are also possible here, but not recommended.
plugin.compile.version = 17023
plugin.compile.version = 17084
plugin.canloadatruntime = true
plugin.author = Taylor Smock <incoming+gokaart/JOSM_MapWithAI@incoming.gitlab.com>
plugin.class = org.openstreetmap.josm.plugins.mapwithai.MapWithAIPlugin

Wyświetl plik

@ -21,6 +21,7 @@ import java.util.stream.Collectors;
import javax.swing.SwingUtilities;
import org.openstreetmap.josm.actions.ExpertToggleAction;
import org.openstreetmap.josm.data.StructUtils;
import org.openstreetmap.josm.data.imagery.ImageryInfo;
import org.openstreetmap.josm.data.preferences.BooleanProperty;
@ -45,7 +46,7 @@ public class MapWithAILayerInfo {
/**
* A boolean preference used to determine if preview datasets should be shown
*/
private static final BooleanProperty SHOW_PREVIEW = new BooleanProperty("mapwithai.sources.preview", false);
public static final BooleanProperty SHOW_PREVIEW = new BooleanProperty("mapwithai.sources.preview", false);
/** List of all usable layers */
private final List<MapWithAIInfo> layers = Collections.synchronizedList(new ArrayList<>());
@ -500,7 +501,7 @@ public class MapWithAILayerInfo {
* {@code true}.
*/
private static List<MapWithAIInfo> filterPreview(List<MapWithAIInfo> layers) {
if (SHOW_PREVIEW.get()) {
if (Boolean.TRUE.equals(SHOW_PREVIEW.get()) && ExpertToggleAction.isExpert()) {
return layers;
}
return layers.stream()

Wyświetl plik

@ -129,7 +129,7 @@ public class MapWithAIPreferences extends DefaultTabPreferenceSetting {
pane.add(expertHorizontalGlue, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
final JLabel previewFeatureSets = new JLabel(tr("Show Preview DataSets"));
final JCheckBox previewFeatureSetCheckbox = new JCheckBox();
BooleanProperty previewFeatureSetProperty = new BooleanProperty("mapwithai.sources.preview", false);
BooleanProperty previewFeatureSetProperty = MapWithAILayerInfo.SHOW_PREVIEW;
previewFeatureSetCheckbox.setToolTipText(tr("If selected, show datasets which may have various issues"));
previewFeatureSetCheckbox.setSelected(Boolean.TRUE.equals(previewFeatureSetProperty.get()));
previewFeatureSetCheckbox