proxy-option: Fixed checking host proxy.
authorminkee.lee <minkee.lee@samsung.com>
Wed, 17 Jun 2015 06:26:57 +0000 (15:26 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 18 Jun 2015 04:14:35 +0000 (13:14 +0900)
- check only if host proxy option is selected.

Change-Id: I4e734ee10f44dc7bc448cf7349d7f0645ebdf87a
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
src/org/tizen/emulator/manager/vms/VMLauncher.java
src/org/tizen/emulator/manager/vms/option/NetProxyOption.java

index 8c17186..7471d48 100644 (file)
@@ -135,7 +135,7 @@ public class VMLauncher {
 
        }
 
-       private static String getProxyArgument(VMProperty property) {
+       private static String getProxyArgument(VMProperty property) throws VMLauncherException {
                String hostProxy = NetProxyOption.getHostProxyCmd(property);
                if (hostProxy.isEmpty()) {
                        return "";
index 48eed0b..30e9903 100644 (file)
@@ -42,26 +42,23 @@ import org.tizen.emulator.manager.ui.dialog.MessageDialog;
 import org.tizen.emulator.manager.vms.VMProperty;
 import org.tizen.emulator.manager.vms.helper.HelperClass;
 import org.tizen.emulator.manager.vms.helper.ProcessResult;
+import org.tizen.emulator.manager.vms.helper.VMLauncherException;
 import org.tizen.emulator.manager.vms.helper.VMWorkerException;
 
 public class NetProxyOption extends Option {
 
-       public static String hostProxy = "";
+       public static String hostProxy;
        public static final String PROXY_COMMENT = "# network_proxy : use host's proxy configuration\n"
                        + "# (only if VM's proxy option is set as using host proxy)";
-       static {
-               try {
-                       hostProxy = getHostProxy();
-               } catch (VMWorkerException e) {
-                       EMLogger.getLogger().info("Failed to get host proxy :" + e.getMessage());
-               }
-       }
 
-       public static String getHostProxyCmd(VMProperty property) {
+       public static String getHostProxyCmd(VMProperty property) throws VMLauncherException {
                String proxyMode = property.getPropertyValue()
                                .getAdvancedOptionSubValue(ItemName.NET_PROXY,
                                                NetProxyViewItem.ITEM_PROXY_MODE);
                if (proxyMode.equals(NetProxyViewItem.MODE_AUTO)) {
+                       if (hostProxy == null) {
+                               hostProxy = getHostProxy();
+                       }
                        return hostProxy;
                }
 
@@ -114,7 +111,7 @@ public class NetProxyOption extends Option {
 
        }
 
-       public static String getHostProxy() throws VMWorkerException {
+       public static String getHostProxy() throws VMLauncherException {
                String result = null;
                String proxyCommand = "check-net";
                if (EmulatorManager.isWin()) {
@@ -141,9 +138,9 @@ public class NetProxyOption extends Option {
                                        .openWarningAndSelectionDialog("Failed to get host proxy setting."
                                                        + "\n"
                                                        + res.getResultMessage()
-                                                       + "\nContinue creating anyway ?");
+                                                       + "\nContinue launching anyway ?");
                        if (dialogRes != SWT.OK) {
-                               throw new VMWorkerException("User canceled creating VM.");
+                               throw new VMLauncherException("User canceled launching VM.");
                        }
                }