Modify

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#8561 closed enhancement (fixed)

Replace 'warning, you will need to restart' alert after plugin installation with confirmation box

Reported by: daniel.oconnor@… Owned by: Don-vip
Priority: minor Milestone:
Component: Core Version:
Keywords: usability Cc:

Description

  1. Install a new plugin
  2. Acknowledge the UI which indicates you will need to restart
  3. Close the plugin manager UI
  4. Acknowledge the 'Warning, you will need to restart' alert UI
  5. File
  6. 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 skyper, 12 years ago

Component: PluginCore

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.

comment:2 by Don-vip, 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

comment:3 by stoecker, 12 years ago

Sure, why not.

in reply to:  2 ; comment:4 by bastiK, 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.

in reply to:  4 comment:5 by Don-vip, 11 years ago

Replying to bastiK:

this is easy to fix, just save the argument list from the public static void main(String[] args) { ... } method.

Done in r5831 with Main.commandLineArgs (now displayed in status report)

comment:6 by Don-vip, 11 years ago

Resolution: fixed
Status: newclosed

In 5857/josm:

fix #8561 - Integrate restart plugin into core. Asks for restart when needed.

comment:7 by Don-vip, 11 years ago

Resolution: fixed
Status: closedreopened

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.

Last edited 11 years ago by Don-vip (previous) (diff)

comment:8 by Don-vip, 11 years ago

Owner: changed from team to Don-vip
Status: reopenednew

comment:9 by skyper, 11 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

comment:10 by Don-vip, 11 years ago

It will work when I'll fix the issue I have on Windows too.

comment:11 by Don-vip, 11 years ago

Resolution: fixed
Status: newclosed

In 5904/josm:

fix #8561 - fix restart on 6u45/7u21 (wrong call to Runtime.exec(String))

comment:12 by skyper, 11 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.

in reply to:  12 ; comment:13 by Don-vip, 11 years ago

Replying to skyper:

One minor issue though. If started from a terminal the restart is not executed in this terminal.

Known issue: #7275. But I don't know if it's possible to fix it.

Last edited 11 years ago by Don-vip (previous) (diff)

in reply to:  13 comment:14 by skyper, 11 years ago

Replying to Don-vip:

Replying to skyper:

One minor issue though. If started from a terminal the restart is not executed in this terminal.

Known issue: #7275. But I don't know if it's possible to fix it.

Does not work that well anymore as restart will always open a new shell.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.