Changeset 12273 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-05-29T15:43:26+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/RestartAction.java
r11650 r12273 56 56 @Override 57 57 public void actionPerformed(ActionEvent e) { 58 try { 59 restartJOSM(); 60 } catch (IOException ex) { 61 Main.error(ex); 62 } 63 } 64 65 /** 66 * Determines if restarting the application should be possible on this platform. 67 * @return {@code true} if the mandatory system property {@code sun.java.command} is defined, {@code false} otherwise. 68 * @since 5951 69 */ 70 public static boolean isRestartSupported() { 71 return System.getProperty("sun.java.command") != null; 72 } 73 74 /** 75 * Restarts the current Java application. 76 * @throws IOException in case of any I/O error 77 */ 78 public static void restartJOSM() throws IOException { 58 79 // If JOSM has been started with property 'josm.restart=true' this means 59 80 // it is executed by a start script that can handle restart. … … 64 85 } 65 86 66 try {67 restartJOSM();68 } catch (IOException ex) {69 Main.error(ex);70 }71 }72 73 /**74 * Determines if restarting the application should be possible on this platform.75 * @return {@code true} if the mandatory system property {@code sun.java.command} is defined, {@code false} otherwise.76 * @since 595177 */78 public static boolean isRestartSupported() {79 return System.getProperty("sun.java.command") != null;80 }81 82 /**83 * Restarts the current Java application.84 * @throws IOException in case of any I/O error85 */86 public static void restartJOSM() throws IOException {87 87 if (isRestartSupported() && !Main.exitJosm(false, 0, SaveLayersDialog.Reason.RESTART)) return; 88 88 final List<String> cmd; -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r12150 r12273 498 498 Main.info(tr("Detected no useable IPv6 network, prefering IPv4 over IPv6 after next restart.")); 499 499 Main.pref.put("validated.ipv6", hasv6); // be sure it is stored before the restart! 500 new RestartAction().actionPerformed(null); 500 try { 501 RestartAction.restartJOSM(); 502 } catch (IOException e) { 503 Main.error(e); 504 } 501 505 } 502 506 Main.pref.put("validated.ipv6", hasv6); -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r11974 r12273 610 610 Main.pref.putCollection("plugins", plugins); 611 611 // restart 612 new RestartAction().actionPerformed(null); 612 try { 613 RestartAction.restartJOSM(); 614 } catch (IOException e) { 615 Main.error(e); 616 } 613 617 } else { 614 618 Main.warn("No plugin downloaded, restart canceled");
Note:
See TracChangeset
for help on using the changeset viewer.