Changeset 5775 in josm for trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
- Timestamp:
- 2013-03-13T21:52:18+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r5758 r5775 74 74 import org.openstreetmap.josm.data.validation.TestError; 75 75 import org.openstreetmap.josm.gui.ExtendedDialog; 76 import org.openstreetmap.josm.gui.HelpAwareOptionPane;77 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;78 76 import org.openstreetmap.josm.gui.MapView; 79 77 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; … … 81 79 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor; 82 80 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 83 import org.openstreetmap.josm.gui.util.GuiHelper;84 81 import org.openstreetmap.josm.tools.DateUtils; 85 82 import org.openstreetmap.josm.tools.FilteredCollection; … … 410 407 Main.map.mapView.repaint(); 411 408 } 412 warnNumNewConflicts(numNewConflicts); 413 } 414 415 /** 416 * Warns the user about the number of detected conflicts 417 * 418 * @param numNewConflicts the number of detected conflicts 419 */ 420 protected void warnNumNewConflicts(int numNewConflicts) { 421 if (numNewConflicts == 0) return; 422 423 String msg1 = trn( 424 "There was {0} conflict detected.", 425 "There were {0} conflicts detected.", 426 numNewConflicts, 427 numNewConflicts 428 ); 429 430 final StringBuffer sb = new StringBuffer(); 431 sb.append("<html>").append(msg1).append("</html>"); 432 if (numNewConflicts > 0) { 433 final ButtonSpec[] options = new ButtonSpec[] { 434 new ButtonSpec( 435 tr("OK"), 436 ImageProvider.get("ok"), 437 tr("Click to close this dialog and continue editing"), 438 null /* no specific help */ 439 ) 440 }; 441 GuiHelper.runInEDT(new Runnable() { 442 @Override 443 public void run() { 444 HelpAwareOptionPane.showOptionDialog( 445 Main.parent, 446 sb.toString(), 447 tr("Conflicts detected"), 448 JOptionPane.WARNING_MESSAGE, 449 null, /* no icon */ 450 options, 451 options[0], 452 ht("/Concepts/Conflict#WarningAboutDetectedConflicts") 453 ); 454 Main.map.conflictDialog.unfurlDialog(); 455 Main.map.repaint(); 456 } 457 }); 458 } 459 } 460 409 Main.map.conflictDialog.warnNumNewConflicts(numNewConflicts); 410 } 461 411 462 412 @Override public boolean isMergable(final Layer other) {
Note:
See TracChangeset
for help on using the changeset viewer.
