Changeset 18361 in josm


Ignore:
Timestamp:
2022-01-09T12:11:27+01:00 (2 years ago)
Author:
GerdP
Message:

fix #6725: Plugins need to be loaded before tool definitions for toolbar buttons

  • use a flag to indicate that all plugins were loaded and suppress INFO messages unless that was done
Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r18322 r18361  
    12231223        monitor.indeterminateSubTask(tr("Loading plugins"));
    12241224        PluginHandler.loadLatePlugins(splash, pluginsToLoad, monitor.createSubTaskMonitor(1, false));
    1225         GuiHelper.runInEDTAndWait(() -> toolbar.refreshToolbarControl());
     1225        GuiHelper.runInEDTAndWait(() -> {
     1226            toolbar.enableInfoAboutMissingAction();
     1227            toolbar.refreshToolbarControl();
     1228        });
    12261229    }
    12271230
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r18342 r18361  
    583583    public final JToolBar control = new JToolBar();
    584584    private final Map<Object, ActionDefinition> buttonActions = new ConcurrentHashMap<>(30);
     585    private boolean showInfoAboutMissingActions;
    585586
    586587    @Override
     
    11131114                if (a != null) {
    11141115                    result.add(a);
    1115                 } else {
     1116                } else if (showInfoAboutMissingActions) {
    11161117                    Logging.info("Could not load tool definition "+s);
    11171118                }
     
    12931294        refreshToolbarControl();
    12941295    }
     1296
     1297    /**
     1298     * Call with {@code true} when all plugins were loaded.
     1299     * @since xxx
     1300     */
     1301    public void enableInfoAboutMissingAction() {
     1302        this.showInfoAboutMissingActions = true;
     1303    }
     1304
     1305
    12951306}
Note: See TracChangeset for help on using the changeset viewer.