diff --git a/src/org/openstreetmap/josm/actions/AutoScaleAction.java b/src/org/openstreetmap/josm/actions/AutoScaleAction.java
index 6b4d5ef..f4ec85f 100644
|
a
|
b
|
public class AutoScaleAction extends JosmAction {
|
| 220 | 220 | * @return the first selected layer in the layer list dialog |
| 221 | 221 | */ |
| 222 | 222 | protected Layer getFirstSelectedLayer() { |
| | 223 | if (Main.main.getActiveLayer() == null) |
| | 224 | return null; |
| 223 | 225 | List<Layer> layers = LayerListDialog.getInstance().getModel().getSelectedLayers(); |
| 224 | 226 | if (layers.isEmpty()) |
| 225 | 227 | return null; |
| … |
… |
public class AutoScaleAction extends JosmAction {
|
| 245 | 247 | } |
| 246 | 248 | break; |
| 247 | 249 | case "layer": |
| 248 | | if (Main.main.getActiveLayer() == null) |
| 249 | | return null; |
| 250 | 250 | // try to zoom to the first selected layer |
| 251 | 251 | Layer l = getFirstSelectedLayer(); |
| 252 | 252 | if (l == null) |
| … |
… |
public class AutoScaleAction extends JosmAction {
|
| 289 | 289 | if (lastZoomTime > 0 && System.currentTimeMillis() - lastZoomTime > Main.pref.getLong("zoom.bounds.reset.time", 10*1000)) { |
| 290 | 290 | lastZoomTime = -1; |
| 291 | 291 | } |
| 292 | | DataSet dataset = Main.main.getCurrentDataSet(); |
| | 292 | DataSet dataset = getCurrentDataSet(); |
| 293 | 293 | if (dataset != null) { |
| 294 | 294 | List<DataSource> dataSources = new ArrayList<>(dataset.getDataSources()); |
| 295 | 295 | int s = dataSources.size(); |
| … |
… |
public class AutoScaleAction extends JosmAction {
|
| 322 | 322 | setEnabled(getCurrentDataSet() != null && !getCurrentDataSet().getSelected().isEmpty()); |
| 323 | 323 | break; |
| 324 | 324 | case "layer": |
| 325 | | if (!Main.isDisplayingMapView() || Main.map.mapView.getAllLayersAsList().isEmpty()) { |
| 326 | | setEnabled(false); |
| 327 | | } else { |
| 328 | | // FIXME: should also check for whether a layer is selected in the layer list dialog |
| 329 | | setEnabled(true); |
| 330 | | } |
| | 325 | setEnabled(getFirstSelectedLayer() != null); |
| 331 | 326 | break; |
| 332 | 327 | case "conflict": |
| 333 | 328 | setEnabled(Main.map != null && Main.map.conflictDialog.getSelectedConflict() != null); |
| 334 | 329 | break; |
| | 330 | case "download": |
| | 331 | setEnabled(getCurrentDataSet() != null && getCurrentDataSet().getDataSources().size()>0); |
| | 332 | break; |
| 335 | 333 | case "problem": |
| 336 | 334 | setEnabled(Main.map != null && Main.map.validatorDialog.getSelectedError() != null); |
| 337 | 335 | break; |
| … |
… |
public class AutoScaleAction extends JosmAction {
|
| 413 | 411 | oldFrame.validatorDialog.removeTreeSelectionListener(validatorSelectionListener); |
| 414 | 412 | } |
| 415 | 413 | } |
| | 414 | updateEnabledState(); |
| 416 | 415 | } |
| 417 | 416 | } |
| 418 | 417 | } |
diff --git a/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java b/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
index 972ebcb..286ef70 100644
|
a
|
b
|
public final class OrthogonalizeAction extends JosmAction {
|
| 598 | 598 | } |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | | /** |
| 602 | | * Don't check, if the current selection is suited for orthogonalization. |
| 603 | | * Instead, show a usage dialog, that explains, why it cannot be done. |
| 604 | | */ |
| 605 | 601 | @Override |
| 606 | 602 | protected void updateEnabledState() { |
| 607 | | setEnabled(getCurrentDataSet() != null); |
| | 603 | setEnabled(getCurrentDataSet() != null && !getCurrentDataSet().getSelected().isEmpty()); |
| | 604 | } |
| | 605 | |
| | 606 | @Override |
| | 607 | protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { |
| | 608 | setEnabled(selection != null && !selection.isEmpty()); |
| 608 | 609 | } |
| 609 | 610 | } |
diff --git a/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java b/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
index d78347b..db1768c 100644
|
a
|
b
|
public class DrawAction extends MapMode implements MapViewPaintable, SelectionCh
|
| 1791 | 1791 | |
| 1792 | 1792 | @Override |
| 1793 | 1793 | protected void updateEnabledState() { |
| 1794 | | setEnabled(Main.main != null && Main.main.hasEditLayer()); |
| | 1794 | setEnabled(Main.map != null && Main.map.mapMode instanceof DrawAction); |
| 1795 | 1795 | } |
| | 1796 | |
| | 1797 | |
| 1796 | 1798 | } |
| 1797 | 1799 | } |
diff --git a/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java b/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
index e811caf..0e017a4 100644
|
a
|
b
|
public class ExtrudeAction extends MapMode implements MapViewPaintable, KeyPress
|
| 201 | 201 | |
| 202 | 202 | @Override |
| 203 | 203 | protected void updateEnabledState() { |
| 204 | | setEnabled(Main.main != null && Main.main.hasEditLayer()); |
| | 204 | setEnabled(Main.map != null && Main.map.mapMode instanceof ExtrudeAction); |
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java b/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java
index 9ce1179..a9845eb 100644
|
a
|
b
|
public final class TaggingPresetSearchPrimitiveDialog extends ExtendedDialog {
|
| 35 | 35 | * Constructs a new {@link TaggingPresetSearchPrimitiveDialog.Action}. |
| 36 | 36 | */ |
| 37 | 37 | public Action() { |
| 38 | | super(tr("Search for objects by preset"), "dialogs/search", tr("Show preset search dialog"), |
| | 38 | super(tr("Search for objects by preset..."), "dialogs/search", tr("Show preset search dialog"), |
| 39 | 39 | Shortcut.registerShortcut("preset:search-objects", tr("Search for objects by preset"), KeyEvent.VK_F3, Shortcut.SHIFT), |
| 40 | 40 | false); |
| 41 | 41 | putValue("toolbar", "presets/search-objects"); |
| … |
… |
public final class TaggingPresetSearchPrimitiveDialog extends ExtendedDialog {
|
| 48 | 48 | TaggingPresetSearchPrimitiveDialog.getInstance().showDialog(); |
| 49 | 49 | } |
| 50 | 50 | } |
| | 51 | |
| | 52 | @Override |
| | 53 | protected void updateEnabledState() { |
| | 54 | setEnabled(getEditLayer() != null); |
| | 55 | } |
| 51 | 56 | } |
| 52 | 57 | |
| 53 | 58 | /** |