Ignore:
Timestamp:
2009-10-26T16:51:21+01:00 (17 years ago)
Author:
Gubaer
Message:

fixed #3783: does not finish download API
Also improved help

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r2308 r2325  
    44
    55import static org.openstreetmap.josm.tools.I18n.marktr;
     6import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    67import static org.openstreetmap.josm.tools.I18n.tr;
    78import static org.openstreetmap.josm.tools.I18n.trn;
     
    6263import org.openstreetmap.josm.data.osm.visitor.MergeVisitor;
    6364import org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor;
     65import org.openstreetmap.josm.gui.HelpAwareOptionPane;
    6466import org.openstreetmap.josm.gui.MapView;
     67import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    6568import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
    6669import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
     
    334337        );
    335338        String msg2 = trn(
    336                 "{0} object has been purged from the local dataset because it is deleted on the server.",
    337                 "{0} objects have been purged from 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.",
    338341                numPurgedPrimitives,
    339342                numPurgedPrimitives
    340343        );
     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       
    341355        StringBuffer sb = new StringBuffer();
    342356        sb.append("<html>").append(msg1);
     
    344358            sb.append("<br>").append(msg2);
    345359        }
    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        }
    347363        sb.append("</html>");
    348364        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                            )
    352372            };
    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,
    356375                    sb.toString(),
     376                    tr("Conflicts detected"),
    357377                    JOptionPane.WARNING_MESSAGE,
    358                     JOptionPane.DEFAULT_OPTION,
    359                     null,
     378                    null, /* no icon */
    360379                    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             );           
    388383        }
    389384    }
Note: See TracChangeset for help on using the changeset viewer.