import org.tizen.emulator.manager.plugin.EMPlugin;
import org.tizen.emulator.manager.plugin.ExtensionItem;
import org.tizen.emulator.manager.plugin.PluginStringResources;
+import org.tizen.emulator.manager.resources.FilePathResources;
import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.tool.About;
import org.tizen.emulator.manager.vms.EmulatorVMList;
}
try {
- prop.getWorker().deleteVM();
+ if (!prop.getWorker().deleteVM()) {
+ System.out.println("Warning: Fail to delete VM directory complete.");
+ System.out.println(" - Please check and remove VM directory completely.");
+ System.out.println(" - path : " + FilePathResources.getTizenVmsPath() + File.separator + name);
+ }
} catch (VMWorkerException e) {
System.out.println("Error: " + e.getMessage());
return false;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.ui.MainDialog;
return openMessageDialog(title, message, SWT.ICON_QUESTION, SWT.OK | SWT.CANCEL);
}
+ public int openRemoveVMFailDialog(final String path, final String vmName) {
+ msgResponse = 0;
+ return openRemoveVMFailDialog("Emulator Manager", path, vmName, SWT.ICON_WARNING, SWT.OK);
+ }
+
+ public int openRemoveVMFailDialog(final String title, final String path, final String vmName,
+ final int icon_style, final int style) {
+ dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ dialog.setText(title);
+ dialog.setLayout(new GridLayout(2, false));
+ dialog.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ Label icon = new Label(dialog, SWT.NONE);
+ icon.setImage(Display.getCurrent().getSystemImage(icon_style));
+ icon.pack();
+ Composite textComp = new Composite(dialog, SWT.NONE);
+ GridLayout layout = new GridLayout(1, true);
+ layout.horizontalSpacing = 0;
+ layout.verticalSpacing = 0;
+ layout.marginBottom = 0;
+ layout.marginHeight = 0;
+ layout.marginLeft = 5;
+ layout.marginRight = 10;
+ layout.marginTop = 0;
+ layout.marginWidth = 0;
+ textComp.setLayout(layout);
+ textComp.setLayoutData(new GridData(SWT.RIGHT, SWT.BOTTOM, false, false));
+
+ Label content = new Label(textComp, SWT.NONE);
+ content.setText("Fail to remove VM(" + vmName + ")\'s directory because\n"
+ + "some directories or files are opened. \n"
+ + "Please check and remove completely.\n");
+ content.pack();
+
+ Link vmDirectory = new Link(textComp, SWT.NONE);
+ vmDirectory.setText("<a>" + path +"</a>");
+ vmDirectory.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ }
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ try {
+ org.eclipse.swt.program.Program.launch(path);
+ } catch (Throwable e) {
+ return;
+ }
+ }
+ });
+ vmDirectory.pack();
+
+ textComp.pack();
+ int x = icon.getSize().x + textComp.getSize().x;
+ int y = 0;
+ if (icon.getSize().y > textComp.getSize().y ) {
+ y = icon.getSize().y;
+ } else {
+ y = textComp.getSize().y;
+ }
+
+ dialog.setSize(x + 50, y + 100);
+
+ if (MainDialog.getShell() != null) {
+ Point p = MainDialog.getShell().getLocation();
+ Point s = MainDialog.getShell().getSize();
+ dialog.setLocation(p.x + (s.x>>2), p.y + (s.y>>2));
+ }
+
+ //TODO : dummy label
+ new Label(dialog, SWT.NONE);
+ new Label(dialog, SWT.NONE);
+ new Label(dialog, SWT.NONE);
+
+ makeButtonComposite(style);
+
+ dialog.open();
+ while(!dialog.isDisposed()) {
+ if(!Display.getCurrent().readAndDispatch()) {
+ Display.getCurrent().sleep();
+ }
+ }
+
+ return msgResponse;
+ }
+
int msgResponse = 0;
private Shell dialog = null;
public int openMessageDialog(final String title, final String message, final int icon_style, final int style) {