Changeset 1628 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2009-05-30T13:58:30+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r1575 r1628 22 22 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 23 23 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 24 import org.openstreetmap.josm.gui.historycombobox.StringUtils;25 24 import org.openstreetmap.josm.gui.historycombobox.SuggestingJHistoryComboBox; 26 25 import org.openstreetmap.josm.io.OsmServerWriter; … … 38 37 */ 39 38 public class UploadAction extends JosmAction { 40 41 public static final String HISTORY_KEY = "upload.comment.history"; 39 40 public static final String HISTORY_KEY = "upload.comment.history"; 42 41 43 42 /** Upload Hook */ … … 103 102 p.add(new JScrollPane(l), GBC.eol().fill()); 104 103 } 105 104 106 105 p.add(new JLabel(tr("Provide a brief comment for the changes you are uploading:")), GBC.eol().insets(0, 5, 10, 3)); 107 106 SuggestingJHistoryComboBox cmt = new SuggestingJHistoryComboBox(); 108 List<String> cmtHistory = StringUtils.stringToList(Main.pref.get(HISTORY_KEY), SuggestingJHistoryComboBox.DELIM);107 List<String> cmtHistory = new LinkedList<String>(Main.pref.getCollection(HISTORY_KEY, null)); 109 108 cmt.setHistory(cmtHistory); 110 109 //final JTextField cmt = new JTextField(lastCommitComment); … … 112 111 113 112 while(true) { 114 int result = new ExtendedDialog(Main.parent, 115 tr("Upload these changes?"), 113 int result = new ExtendedDialog(Main.parent, 114 tr("Upload these changes?"), 116 115 p, 117 new String[] {tr("Upload Changes"), tr("Cancel")}, 116 new String[] {tr("Upload Changes"), tr("Cancel")}, 118 117 new String[] {"upload.png", "cancel.png"}).getValue(); 119 118 120 119 // cancel pressed 121 120 if (result != 1) return false; 122 121 123 122 // don't allow empty commit message 124 123 if (cmt.getText().trim().length() < 3) continue; 125 124 126 125 // store the history of comments 127 126 cmt.addCurrentItemToHistory(); 128 Main.pref.put (HISTORY_KEY, StringUtils.listToString(cmt.getHistory(), SuggestingJHistoryComboBox.DELIM));129 127 Main.pref.putCollection(HISTORY_KEY, cmt.getHistory()); 128 130 129 break; 131 130 }
Note:
See TracChangeset
for help on using the changeset viewer.