Changeset 18623 in osm for applications/editors/josm


Ignore:
Timestamp:
2009-11-15T15:28:53+01:00 (15 years ago)
Author:
stoecker
Message:

cleanup mappaint error handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java

    r18600 r18623  
    440440            }
    441441        }
    442         if(checkPaint && p.getErrors() != null)
    443         {
    444             for(String s: p.getErrors())
    445             {
    446                 /* passing translated text also to original string, as we already
    447                 translated the stuff before. Makes the ignore file language dependend. */
    448                 errors.add( new TestError(this, Severity.WARNING, tr("Painting problem"),
    449                 s, s, PAINT, p) );
    450                 withErrors.add(p, "P");
     442        if(checkPaint)
     443        {
     444            List<String> pe = p.getDataSet().getErrors(p);
     445            if(pe != null)
     446            {
     447                for(String s: pe)
     448                {
     449                    /* passing translated text also to original string, as we already
     450                    translated the stuff before. Makes the ignore file language dependend. */
     451                    errors.add( new TestError(this, Severity.WARNING, tr("Painting problem"),
     452                    s, s, PAINT, p) );
     453                    withErrors.add(p, "P");
     454                }
    451455            }
    452456        }
     
    556560    public void startTest(ProgressMonitor monitor)
    557561    {
    558         super.startTest(monitor);
     562        super.startTest(monitor);
    559563        checkKeys = Main.pref.getBoolean(PREF_CHECK_KEYS, true);
    560564        if( isBeforeUpload )
     
    622626            public void actionPerformed(ActionEvent e) {
    623627                String source = JOptionPane.showInputDialog(
    624                                 Main.parent,
    625                                 tr("TagChecker source"),
    626                                 tr("TagChecker source"),
    627                                 JOptionPane.QUESTION_MESSAGE
    628                                 );
     628                        Main.parent,
     629                        tr("TagChecker source"),
     630                        tr("TagChecker source"),
     631                        JOptionPane.QUESTION_MESSAGE
     632                        );
    629633                if (source != null)
    630634                    ((DefaultListModel)Sources.getModel()).addElement(source);
     
    653657                    {
    654658                        JOptionPane.showMessageDialog(
    655                                         Main.parent,
    656                                         tr("Please select the row to edit."),
    657                                         tr("Information"),
    658                                         JOptionPane.INFORMATION_MESSAGE
    659                                         );
     659                                Main.parent,
     660                                tr("Please select the row to edit."),
     661                                tr("Information"),
     662                                JOptionPane.INFORMATION_MESSAGE
     663                                );
    660664                    }
    661665                }
    662666                else {
    663                         String source = (String)JOptionPane.showInputDialog(Main.parent,
    664                                         tr("TagChecker source"),
    665                                         tr("TagChecker source"),
    666                                         JOptionPane.QUESTION_MESSAGE, null, null,
    667                                         Sources.getSelectedValue());
     667                    String source = (String)JOptionPane.showInputDialog(Main.parent,
     668                            tr("TagChecker source"),
     669                            tr("TagChecker source"),
     670                            JOptionPane.QUESTION_MESSAGE, null, null,
     671                            Sources.getSelectedValue());
    668672                    if (source != null)
    669673                        ((DefaultListModel)Sources.getModel()).setElementAt(source, row);
Note: See TracChangeset for help on using the changeset viewer.