Changeset 33587 in osm for applications/editors
- Timestamp:
- 2017-09-09T17:19:12+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/native-password-manager
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/native-password-manager/build.xml
r33579 r33587 5 5 <property name="commit.message" value="Commit message"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="12 678"/>7 <property name="plugin.main.version" value="12805"/> 8 8 <property name="plugin.author" value="Paul Hartmann"/> 9 9 <property name="plugin.class" value="org.openstreetmap.josm.plugins.npm.NPMPlugin"/> -
applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/kde/KWalletProvider.java
r30822 r33587 222 222 } 223 223 224 private class CommandResult {224 private static class CommandResult { 225 225 private int exitCode; 226 226 private char[] retVal; -
applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/InitializationWizard.java
r33579 r33587 43 43 import org.openstreetmap.josm.Main; 44 44 import org.openstreetmap.josm.data.oauth.OAuthToken; 45 import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel;46 45 import org.openstreetmap.josm.gui.util.WindowGeometry; 47 46 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 47 import org.openstreetmap.josm.io.DefaultProxySelector; 48 48 import org.openstreetmap.josm.io.OsmApi; 49 49 import org.openstreetmap.josm.io.auth.CredentialsAgentException; … … 365 365 } 366 366 367 String proxy_username = Main.pref.get( ProxyPreferencesPanel.PROXY_USER, null);368 String proxy_password = Main.pref.get( ProxyPreferencesPanel.PROXY_PASS, null);369 String proxy_host = Main.pref.get( ProxyPreferencesPanel.PROXY_HTTP_HOST, null);367 String proxy_username = Main.pref.get(DefaultProxySelector.PROXY_USER, null); 368 String proxy_password = Main.pref.get(DefaultProxySelector.PROXY_PASS, null); 369 String proxy_host = Main.pref.get(DefaultProxySelector.PROXY_HTTP_HOST, null); 370 370 if (proxy_username != null || proxy_password != null) { 371 371 try { 372 372 cm.store(RequestorType.PROXY, proxy_host, new PasswordAuthentication(string(proxy_username), toCharArray(proxy_password))); 373 373 if (rbClear.isSelected()) { 374 Main.pref.put( ProxyPreferencesPanel.PROXY_USER, null);375 Main.pref.put( ProxyPreferencesPanel.PROXY_PASS, null);374 Main.pref.put(DefaultProxySelector.PROXY_USER, null); 375 Main.pref.put(DefaultProxySelector.PROXY_PASS, null); 376 376 } 377 377 } catch (CredentialsAgentException ex) { … … 425 425 Main.pref.get("osm-server.username", null) != null || 426 426 Main.pref.get("osm-server.password", null) != null || 427 Main.pref.get( ProxyPreferencesPanel.PROXY_USER, null) != null ||428 Main.pref.get( ProxyPreferencesPanel.PROXY_PASS, null) != null ||427 Main.pref.get(DefaultProxySelector.PROXY_USER, null) != null || 428 Main.pref.get(DefaultProxySelector.PROXY_PASS, null) != null || 429 429 Main.pref.get("oauth.access-token.key", null) != null || 430 430 Main.pref.get("oauth.access-token.secret", null) != null; -
applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgent.java
r30737 r33587 2 2 package org.openstreetmap.josm.plugins.npm; 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 4 6 import java.awt.Component; 5 import static org.openstreetmap.josm.tools.I18n.tr;6 7 7 import java.net.Authenticator.RequestorType; 8 8 import java.net.PasswordAuthentication; … … 12 12 import java.util.Map; 13 13 import java.util.zip.CRC32; 14 14 15 import javax.swing.text.html.HTMLEditorKit; 15 16 … … 17 18 import org.openstreetmap.josm.Main; 18 19 import org.openstreetmap.josm.data.oauth.OAuthToken; 19 import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel;20 20 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 21 import org.openstreetmap.josm.io.DefaultProxySelector; 21 22 import org.openstreetmap.josm.io.OsmApi; 22 23 import org.openstreetmap.josm.io.auth.AbstractCredentialsAgent; … … 70 71 protected String getProxyDescriptor() { 71 72 String pref = Main.pref.getPreferenceFile().getAbsolutePath(); 72 String host = Main.pref.get( ProxyPreferencesPanel.PROXY_HTTP_HOST, "");73 String port = Main.pref.get( ProxyPreferencesPanel.PROXY_HTTP_PORT, "");73 String host = Main.pref.get(DefaultProxySelector.PROXY_HTTP_HOST, ""); 74 String port = Main.pref.get(DefaultProxySelector.PROXY_HTTP_PORT, ""); 74 75 75 76 CRC32 id = new CRC32(); … … 229 230 sensitive.add(tr("password")); 230 231 } 231 if (Main.pref.get( ProxyPreferencesPanel.PROXY_USER, null) != null) {232 if (Main.pref.get(DefaultProxySelector.PROXY_USER, null) != null) { 232 233 sensitive.add(tr("proxy username")); 233 234 } 234 if (Main.pref.get( ProxyPreferencesPanel.PROXY_PASS, null) != null) {235 if (Main.pref.get(DefaultProxySelector.PROXY_PASS, null) != null) { 235 236 sensitive.add(tr("proxy password")); 236 237 } -
applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMType.java
r30442 r33587 8 8 import org.netbeans.modules.keyring.mac.MacProvider; 9 9 import org.netbeans.spi.keyring.KeyringProvider; 10 import org.openstreetmap.josm.tools.JosmRuntimeException; 10 11 11 12 import static org.openstreetmap.josm.tools.I18n.tr; … … 92 93 if (provider == null) { 93 94 try { 94 provider = providerClass.newInstance(); 95 } catch (InstantiationException ex) { 96 throw new RuntimeException(); 97 } catch (IllegalAccessException ex) { 98 throw new RuntimeException(); 95 provider = providerClass.getDeclaredConstructor().newInstance(); 96 } catch (IllegalArgumentException | ReflectiveOperationException | SecurityException ex) { 97 throw new JosmRuntimeException(ex); 99 98 } 100 99 }
Note:
See TracChangeset
for help on using the changeset viewer.