Modify

Opened 11 years ago

Closed 10 years ago

Last modified 10 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 Changed 11 years ago by skyper

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 Changed 11 years ago by Don-vip

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 Changed 11 years ago by stoecker

Sure, why not.

comment:4 in reply to:  2 ; Changed 11 years ago by bastiK

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 in reply to:  4 Changed 10 years ago by Don-vip

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 Changed 10 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 5857/josm:

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

comment:7 Changed 10 years ago by Don-vip

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 10 years ago by Don-vip (previous) (diff)

comment:8 Changed 10 years ago by Don-vip

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

comment:9 Changed 10 years ago by skyper

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 Changed 10 years ago by Don-vip

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

comment:11 Changed 10 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 5904/josm:

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

comment:12 Changed 10 years ago by skyper

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.

comment:13 in reply to:  12 ; Changed 10 years ago by 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.

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

comment:14 in reply to:  13 Changed 10 years ago by skyper

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.