Changeset 2289 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2009-10-15T04:45:06+02:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 1 added
- 3 edited
-
ExceptionDialogUtil.java (modified) (2 diffs)
-
help/ContextSensitiveHelpAction.java (added)
-
io/DownloadOpenChangesetsTask.java (modified) (1 diff)
-
io/UploadDialog.java (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
r2240 r2289 144 144 145 145 /** 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 /** 146 156 * Explains a {@see UnknownHostException} which has caused an {@see OsmTransferException}. 147 157 * This is most likely happening when there is an error in the API URL or when … … 231 241 return; 232 242 } 243 if (oae.getResponseCode() == HttpURLConnection.HTTP_CONFLICT) { 244 explainConflict(oae); 245 return; 246 } 233 247 234 248 } -
trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java
r2135 r2289 70 70 new Runnable() { 71 71 public void run() { 72 model. addOrUpdate(changesets);72 model.setChangesets(changesets); 73 73 } 74 74 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r2285 r2289 52 52 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 53 53 import org.openstreetmap.josm.gui.SideButton; 54 import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction; 55 import org.openstreetmap.josm.gui.help.HelpBuilder; 54 56 import org.openstreetmap.josm.gui.tagging.TagEditorModel; 55 57 import org.openstreetmap.josm.gui.tagging.TagEditorPanel; … … 64 66 * This is a dialog for entering upload options like the parameters for 65 67 * the upload changeset and the strategy for opening/closing a changeset. 66 * 67 * 68 * 68 69 */ 69 70 public class UploadDialog extends JDialog { 70 71 71 72 72 public static final String HISTORY_KEY = "upload.comment.history"; … … 109 109 110 110 private ChangesetSelectionPanel pnlChangesetSelection; 111 112 111 private boolean canceled = false; 113 112 … … 152 151 southTabbedPane.setComponentAt(0, pnlChangesetSelection = new ChangesetSelectionPanel()); 153 152 southTabbedPane.setTitleAt(0, tr("Settings")); 153 southTabbedPane.setToolTipTextAt(0, tr("Decide how to upload the data and which changeset to use")); 154 154 southTabbedPane.setTitleAt(1, tr("Tags of new changeset")); 155 southTabbedPane.setToolTipTextAt(1, tr("Apply tags to the changeset data is uploaded to")); 155 156 southTabbedPane.addChangeListener(new TabbedPaneChangeLister()); 156 157 JPanel pnl1 = new JPanel(); … … 191 192 JComponent.WHEN_IN_FOCUSED_WINDOW 192 193 ); 194 195 pnl.add(new SideButton(new ContextSensitiveHelpAction("/Help/Dialogs/UploadDialog"))); 196 HelpBuilder.setHelpContext(getRootPane(),"/Help/Dialogs/UploadDialog"); 193 197 return pnl; 194 198 } … … 562 566 563 567 /** 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 565 570 * 566 571 */ … … 572 577 573 578 @Override 574 public void window Activated(WindowEvent e) {579 public void windowOpened(WindowEvent e) { 575 580 startUserInput(); 576 581 } … … 621 626 pnl.add(new JLabel(tr("Provide a brief comment for the changes you are uploading:")), GBC.eol().insets(0, 5, 10, 3)); 622 627 cmt = new HistoryComboBox(); 628 cmt.setToolTipText(tr("Enter an upload comment (min. 3 characters)")); 623 629 List<String> cmtHistory = new LinkedList<String>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>())); 624 630 // we have to reverse the history, because ComboBoxHistory will reverse it again … … 994 1000 } 995 1001 1002 /** 1003 * A combobox model for the list of open changesets 1004 * 1005 */ 996 1006 public class OpenChangesetModel extends DefaultComboBoxModel { 997 1007 private List<Changeset> changesets; … … 1034 1044 } 1035 1045 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 } 1050 1052 } 1051 1053 fireContentsChanged(this, 0, getSize()); … … 1055 1057 if (changesets.contains(getSelectedItem())) { 1056 1058 setSelectedItem(getSelectedItem()); 1059 } else if (!this.changesets.isEmpty()){ 1060 setSelectedItem(this.changesets.get(0)); 1057 1061 } else { 1058 setSelectedItem( this.changesets.get(0));1062 setSelectedItem(null); 1059 1063 } 1060 1064 } else {
Note:
See TracChangeset
for help on using the changeset viewer.
