kopia lustrzana https://github.com/JOSM/MapWithAI
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
rodzic
db4416ad60
commit
10e3ad76a7
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<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>
|
<attributes>
|
||||||
<attribute name="module" value="true"/>
|
<attribute name="module" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# The minimum JOSM version this plugin is compatible with (can be any numeric version
|
# 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
|
# The JOSM version this plugin is currently compiled against
|
||||||
# Please make sure this version is available at https://josm.openstreetmap.de/download
|
# 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.
|
# 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.canloadatruntime = true
|
||||||
plugin.author = Taylor Smock <incoming+gokaart/JOSM_MapWithAI@incoming.gitlab.com>
|
plugin.author = Taylor Smock <incoming+gokaart/JOSM_MapWithAI@incoming.gitlab.com>
|
||||||
plugin.class = org.openstreetmap.josm.plugins.mapwithai.MapWithAIPlugin
|
plugin.class = org.openstreetmap.josm.plugins.mapwithai.MapWithAIPlugin
|
||||||
|
|
|
@ -21,6 +21,7 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
|
import org.openstreetmap.josm.actions.ExpertToggleAction;
|
||||||
import org.openstreetmap.josm.data.StructUtils;
|
import org.openstreetmap.josm.data.StructUtils;
|
||||||
import org.openstreetmap.josm.data.imagery.ImageryInfo;
|
import org.openstreetmap.josm.data.imagery.ImageryInfo;
|
||||||
import org.openstreetmap.josm.data.preferences.BooleanProperty;
|
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
|
* 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 */
|
/** List of all usable layers */
|
||||||
private final List<MapWithAIInfo> layers = Collections.synchronizedList(new ArrayList<>());
|
private final List<MapWithAIInfo> layers = Collections.synchronizedList(new ArrayList<>());
|
||||||
|
@ -500,7 +501,7 @@ public class MapWithAILayerInfo {
|
||||||
* {@code true}.
|
* {@code true}.
|
||||||
*/
|
*/
|
||||||
private static List<MapWithAIInfo> filterPreview(List<MapWithAIInfo> layers) {
|
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;
|
||||||
}
|
}
|
||||||
return layers.stream()
|
return layers.stream()
|
||||||
|
|
|
@ -129,7 +129,7 @@ public class MapWithAIPreferences extends DefaultTabPreferenceSetting {
|
||||||
pane.add(expertHorizontalGlue, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
|
pane.add(expertHorizontalGlue, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
|
||||||
final JLabel previewFeatureSets = new JLabel(tr("Show Preview DataSets"));
|
final JLabel previewFeatureSets = new JLabel(tr("Show Preview DataSets"));
|
||||||
final JCheckBox previewFeatureSetCheckbox = new JCheckBox();
|
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.setToolTipText(tr("If selected, show datasets which may have various issues"));
|
||||||
previewFeatureSetCheckbox.setSelected(Boolean.TRUE.equals(previewFeatureSetProperty.get()));
|
previewFeatureSetCheckbox.setSelected(Boolean.TRUE.equals(previewFeatureSetProperty.get()));
|
||||||
previewFeatureSetCheckbox
|
previewFeatureSetCheckbox
|
||||||
|
|
Ładowanie…
Reference in New Issue