proxy-option: set default value
authorminkee.lee <minkee.lee@samsung.com>
Mon, 30 Nov 2015 05:54:00 +0000 (14:54 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 1 Dec 2015 05:08:15 +0000 (14:08 +0900)
Set default value (auto) for proxy mode.

Change-Id: Ibff3aba7f184cb8f14d99e25b32bf634422517f8
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetProxyItem.java

index 44ee7d3..3d2786b 100644 (file)
@@ -181,14 +181,19 @@ public class NetProxyItem extends ComboItem{
                        return;
                }
 
-               // select item
-               int index = 0;
+
+               int index = -1;
                for (int i=0 ; i < getComboItemList().size() ; i++) {
                        if (getComboItemList().get(i).equals(optionMap.get(proxyMode))) {
                                index = i;
                                break;
                        }
                }
+
+               if (index == -1) {
+                       index = 0;
+                       proxyMode = (String)getCobmoData(0);
+               }
                selectComboItem(index, notifySelect);
                if (getItemListComp().isDetailMode()) {
                        comboBox.setEnabled(false);
@@ -256,6 +261,9 @@ public class NetProxyItem extends ComboItem{
        @Override
        public void setInitialValue(PropertyValue value) {
                proxyMode = value.getSubOptionValue(ItemName.NET_PROXY, ITEM_PROXY_MODE);
+               if (proxyMode.isEmpty()) {
+                       proxyMode = MODE_AUTO;
+               }
                if (proxyMode.equals(MODE_MANUAL)) {
                        httpProxy = value.getSubOptionValue(ItemName.NET_PROXY, ITEM_HTTP_PROXY);
                        httpsProxy = value.getSubOptionValue(ItemName.NET_PROXY, ITEM_HTTPS_PROXY);