From 8940dcbe7c61569946b155f97986ebfa7db45671 Mon Sep 17 00:00:00 2001 From: "minkee.lee" Date: Thu, 11 Sep 2014 17:06:59 +0900 Subject: [PATCH] Mobile Template: Added viewer-type(spice mode) option. Change-Id: I03cba5806fbdbde74e795e7de94722704ed77d37 Signed-off-by: minkee.lee --- .../manager/mobile/ui/detail/ItemListFactory.java | 56 ++++++++++++++++++++++ .../emulator/manager/mobile/vms/Launcher.java | 6 +-- template/x86-kiran-template.xml | 7 +++ 3 files changed, 65 insertions(+), 4 deletions(-) diff --git a/plugin-project/mobile-plugin/src/org/tizen/emulator/manager/mobile/ui/detail/ItemListFactory.java b/plugin-project/mobile-plugin/src/org/tizen/emulator/manager/mobile/ui/detail/ItemListFactory.java index 4fbe97c..c3e9be3 100644 --- a/plugin-project/mobile-plugin/src/org/tizen/emulator/manager/mobile/ui/detail/ItemListFactory.java +++ b/plugin-project/mobile-plugin/src/org/tizen/emulator/manager/mobile/ui/detail/ItemListFactory.java @@ -35,6 +35,17 @@ import org.tizen.emulator.manager.EmulatorManager; import org.tizen.emulator.manager.EmulatorManager.ManagerModeType; import org.tizen.emulator.manager.ui.detail.item.CommonItemListFactory; import org.tizen.emulator.manager.ui.detail.item.IViewItem; +import org.tizen.emulator.manager.ui.detail.item.ItemType; +import org.tizen.emulator.manager.ui.detail.item.LineLabelViewItem; +import org.tizen.emulator.manager.ui.detail.item.template.CheckLabelViewItem; +import org.tizen.emulator.manager.ui.detail.item.template.ComboViewItem; +import org.tizen.emulator.manager.ui.detail.item.template.FileViewItem; +import org.tizen.emulator.manager.ui.detail.item.template.LabelViewItem; +import org.tizen.emulator.manager.ui.detail.item.template.OnOffViewItem; +import org.tizen.emulator.manager.ui.detail.item.template.TextViewItem; +import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator; +import org.tizen.emulator.manager.vms.xml.template.DeviceList; +import org.tizen.emulator.manager.vms.xml.template.Item; import org.tizen.emulator.manager.vms.xml.template.ItemList; public class ItemListFactory extends CommonItemListFactory { @@ -67,6 +78,51 @@ public class ItemListFactory extends CommonItemListFactory { } } + // Override if need + public void makeDeviceItemList(List list, DeviceList deviceList) { + + if (deviceList != null) { + List itemList = (List)list; + List deviceItemList = deviceList.getItem(); + LineLabelViewItem currentLineLabel = null; // Top categorizing item + + for (Item item : deviceItemList) { + String type = item.getType(); + String name = item.getName(); + + if (name.equals(CheckingRunningEmulator.OPTION_VIEWER)) { + if (EmulatorManager.isLinux()) { + itemList.add(new LabelViewItem(item, currentLineLabel)); + } + continue; + } + + if (type.equals(ItemType.LINE_LABEL.getName())) { // Top categorizing item + currentLineLabel = new LineLabelViewItem(item); + itemList.add(currentLineLabel); + + } else if (type.equals(ItemType.TOGGLE.getName())) { + itemList.add(new OnOffViewItem(item, currentLineLabel)); + + } else if (type.equals(ItemType.LABEL.getName())) { + itemList.add(new LabelViewItem(item, currentLineLabel)); + + } else if (type.equals(ItemType.COMBO.getName())) { + itemList.add(new ComboViewItem(item, currentLineLabel)); + + } else if (type.equals(ItemType.FILE.getName())) { + itemList.add(new FileViewItem(item, currentLineLabel)); + + } else if (type.equals(ItemType.CHECK_LABEL.getName())) { + itemList.add(new CheckLabelViewItem(item, currentLineLabel)); + + } else if (type.equals(ItemType.TEXT.getName())) { + itemList.add(new TextViewItem(item, currentLineLabel)); + } + } + } + } + @Override public void makeCustomItemList(List itemList, diff --git a/plugin-project/mobile-plugin/src/org/tizen/emulator/manager/mobile/vms/Launcher.java b/plugin-project/mobile-plugin/src/org/tizen/emulator/manager/mobile/vms/Launcher.java index fee776d..91ea905 100644 --- a/plugin-project/mobile-plugin/src/org/tizen/emulator/manager/mobile/vms/Launcher.java +++ b/plugin-project/mobile-plugin/src/org/tizen/emulator/manager/mobile/vms/Launcher.java @@ -43,7 +43,6 @@ import org.tizen.emulator.manager.EmulatorManager; import org.tizen.emulator.manager.EmulatorManager.ManagerModeType; import org.tizen.emulator.manager.console.RemoteManager; import org.tizen.emulator.manager.logging.EMLogger; -import org.tizen.emulator.manager.mobile.ui.detail.TNFCItem; import org.tizen.emulator.manager.resources.FilePathResources; import org.tizen.emulator.manager.resources.StringResources; import org.tizen.emulator.manager.tool.CheckVirtualization; @@ -431,8 +430,6 @@ public class Launcher implements ILauncher { cmd.add(sb.toString()); } } - - } /* append user added options if exists */ @@ -445,7 +442,8 @@ public class Launcher implements ILauncher { } /* spice options */ - if (RemoteManager.getSpiceMode()) { + if (RemoteManager.getSpiceMode() + || CheckingRunningEmulator.isRemote(property)) { cmd.add("-spice"); cmd.add("disable-ticketing"); cmd.add("-device"); diff --git a/template/x86-kiran-template.xml b/template/x86-kiran-template.xml index afb7421..6eee363 100644 --- a/template/x86-kiran-template.xml +++ b/template/x86-kiran-template.xml @@ -45,6 +45,13 @@ + + + + + + + -- 2.7.4