Changeset 4023 in josm


Ignore:
Timestamp:
Apr 15, 2011 12:26:55 PM (2 years ago)
Author:
stoecker
Message:

improve validator user interface

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java

    r3745 r4023  
    2121import org.openstreetmap.josm.data.validation.TestError; 
    2222import org.openstreetmap.josm.data.validation.util.AgregatePrimitivesVisitor; 
     23import org.openstreetmap.josm.gui.ExtendedDialog; 
    2324import org.openstreetmap.josm.gui.dialogs.validator.ValidatorTreePanel; 
    2425import org.openstreetmap.josm.gui.preferences.ValidatorPreference; 
     26import org.openstreetmap.josm.gui.widgets.HtmlPanel; 
    2527import org.openstreetmap.josm.tools.GBC; 
    2628 
     
    108110        ValidatorTreePanel errorPanel = new ValidatorTreePanel(errors); 
    109111        errorPanel.expandAll(); 
    110         p.add(new JScrollPane(errorPanel), GBC.eol()); 
     112        HtmlPanel pnlMessage = new HtmlPanel(); 
     113        pnlMessage.setText("<html><body>" 
     114                + tr("The following are results of automatic validation. Try fixing" 
     115                + " these, but be careful( don't destray valid data)." 
     116                + " When in doubt ignore them.<br>When you" 
     117                + " cancel this dialog, you can find the entries in the validator" 
     118                + " side panel to inspect them.") 
     119                + "<table align=\"center\">" 
     120                + "<tr><td align=\"left\"><b>"+tr("Errors") 
     121                + "&nbsp;</b></td><td align=\"left\">" 
     122                + tr("Usually this should be fixed.")+"</td></tr>" 
     123                + "<tr><td align=\"left\"><b>"+tr("Warnings") 
     124                + "&nbsp;</b></td><td align=\"left\">" 
     125                + tr("Fix these when possible.")+"</td></tr>" 
     126                + "<tr><td align=\"left\"><b>"+tr("Other") 
     127                + "&nbsp;</b></td><td align=\"left\">" 
     128                + tr("Informational warnings, expect many false entries.")+"</td></tr>" 
     129                + "</table>" 
     130        ); 
     131        p.add(pnlMessage, GBC.eol()); 
     132        p.add(new JScrollPane(errorPanel), GBC.eol().fill(GBC.BOTH)); 
    111133 
    112         int res = JOptionPane.showConfirmDialog(Main.parent, p, 
    113             tr("Data with errors. Upload anyway?"), 
    114             JOptionPane.YES_NO_OPTION, 
    115             JOptionPane.QUESTION_MESSAGE); 
    116         if (res == JOptionPane.NO_OPTION) { 
     134        ExtendedDialog ed = new ExtendedDialog(Main.parent, 
     135                tr("Supicious data found. Upload anyway?"), 
     136                new String[] {tr("Continue upload"), tr("Cancel")}); 
     137        ed.setButtonIcons(new String[] {"ok.png", "cancel.png"}); 
     138        ed.setContent(p); 
     139        ed.showDialog(); 
     140 
     141        if(ed.getValue() != 1) { 
    117142            OsmValidator.initializeErrorLayer(); 
    118143            Main.map.validatorDialog.unfurlDialog(); 
    119144            Main.map.validatorDialog.tree.setErrors(errors); 
    120145            Main.main.getCurrentDataSet().fireSelectionChanged(); 
     146            return false; 
    121147        } 
    122         return res == JOptionPane.YES_OPTION; 
     148        return true; 
    123149    } 
    124150} 
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r3707 r4023  
    399399 
    400400                if (!ignore) { 
    401                     errors.add( new TestError(this, Severity.ERROR, tr("Illegal tag/value combinations"), 
    402                             tr("Illegal tag/value combinations"), tr("Illegal tag/value combinations"), 1272, p) ); 
     401                    errors.add( new TestError(this, Severity.ERROR, tr("Suspicious tag/value combinations"), 
     402                            tr("Suspicious tag/value combinations"), tr("Suspicious tag/value combinations"), 1272, p) ); 
    403403                    withErrors.put(p, "TC"); 
    404404                } 
     
    408408            for (CheckerData d : checkerData) { 
    409409                if (d.match(p, keys)) { 
    410                     errors.add( new TestError(this, d.getSeverity(), tr("Illegal tag/value combinations"), 
     410                    errors.add( new TestError(this, d.getSeverity(), tr("Suspicious tag/value combinations"), 
    411411                            d.getDescription(), d.getDescriptionOrig(), d.getCode(), p) ); 
    412412                    withErrors.put(p, "TC"); 
  • trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    r3745 r4023  
    236236                        msg = msgErrors.getKey() + " (" + errs.size() + ")"; 
    237237                    } else { 
    238                         msg = bag.getKey() + " - " + msgErrors.getKey() + " (" + errs.size() + ")"; 
     238                        msg = msgErrors.getKey() + " - " + bag.getKey() + " (" + errs.size() + ")"; 
    239239                    } 
    240240                    DefaultMutableTreeNode messageNode = new DefaultMutableTreeNode(msg); 
Note: See TracChangeset for help on using the changeset viewer.