From 68515b2a1f059ab9ce647b3f73efc608d4bf9bfc Mon Sep 17 00:00:00 2001 From: jihye kim Date: Thu, 29 Mar 2012 22:35:34 +0900 Subject: [PATCH] [Title] disable 'reset' and 'delete' button when emulator manager start. [Type] bug fix [Module] emulator manager [Priority] major [Jira#] [TIZEN-NABI] (N_SE-83) [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- src/org/tizen/emulator/manager/ui/MainDialog.java | 19 ++++++++++++------- .../tizen/emulator/manager/ui/ResourceRegistry.java | 2 +- .../emulator/manager/ui/vmstree/ContextMenu.java | 1 + 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/org/tizen/emulator/manager/ui/MainDialog.java b/src/org/tizen/emulator/manager/ui/MainDialog.java index 66a9273..9c736e0 100644 --- a/src/org/tizen/emulator/manager/ui/MainDialog.java +++ b/src/org/tizen/emulator/manager/ui/MainDialog.java @@ -209,7 +209,7 @@ public class MainDialog { } } else if (type.equals(Confirm)) { VMsProperty pro = detailView.confirm(); - if (pro != null) { // successs + if (pro != null) { // success refreshProperties(); openDetailView(pro); } @@ -227,6 +227,8 @@ public class MainDialog { handling = new MenuHandling(shell, vmsTree); + deleteButton.setEnabled(false); + resetButton.setEnabled(false); } public void open() { @@ -255,7 +257,7 @@ public class MainDialog { // TOOD : error checking public void deleteVirtualMachine() { if (handling.deleteVirtualMachine()) { - detailView.closeDetailView(); + closeDetailView(); refreshProperties(); } } @@ -278,8 +280,13 @@ public class MainDialog { } public void openDetailView(VMsProperty property) { - deleteButton.setEnabled(true); - resetButton.setEnabled(true); + if (vmsTree.getSelectionContentCount() == 1) { + deleteButton.setEnabled(true); + resetButton.setEnabled(true); + } else { + deleteButton.setEnabled(false); + resetButton.setEnabled(false); + } leftButton.setText(Modify); leftButton.setImage(ResourceRegistry.getImage(ImageName.MODIFY)); @@ -299,7 +306,6 @@ public class MainDialog { deleteButton.setEnabled(false); resetButton.setEnabled(false); } - resetButton.setEnabled(false); detailView.closeDetailView(); } @@ -359,7 +365,7 @@ public class MainDialog { public void dispose() { ResourceRegistry.dispose(); - + if(icon != null) icon.dispose(); } @@ -381,5 +387,4 @@ public class MainDialog { public boolean isX86Selected() { return archGroup.x86RadioButton.getSelection(); } - } diff --git a/src/org/tizen/emulator/manager/ui/ResourceRegistry.java b/src/org/tizen/emulator/manager/ui/ResourceRegistry.java index d0f074a..9120483 100644 --- a/src/org/tizen/emulator/manager/ui/ResourceRegistry.java +++ b/src/org/tizen/emulator/manager/ui/ResourceRegistry.java @@ -11,7 +11,7 @@ import org.eclipse.swt.widgets.Display; public class ResourceRegistry { public enum ImageName { CANCEL("cancel"), CONFIRM("confirm"), CREATE("create"), DELETE("delete"), DETAILS("details"), - FOLDER("folder"), MODIFY("modify"), REFRESH("refresh"), RESET("reset"), LAUNCH("launch"); + FOLDER("folder"), MODIFY("modify"), REFRESH("refresh"), RESET("reset"), LAUNCH("launch"), CLONE("clone"); String name; diff --git a/src/org/tizen/emulator/manager/ui/vmstree/ContextMenu.java b/src/org/tizen/emulator/manager/ui/vmstree/ContextMenu.java index c51730a..30be929 100644 --- a/src/org/tizen/emulator/manager/ui/vmstree/ContextMenu.java +++ b/src/org/tizen/emulator/manager/ui/vmstree/ContextMenu.java @@ -91,6 +91,7 @@ public class ContextMenu { final MenuItem cloneItem = new MenuItem(treeMenu, SWT.NONE); cloneItem.setText("Clone"); + cloneItem.setImage(ResourceRegistry.getImage(ImageName.CLONE)); cloneItem.addSelectionListener(new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent arg0) { -- 2.7.4