Changeset 1546 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2009-04-22T02:39:47+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r1523 r1546 15 15 import javax.swing.JPanel; 16 16 import javax.swing.JScrollPane; 17 import javax.swing.JTextField; 17 18 18 19 import org.openstreetmap.josm.Main; … … 36 37 public class UploadAction extends JosmAction { 37 38 39 /** 40 * Last commit message used for uploading changes. 41 * FIXME save this in preferences, or even offer list of 10 last recently used comments? 42 * FIXME ugly hack; value is filled here and retrieved in the OsmApi class; find better way 43 */ 44 public static String lastCommitComment; 45 38 46 /** Upload Hook */ 39 47 public interface UploadHook { … … 98 106 p.add(new JScrollPane(l), GBC.eol().fill()); 99 107 } 108 109 p.add(new JLabel(tr("Provide a brief comment for the changes you are uploading:")), GBC.eol().insets(0, 5, 10, 3)); 110 final JTextField cmt = new JTextField(lastCommitComment); 111 p.add(cmt, GBC.eol().fill(GBC.HORIZONTAL)); 100 112 101 return new ExtendedDialog(Main.parent, 113 while(true) { 114 int result = new ExtendedDialog(Main.parent, 102 115 tr("Upload these changes?"), 103 116 p, 104 117 new String[] {tr("Upload Changes"), tr("Cancel")}, 105 new String[] {"upload.png", "cancel.png"}).getValue() == 1; 118 new String[] {"upload.png", "cancel.png"}).getValue(); 119 120 // cancel pressed 121 if (result != 1) return false; 122 123 // don't allow empty commit message 124 if (cmt.getText().trim().length() < 3) continue; 125 126 lastCommitComment = cmt.getText().trim(); 127 break; 128 } 129 return true; 106 130 } 107 131 });
Note:
See TracChangeset
for help on using the changeset viewer.