Ignore:
Timestamp:
2009-05-30T13:58:30+02:00 (15 years ago)
Author:
stoecker
Message:

cleanup group settings in preferences

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/UploadAction.java

    r1575 r1628  
    2222import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
    2323import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    24 import org.openstreetmap.josm.gui.historycombobox.StringUtils;
    2524import org.openstreetmap.josm.gui.historycombobox.SuggestingJHistoryComboBox;
    2625import org.openstreetmap.josm.io.OsmServerWriter;
     
    3837 */
    3938public 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";
    4241
    4342    /** Upload Hook */
     
    103102                    p.add(new JScrollPane(l), GBC.eol().fill());
    104103                }
    105                
     104
    106105                p.add(new JLabel(tr("Provide a brief comment for the changes you are uploading:")), GBC.eol().insets(0, 5, 10, 3));
    107106                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));
    109108                cmt.setHistory(cmtHistory);
    110109                //final JTextField cmt = new JTextField(lastCommitComment);
     
    112111
    113112                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?"),
    116115                        p,
    117                         new String[] {tr("Upload Changes"), tr("Cancel")}, 
     116                        new String[] {tr("Upload Changes"), tr("Cancel")},
    118117                        new String[] {"upload.png", "cancel.png"}).getValue();
    119                    
     118
    120119                    // cancel pressed
    121120                    if (result != 1) return false;
    122                    
     121
    123122                    // don't allow empty commit message
    124123                    if (cmt.getText().trim().length() < 3) continue;
    125                    
     124
    126125                    // store the history of comments
    127126                    cmt.addCurrentItemToHistory();
    128                     Main.pref.put(HISTORY_KEY, StringUtils.listToString(cmt.getHistory(), SuggestingJHistoryComboBox.DELIM));
    129                    
     127                    Main.pref.putCollection(HISTORY_KEY, cmt.getHistory());
     128
    130129                    break;
    131130                }
Note: See TracChangeset for help on using the changeset viewer.