#8561 closed enhancement (fixed)
Replace 'warning, you will need to restart' alert after plugin installation with confirmation box
Reported by: | Owned by: | Don-vip | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Core | Version: | |
Keywords: | usability | Cc: |
Description
- Install a new plugin
- Acknowledge the UI which indicates you will need to restart
- Close the plugin manager UI
- Acknowledge the 'Warning, you will need to restart' alert UI
- File
- Exit
Expected:
Step 4 should be a OK/Cancel UI, which asks 'would you like to restart now, to finish installing plugins?'
Clicking OK should close the application, clicking cancel should close the prompt UI.
Attachments (0)
Change History (14)
comment:1 by , 12 years ago
Component: | Plugin → Core |
---|
follow-up: 4 comment:2 by , 12 years ago
Maybe we could integrate restart plugin into core ? It's only a few lines of code, and this example may fix the cases where the plugin might fail:
http://lewisleo.blogspot.jp/2012/08/programmatically-restart-java.html
follow-up: 5 comment:4 by , 12 years ago
Replying to Don-vip:
Maybe we could integrate restart plugin into core ?
+1
It's only a few lines of code, and this example may fix the cases where the plugin might fail:
http://lewisleo.blogspot.jp/2012/08/programmatically-restart-java.html
Nice article. Although you cannot use System.getProperty("sun.java.command")
to collect program arguments, because it will fail when arguments contain space characters (e.g. a file name). But this is easy to fix, just save the argument list from the public static void main(String[] args) { ... }
method.
comment:5 by , 12 years ago
comment:7 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Implementation does not work anymore on Windows after upgrading to 6u45/7u21 because of breaking changes of Runtime.exec().
The command string need to be replaced by an array, without quoting the executable.
comment:8 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:9 by , 12 years ago
It does not work for me on linux either. I just did download the .jar file and did start java from a terminal:
user@host:~$ java -jar josm-latest.jar
java.io.IOException: Cannot run program ""/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java"": java.io.IOException: error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:475) at java.lang.Runtime.exec(Runtime.java:610) at java.lang.Runtime.exec(Runtime.java:448) at java.lang.Runtime.exec(Runtime.java:345) at org.openstreetmap.josm.actions.RestartAction$1.run(RestartAction.java:89) Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.<init>(UNIXProcess.java:164) at java.lang.ProcessImpl.start(ProcessImpl.java:81) at java.lang.ProcessBuilder.start(ProcessBuilder.java:468) ... 4 more
follow-up: 13 comment:12 by , 12 years ago
Thanks, works almost perfect. Does even work if started through a non-executable script.
One minor issue though. If started from a terminal the restart is not executed in this terminal.
Restarting is not that easy as there are several ways to start josm and it differs from OS to OS.
Anyway, have a look at the restart plugin which should work in most cases.