Changeset 2037 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2009-09-03T14:13:22+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r2035 r2037 160 160 if (initialized) 161 161 return; 162 cancel = false; 162 163 initAuthentication(); 163 164 try { -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r2015 r2037 23 23 import org.openstreetmap.josm.Main; 24 24 import org.openstreetmap.josm.gui.ExtendedDialog; 25 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 25 26 import org.openstreetmap.josm.tools.Base64; 26 27 import org.openstreetmap.josm.tools.GBC; … … 94 95 95 96 public void cancel() { 96 //TODO97 //Main.pleaseWaitDlg.currentAction.setText(tr("Aborting..."));98 97 cancel = true; 99 98 if (activeConnection != null) { … … 112 111 try { 113 112 synchronized (credentialsManager) { 114 auth = credentialsManager.lookup(CredentialsManager.Key.USERNAME) + ":" + 115 113 auth = credentialsManager.lookup(CredentialsManager.Key.USERNAME) + ":" + 114 credentialsManager.lookup(CredentialsManager.Key.PASSWORD); 116 115 } 117 116 } catch (CredentialsManager.CMException e) { … … 139 138 String secret = Main.pref.get("osm-server." + key.toString(), null); 140 139 if (secret == null) throw new CredentialsManager.NoContentException(); 141 return secret; 140 return secret; 142 141 } 143 142 public void store(CredentialsManager.Key key, String secret) { … … 171 170 p.add(warning, GBC.eop()); 172 171 173 JCheckBox savePassword = new JCheckBox(tr("Save user and password (unencrypted)"), 174 172 JCheckBox savePassword = new JCheckBox(tr("Save user and password (unencrypted)"), 173 !username.equals("") && !password.equals("")); 175 174 p.add(savePassword, GBC.eop()); 176 175 177 int choice = new ExtendedDialog( 178 Main.parent, 179 tr("Enter Password"), 180 p, 181 new String[] {tr("Login"), tr("Cancel")}, 182 new String[] {"ok.png", "cancel.png"}).getValue(); 183 184 if (choice != 1) { 176 ExtendedDialog dialog = new ExtendedDialog( 177 Main.parent, 178 tr("Enter Password"), 179 new String[] {tr("Login"), tr("Cancel")} 180 ); 181 dialog.setContent(p); 182 dialog.setButtonIcons( new String[] {"ok.png", "cancel.png"}); 183 dialog.showDialog(); 184 185 if (dialog.getValue() != 1) { 185 186 caller.authCancelled = true; 186 187 return null; … … 223 224 oldServerURL = ""; 224 225 } 225 if (oldServerURL.equals("")) oldServerURL = "http://api.openstreetmap.org/api"; 226 if (oldServerURL.equals("")) { 227 oldServerURL = "http://api.openstreetmap.org/api"; 228 } 226 229 try { 227 230 oldUsername = lookup(Key.USERNAME); … … 258 261 String newPassword = String.valueOf(osmDataPassword.getPassword()); 259 262 if (!oldServerURL.equals(newServerURL)) { 260 store(Key.OSM_SERVER_URL, newServerURL); 263 store(Key.OSM_SERVER_URL, newServerURL); 261 264 } 262 265 if (!oldUsername.equals(newUsername)) { -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r2035 r2037 12 12 import org.openstreetmap.josm.Main; 13 13 import org.openstreetmap.josm.actions.UploadAction; 14 import org.openstreetmap.josm.data.osm.Changeset;15 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 15 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 203 202 } 204 203 205 public void disconnectActiveConnection() {206 if (api != null && api.activeConnection != null) {207 api. activeConnection.disconnect();204 public void cancel() { 205 if (api != null) { 206 api.cancel(); 208 207 } 209 208 }
Note:
See TracChangeset
for help on using the changeset viewer.