Mercurial > hg > release > icedtea-web-1.5
changeset 37:3cac6a3232e6
use browser path from configuration
2010-11-05 Omair Majid <omajid@redhat.com>
* netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java:
Add KEY_BROWSER_PATH.
(loadDefaultProperties): Use KEY_BROWSER_PATH.
* netx/net/sourceforge/jnlp/services/XBasicService.java
(initialize): Use the browser command from the configuration.
Save updates to configuration as well.
author | Omair Majid <omajid@redhat.com> |
---|---|
date | Wed, 10 Nov 2010 16:20:51 -0500 |
parents | 5537145cde35 |
children | 44d47c366e5f |
files | ChangeLog netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java netx/net/sourceforge/jnlp/services/XBasicService.java |
diffstat | 3 files changed, 21 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Nov 10 16:07:06 2010 -0500 +++ b/ChangeLog Wed Nov 10 16:20:51 2010 -0500 @@ -1,3 +1,12 @@ +2010-11-05 Omair Majid <omajid@redhat.com> + + * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: + Add KEY_BROWSER_PATH. + (loadDefaultProperties): Use KEY_BROWSER_PATH. + * netx/net/sourceforge/jnlp/services/XBasicService.java + (initialize): Use the browser command from the configuration. + Save updates to configuration as well. + 2010-11-05 Omair Majid <omajid@redhat.com> * netx/net/sourceforge/jnlp/ShortcutDesc.java: Change prefixes from
--- a/netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java Wed Nov 10 16:07:06 2010 -0500 +++ b/netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java Wed Nov 10 16:20:51 2010 -0500 @@ -156,6 +156,8 @@ public static final String KEY_CREATE_DESKTOP_SHORTCUT = "deployment.javaws.shortcut"; + public static final String KEY_BROWSER_PATH = "deployment.browser.path"; + public enum ConfigType { System, User } @@ -383,7 +385,7 @@ /* jre management */ { "deployment.javaws.autodownload", null }, /* browser selection */ - { "deployment.browser.path", null }, + { KEY_BROWSER_PATH, null }, /* check for update timeout */ { "deployment.javaws.update.timeout", String.valueOf(500) } };
--- a/netx/net/sourceforge/jnlp/services/XBasicService.java Wed Nov 10 16:07:06 2010 -0500 +++ b/netx/net/sourceforge/jnlp/services/XBasicService.java Wed Nov 10 16:20:51 2010 -0500 @@ -30,6 +30,7 @@ import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.Launcher; import net.sourceforge.jnlp.runtime.ApplicationInstance; +import net.sourceforge.jnlp.runtime.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.PropertiesFile; @@ -199,15 +200,19 @@ command = "rundll32 url.dll,FileProtocolHandler "; } else { - PropertiesFile props = JNLPRuntime.getProperties(); - command = props.getProperty("browser.command"); + DeploymentConfiguration config = JNLPRuntime.getConfiguration(); + command = config.getProperty(DeploymentConfiguration.KEY_BROWSER_PATH); if(command == null) { // prompt & store command = promptForCommand(null); if(command != null) { - props.setProperty("browser.command", command); - props.store(); + config.setProperty(DeploymentConfiguration.KEY_BROWSER_PATH, command); + try { + config.save(); + } catch (IOException e) { + e.printStackTrace(); + } } } }