Ignore:
Timestamp:
2013-08-09T16:08:30+02:00 (7 years ago)
Author:
bastiK
Message:

see #7275 - allow script to handle restart

When JOSM was started with parameter -Djosm.restart=true, a
user request for restart will simply terminate the application
with exit code 9.
The start script is then responsible for the restart.

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/ExitAction.java

    r6084 r6125  
    2828    @Override
    2929    public void actionPerformed(ActionEvent e) {
    30         Main.exitJosm(true);
     30        Main.exitJosm(true, 0);
    3131    }
    3232}
  • trunk/src/org/openstreetmap/josm/actions/RestartAction.java

    r6111 r6125  
    4343    @Override
    4444    public void actionPerformed(ActionEvent e) {
     45        // If JOSM has been started with property 'josm.restart=true' this means
     46        // it is executed by a start script that can handle restart.
     47        // Request for restart is indicated by exit code 9.
     48        String scriptRestart = System.getProperty("josm.restart");
     49        if ("true".equals(scriptRestart)) {
     50            Main.exitJosm(true, 9);
     51        }
     52       
    4553        try {
    4654            restartJOSM();
     
    6472     */
    6573    public static void restartJOSM() throws IOException {
    66         if (isRestartSupported() && !Main.exitJosm(false)) return;
     74        if (isRestartSupported() && !Main.exitJosm(false, 0)) return;
    6775        try {
    6876            // java binary
Note: See TracChangeset for help on using the changeset viewer.