Changeset 2325 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2009-10-26T16:51:21+01:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r2308 r2325 4 4 5 5 import static org.openstreetmap.josm.tools.I18n.marktr; 6 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 6 7 import static org.openstreetmap.josm.tools.I18n.tr; 7 8 import static org.openstreetmap.josm.tools.I18n.trn; … … 62 63 import org.openstreetmap.josm.data.osm.visitor.MergeVisitor; 63 64 import org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor; 65 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 64 66 import org.openstreetmap.josm.gui.MapView; 67 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; 65 68 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 66 69 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; … … 334 337 ); 335 338 String msg2 = trn( 336 "{0} object has beenpurgedfrom the local dataset because it is deleted on the server.",337 "{0} objects have beenpurgedfrom the local dataset because they are deleted on the server.",339 "{0} conflict has been <strong>resolved automatically</strong> by purging {0} object<br>from the local dataset because it is deleted on the server.", 340 "{0} conflicts have been <strong>resolved automatically</strong> by purging {0} objects<br> from the local dataset because they are deleted on the server.", 338 341 numPurgedPrimitives, 339 342 numPurgedPrimitives 340 343 ); 344 int numRemainingConflicts = numNewConflicts - numPurgedPrimitives; 345 String msg3 = ""; 346 if (numRemainingConflicts >0) { 347 msg3 = trn( 348 "{0} conflict remains to be resolved.<br><br>Please open the Conflict List Dialog and manually resolve it.", 349 "{0} conflicts remain to be resolved.<br><br>Please open the Conflict List Dialog and manually resolve them.", 350 numRemainingConflicts, 351 numRemainingConflicts 352 ); 353 } 354 341 355 StringBuffer sb = new StringBuffer(); 342 356 sb.append("<html>").append(msg1); … … 344 358 sb.append("<br>").append(msg2); 345 359 } 346 sb.append("<br>").append(tr("Please consult the Conflict List Dialog<br>and manually resolve them.")); 360 if (numRemainingConflicts > 0) { 361 sb.append("<br>").append(msg3); 362 } 347 363 sb.append("</html>"); 348 364 if (numNewConflicts > 0) { 349 JButton[] options = new JButton[] { 350 new JButton(tr("OK")), 351 new JButton(tr("Help")) 365 ButtonSpec[] options = new ButtonSpec[] { 366 new ButtonSpec( 367 tr("OK"), 368 ImageProvider.get("ok"), 369 tr("Click to close this dialog and continue editing"), 370 null /* no specific help */ 371 ) 352 372 }; 353 options[0].setIcon(ImageProvider.get("ok")); 354 options[1].setIcon(ImageProvider.get("help")); 355 final JOptionPane pane = new JOptionPane( 373 HelpAwareOptionPane.showOptionDialog( 374 Main.parent, 356 375 sb.toString(), 376 tr("Conflicts detected"), 357 377 JOptionPane.WARNING_MESSAGE, 358 JOptionPane.DEFAULT_OPTION, 359 null, 378 null, /* no icon */ 360 379 options, 361 options[0] 362 ); 363 final JDialog dialog = new JDialog( 364 JOptionPane.getFrameForComponent(Main.parent), 365 tr("Conflicts detected"), 366 true); 367 options[0].addActionListener( 368 new ActionListener() { 369 public void actionPerformed(ActionEvent e) { 370 dialog.setVisible(false); 371 } 372 } 373 ); 374 options[1].addActionListener( 375 new ActionListener() { 376 public void actionPerformed(ActionEvent e) { 377 HelpBrowser b = new HelpBrowser(); 378 b.openHelpTopic("Help/Concepts/Conflict"); 379 b.setVisible(true); 380 } 381 } 382 ); 383 dialog.setContentPane(pane); 384 dialog.pack(); 385 HelpUtil.setHelpContext(dialog.getRootPane(), "/Concepts/Conflict"); 386 WindowGeometry.centerOnScreen(dialog.getSize()).applySafe(dialog); 387 dialog.setVisible(true); 380 options[0], 381 ht("/Concepts/Conflict#WarningAboutDetectedConflicts") 382 ); 388 383 } 389 384 }
Note:
See TracChangeset
for help on using the changeset viewer.
