Changeset 7335 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2014-07-26T03:50:31+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r7187 r7335 13 13 import java.awt.event.WindowEvent; 14 14 import java.io.File; 15 import java.io.IOException; 15 16 import java.io.InputStream; 16 17 import java.net.Authenticator; … … 19 20 import java.security.AllPermission; 20 21 import java.security.CodeSource; 22 import java.security.KeyStoreException; 23 import java.security.NoSuchAlgorithmException; 21 24 import java.security.PermissionCollection; 22 25 import java.security.Permissions; 23 26 import java.security.Policy; 27 import java.security.cert.CertificateException; 24 28 import java.util.ArrayList; 25 29 import java.util.Collection; … … 59 63 import org.openstreetmap.josm.tools.ImageProvider; 60 64 import org.openstreetmap.josm.tools.OsmUrlToBounds; 65 import org.openstreetmap.josm.tools.PlatformHookWindows; 61 66 import org.openstreetmap.josm.tools.Utils; 62 67 … … 323 328 // Enable JOSM debug level 324 329 logLevel = 4; 325 // Enable debug in OAuth signpost326 Preferences.updateSystemProperty("debug", "true");327 330 Main.info(tr("Printing debugging messages to console")); 328 331 } … … 331 334 // Enable JOSM debug level 332 335 logLevel = 5; 336 // Enable debug in OAuth signpost via system preference, but only at trace level 337 Preferences.updateSystemProperty("debug", "true"); 333 338 Main.info(tr("Enabled detailed debug level (trace)")); 334 339 } … … 435 440 436 441 SwingUtilities.invokeLater(new GuiFinalizationWorker(args, proxySelector)); 442 443 if (Main.isPlatformWindows()) { 444 try { 445 // Check for insecure certificates to remove. 446 // This is Windows-dependant code but it can't go to preStartupHook (need i18n) neither startupHook (need to be called before remote control) 447 ((PlatformHookWindows)Main.platform).removeInsecureCertificates(); 448 } catch (NoSuchAlgorithmException | CertificateException | KeyStoreException | IOException e) { 449 error(e); 450 } 451 } 437 452 438 453 if (RemoteControl.PROP_REMOTECONTROL_ENABLED.get()) { -
trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java
r7005 r7335 28 28 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; 29 29 import org.openstreetmap.josm.io.remotecontrol.RemoteControl; 30 import org.openstreetmap.josm.io.remotecontrol.RemoteControlHttpsServer; 30 31 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler; 31 32 import org.openstreetmap.josm.tools.GBC; … … 59 60 private final Map<PermissionPrefWithDefault, JCheckBox> prefs = new LinkedHashMap<>(); 60 61 private JCheckBox enableRemoteControl; 62 private JCheckBox enableHttpsSupport; 61 63 private JCheckBox loadInNewLayer = new JCheckBox(tr("Download objects to new layer")); 62 64 private JCheckBox alwaysAskUserConfirm = new JCheckBox(tr("Confirm all Remote Control actions manually")); … … 89 91 remote.add(wrapper, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 5, 5, 5)); 90 92 91 wrapper.add(new JLabel(tr("Permitted actions:")), GBC.eol()); 93 enableHttpsSupport = new JCheckBox(tr("Enable HTTPS support"), RemoteControl.PROP_REMOTECONTROL_HTTPS_ENABLED.get()); 94 wrapper.add(enableHttpsSupport, GBC.eol().fill(GBC.HORIZONTAL)); 95 wrapper.add(new JSeparator(), GBC.eop().fill(GBC.HORIZONTAL).insets(15, 5, 15, 5)); 96 97 wrapper.add(new JLabel(tr("Permitted actions:")), GBC.eol().insets(5, 0, 0, 0)); 92 98 for (JCheckBox p : prefs.values()) { 93 99 wrapper.add(p, GBC.eol().insets(15, 5, 0, 0).fill(GBC.HORIZONTAL)); … … 120 126 public boolean ok() { 121 127 boolean enabled = enableRemoteControl.isSelected(); 128 boolean httpsEnabled = enableHttpsSupport.isSelected(); 122 129 boolean changed = RemoteControl.PROP_REMOTECONTROL_ENABLED.put(enabled); 130 boolean httpsChanged = RemoteControl.PROP_REMOTECONTROL_HTTPS_ENABLED.put(httpsEnabled); 123 131 if (enabled) { 124 132 for (Entry<PermissionPrefWithDefault, JCheckBox> p : prefs.entrySet()) { … … 134 142 RemoteControl.stop(); 135 143 } 144 } else if (httpsChanged) { 145 if (httpsEnabled) { 146 RemoteControlHttpsServer.restartRemoteControlHttpsServer(); 147 } else { 148 RemoteControlHttpsServer.stopRemoteControlHttpsServer(); 149 } 136 150 } 137 151 return false;
Note:
See TracChangeset
for help on using the changeset viewer.