From 7551c7bd3f1bc10aad5daac667bcec118bc44974 Mon Sep 17 00:00:00 2001 From: jihye kim Date: Fri, 18 Jan 2013 17:52:34 +0900 Subject: [PATCH] [Title] emulator-manager : add checking dpi value [Desc.] add checking dpi value and modify ram-size [Issue] N_SE-21851 Conflicts: package/changelog package/pkginfo.manifest --- VERSION | 2 +- package/changelog | 6 +++++ package/pkginfo.manifest | 2 +- .../emulator/manager/ui/detail/TableWidget.java | 3 ++- .../emulator/manager/ui/detail/VMPropertyView.java | 13 +++++++++-- src/org/tizen/emulator/manager/vms/RAM_SIZE.java | 26 +++++++++++++++++++--- 6 files changed, 44 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index 3e32ff6..e47889e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0 RC3 +2.1.0 RC4 diff --git a/package/changelog b/package/changelog index 11c5f37..f3f7832 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,9 @@ +* 1.3.74 +- update version +- modify ram-size +- add checking dpi value +== jihye kim 2013-01-18 + * 1.3.73 - update version == jihye kim 2013-01-14 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index d157b13..858e98b 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Source: emulator-manager -Version: 1.3.73 +Version: 1.3.74 Maintainer: Yeong-Kyoon Lee Package: emulator-manager diff --git a/src/org/tizen/emulator/manager/ui/detail/TableWidget.java b/src/org/tizen/emulator/manager/ui/detail/TableWidget.java index 196109c..dd60071 100644 --- a/src/org/tizen/emulator/manager/ui/detail/TableWidget.java +++ b/src/org/tizen/emulator/manager/ui/detail/TableWidget.java @@ -464,7 +464,7 @@ class DPISpinner extends TableWidget { oldDPI = newDPI = value.dpi; dpiSpinner = new Spinner(table, SWT.BORDER); dpiSpinner.setValues(oldDPI, - VMPropertyView.MIN_DPI, VMPropertyView.MAX_DPI, 0, 1, 1); + /*VMPropertyView.MIN_DPI*/0, /*VMPropertyView.MAX_DPI*/999, 0, 1, 1); dpiSpinner.setTextLimit(3); return true; @@ -481,6 +481,7 @@ class DPISpinner extends TableWidget { } } }); + return true; } diff --git a/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java b/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java index da6f3d9..3980ea6 100644 --- a/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java +++ b/src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java @@ -166,18 +166,27 @@ public class VMPropertyView implements TableWidgetChangeListener { for (TableWidget widget : createList) { widget.setValue(newValue); } - p = Creator.create(newValue); } else { for (TableWidget widget : modifyList) { widget.setValue(newValue); } + } + // dpi check + if (newValue.dpi < VMPropertyView.MIN_DPI || newValue.dpi > VMPropertyView.MAX_DPI) { + throw new VMsWorkerException("Invalid value.\nDisplay Density should be from 100 to 480"); + } + + if (isCreateMode) { + p = Creator.create(newValue); + } + else { property.getWorker().modifyVM(oldValue, newValue); p = property; } } catch (VMsWorkerException e) { message = e.getMessage(); - msg.openInfoDialog(message); + msg.openWarningDialog(message); } return p; } diff --git a/src/org/tizen/emulator/manager/vms/RAM_SIZE.java b/src/org/tizen/emulator/manager/vms/RAM_SIZE.java index 482dee7..c1d4816 100644 --- a/src/org/tizen/emulator/manager/vms/RAM_SIZE.java +++ b/src/org/tizen/emulator/manager/vms/RAM_SIZE.java @@ -29,13 +29,33 @@ package org.tizen.emulator.manager.vms; -public enum RAM_SIZE { - RAM512("512", 512), RAM768("768", 768), RAM1024("1024", 1024); +import java.util.ArrayList; + +public class RAM_SIZE { + public static RAM_SIZE RAM512 = new RAM_SIZE("512", 512); + public static RAM_SIZE RAM768 = new RAM_SIZE("768", 768); + public static RAM_SIZE RAM1024 = new RAM_SIZE("1024", 1024); + + private static final ArrayList list; + static{ + list = new ArrayList(); + if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) { + list.add(RAM512); + } else { + list.add(RAM512); + list.add(RAM768); + list.add(RAM1024); + } + } + + public static ArrayList values() { + return list; + } private String id; private int size; - RAM_SIZE(String id, int size) { + private RAM_SIZE(String id, int size) { this.id = id; this.size = size; } -- 2.7.4