From eb40d59c64fdd05ae3bc67e15e5e1e2fce00a443 Mon Sep 17 00:00:00 2001 From: jihye kim Date: Mon, 2 Jul 2012 15:29:33 +0900 Subject: [PATCH] [Title] remove key type option and delete success dialog [Type] work [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- .../tizen/emulator/manager/console/ActionList.java | 4 +++ .../emulator/manager/console/ConsoleCreateVM.java | 2 ++ src/org/tizen/emulator/manager/ui/CloneDialog.java | 6 ++-- .../tizen/emulator/manager/ui/MenuHandling.java | 8 +++--- .../emulator/manager/ui/detail/VMPropertyView.java | 33 ++++++++++++++-------- src/org/tizen/emulator/manager/vms/Creator.java | 16 +++++------ src/org/tizen/emulator/manager/vms/VMsWorker.java | 8 ++++-- 7 files changed, 46 insertions(+), 31 deletions(-) diff --git a/src/org/tizen/emulator/manager/console/ActionList.java b/src/org/tizen/emulator/manager/console/ActionList.java index 5b7e5bc..f74016b 100644 --- a/src/org/tizen/emulator/manager/console/ActionList.java +++ b/src/org/tizen/emulator/manager/console/ActionList.java @@ -307,8 +307,10 @@ class Create extends Action { , RESOLUTION.HD.getType(), false, true)); commandList.add(new Command("d", Actions.OP_DPI, "DPI. (100 ~ 480)", Integer.toString(property.dpi), false, true)); + /* commandList.add(new Command("k", Actions.OP_KEYTYPE, "Skin'front button type. (1 | 3)", Integer.toString(property.keyType), false, true)); + */ String ram = ""; for (RAM_SIZE size : RAM_SIZE.values()) { @@ -359,8 +361,10 @@ class Modify extends Action { commandList.add(new Command("d", Actions.OP_DPI, "DPI. (100 ~ 480)", Integer.toString(property.dpi), false, true)); */ + /* commandList.add(new Command("k", Actions.OP_KEYTYPE, "Skin'front button type. (1 | 3)", Integer.toString(property.keyType), false, true)); + */ String ram = ""; for (RAM_SIZE size : RAM_SIZE.values()) { diff --git a/src/org/tizen/emulator/manager/console/ConsoleCreateVM.java b/src/org/tizen/emulator/manager/console/ConsoleCreateVM.java index 4713f10..a619ae9 100644 --- a/src/org/tizen/emulator/manager/console/ConsoleCreateVM.java +++ b/src/org/tizen/emulator/manager/console/ConsoleCreateVM.java @@ -145,6 +145,7 @@ public class ConsoleCreateVM { throw new ConsoleException("DPI value (" + c.getCurrentValue() + ") is not avaliable."); } } + /* else if (c.getLongName() == Actions.OP_KEYTYPE) { check = false; int key = Integer.valueOf(c.getCurrentValue()); @@ -157,6 +158,7 @@ public class ConsoleCreateVM { + c.getCurrentValue() + ") is not avaliable. Avaliable key type is 1 or 3."); } } + */ else if (c.getLongName() == Actions.OP_RAM) { prop.ramSize = checkRAMSize(c.getCurrentValue()).getSize(); } diff --git a/src/org/tizen/emulator/manager/ui/CloneDialog.java b/src/org/tizen/emulator/manager/ui/CloneDialog.java index fed9775..5a7ebb9 100644 --- a/src/org/tizen/emulator/manager/ui/CloneDialog.java +++ b/src/org/tizen/emulator/manager/ui/CloneDialog.java @@ -127,12 +127,12 @@ public class CloneDialog { String message = ""; try { property.getWorker().cloneVM(vmName); - message = "Emulator cloning completed!"; + //message = "Emulator cloning completed!"; } catch (VMsWorkerException e) { message = e.getMessage(); - } + msg.openInfoDialog(message); - msg.openInfoDialog(message); + } dialog.close(); mainDialog.refreshProperties(); diff --git a/src/org/tizen/emulator/manager/ui/MenuHandling.java b/src/org/tizen/emulator/manager/ui/MenuHandling.java index 2dd3158..58a61d6 100644 --- a/src/org/tizen/emulator/manager/ui/MenuHandling.java +++ b/src/org/tizen/emulator/manager/ui/MenuHandling.java @@ -76,7 +76,7 @@ public class MenuHandling { } } - msg.openInfoDialog("Completed reset process!"); + //msg.openInfoDialog("Completed reset process!"); } public boolean deleteVirtualMachine(VMsProperty prop) { @@ -107,7 +107,7 @@ public class MenuHandling { } } - msg.openInfoDialog("Completed delete process!"); + //msg.openInfoDialog("Completed delete process!"); return true; } @@ -138,10 +138,10 @@ public class MenuHandling { String returnMSG = ""; try { property.getWorker().createNewBaseImage(property, path); - returnMSG = "Succeeded to create 'Base Image'!\nPath: " + path; + //returnMSG = "Succeeded to create 'Base Image'!\nPath: " + path; } catch (VMsWorkerException e) { returnMSG =e.getMessage(); + msg.openInfoDialog(returnMSG); } - msg.openInfoDialog(returnMSG); } } diff --git a/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java b/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java index e4cac6c..87d8792 100644 --- a/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java +++ b/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java @@ -66,7 +66,7 @@ import org.tizen.emulator.manager.vms.VMsWorkerException; enum CItem{ ImageName("Name"), ImageNameInfo(""), BaseImage("BaseImage"), - Resolution("Display Resolution"), Density("Display Density"), SkinType("Front Key Type"), + Resolution("Display Resolution "), Density("Display Density"), /*SkinType("Front Key Type"),*/ RAMSize("RAM Size"), ShareType("File Sharing"), SharePath("File Sharing Path"), HWVirtual("HW Virtualization"), TouchType("Max Touch Point"); @@ -82,7 +82,7 @@ enum CItem{ enum DItem{ ImageName("Name"), BaseImage("BaseImage"), - Resolution("Display Resolution"), Density("Display Density"), SkinType("Front Key Type"), + Resolution("Display Resolution "), Density("Display Density"), /*SkinType("Front Key Type"),*/ RAMSize("RAM Size"), ShareType("File Sharing"), SharePath("File Sharing Path"), HWVirtual("HW Virtualization"), TouchType("Max Touch Point"), Dummy(""); @@ -168,9 +168,10 @@ public class VMPropertyView { widget.itemList.get(DItem.Resolution.ordinal()).setText(1, oldValue.resolution); widget.itemList.get(DItem.Density.ordinal()).setText(1, String.valueOf(oldValue.dpi)); // TODO : please !! + /* widget.itemList.get(DItem.SkinType.ordinal()).setText(1, oldValue.keyType == 1 ? StringResource.ONE_KEY_TYPE : StringResource.THREE_KEYS_TYPE); - + */ widget.itemList.get(DItem.RAMSize.ordinal()).setText(1, String.valueOf(oldValue.ramSize)); widget.itemList.get(DItem.ShareType.ordinal()).setText(1,oldValue.isFileShareSupport @@ -198,8 +199,9 @@ public class VMPropertyView { widget.itemList.get(CItem.Resolution.ordinal()).setText(1, oldValue.resolution); widget.itemList.get(CItem.Density.ordinal()).setText(1, String.valueOf(oldValue.dpi)); // TODO : please !!! + /* widget.itemList.get(CItem.SkinType.ordinal()).setText(1, StringResource.ONE_KEY_TYPE); - + */ widget.itemList.get(CItem.RAMSize.ordinal()).setText(1, String.valueOf(oldValue.ramSize)); widget.itemList.get(CItem.ShareType.ordinal()).setText(1, StringResource.NOT_SUPPORTED); @@ -260,10 +262,12 @@ public class VMPropertyView { editor.grabHorizontal = true; editor.setEditor(widget.DIPspinner, widget.itemList.get(DItem.Density.ordinal()), 1); + /* editor = new TableEditor(table); editor.grabHorizontal = true; editor.setEditor(widget.skinTypeCombo, widget.itemList.get(DItem.SkinType.ordinal()), 1); - + */ + editor = new TableEditor(table); editor.grabHorizontal = true; @@ -314,10 +318,12 @@ public class VMPropertyView { editor.grabHorizontal = true; editor.setEditor(widget.DIPspinner, widget.itemList.get(CItem.Density.ordinal()), 1); + /* editor = new TableEditor(table); editor.grabHorizontal = true; editor.setEditor(widget.skinTypeCombo, widget.itemList.get(CItem.SkinType.ordinal()), 1); - + */ + editor = new TableEditor(table); editor.grabHorizontal = true; editor.setEditor(widget.ramSizeCombo, widget.itemList.get(CItem.RAMSize.ordinal()), 1); @@ -466,11 +472,13 @@ public class VMPropertyView { widget.DIPspinner.setEnabled(false); } + /* widget.skinTypeCombo = helper.makeCombo(table); widget.skinTypeCombo.add(StringResource.ONE_KEY_TYPE); widget.skinTypeCombo.add(StringResource.THREE_KEYS_TYPE); widget.skinTypeCombo.select(oldValue.keyType == 1 ? 0 : 1); widget.skinTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + */ createDisplayListener(); } @@ -512,6 +520,7 @@ public class VMPropertyView { }); // TODO + /* widget.skinTypeCombo.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { @@ -533,6 +542,7 @@ public class VMPropertyView { } }); + */ } private void createRAMSizeArea(Table table) { @@ -687,18 +697,17 @@ public class VMPropertyView { try { if (isCreateMode) { p = Creator.create(newValue); - message= "Succeeded to create the VM!"; + //message= "Succeeded to create the VM!"; } else { property.getWorker().modifyVM(oldValue, newValue); p = property; - message = "Succeeded to modify the VM!"; + //message = "Succeeded to modify the VM!"; } } catch (VMsWorkerException e) { message = e.getMessage(); + msg.openInfoDialog(message); } - - msg.openInfoDialog(message); return p; } @@ -716,7 +725,7 @@ class VMViewWidget { public Combo resolutionCombo; public Spinner DIPspinner; - public Combo skinTypeCombo; + //public Combo skinTypeCombo; public Combo ramSizeCombo; @@ -738,7 +747,7 @@ class VMViewWidget { selectBaseImageButton.dispose(); resolutionCombo.dispose(); DIPspinner.dispose(); - skinTypeCombo.dispose(); + //skinTypeCombo.dispose(); ramSizeCombo.dispose(); shareTypeCombo.dispose(); selectShareFolderButton.dispose(); diff --git a/src/org/tizen/emulator/manager/vms/Creator.java b/src/org/tizen/emulator/manager/vms/Creator.java index cc71bce..9a133b7 100644 --- a/src/org/tizen/emulator/manager/vms/Creator.java +++ b/src/org/tizen/emulator/manager/vms/Creator.java @@ -111,11 +111,9 @@ public class Creator { } private void createDiskImage() throws VMsCreatorException { - if (newVM.baseImagePath != null) { + if (newVM.baseImagePath != null && !newVM.baseImagePath.isEmpty()) { checkCustomBaseImage(newVM.baseImagePath); - } - - if (newVM.baseImagePath == null || newVM.baseImagePath.isEmpty()) { + } else { newVM.baseImagePath = FileIO.getInstance().getBaseimgPath(); } @@ -128,8 +126,8 @@ public class Creator { createInitialVMImageInternal(newVM.baseImagePath, targetPath); } - private boolean isError = false; - private String errorMsg = null; + private boolean isError = false; + private String errorMsg = null; private void checkCustomBaseImage(final String path) throws VMsCreatorException { String exe_path = FileIO.getInstance().getBinPath() + File.separator + "qemu-img"; @@ -159,7 +157,7 @@ public class Creator { } catch (IOException e) { isError = true; EMLogger.getLogger().log(Level.WARNING, - "Failed check base image...\n" + e.getMessage()); + "Failed check base image...(stderr of qemu-img)\n" + e.getMessage()); } } }).start(); @@ -188,7 +186,7 @@ public class Creator { } catch (IOException e) { isError = true; EMLogger.getLogger().log(Level.WARNING, - "Failed check base image...\n" + e.getMessage()); + "Failed check base image...(stdout of qemu-img)\n" + e.getMessage()); } } }).start(); @@ -253,7 +251,7 @@ public class Creator { } while (str != null); } catch (IOException e) { EMLogger.getLogger().log(Level.WARNING, - "Error while running 'qemu-img'\n" + e.getMessage()); + "Error while running 'qemu-img'(stderr)\n" + e.getMessage()); } } }).start(); diff --git a/src/org/tizen/emulator/manager/vms/VMsWorker.java b/src/org/tizen/emulator/manager/vms/VMsWorker.java index 20ac4e5..551f2bf 100644 --- a/src/org/tizen/emulator/manager/vms/VMsWorker.java +++ b/src/org/tizen/emulator/manager/vms/VMsWorker.java @@ -173,7 +173,8 @@ public class VMsWorker { while ((line = stdOut.readLine()) != null) { String imagePath = FileIO.getInstance().getVirtualTargetImagePath(property.getName()); if(line.contains(imagePath)) { - logger.log(Level.INFO, line + " contains " + imagePath + "\n"); + //logger.log(Level.INFO, line + " contains " + imagePath); + logger.log(Level.INFO, "emulator instance with the same name is running now (" + imagePath + ")"); stdOut.close(); return true; } @@ -184,7 +185,8 @@ public class VMsWorker { String[] titleName = line.split(","); // "split[split.length - 1]" is window title. if(titleName[titleName.length - 1].startsWith("\"" + property.getName()+ ":261")) { - logger.log(Level.INFO, "contains " +titleName[titleName.length - 1] + "\n"); + //logger.log(Level.INFO, "contains " + titleName[titleName.length - 1]); + logger.log(Level.INFO, "emulator instance with the same name is running now (" + titleName[titleName.length - 1] + ")"); stdOut.close(); return true; } @@ -198,6 +200,6 @@ public class VMsWorker { msg.openWarningDialog("Error occured while checking if the same VM .\n" + err.getMessage()); return false; - } + } } } \ No newline at end of file -- 2.7.4