Changeset 4023 in josm for trunk/src/org/openstreetmap/josm/actions/upload
- Timestamp:
- 2011-04-15T12:26:55+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r3745 r4023 21 21 import org.openstreetmap.josm.data.validation.TestError; 22 22 import org.openstreetmap.josm.data.validation.util.AgregatePrimitivesVisitor; 23 import org.openstreetmap.josm.gui.ExtendedDialog; 23 24 import org.openstreetmap.josm.gui.dialogs.validator.ValidatorTreePanel; 24 25 import org.openstreetmap.josm.gui.preferences.ValidatorPreference; 26 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 25 27 import org.openstreetmap.josm.tools.GBC; 26 28 … … 108 110 ValidatorTreePanel errorPanel = new ValidatorTreePanel(errors); 109 111 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 + " </b></td><td align=\"left\">" 122 + tr("Usually this should be fixed.")+"</td></tr>" 123 + "<tr><td align=\"left\"><b>"+tr("Warnings") 124 + " </b></td><td align=\"left\">" 125 + tr("Fix these when possible.")+"</td></tr>" 126 + "<tr><td align=\"left\"><b>"+tr("Other") 127 + " </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)); 111 133 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) { 117 142 OsmValidator.initializeErrorLayer(); 118 143 Main.map.validatorDialog.unfurlDialog(); 119 144 Main.map.validatorDialog.tree.setErrors(errors); 120 145 Main.main.getCurrentDataSet().fireSelectionChanged(); 146 return false; 121 147 } 122 return res == JOptionPane.YES_OPTION;148 return true; 123 149 } 124 150 }
Note:
See TracChangeset
for help on using the changeset viewer.