Ignore:
Timestamp:
2019-03-03T10:52:10+01:00 (5 years ago)
Author:
GerdP
Message:

fix #17268: There should be a method to clear ignored errors

patch clear_ignored_errors_v32.patch by taylor.smock adapted to r14827

File:
1 edited

Legend:

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

    r14826 r14828  
    6565import org.openstreetmap.josm.tools.InputMapUtils;
    6666import org.openstreetmap.josm.tools.JosmRuntimeException;
     67import org.openstreetmap.josm.tools.Pair;
    6768import org.openstreetmap.josm.tools.Shortcut;
    6869import org.xml.sax.SAXException;
     
    8788    /** The ignore button */
    8889    private final SideButton ignoreButton;
     90    /** The reset ignorelist button */
     91    private final SideButton ignorelistManagement;
    8992    /** The select button */
    9093    private final SideButton selectButton;
     
    160163            ignoreButton.setEnabled(false);
    161164            buttons.add(ignoreButton);
     165
     166            ignorelistManagement = new SideButton(new AbstractAction() {
     167                {
     168                    putValue(NAME, tr("Manage Ignore"));
     169                    putValue(SHORT_DESCRIPTION, tr("Manage the ignore list"));
     170                    new ImageProvider("dialogs", "fix").getResource().attachImageIcon(this, true);
     171                }
     172
     173                @Override
     174                public void actionPerformed(ActionEvent e) {
     175                    new ValidatorListManagementDialog("Ignore");
     176                }
     177            });
     178            buttons.add(ignorelistManagement);
    162179        } else {
    163180            ignoreButton = null;
    164         }
     181            ignorelistManagement = null;
     182        }
     183
    165184        createLayout(tree, true, buttons);
    166185    }
     
    169188     * The action to lookup the selection in the error tree.
    170189     */
    171      class LookupAction extends AbstractAction implements DataSelectionListener {
     190    class LookupAction extends AbstractAction implements DataSelectionListener {
    172191
    173192        LookupAction() {
     
    274293            if (depth <= 1) {
    275294                if (!(mainNodeInfo instanceof TestError)) {
    276                     Set<String> state = new HashSet<>();
     295                    Set<Pair<String, String>> state = new HashSet<>();
    277296                    // ask if the whole set should be ignored
    278297                    if (asked == JOptionPane.DEFAULT_OPTION) {
     
    286305                            err.setIgnored(true);
    287306                            changed.set(true);
    288                             state.add(depth == 1 ? err.getIgnoreSubGroup() : err.getIgnoreGroup());
     307                            state.add(new Pair<>(node.getDepth() == 1 ? err.getIgnoreSubGroup() : err.getIgnoreGroup(), err.getMessage()));
    289308                        }, processedNodes);
    290                         for (String s : state) {
    291                             OsmValidator.addIgnoredError(s);
     309                        for (Pair<String, String> s : state) {
     310                            OsmValidator.addIgnoredError(s.a, s.b);
    292311                        }
    293312                        continue;
     
    300319                    String state = error.getIgnoreState();
    301320                    if (state != null) {
    302                         OsmValidator.addIgnoredError(state);
     321                        OsmValidator.addIgnoredError(state, error.getMessage());
    303322                    }
    304323                    changed.set(true);
     
    317336     * Sets the selection of the map to the current selected items.
    318337     */
    319     @SuppressWarnings("unchecked")
    320338    private void setSelectedItems() {
    321339        DataSet ds = MainApplication.getLayerManager().getActiveDataSet();
Note: See TracChangeset for help on using the changeset viewer.