From d2ad9841f26a30cd37fdf3b573f14f8034e3f40e Mon Sep 17 00:00:00 2001 From: "jihye424.kim" Date: Tue, 3 Nov 2015 12:39:57 +0900 Subject: [PATCH] Create VM: modify setting default skin routine - default skin -> high priority skin of platform's skin list Change-Id: I136241847421f6853209d1373ac71a49f3d746b8 Signed-off-by: jihye424.kim --- .../manager/ui/renewal/tableviewer/CreateVMTable.java | 9 ++++++--- .../ui/renewal/tableviewer/CreateVMTableViewer.java | 15 +++++++++++---- .../ui/renewal/tableviewer/CreateVMTopComposite.java | 5 ++++- .../ui/renewal/tableviewer/DeviceTemplateTableViewer.java | 2 +- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTable.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTable.java index 8480f59..72ee1ab 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTable.java +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTable.java @@ -93,7 +93,6 @@ public class CreateVMTable { Profile profile = viewer.getProfile(); image = viewer.getBaseImage(); if (profile != null && image != null) { - System.out.println("show table"); SKIN_SHAPE shape = image.getSkinShape(); for (DeviceTemplate template : profile.getTemplateList()) { @@ -172,7 +171,7 @@ public class CreateVMTable { } DeviceTemplateValue value = template.getValue(); - // set default skin + //TODO: set default skin Skin skin = null; List skins = image.getPlatform().findSkinList(value.getResolution(), value.getSkinShape()); if (!skins.isEmpty()) { @@ -211,7 +210,11 @@ public class CreateVMTable { : ""); item.setToolTipText(1, displayInfo); item.setToolTipText(2, displayInfo); - item.setToolTipText(3, displayInfo); + item.setToolTipText(3, displayInfo + + (value.getSkin() == null + ? "" + : StringResources.NEW_LINE + + "Skin path: " + value.getSkin().getPath())); } } diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTableViewer.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTableViewer.java index ec05c8c..c6c148a 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTableViewer.java +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTableViewer.java @@ -199,8 +199,11 @@ public class CreateVMTableViewer extends AbstractTableViewer { public void setBaseImage(BaseImage baseImage) { boolean needRedrawingTable = false; - if (this.baseImage == null - || this.baseImage.getSkinShape() != baseImage.getSkinShape()) { + if (this.baseImage == null) { + needRedrawingTable = true; + } else if (this.baseImage.getSkinShape() != baseImage.getSkinShape()) { + needRedrawingTable = true; + } else if (this.baseImage.getPlatform() != baseImage.getPlatform()) { needRedrawingTable = true; } @@ -285,10 +288,14 @@ public class CreateVMTableViewer extends AbstractTableViewer { private void createEmulator() { // TODO VMProperty lastCreateProperty = profile.getLastCreatedProperty(); - VMPropertyValue value = lastCreateProperty.getPropertyValue(); + VMPropertyValue value = null; + if (lastCreateProperty != null) { + value = new VMPropertyValue(baseImage, lastCreateProperty); + } else { + value = new VMPropertyValue(baseImage, baseImage.getDefaultProperty()); + } value.vmsName = vmName; - value.setBaseImage(baseImage); value.setDeviceTemplate(template); // TODO diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTopComposite.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTopComposite.java index 18ffffc..b671c71 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTopComposite.java +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTopComposite.java @@ -191,7 +191,10 @@ public class CreateVMTopComposite extends Composite { + StringResources.NEW_LINE + "Path: " + baseImage.getPath(); baseImageCombo.setToolTipText(toolTip); - vmNameText.setText(getDefaultName()); + if (vmNameText.getTextWidget().getText().isEmpty()) { + vmNameText.setText(getDefaultName()); + } + // change base image viewer.setBaseImage(baseImage); default: break; diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/DeviceTemplateTableViewer.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/DeviceTemplateTableViewer.java index d2a5131..30b1f43 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/DeviceTemplateTableViewer.java +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/DeviceTemplateTableViewer.java @@ -639,7 +639,7 @@ public class DeviceTemplateTableViewer extends AbstractTableViewer { } else { // finding default template ProfileButton pButton = findTopPriorityProfileButton(); - if (pButton != null) { + if (pButton != null && pButton.getProfile().getDefaultTemplate() != null) { value = pButton.getProfile().getDefaultTemplate().getValue(); } } -- 2.7.4