Changeset 2253 in josm
- Timestamp:
- 2009-10-06T23:52:41+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
r2017 r2253 35 35 36 36 public DownloadReferrersAction() { 37 super(tr("Download referrers from OSM..."), "downloadreferrers", tr("Download primitives referring to one of the selected primitives"),38 Shortcut.registerShortcut("file:downloadreferrers", tr("File: {0}", tr("Download referrers...")), KeyEvent.VK_D, Shortcut.GROUPS_ALT2+Shortcut.GROUP_HOTKEY), true);37 super(tr("Download parent ways/relations..."), "downloadreferrers", tr("Download primitives referring to one of the selected primitives"), 38 Shortcut.registerShortcut("file:downloadreferrers", tr("File: {0}", tr("Download parent ways/relations ...")), KeyEvent.VK_D, Shortcut.GROUPS_ALT2+Shortcut.GROUP_HOTKEY), true); 39 39 } 40 40 -
trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java
r2025 r2253 17 17 public class UpdateDataAction extends JosmAction{ 18 18 public UpdateDataAction() { 19 super(tr("Update Data"),19 super(tr("Update data"), 20 20 "updatedata", 21 tr("Updates the current data layer from the server (re-downloads data)"),21 tr("Updates the objects in the current data layer from the server "), 22 22 Shortcut.registerShortcut("file:updatedata", 23 23 tr("Update Data"), -
trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
r2077 r2253 87 87 */ 88 88 public UpdateSelectionAction() { 89 super(tr("Update Selection"),89 super(tr("Update selections"), 90 90 "updateselection", 91 tr("Updates the currently selected primitives from the server"),91 tr("Updates the currently selected objects from the server (re-downloads data)"), 92 92 Shortcut.registerShortcut("file:updateselection", 93 93 tr("Update Selection"), -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r2250 r2253 5 5 6 6 import java.awt.event.ActionEvent; 7 import java.awt.event.ActionListener; 7 8 import java.awt.event.KeyEvent; 8 9 import java.io.IOException; … … 17 18 import java.util.regex.Pattern; 18 19 20 import javax.swing.JButton; 21 import javax.swing.JDialog; 19 22 import javax.swing.JOptionPane; 20 23 … … 33 36 import org.openstreetmap.josm.gui.ExceptionDialogUtil; 34 37 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 38 import org.openstreetmap.josm.gui.help.HelpBrowser; 39 import org.openstreetmap.josm.gui.help.HelpBuilder; 35 40 import org.openstreetmap.josm.gui.io.UploadDialog; 36 41 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 44 49 import org.openstreetmap.josm.io.OsmTransferException; 45 50 import org.openstreetmap.josm.tools.DateUtils; 51 import org.openstreetmap.josm.tools.ImageProvider; 46 52 import org.openstreetmap.josm.tools.Shortcut; 53 import org.openstreetmap.josm.tools.WindowGeometry; 47 54 import org.xml.sax.SAXException; 48 55 … … 114 121 115 122 public UploadAction() { 116 super(tr("Upload to OSM..."), "upload", tr("Upload all changes to the OSM server."),117 Shortcut.registerShortcut("file:upload", tr("File: {0}", tr("Upload to OSM...")), KeyEvent.VK_U, Shortcut.GROUPS_ALT1+Shortcut.GROUP_HOTKEY), true);123 super(tr("Upload data"), "upload", tr("Upload all changes in the current data layer to the OSM server"), 124 Shortcut.registerShortcut("file:upload", tr("File: {0}", tr("Upload data")), KeyEvent.VK_U, Shortcut.GROUPS_ALT1+Shortcut.GROUP_HOTKEY), true); 118 125 } 119 126 … … 222 229 * @param myVersion the version of the primitive in the local dataset 223 230 */ 224 protected void handleUploadConflictForKnownConflict(OsmPrimitiveType primitiveType, long id, String serverVersion, String myVersion) { 225 Object[] options = new Object[] { 226 tr("Synchronize {0} {1} only", tr(primitiveType.getAPIName()), id), 227 tr("Synchronize entire dataset"), 228 tr("Cancel") 231 protected void handleUploadConflictForKnownConflict(final OsmPrimitiveType primitiveType, final long id, String serverVersion, String myVersion) { 232 JButton[] options = new JButton[] { 233 new JButton(tr("Synchronize {0} {1} only", tr(primitiveType.getAPIName()), id)), 234 new JButton(tr("Synchronize entire dataset")), 235 new JButton(tr("Cancel")), 236 new JButton(tr("Help")) 229 237 }; 230 Object defaultOption = options[0]; 238 options[0].setIcon(ImageProvider.get("updatedata")); 239 options[1].setIcon(ImageProvider.get("updatedata")); 240 options[2].setIcon(ImageProvider.get("cancel")); 241 options[3].setIcon(ImageProvider.get("help")); 231 242 String msg = tr("<html>Uploading <strong>failed</strong> because the server has a newer version of one<br>" 232 243 + "of your nodes, ways, or relations.<br>" … … 238 249 + "Click <strong>{6}</strong> to abort and continue editing.<br></html>", 239 250 tr(primitiveType.getAPIName()), id, serverVersion, myVersion, 240 options[0], options[1], options[2] 241 ); 242 int optionsType = JOptionPane.YES_NO_CANCEL_OPTION; 243 int ret = JOptionPane.showOptionDialog( 244 null, 251 options[0].getText(), options[1].getText(), options[2].getText() 252 ); 253 final JOptionPane pane = new JOptionPane( 245 254 msg, 246 tr("Conflict detected"),247 optionsType,248 255 JOptionPane.ERROR_MESSAGE, 256 JOptionPane.DEFAULT_OPTION, 249 257 null, 250 258 options, 251 defaultOption 252 ); 253 switch(ret) { 254 case JOptionPane.CLOSED_OPTION: return; 255 case JOptionPane.CANCEL_OPTION: return; 256 case 0: synchronizePrimitive(primitiveType, id); break; 257 case 1: synchronizeDataSet(); break; 258 default: 259 // should not happen 260 throw new IllegalStateException(tr("Unexpected return value. Got {0}.", ret)); 261 } 259 options[0] 260 ); 261 final JDialog dialog = new JDialog( 262 JOptionPane.getFrameForComponent(Main.parent), 263 tr("Conflicts detected"), 264 true); 265 options[0].addActionListener( 266 new ActionListener() { 267 public void actionPerformed(ActionEvent e) { 268 dialog.setVisible(false); 269 synchronizePrimitive(primitiveType, id); 270 } 271 } 272 ); 273 options[1].addActionListener( 274 new ActionListener() { 275 public void actionPerformed(ActionEvent e) { 276 dialog.setVisible(false); 277 synchronizeDataSet(); 278 } 279 } 280 ); 281 options[2].addActionListener( 282 new ActionListener() { 283 public void actionPerformed(ActionEvent e) { 284 dialog.setVisible(false); 285 } 286 } 287 ); 288 options[3].addActionListener( 289 new ActionListener() { 290 public void actionPerformed(ActionEvent e) { 291 HelpBrowser b = new HelpBrowser(); 292 b.setUrlForHelpTopic("Help/Concepts/Conflict"); 293 b.setVisible(true); 294 } 295 } 296 ); 297 dialog.setContentPane(pane); 298 dialog.pack(); 299 HelpBuilder.setHelpContext(dialog.getRootPane(), "Concepts/Conflict"); 300 WindowGeometry.centerOnScreen(dialog.getSize()).applySafe(dialog); 301 dialog.setVisible(true); 262 302 } 263 303 … … 268 308 */ 269 309 protected void handleUploadConflictForUnknownConflict() { 270 Object[] options = new Object[] { 271 tr("Synchronize entire dataset"), 272 tr("Cancel") 310 JButton[] options = new JButton[] { 311 new JButton(tr("Synchronize entire dataset")), 312 new JButton(tr("Cancel")), 313 new JButton(tr("Help")) 273 314 }; 274 315 Object defaultOption = options[0]; … … 278 319 + "Click <strong>{0}</strong> to synchronize the entire local dataset with the server.<br>" 279 320 + "Click <strong>{1}</strong> to abort and continue editing.<br></html>", 280 options[0], options[1] 281 ); 282 int optionsType = JOptionPane.YES_NO_OPTION; 283 int ret = JOptionPane.showOptionDialog( 284 null, 321 options[0].getText(), options[1].getText() 322 ); 323 final JOptionPane pane = new JOptionPane( 285 324 msg, 286 tr("Conflict detected"),287 optionsType,288 325 JOptionPane.ERROR_MESSAGE, 326 JOptionPane.DEFAULT_OPTION, 289 327 null, 290 328 options, 291 defaultOption 292 ); 293 switch(ret) { 294 case JOptionPane.CLOSED_OPTION: return; 295 case 1: return; 296 case 0: synchronizeDataSet(); break; 297 default: 298 // should not happen 299 throw new IllegalStateException(tr("Unexpected return value. Got {0}.", ret)); 300 } 329 options[0] 330 ); 331 final JDialog dialog = new JDialog( 332 JOptionPane.getFrameForComponent(Main.parent), 333 tr("Conflicts detected"), 334 true); 335 336 options[0].addActionListener( 337 new ActionListener() { 338 public void actionPerformed(ActionEvent e) { 339 dialog.setVisible(false); 340 synchronizeDataSet(); 341 } 342 } 343 ); 344 options[1].addActionListener( 345 new ActionListener() { 346 public void actionPerformed(ActionEvent e) { 347 dialog.setVisible(false); 348 } 349 } 350 ); 351 options[2].addActionListener( 352 new ActionListener() { 353 public void actionPerformed(ActionEvent e) { 354 HelpBrowser b = new HelpBrowser(); 355 b.setUrlForHelpTopic("Help/Concepts/Conflict"); 356 b.setVisible(true); 357 } 358 } 359 ); 360 dialog.setContentPane(pane); 361 dialog.pack(); 362 HelpBuilder.setHelpContext(dialog.getRootPane(), "Concepts/Conflict"); 363 WindowGeometry.centerOnScreen(dialog.getSize()).applySafe(dialog); 364 dialog.setVisible(true); 301 365 } 302 366 -
trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
r2250 r2253 44 44 public UploadSelectionAction() { 45 45 super( 46 tr("Upload selection ..."),46 tr("Upload selection"), 47 47 "uploadselection", 48 tr("Upload thecurrent selection to the OSM server."),48 tr("Upload all changes in the current current selection to the OSM server."), 49 49 null, /* no shortcut */ 50 50 true); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r2215 r2253 21 21 import org.openstreetmap.josm.gui.layer.Layer; 22 22 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 23 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;24 23 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 25 24 import org.openstreetmap.josm.io.BoundingBoxDownloader; … … 29 28 import org.openstreetmap.josm.tools.ExceptionUtil; 30 29 import org.xml.sax.SAXException; 31 32 30 33 31 /** -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskList.java
r2097 r2253 166 166 for (OsmPrimitive primitive : ds.relations) { 167 167 if (! primitive.incomplete && primitive.getId() == 0) { 168 ret.add(primitive); ;168 ret.add(primitive); 169 169 } 170 170 } … … 232 232 ); 233 233 switch(ret) { 234 case JOptionPane.CLOSED_OPTION: return;235 case JOptionPane.NO_OPTION: return;236 case JOptionPane.YES_OPTION: updatePotentiallyDeletedPrimitives(potentiallyDeleted); break;234 case JOptionPane.CLOSED_OPTION: return; 235 case JOptionPane.NO_OPTION: return; 236 case JOptionPane.YES_OPTION: updatePotentiallyDeletedPrimitives(potentiallyDeleted); break; 237 237 } 238 238 } -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r2250 r2253 207 207 add(fileMenu, download); 208 208 add(fileMenu, downloadReferrers); 209 add(fileMenu, update); 210 add(fileMenu, updateSelection); 211 fileMenu.addSeparator(); 209 212 add(fileMenu, upload); 210 213 add(fileMenu, uploadSelection); 211 add(fileMenu, update); 212 add(fileMenu, updateSelection); 214 fileMenu.addSeparator(); 213 215 add(fileMenu, closeChangesetAction); 214 216 fileMenu.addSeparator(); -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r2198 r2253 18 18 import java.awt.TexturePaint; 19 19 import java.awt.event.ActionEvent; 20 import java.awt.event.ActionListener; 20 21 import java.awt.geom.Area; 21 22 import java.awt.image.BufferedImage; 23 import java.beans.PropertyChangeEvent; 24 import java.beans.PropertyChangeListener; 22 25 import java.io.File; 23 26 import java.util.ArrayList; … … 30 33 import javax.swing.AbstractAction; 31 34 import javax.swing.Icon; 35 import javax.swing.JButton; 36 import javax.swing.JDialog; 32 37 import javax.swing.JLabel; 33 38 import javax.swing.JMenuItem; … … 62 67 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 63 68 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; 69 import org.openstreetmap.josm.gui.help.HelpBrowser; 70 import org.openstreetmap.josm.gui.help.HelpBuilder; 64 71 import org.openstreetmap.josm.tools.DateUtils; 65 72 import org.openstreetmap.josm.tools.GBC; 66 73 import org.openstreetmap.josm.tools.ImageProvider; 74 import org.openstreetmap.josm.tools.WindowGeometry; 67 75 68 76 /** … … 338 346 sb.append("<br>").append(msg2); 339 347 } 348 sb.append("<br>").append(tr("Please consult the Conflict List Dialog<br>and manually resolve them.")); 340 349 sb.append("</html>"); 341 350 if (numNewConflicts > 0) { 342 JOptionPane.showMessageDialog( 343 Main.parent, 351 JButton[] options = new JButton[] { 352 new JButton(tr("OK")), 353 new JButton(tr("Help")) 354 }; 355 options[0].setIcon(ImageProvider.get("ok")); 356 options[1].setIcon(ImageProvider.get("help")); 357 final JOptionPane pane = new JOptionPane( 344 358 sb.toString(), 359 JOptionPane.WARNING_MESSAGE, 360 JOptionPane.DEFAULT_OPTION, 361 null, 362 options, 363 options[0] 364 ); 365 final JDialog dialog = new JDialog( 366 JOptionPane.getFrameForComponent(Main.parent), 345 367 tr("Conflicts detected"), 346 JOptionPane.WARNING_MESSAGE 368 true); 369 options[0].addActionListener( 370 new ActionListener() { 371 public void actionPerformed(ActionEvent e) { 372 dialog.setVisible(false); 373 } 374 } 347 375 ); 376 options[1].addActionListener( 377 new ActionListener() { 378 public void actionPerformed(ActionEvent e) { 379 HelpBrowser b = new HelpBrowser(); 380 b.setUrlForHelpTopic("Help/Concepts/Conflict"); 381 b.setVisible(true); 382 } 383 } 384 ); 385 dialog.setContentPane(pane); 386 dialog.pack(); 387 HelpBuilder.setHelpContext(dialog.getRootPane(), "Concepts/Conflict"); 388 WindowGeometry.centerOnScreen(dialog.getSize()).applySafe(dialog); 389 dialog.setVisible(true); 348 390 } 349 391 }
Note:
See TracChangeset
for help on using the changeset viewer.