Ignore:
Timestamp:
2009-10-15T04:45:06+02:00 (17 years ago)
Author:
Gubaer
Message:

fixed #3719: Upload dialog still lists closed changesets after JOSM knows they've been closed
fixed #3668: Upload dialog: comment textbox buggy
Added context sensitive help to upload dialog
Improved error handling for errors due to closing already closed changesets

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
1 added
3 edited

Legend:

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

    r2240 r2289  
    144144
    145145    /**
     146     * Explains a {@see OsmApiException} which was thrown because of a conflict
     147     *
     148     * @param e the exception
     149     */
     150    public static void explainConflict(OsmApiException e) {
     151        JOptionPane.showMessageDialog(Main.parent, ExceptionUtil.explainConflict(e), tr("Conflict"),
     152                JOptionPane.ERROR_MESSAGE);
     153    }
     154
     155    /**
    146156     * Explains a {@see UnknownHostException} which has caused an {@see OsmTransferException}.
    147157     * This is most likely happening when there is an error in the API URL or when
    … …  
    231241                return;
    232242            }
     243            if (oae.getResponseCode() == HttpURLConnection.HTTP_CONFLICT) {
     244                explainConflict(oae);
     245                return;
     246            }
    233247
    234248        }
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java

    r2135 r2289  
    7070                new Runnable() {
    7171                    public void run() {
    72                         model.addOrUpdate(changesets);
     72                        model.setChangesets(changesets);
    7373                    }
    7474                }
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r2285 r2289  
    5252import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
    5353import org.openstreetmap.josm.gui.SideButton;
     54import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
     55import org.openstreetmap.josm.gui.help.HelpBuilder;
    5456import org.openstreetmap.josm.gui.tagging.TagEditorModel;
    5557import org.openstreetmap.josm.gui.tagging.TagEditorPanel;
    … …  
    6466 * This is a dialog for entering upload options like the parameters for
    6567 * the upload changeset and the strategy for opening/closing a changeset.
    66  *
    67  *
     68 *
    6869 */
    6970public class UploadDialog extends JDialog {
    70 
    7171
    7272    public static final String HISTORY_KEY = "upload.comment.history";
    … …  
    109109
    110110    private ChangesetSelectionPanel pnlChangesetSelection;
    111 
    112111    private boolean canceled = false;
    113112
    … …  
    152151        southTabbedPane.setComponentAt(0, pnlChangesetSelection = new ChangesetSelectionPanel());
    153152        southTabbedPane.setTitleAt(0, tr("Settings"));
     153        southTabbedPane.setToolTipTextAt(0, tr("Decide how to upload the data and which changeset to use"));
    154154        southTabbedPane.setTitleAt(1, tr("Tags of new changeset"));
     155        southTabbedPane.setToolTipTextAt(1, tr("Apply tags to the changeset data is uploaded to"));
    155156        southTabbedPane.addChangeListener(new TabbedPaneChangeLister());
    156157        JPanel pnl1 = new JPanel();
    … …  
    191192                JComponent.WHEN_IN_FOCUSED_WINDOW
    192193        );
     194
     195        pnl.add(new SideButton(new ContextSensitiveHelpAction("/Help/Dialogs/UploadDialog")));
     196        HelpBuilder.setHelpContext(getRootPane(),"/Help/Dialogs/UploadDialog");
    193197        return pnl;
    194198    }
    … …  
    562566
    563567    /**
    564      * Listens to window closing events and processes them as cancel events
     568     * Listens to window closing events and processes them as cancel events.
     569     * Listens to window open events and initializes user input
    565570     *
    566571     */
    … …  
    572577
    573578        @Override
    574         public void windowActivated(WindowEvent e) {
     579        public void windowOpened(WindowEvent e) {
    575580            startUserInput();
    576581        }
    … …  
    621626            pnl.add(new JLabel(tr("Provide a brief comment for the changes you are uploading:")), GBC.eol().insets(0, 5, 10, 3));
    622627            cmt = new HistoryComboBox();
     628            cmt.setToolTipText(tr("Enter an upload comment (min. 3 characters)"));
    623629            List<String> cmtHistory = new LinkedList<String>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>()));
    624630            // we have to reverse the history, because ComboBoxHistory will reverse it again
    … …  
    9941000    }
    9951001
     1002    /**
     1003     * A combobox model for the list of open changesets
     1004     *
     1005     */
    9961006    public class OpenChangesetModel extends DefaultComboBoxModel {
    9971007        private List<Changeset> changesets;
    … …  
    10341044        }
    10351045
    1036         /**
    1037          * Updates the current list of open changesets with the changesets
    1038          * in <code>changesets</code>
    1039          *
    1040          * @param changesets the collection of changesets. If null, removes
    1041          * all changesets from the current list of changesets
    1042          */
    1043         public void addOrUpdate(Collection<Changeset> changesets) {
    1044             if (changesets == null){
    1045                 this.changesets.clear();
    1046                 setSelectedItem(null);
    1047             }
    1048             for (Changeset cs: changesets) {
    1049                 internalAddOrUpdate(cs);
     1046        public void setChangesets(Collection<Changeset> changesets) {
     1047            this.changesets.clear();
     1048            if (changesets != null) {
     1049                for (Changeset cs: changesets) {
     1050                    internalAddOrUpdate(cs);
     1051                }
    10501052            }
    10511053            fireContentsChanged(this, 0, getSize());
    … …  
    10551057                if (changesets.contains(getSelectedItem())) {
    10561058                    setSelectedItem(getSelectedItem());
     1059                } else if (!this.changesets.isEmpty()){
     1060                    setSelectedItem(this.changesets.get(0));
    10571061                } else {
    1058                     setSelectedItem(this.changesets.get(0));
     1062                    setSelectedItem(null);
    10591063                }
    10601064            } else {
Note: See TracChangeset for help on using the changeset viewer.