[Esbox-commits] r2278 - in branches/work_Fabricio: org.maemo.esbox.maemosdk.core/conf org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware

fabricioepa at garage.maemo.org fabricioepa at garage.maemo.org
Wed Oct 7 23:04:38 EEST 2009


Author: fabricioepa
Date: 2009-10-07 23:04:28 +0300 (Wed, 07 Oct 2009)
New Revision: 2278

Added:
   branches/work_Fabricio/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/ILaunchableMachineController.java
   branches/work_Fabricio/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/LaunchedMachineInfo.java
Removed:
   branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/LaunchedMachineInfo.java
Modified:
   branches/work_Fabricio/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml
   branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BaseMachinePreferencePage.java
   branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java
   branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFolderTreeViewer.java
   branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFoldersPreferencePage.java
   branches/work_Fabricio/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerDataContentLabelProvider.java
   branches/work_Fabricio/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerDataContentLabelProvider.java
   branches/work_Fabricio/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineController.java
   branches/work_Fabricio/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferencePage.java
   branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxMachineController.java
   branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxPreferencePage.java
   branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareMachineController.java
   branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwarePreferencePage.java
   branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareSettingsPreferencePage.java
   branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseLaunchableVirtualMachineController.java
   branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineController.java
   branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/AddressFieldEditor.java
   branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/BaseVirtualMachinePreferencePage.java
   branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java
   branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ManualVirtualMachineController.java
   branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ManualVirtualMachinePreferencePage.java
Log:
Merging with /trunk 

Modified: branches/work_Fabricio/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml	2009-10-07 20:04:28 UTC (rev 2278)
@@ -24,6 +24,6 @@
 	<entry key="MAEMO_RESTART_ACTION">restart</entry>
 	<entry key="MAEMO_STOP_ACTION">stop</entry>
 	
-	<entry key="VALIDATE_SHARED_FOLDERS">true</entry>
+	<entry key="VALIDATE_SHARED_FOLDERS">false</entry>
 	
 </properties>

Copied: branches/work_Fabricio/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/ILaunchableMachineController.java (from rev 2271, trunk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/ILaunchableMachineController.java)
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/ILaunchableMachineController.java	                        (rev 0)
+++ branches/work_Fabricio/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/ILaunchableMachineController.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.api.maemosdk.core;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+
+/**
+ * This interface identifies a machine controller whose machine can be launched as a process
+ * (e.g. a virtual machine or emulator) without explicitly acquiring the machine or trying to
+ * access it over the network.  It is currently used by the ESbox > Build Machines
+ * page.
+ * @author eswartz
+ *
+ */
+public interface ILaunchableMachineController {
+	/**
+	 * Tell if the virtual machine or engine is running.  This either detects
+	 * existing instances of the machine running on the host, or verifies
+	 * that a previously launched instance via {@link #startMachine(IProgressMonitor)} 
+	 * is still valid.
+	 * <p>
+	 * This check uses cached information that remains "true" for a long time
+	 * after the machine is detected.  Use {@link #scheduleProbe()} to reset.
+	 * @return true if it is likely running, false if we either don't know
+	 * or if it is not running.  If unsure, return false.
+	 */
+	boolean isMachineRunning();
+	
+	/**
+	 * Launch the machine and wait long enough to see if it's started up.
+	 * @param monitor 
+	 * @return status of launch
+	 */
+	IStatus launchMachine(IProgressMonitor monitor);
+
+}
\ No newline at end of file

Copied: branches/work_Fabricio/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/LaunchedMachineInfo.java (from rev 2271, trunk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/LaunchedMachineInfo.java)
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/LaunchedMachineInfo.java	                        (rev 0)
+++ branches/work_Fabricio/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/LaunchedMachineInfo.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.api.maemosdk.core;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.mica.common.core.Policy;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.process.IProcessMonitor;
+import org.maemo.mica.common.core.process.StringBuilderStreamTextMonitor;
+import org.maemo.mica.common.core.process.ProcessLauncherUtils.LaunchResults;
+
+public class LaunchedMachineInfo {
+	public LaunchedMachineInfo(
+			IProcessLauncher processLauncher) {
+		this.launcher = processLauncher;
+		this.monitor = processLauncher.createProcessMonitor();
+		this.streamGrabber = new StringBuilderStreamTextMonitor(false);
+		this.monitor.addMonitor(streamGrabber);
+	}
+	public LaunchedMachineInfo(IStatus failedStatus) {
+		this.failedStatus = failedStatus;
+	}
+
+	public IProcessLauncher launcher;
+	public IProcessMonitor monitor;
+	public StringBuilderStreamTextMonitor streamGrabber;
+	private IStatus failedStatus;
+	
+	public boolean isAlive() {
+		if (monitor == null)
+			return false;
+		
+		return !monitor.isCompleted();
+	}
+	
+	/**
+	 * Return an status describing the output if the machine died.
+	 * @return IStatus
+	 */
+	public IStatus checkAlive() {
+		if (isAlive())
+			return Status.OK_STATUS;
+
+		String msg;
+		if (launcher != null) {
+			LaunchResults results = new LaunchResults(launcher.getLastCreatedProcess().exitValue(),
+					streamGrabber.stdout.toString(),
+					streamGrabber.stderr.toString());
+			msg = results.reportResults("Virtual machine died unexpectedly");
+			return Activator.createErrorStatus(msg, null);
+		} else {
+			return failedStatus != null ? failedStatus : 
+				Activator.createErrorStatus("The machine was never launched", null);
+		}
+	}
+
+	/**
+	 * @return the failed
+	 */
+	public boolean isFailed() {
+		return failedStatus != null;
+	}
+	
+	/**
+	 * Indicate that this launch failed
+	 * @param status 
+	 */
+	public void setFailed(IStatus status) {
+		if (this.failedStatus == null)
+			this.failedStatus = status;
+	}
+	/**
+	 * @return the failedStatus
+	 */
+	public IStatus getFailedStatus() {
+		return failedStatus;
+	}
+	/**
+	 * 
+	 */
+	public void cancel() {
+		setFailed(Policy.getCancelStatus(Activator.getDefault()));
+
+		// don't cancel anything else here... we can't distinguish explicit user cancel from 
+		// a nested cancellation (e.g. refresh SDKs launches machine, then the refresh is canceled).
+		// This can result in killing a perfectly fine machine
+	}
+}
\ No newline at end of file

Modified: branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BaseMachinePreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BaseMachinePreferencePage.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BaseMachinePreferencePage.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -11,6 +11,8 @@
 
 package org.maemo.esbox.internal.api.maemosdk.ui.preferences;
 
+import java.net.InetAddress;
+
 import org.maemo.mica.common.core.machine.IMachine;
 import org.maemo.mica.common.ui.preferences.ComposedPreferencePage;
 
@@ -36,8 +38,14 @@
 	/**
 	 * Refresh contents after machine was scanned. 
 	 */
-	public void validationFinished(IMachine machine) {
+	public void machineLaunched(IMachine machine) {
 		
 	}
-
-}
\ No newline at end of file
+	
+	/**
+	 * Tell if the address is provided by the machine.
+	 * @param address
+	 * @return
+	 */
+	public abstract boolean isSpecialHostAddress(InetAddress address);
+}

Modified: branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -23,6 +23,7 @@
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.core.runtime.jobs.Job;
@@ -48,9 +49,14 @@
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.NewWizardAction;
+import org.maemo.esbox.internal.api.maemosdk.core.ILaunchableMachineController;
 import org.maemo.esbox.internal.maemosdk.ui.IHelpID;
 import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
 import org.maemo.mica.common.core.NetworkUtils;
@@ -58,12 +64,16 @@
 import org.maemo.mica.common.core.machine.IComposablePreferencePage;
 import org.maemo.mica.common.core.machine.ILocalMachine;
 import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.IMachineController;
 import org.maemo.mica.common.core.machine.MachineManager;
 import org.maemo.mica.common.core.machine.MachineRegistry;
+import org.maemo.mica.common.ui.MicaStockUIConstants;
 import org.maemo.mica.common.ui.dialogs.DialogUtils;
 import org.maemo.mica.common.ui.dialogs.StyledTextProgressDialog;
+import org.maemo.mica.internal.api.common.core.machine.IMachineImpl;
 import org.maemo.mica.internal.api.common.core.sdk.SDKManagerInternal;
-import org.maemo.mica.internal.api.common.ui.utils.PixelConverter;
+import org.maemo.mica.internal.api.common.core.ui.GridLayoutWrappedTextUtils;
+import org.osgi.framework.Bundle;
 
 import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
 
@@ -88,10 +98,12 @@
 	private Map<String, IComposablePreferencePage> machineConfigPages;
 	protected Map<String, IBuildMachine> machineMap;
 	private Label noMachineConfigUI;
-	private Button applyAndValidateButton;
+	private Button validateButton;
 
 	private IComposablePreferencePage selectedMachinePage;
-	private IMachine lastValidatedMachine;
+	private IMachine lastLaunchedMachine;
+
+	private Button launchButton;
 	
 	/**
 	 * 
@@ -171,13 +183,31 @@
 		composite.setLayout(layout);
 		composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
 		
-		Text descr = new Text(composite, SWT.READ_ONLY + SWT.MULTI + SWT.WRAP);
-		descr.setText("Select the build machine for ESbox.  The machine determines where scratchbox is found.\nIf the host is not Linux/x86 you must select and configure a virtual machine.");
-		GridData msgLayoutData = new GridData(SWT.LEFT, SWT.TOP, true, false);
-		msgLayoutData.heightHint = new PixelConverter(getControl()).convertHeightInCharsToPixels(3);
-		descr.setLayoutData(msgLayoutData);
-		descr.setBackground(parent.getBackground());
+		Link descr = new Link(composite, SWT.WRAP);
+		String message = "Select the build machine for ESbox.  "
+				+"The machine determines where Scratchbox is found, "
+				+"where builds are performed and applications are launched locally.";
 		
+		// HACK, we shouldn't know about this plugin :)
+		Bundle bundle = Platform.getBundle("org.maemo.esbox.vm.vmware");
+		if (bundle != null) {
+			message += "\n \n"
+					+ "If the host is not Linux/x86 you must select and configure a virtual machine.  "
+					+ "<a href=\"install\">Click here for Maemo installers.</a>";
+			
+			
+			descr.addSelectionListener(new SelectionAdapter() {
+				@Override
+				public void widgetSelected(SelectionEvent e) {
+					runNewWizard(getShell());
+				}
+			});
+		}
+		
+		descr.setText(message);
+		GridLayoutWrappedTextUtils.setupLabel(composite, descr, 
+				new GridData(SWT.LEFT, SWT.TOP, true, false));
+		
 		Label sep = new Label(composite, SWT.SEPARATOR + SWT.HORIZONTAL);
 		sep.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
 		
@@ -191,6 +221,21 @@
 	}
 
 	/**
+	 * @param shell
+	 */
+	protected void runNewWizard(Shell shell) {
+		IWorkbenchWindow workbenchWindow = null;
+		IWorkbench workbench = PlatformUI.getWorkbench();
+		workbenchWindow = workbench.getActiveWorkbenchWindow();
+		if (workbenchWindow == null)
+			workbenchWindow = workbench.getWorkbenchWindows()[0];
+		
+		NewWizardAction action = new NewWizardAction(workbenchWindow);
+		action.setCategoryId(MicaStockUIConstants.MAEMO_TARGET_WIZARD_CATEGORY_ID);
+		action.run();
+	}
+
+	/**
 	 * @param parent
 	 */
 	private void createBuildMachineSelectorUI(Composite parent) {
@@ -257,8 +302,7 @@
 		// then add the pre-sorted entries
 		for (IBuildMachine machine : availableBuildMachines) {
 			IComposablePreferencePage page = machine.createPreferencePage();
-			machineConfigPages.put(machine.getName(), 
-					page);
+			machineConfigPages.put(machine.getName(), page);
 			page.setOwner(this);
 			machineMap.put(machine.getName(), machine);
 		}
@@ -295,8 +339,10 @@
 			machineConfigStackLayout.topControl = noMachineConfigUI;
 			selectedMachine = null;
 			selectedMachinePage = null;
+			launchButton.setEnabled(false);
+
 			setErrorMessage(null);
-			setMessage(null, INFORMATION);
+			setMessage(null, NONE);
 			setValid(true);
 		}
 		machineConfigComposite.layout();
@@ -329,6 +375,9 @@
 	 */
 	@Override
 	public boolean isValid() {
+		if (launchButton != null)
+			launchButton.setEnabled(false);
+		
 		if (!super.isValid())
 			return false;
 		
@@ -337,6 +386,12 @@
 			if (page != null && !page.isValid())
 				return false;
 		}		
+		
+		if (launchButton != null) {
+			IMachineController machineController = ((IMachineImpl) selectedMachine).getMachineController();
+			launchButton.setEnabled(machineController instanceof ILaunchableMachineController);
+		}
+
 		return true;
 	}
 	
@@ -346,8 +401,8 @@
 	@Override
 	protected void updateApplyButton() {
 		super.updateApplyButton();
-		if (applyAndValidateButton != null)
-			applyAndValidateButton.setEnabled(isValid());
+		if (validateButton != null)
+			validateButton.setEnabled(isValid());
 	}
 	
 	/* (non-Javadoc)
@@ -458,10 +513,10 @@
 			}
 		}
 		
-		if (lastValidatedMachine != null && current == null) {
-			if (MachineManager.getInstance().isActive(lastValidatedMachine)) {
+		if (lastLaunchedMachine != null && current == null) {
+			if (MachineManager.getInstance().isActive(lastLaunchedMachine)) {
 				vmRunning = true;
-				current = lastValidatedMachine;
+				current = lastLaunchedMachine;
 				currentMachines_ = new IMachine[] { current };
 			}
 		}
@@ -474,7 +529,7 @@
 			final IMachine[] currentMachines = currentMachines_;
 			boolean doit;
 			String message;
-			if (selectedMachine.getName().equals(current.getName())) {
+			if (selectedMachine.getClass().equals(current.getClass())) {
 				// the same machine, different message
 				message = MessageFormat.format(
 						"You have changed virtual machine settings for ''{0}''.  The virtual machine is still running, however.\n \n"+
@@ -578,9 +633,10 @@
 	
 	@Override
 	protected void contributeButtons(Composite parent) {
-		applyAndValidateButton = new Button(parent, SWT.PUSH);
-		applyAndValidateButton.setText("&Validate Machine");
-		applyAndValidateButton.addSelectionListener(new SelectionAdapter() {
+		launchButton = new Button(parent, SWT.PUSH);
+		launchButton.setText("&Launch Machine");
+		launchButton.setToolTipText("Launch the machine with the current settings, but do not connect to it or perform any other validation.\n \nThis may be used to figure out the IP address for the Machine Access tab.");
+		launchButton.addSelectionListener(new SelectionAdapter() {
 			@Override
 			public void widgetSelected(SelectionEvent ev) {
 				
@@ -588,6 +644,30 @@
 					Display.getDefault().asyncExec(new Runnable() {
 
 						public void run() {
+							launchMachine();
+						}
+
+						
+					});
+				}
+			}
+		});
+		launchButton.setEnabled(false);
+		
+		((GridLayout) parent.getLayout()).numColumns++;
+
+		
+		validateButton = new Button(parent, SWT.PUSH);
+		validateButton.setText("&Validate Machine");
+		validateButton.setToolTipText("Launch the machine, if needed, auto-mount any shared folders, and run tests on to ensure the settings are valid.");
+		validateButton.addSelectionListener(new SelectionAdapter() {
+			@Override
+			public void widgetSelected(SelectionEvent ev) {
+				
+				if (selectedMachine != null) {
+					Display.getDefault().asyncExec(new Runnable() {
+
+						public void run() {
 							validateMachine();
 						}
 
@@ -628,9 +708,72 @@
 			UIActivator.getErrorLogger().logAndShowError("Unexpected exception running tests", e);
 		}
 		
-		lastValidatedMachine = machineToValidate;
+		setLastLaunchedMachine(machineToValidate);
+	}
+
+	/**
+	 * Launch the machine (only).  This is called on the UI thread.
+	 */
+	protected void launchMachine() {
+		final IMachine machineToLaunch = getCurrentMachine();
+		
+		IMachineController machineController = ((IMachineImpl)machineToLaunch).getMachineController();
+		final Shell shell = getShell();
+		
+		if (!(machineController instanceof ILaunchableMachineController)) {
+			DialogUtils.showWarningDialog(shell, "Cannot Launch", "This machine cannot be launched.");
+			return;
+		}
+		final ILaunchableMachineController controller = (ILaunchableMachineController) machineController;
+		
+		ProgressMonitorDialog dialog = new ProgressMonitorDialog(
+				shell);
+		try {
+			dialog.run(true, true, new IRunnableWithProgress() {
+
+				public void run(final IProgressMonitor monitor)
+						throws InvocationTargetException, InterruptedException {
+					Display.getDefault().syncExec(new Runnable() {
+						public void run() {
+							monitor.beginTask("Launching machine...", 2);
+							
+							if (controller.isMachineRunning()) {
+								DialogUtils.showWarningDialog(shell, "Already Running", 
+										"This machine is already running.");
+								return;
+							}
+
+							shutDownMachinesBeforeSwitchingTo(machineToLaunch);
+
+							monitor.worked(1);
+							if (monitor.isCanceled())
+								return;
+							
+							IStatus status = controller.launchMachine(new SubProgressMonitor(monitor, 1));
+							if (!monitor.isCanceled())
+								UIActivator.getErrorLogger().show(status);
+						}
+					});
+				}
+			});
+		} catch (InterruptedException e) {
+			// ignore
+		} catch (InvocationTargetException e) {
+			UIActivator.getErrorLogger().logAndShowError("Unexpected exception launching machine", e.getCause());
+		} catch (Exception e) {
+			UIActivator.getErrorLogger().logAndShowError("Unexpected exception launching machine", e);
+		}
+		
+		setLastLaunchedMachine(machineToLaunch);
+	}
+
+	/**
+	 * @param machineToValidate
+	 */
+	private void setLastLaunchedMachine(final IMachine machineToValidate) {
+		lastLaunchedMachine = machineToValidate;
 		if (selectedMachinePage instanceof BaseMachinePreferencePage)
-			((BaseMachinePreferencePage) selectedMachinePage).validationFinished(lastValidatedMachine);
+			((BaseMachinePreferencePage) selectedMachinePage).machineLaunched(lastLaunchedMachine);
 	}
 
 	/**

Modified: branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFolderTreeViewer.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFolderTreeViewer.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFolderTreeViewer.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -22,6 +22,7 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.viewers.BaseLabelProvider;
 import org.eclipse.jface.viewers.CellEditor;
@@ -52,6 +53,7 @@
 import org.maemo.mica.common.core.filesystem.SharedFolderManager;
 import org.maemo.mica.common.core.filesystem.SharedFolderState;
 import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.MachineManager;
 import org.maemo.mica.common.core.machine.MachineRegistry;
 import org.maemo.mica.common.ui.CommonUIImages;
 import org.maemo.mica.common.ui.TextAndDialogCellEditor;
@@ -471,6 +473,8 @@
 							else if (status.getSeverity() == IStatus.INFO)
 								prefix = "Info: ";
 							return prefix + status.getMessage();
+						} else if (status.isOK()) {
+							return "Connected";
 						}
 						return "";
 					} else if (scanSharedFoldersThread != null) {
@@ -616,32 +620,39 @@
 				scanSharedFoldersThread = null;
 				return;
 			}
-			
-			InterruptedThreadMonitor monitor = new InterruptedThreadMonitor();
-			
-			SharedFolderState state;
-			boolean retry = false;
-			do {
-				remoteMachine.getFileSystemAccess().refresh();
+
+			try {
+				InterruptedThreadMonitor monitor = new InterruptedThreadMonitor();
 				
-				state = SharedFolderManager.getInstance().analyzeSharedFolderState(
-						MachineRegistry.getInstance().getLocalMachine(),
-						remoteMachine,
-						mappings,
-						monitor);
-			 	synchronized (SharedFolderTreeViewer.this) {
-					retry = pendingStatusUpdate;
-					pendingStatusUpdate = false;
-			 	}
-			} while (retry && !monitor.isCanceled());
-			
-			synchronized (SharedFolderTreeViewer.this) {
-				if (!monitor.isCanceled()) {
-					shareState = state;
-					updateLabels();
+				SharedFolderState state;
+				boolean retry = false;
+				do {
+					MachineRegistry.getInstance().getLocalMachine().getFileSystemAccess().refresh();
+					remoteMachine.getFileSystemAccess().refresh();
+	
+					// probe machine so we detect a launched one
+					MachineManager.getInstance().probeMachine(remoteMachine, new SubProgressMonitor(monitor, 0));
+					
+					state = SharedFolderManager.getInstance().analyzeSharedFolderState(
+							MachineRegistry.getInstance().getLocalMachine(),
+							remoteMachine,
+							mappings,
+							monitor);
+				 	synchronized (SharedFolderTreeViewer.this) {
+						retry = pendingStatusUpdate;
+						pendingStatusUpdate = false;
+				 	}
+				} while (retry && !monitor.isCanceled());
+				
+				synchronized (SharedFolderTreeViewer.this) {
+					if (!monitor.isCanceled()) {
+						shareState = state;
+					}
+					
 				}
-				
+			} finally {
 				scanSharedFoldersThread = null;
+				updateLabels();
 			}
 		}
 		

Modified: branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFoldersPreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFoldersPreferencePage.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFoldersPreferencePage.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -14,14 +14,12 @@
 import java.text.MessageFormat;
 import java.util.List;
 
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.jface.preference.BooleanFieldEditor;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -73,7 +71,6 @@
 	private final String preferenceName;
 	private IMachine remoteMachine;
 	private final BaseMachinePreferencePage machinePreferencePage;
-	private IPropertyChangeListener scanFoldersListener;
 	
 	public SharedFoldersPreferencePage(BaseMachinePreferencePage machinePreferencePage, IPreferenceStore store, String preferenceName) {
 		super();
@@ -171,7 +168,7 @@
 		
 		GridData labelLayout = new GridData(SWT.LEFT, SWT.TOP, true, false);
 		labelLayout.horizontalSpan = 2;
-		GridLayoutWrappedTextUtils.setupLabel(parent, label, labelLayout);
+		GridLayoutWrappedTextUtils.setupLabel(composite, label, labelLayout);
 
 		Composite tableComposite = new Composite(composite, SWT.NONE);
 		GridLayoutFactory.fillDefaults().applyTo(tableComposite);
@@ -192,7 +189,7 @@
 
 		final Button scanFoldersButton = new Button(tableComposite, SWT.CHECK);
 		scanFoldersButton.setSelection(scanFolders);
-		scanFoldersButton.setText("Dynamically update shared folder status");
+		scanFoldersButton.setText("Check shared folder status while &editing");
 		scanFoldersButton.addSelectionListener(new SelectionAdapter() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
@@ -224,6 +221,7 @@
 		addLocalButton = new Button(buttonBox, SWT.PUSH);
 		addLocalButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
 		addLocalButton.setText("Add &Host Share...");
+		addLocalButton.setToolTipText("Add a shared folder from the host (e.g. to make project sources visible to the build machine)");
 		addLocalButton.addSelectionListener(new SelectionAdapter() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
@@ -234,6 +232,7 @@
 		addRemoteButton = new Button(buttonBox, SWT.PUSH);
 		addRemoteButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
 		addRemoteButton.setText("Add &VM Share...");
+		addRemoteButton.setToolTipText("Add a shared folder from the VM (e.g. to make SDK headers visible to the host)");
 		addRemoteButton.setEnabled(false);
 		addRemoteButton.addSelectionListener(new SelectionAdapter() {
 			@Override
@@ -322,7 +321,7 @@
 			return;
 		
 		setErrorMessage(null);
-		setMessage(null, INFORMATION);
+		setMessage(null, NONE);
 		
 		// only check quick stuff here
 		for (ISharedFolder share : model) {
@@ -341,17 +340,20 @@
 				return;
 			}		
 			
-			/*
 			if (share.isHostProvidedShare()) {
 				IPath path = share.getSharePath();
 				if (!path.toFile().exists()) {
 					setErrorMessage(MessageFormat.format(
-							"The shared folder ''{0}'' does not exist on this machine.",
+							"The shared folder ''{0}'' does not exist on the host.",
 							path.toOSString()));
 					setValid(false);
 					return;
 				}
-			} else {				
+			} 
+			/*
+			 // do this when validating
+			  
+			 else {				
 				IPath path = share.getMountPath();
 				if (!path.toFile().exists()) {
 					if (!path.isRoot()) {
@@ -365,6 +367,7 @@
 					}
 				}
 			}*/
+			
 		}
 		
 		setValid(true);

Modified: branches/work_Fabricio/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerDataContentLabelProvider.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerDataContentLabelProvider.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerDataContentLabelProvider.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -52,12 +52,12 @@
 			
 			//Fremantle Beta 2
 			urls = fetchScriptsFromUrl( 
-					"http://repository.maemo.org/unstable/5.0beta2/",
+					"http://repository.maemo.org/stable/5.0/",
 					"maemo-scratchbox-install.*\\.sh");
 
 			for (URL url : urls) {
 				contents.add(new Scratchbox1SDKInstallerData(
-						"Maemo 5 Series (Fremantle) (Beta 2 Release)",5,  url,
+						"Maemo 5 Series (Fremantle)",5,  url,
 						((IBuildMachine) newInput),
 						"deb http://scratchbox.org/debian/ maemo5-sdk main",
 						"scratchbox-core", "scratchbox-libs",

Modified: branches/work_Fabricio/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerDataContentLabelProvider.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerDataContentLabelProvider.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerDataContentLabelProvider.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -55,7 +55,7 @@
 			
 			// Fremantle Beta 2 release support
 			urls = fetchScriptsFromUrl( 
-					"http://repository.maemo.org/unstable/5.0beta2/", 
+					"http://repository.maemo.org/stable/5.0/", 
 					"maemo-sdk-install.*\\.sh");
 
 			for (URL url : urls) {

Modified: branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseLaunchableVirtualMachineController.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseLaunchableVirtualMachineController.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseLaunchableVirtualMachineController.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -20,6 +20,8 @@
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
+import org.maemo.esbox.internal.api.maemosdk.core.ILaunchableMachineController;
+import org.maemo.esbox.internal.api.maemosdk.core.LaunchedMachineInfo;
 import org.maemo.esbox.internal.vm.Activator;
 import org.maemo.esbox.vm.core.IVirtualMachineConfiguration;
 import org.maemo.mica.common.core.MicaCanceledException;
@@ -51,7 +53,7 @@
  *
  */
 public abstract class BaseLaunchableVirtualMachineController 
-	extends BaseVirtualMachineController  {
+	extends BaseVirtualMachineController implements ILaunchableMachineController  {
 	
 	protected LaunchedMachineInfo launchInfo;
 
@@ -110,14 +112,18 @@
 	 */
 	abstract protected ProcessLauncherParameters constructLaunchParameters();
 
-	/**
-	 * Launch the machine and return an {@link IProcessLauncher} to track it.
-	 * The launcher is not quite ready upon return -- you need to call {@link LaunchedMachineStatus#monitor#runBlocking()}
-	 * or {@link LaunchedMachineStatus#monitor#runNonBlocking()}.
-	 * @return status of launch, which can be used to track the process
-	 * @throws MicaException if process launch fails (i.e. program not found) 
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.api.vm.core.ILaunchableMachineController#launchMachine()
 	 */
-	protected LaunchedMachineInfo launchMachine() throws MicaException {
+	public IStatus launchMachine(IProgressMonitor monitor) {
+		try {
+			return doStartVirtualMachine(monitor, false);
+		} catch (MachineException e) {
+			return Activator.createErrorStatus("Failed to launch machine", e);
+		}
+	}
+	
+	public LaunchedMachineInfo launchMachine() throws MicaException {
 		
 		ProcessLauncherParameters parameters = constructLaunchParameters();
 		List<String> cmdLine = parameters.getCommandLine();
@@ -129,7 +135,7 @@
 		final IProcessLauncher processLauncher = processLauncherFactory.createProcessLauncher(parameters);
 		processLauncher.createProcess(null);
 		
-		LaunchedMachineInfo status = new LaunchedMachineInfo(machineConfiguration, processLauncher);
+		LaunchedMachineInfo status = new LaunchedMachineInfo(processLauncher);
 		
 		
 		return status;

Modified: branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineController.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineController.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineController.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -28,6 +28,7 @@
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.maemo.esbox.internal.api.maemosdk.core.LaunchedMachineInfo;
 import org.maemo.esbox.internal.api.maemosdk.ui.preferences.BuildMachinePreferencePage;
 import org.maemo.esbox.internal.api.vm.ui.LaunchVirtualMachineDialog;
 import org.maemo.esbox.internal.api.vm.ui.SlowVirtualMachineLaunchMonitorDialog;
@@ -144,8 +145,7 @@
 	 * user can edit the machine settings.
 	 * @param launchInfo info used to track the process, or <code>null</code> if it is not relevant or cannot be tracked
 	 * @param monitor
-	 * @return status of connection: OK or CANCEL
-	 * @throws MachineException
+	 * @return status of connection: OK, ERROR, or CANCEL
 	 */
 	protected IStatus probeUntilConnect(LaunchedMachineInfo launchInfo,  
 			IProgressMonitor monitor) {
@@ -356,7 +356,7 @@
 		}
 		
 		try {
-			status = doStartVirtualMachine(new SubProgressMonitor(launchMonitor, 9));
+			status = doStartVirtualMachine(new SubProgressMonitor(launchMonitor, 9), true);
 			
 			if (!status.isOK())
 				return status;
@@ -443,10 +443,11 @@
 	/**
 	 * Start the machine in the VM specific way.  
 	 * @param monitor
+	 * @param connectToMachine if true, connect to the machine's target SSH address
 	 * @return status of start (OK for no-op or success)
 	 * @throws MachineException
 	 */
-	abstract protected IStatus doStartVirtualMachine(IProgressMonitor monitor)
+	abstract protected IStatus doStartVirtualMachine(IProgressMonitor monitor, boolean connectToMachine)
 			throws MachineException;
 
 	protected MachineException cancelled() {

Deleted: branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/LaunchedMachineInfo.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/LaunchedMachineInfo.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/LaunchedMachineInfo.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.api.vm.core;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.maemo.esbox.internal.vm.Activator;
-import org.maemo.esbox.vm.core.IVirtualMachineConfiguration;
-import org.maemo.mica.common.core.process.IProcessLauncher;
-import org.maemo.mica.common.core.process.IProcessMonitor;
-import org.maemo.mica.common.core.process.StringBuilderStreamTextMonitor;
-import org.maemo.mica.common.core.process.ProcessLauncherUtils.LaunchResults;
-
-public class LaunchedMachineInfo {
-	public LaunchedMachineInfo(
-			IVirtualMachineConfiguration configuration,
-			IProcessLauncher processLauncher) {
-		this.configuration = configuration;
-		this.launcher = processLauncher;
-		this.monitor = processLauncher.createProcessMonitor();
-		this.streamGrabber = new StringBuilderStreamTextMonitor(false);
-		this.monitor.addMonitor(streamGrabber);
-	}
-	public LaunchedMachineInfo(IStatus failedStatus) {
-		this.failedStatus = failedStatus;
-	}
-
-	public IProcessLauncher launcher;
-	public IProcessMonitor monitor;
-	public StringBuilderStreamTextMonitor streamGrabber;
-	public IVirtualMachineConfiguration configuration;
-	private IStatus failedStatus;
-	
-	public boolean isAlive() {
-		if (monitor == null)
-			return false;
-		
-		return !monitor.isCompleted();
-	}
-	
-	/**
-	 * Return an status describing the output if the machine died.
-	 * @return IStatus
-	 */
-	public IStatus checkAlive() {
-		if (isAlive())
-			return Status.OK_STATUS;
-
-		String msg;
-		if (launcher != null) {
-			LaunchResults results = new LaunchResults(launcher.getLastCreatedProcess().exitValue(),
-					streamGrabber.stdout.toString(),
-					streamGrabber.stderr.toString());
-			msg = results.reportResults("Virtual machine died unexpectedly");
-			return Activator.createErrorStatus(msg, null);
-		} else {
-			return failedStatus != null ? failedStatus : 
-				Activator.createErrorStatus("The machine was never launched", null);
-		}
-	}
-
-	/**
-	 * @return the failed
-	 */
-	public boolean isFailed() {
-		return failedStatus != null;
-	}
-	
-	/**
-	 * Indicate that this launch failed
-	 * @param status 
-	 */
-	public void setFailed(IStatus status) {
-		if (this.failedStatus == null)
-			this.failedStatus = status;
-	}
-	/**
-	 * @return the failedStatus
-	 */
-	public IStatus getFailedStatus() {
-		return failedStatus;
-	}
-	/**
-	 * 
-	 */
-	public void cancel() {
-		setFailed(BaseLaunchableVirtualMachineController.CANCEL_STATUS);
-
-		// don't cancel anything else here... we can't distinguish explicit user cancel from 
-		// a nested cancellation (e.g. refresh SDKs launches machine, then the refresh is canceled).
-		// This can result in killing a perfectly fine machine
-	}
-}
\ No newline at end of file

Modified: branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/AddressFieldEditor.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/AddressFieldEditor.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/AddressFieldEditor.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -83,6 +83,7 @@
 	private boolean isValid;
 	private boolean allowNetworkAddress;
 	private String oldValue;
+	private boolean allowEmptyAddress;
 
 	//private Button button;
 	
@@ -105,16 +106,32 @@
 			}
 		});
 		*/
+		
+		/*
 		getComboViewer().getCombo().addKeyListener(new KeyAdapter() {
 
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.KeyAdapter#keyReleased(org.eclipse.swt.events.KeyEvent)
-             */
             public void keyReleased(KeyEvent e) {
                 valueChanged();
             }
         });
+		*/
 		
+		// validate on focus lost, since it's costly to validate partial IP addresses as DNS names
+		getComboViewer().getCombo().addKeyListener(new KeyAdapter() {
+            public void keyPressed(KeyEvent e) {
+                clearErrorMessage();
+            }
+        });
+		getComboViewer().getCombo().addFocusListener(new FocusAdapter() {
+            public void focusGained(FocusEvent e) {
+                refreshValidState();
+            }
+
+            public void focusLost(FocusEvent e) {
+                valueChanged();
+                clearErrorMessage();
+            }
+        });
 		getComboViewer().getCombo().addSelectionListener(new SelectionAdapter() {
 			
 			/* (non-Javadoc)
@@ -159,7 +176,24 @@
 	public boolean isAllowNetworkAddress() {
 		return allowNetworkAddress;
 	}
+
+	/**
+	 * Tell whether a blank or empty address is allowed
+	 * @param allow
+	 */
+	public void allowEmptyAddress(boolean allow) {
+		this.allowEmptyAddress = allow;
+	}
 	
+	/**
+	 * 
+	 * Tell whether a blank or empty address is allowed
+	 * @return the allowEmptyAddress
+	 */
+	public boolean isAllowEmptyAddress() {
+		return allowEmptyAddress;
+	}
+	
 	/* (non-Javadoc)
 	 * @see org.eclipse.jface.preference.FieldEditor#isValid()
 	 */
@@ -171,7 +205,7 @@
 		isValid = checkState();
 	}
 	
-	private boolean checkState() {
+	protected boolean checkState() {
 		String address = getComboViewer().getCombo().getText();
 		
 		String label = getLabelText().trim();
@@ -179,6 +213,9 @@
 			label = label.substring(0, label.length() - 1);
 		
 		if (address == null || address.length() == 0) {
+			if (allowEmptyAddress) {
+				return true;
+			}
 			showErrorMessage("Invalid address in " + label);
 			return false;
 		} 
@@ -188,14 +225,30 @@
 			}
 			return true;
 		}
+		
 		if (getPage() != null) {
-			getPage().setMessage(null, IMessageProvider.WARNING);
+			getPage().setMessage(null, IMessageProvider.NONE);
 		}
 		clearErrorMessage();
+
+		if (!customValidate(address, label))
+			return false;
+		
 		return true;
 	}
 
-    protected void valueChanged() {
+    /**
+     * Override to perform custom validation of the address.
+     * If an error occurs, use getPage()#set[Error]Message().
+	 * @param address current address
+	 * @param label label of field
+	 * @return true if valid, false otherwise.  
+	 */
+	protected boolean customValidate(String address, String label) {
+		return true;
+	}
+
+	protected void valueChanged() {
         setPresentsDefaultValue(false);
         boolean oldState = isValid;
         refreshValidState();

Modified: branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/BaseVirtualMachinePreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/BaseVirtualMachinePreferencePage.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/BaseVirtualMachinePreferencePage.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -105,8 +105,8 @@
 	 * @see org.maemo.esbox.internal.api.maemosdk.ui.preferences.BaseMachinePreferencePage#validationFinished(org.maemo.mica.common.core.machine.IMachine)
 	 */
 	@Override
-	public void validationFinished(IMachine machine) {
-		super.validationFinished(machine);
+	public void machineLaunched(IMachine machine) {
+		super.machineLaunched(machine);
 		
 		sharedFoldersPrefPage.setMachine(machine);
 	}

Modified: branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -13,8 +13,10 @@
 
 import java.lang.reflect.InvocationTargetException;
 import java.net.InetAddress;
+import java.net.UnknownHostException;
 
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.IMessageProvider;
 import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.preference.IPreferenceStore;
@@ -34,6 +36,7 @@
 import org.maemo.esbox.internal.vm.Activator;
 import org.maemo.esbox.vm.core.IVirtualMachineConfiguration;
 import org.maemo.esbox.vm.core.VirtualMachinePreferenceConstants;
+import org.maemo.mica.common.core.NetworkUtils;
 import org.maemo.mica.common.core.PasswordStorage;
 import org.maemo.mica.common.ui.StyledTextProgressReporter;
 import org.maemo.mica.common.ui.dialogs.StyledTextProgressDialog;
@@ -105,7 +108,7 @@
 		
 		feUserName = new StringFieldEditor(
 				VirtualMachinePreferenceConstants.VM_USER_NAME,
-				"User:",
+				"&User:",
 				32,
 				getFieldEditorParent());
 		feUserName.setEmptyStringAllowed(false);
@@ -115,7 +118,7 @@
 		
 		feUserPassword = new StringFieldEditor(
 				VirtualMachinePreferenceConstants.VM_USER_PASSWORD,
-				"Password:",
+				"&Password:",
 				32,
 				getFieldEditorParent()) {
 			/* (non-Javadoc)
@@ -180,7 +183,7 @@
 
 		feSshTargetAddr = new AddressFieldEditor(
 				VirtualMachinePreferenceConstants.VM_SSH_TARGET_ADDR,
-				"Target address:",
+				"&Target address:",
 				getFieldEditorParent());
 		addField(feSshTargetAddr);
 		Control control = feSshTargetAddr.getViewerControl();
@@ -210,7 +213,7 @@
 		
 		feSshTargetPort = new PortFieldEditor(
 				VirtualMachinePreferenceConstants.VM_SSH_TARGET_PORT, 
-				"Target SSH port:", 
+				"Target &SSH port:", 
 				getFieldEditorParent(), 
 				5);
 		addField(feSshTargetPort);
@@ -219,8 +222,32 @@
 
 		feSshHostAddr = new AddressFieldEditor(
 				VirtualMachinePreferenceConstants.VM_SSH_HOST_ADDR,
-				"Host address:",
-				getFieldEditorParent());
+				"&Host address:",
+				getFieldEditorParent()) {
+			/* (non-Javadoc)
+			 * @see org.maemo.esbox.internal.api.vm.ui.preferences.AddressFieldEditor#customValidate(java.lang.String, java.lang.String)
+			 */
+			@Override
+			protected boolean customValidate(String address,
+					String label) {
+				try {
+					InetAddress addr = InetAddress.getByName(address);
+					if (NetworkUtils.isLocalAddress(addr))
+						return true;
+					if (basePrefPage.isSpecialHostAddress(addr))
+						return true;
+					if (getPage() != null)
+						getPage().setMessage(
+								"The address " + addr + " does not match a local interface in " + label,
+								IMessageProvider.WARNING);
+					return true;
+				} catch (UnknownHostException e) {
+					if (getPage() != null)
+						getPage().setErrorMessage("Unknown host in " + label + ": " + e.getMessage());
+					return false;
+				}
+			}
+		};
 		addField(feSshHostAddr);
 		control = feSshHostAddr.getViewerControl();
 		control.setToolTipText("Specify the address of the host as seen from the machine.");
@@ -234,7 +261,7 @@
 		
 		feSshHostPort = new PortFieldEditor(
 				VirtualMachinePreferenceConstants.VM_SSH_HOST_PORT,
-				"Host SSH port:",
+				"Host SSH po&rt:",
 				getFieldEditorParent(),
 				5);
 		addField(feSshHostPort);
@@ -253,7 +280,7 @@
 		*/
 		
 		configNetworkButton = new Button(getFieldEditorParent(), SWT.PUSH);
-		configNetworkButton.setText("Autoselect network settings");
+		configNetworkButton.setText("Autoselect net&work settings");
 		GridDataFactory.swtDefaults().span(
 				((GridLayout) getFieldEditorParent().getLayout()).numColumns, 1)
 			.applyTo(configNetworkButton);
@@ -358,4 +385,5 @@
 			config.setHostPort(22);
 		}
 	}
+	
 }

Modified: branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ManualVirtualMachineController.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ManualVirtualMachineController.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ManualVirtualMachineController.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -38,7 +38,7 @@
 	 * @see org.maemo.esbox.internal.api.vm.core.BaseVirtualMachineController#doStartMachineImpl(org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	@Override
-	protected IStatus doStartVirtualMachine(IProgressMonitor monitor)
+	protected IStatus doStartVirtualMachine(IProgressMonitor monitor, boolean connectToMachine)
 			throws MachineException {
 		return Activator.createErrorStatus(
 				MessageFormat.format("Could not contact the build machine at {0}:{1}; it must be manually launched.",

Modified: branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ManualVirtualMachinePreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ManualVirtualMachinePreferencePage.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ManualVirtualMachinePreferencePage.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -11,6 +11,8 @@
 
 package org.maemo.esbox.internal.vm;
 
+import java.net.InetAddress;
+
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.dialogs.DialogSettings;
 import org.eclipse.jface.preference.IPreferenceStore;
@@ -87,4 +89,12 @@
 			
 		};
 	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.api.maemosdk.ui.preferences.BaseMachinePreferencePage#isSpecialHostAddress(java.net.InetAddress)
+	 */
+	@Override
+	public boolean isSpecialHostAddress(InetAddress address) {
+		return false;
+	}
 }

Modified: branches/work_Fabricio/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineController.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineController.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineController.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -22,8 +22,8 @@
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
+import org.maemo.esbox.internal.api.maemosdk.core.LaunchedMachineInfo;
 import org.maemo.esbox.internal.api.vm.core.BaseLaunchableVirtualMachineController;
-import org.maemo.esbox.internal.api.vm.core.LaunchedMachineInfo;
 import org.maemo.esbox.vm.core.IVirtualMachine;
 import org.maemo.esbox.vm.qemu.IQemuConfiguration;
 import org.maemo.mica.common.core.MicaException;
@@ -136,7 +136,7 @@
 	 * @see org.maemo.esbox.internal.api.vm.core.BaseVirtualMachineController#doStartMachineImpl(org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	@Override
-	protected IStatus doStartVirtualMachine(IProgressMonitor monitor)
+	protected IStatus doStartVirtualMachine(IProgressMonitor monitor, boolean connectToMachine)
 			throws MachineException {
 		monitor.beginTask("Starting QEMU...", 10);
 		monitor.subTask("Checking existing QEMU instances...");
@@ -151,9 +151,14 @@
 		
 		launchInfo.monitor.runNonBlocking();
 		
-		IStatus status = probeUntilConnect(
+		IStatus status;
+		
+		if (connectToMachine)
+			status = probeUntilConnect(
 				launchInfo,
 				new SubProgressMonitor(monitor, 8));
+		else
+			status = Status.OK_STATUS;
 		
 		if (monitor.isCanceled() || status.getSeverity() == IStatus.CANCEL) {
 			launchInfo.cancel();

Modified: branches/work_Fabricio/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferencePage.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferencePage.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -40,6 +40,11 @@
 public class QemuPreferencePage extends BaseVirtualMachinePreferencePage {
 
 	/**
+	 * 
+	 */
+	private static final String BASE_DHCP_ADDRESS = "10.0.2.2";
+
+	/**
 	 * @param settings
 	 */
 	public QemuPreferencePage(IVirtualMachineConfiguration config) {
@@ -54,7 +59,8 @@
 		IQemuConfiguration config = new QemuConfiguration(new DialogSettings("temp"));
 		commonPrefPage.saveTo(config);
 		config.setSharedFolders(sharedFoldersPrefPage.getSharedFolders());
-		vmPrefPage.saveTo(config);
+		if (vmPrefPage != null)
+			vmPrefPage.saveTo(config);
 		return new QemuMachine("Test QEMU Machine", config); 
 	}
 
@@ -80,7 +86,7 @@
 					 */
 					@Override
 					protected void addCustomAddresses(Set<String> addrs) {
-						addrs.add("10.0.2.2");
+						addrs.add(BASE_DHCP_ADDRESS);
 						super.addCustomAddresses(addrs);
 					}
 				};
@@ -129,7 +135,7 @@
 				commonPrefPage.getSSHHostPort().setStringValue(hostPort);
 				reporter.logInfo("Setting SSH Host Port to " + hostPort);
 				
-				String host = "10.0.2.2";
+				String host = BASE_DHCP_ADDRESS;
 				try {
 					commonPrefPage.getSSHHostAddr().setAddress(
 							InetAddress.getByName(host));
@@ -143,4 +149,14 @@
 		};
 	}
 	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.api.maemosdk.ui.preferences.BaseMachinePreferencePage#isSpecialHostAddress(java.net.InetAddress)
+	 */
+	@Override
+	public boolean isSpecialHostAddress(InetAddress address) {
+		if (!(address instanceof Inet4Address))
+			return false;
+		byte[] addr = address.getAddress();
+		return addr[0] == 10 && addr[1] == 0;
+	}
 }

Modified: branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxMachineController.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxMachineController.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxMachineController.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -26,8 +26,8 @@
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
+import org.maemo.esbox.internal.api.maemosdk.core.LaunchedMachineInfo;
 import org.maemo.esbox.internal.api.vm.core.BaseLaunchableVirtualMachineController;
-import org.maemo.esbox.internal.api.vm.core.LaunchedMachineInfo;
 import org.maemo.esbox.vm.core.IVirtualMachine;
 import org.maemo.esbox.vm.core.IVirtualMachineConfiguration;
 import org.maemo.esbox.vm.virtualbox.IVirtualBoxConfiguration;
@@ -233,7 +233,7 @@
 	 * @see org.maemo.esbox.internal.api.vm.core.BaseVirtualMachineController#doStartVirtualMachine(org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	@Override
-	protected IStatus doStartVirtualMachine(IProgressMonitor monitor)
+	protected IStatus doStartVirtualMachine(IProgressMonitor monitor, boolean connectToMachine)
 			throws MachineException {
 		monitor.beginTask("Starting VirtualBox...", 10 + 5000);
 		
@@ -272,9 +272,15 @@
 			return status;
 		}
 		
-		IStatus status = probeUntilConnect(
-				null,  /* we're not watching VBoxManage */
-				new SubProgressMonitor(monitor, 8));
+		IStatus status;
+		if (connectToMachine)
+			status = probeUntilConnect(
+					null,  /* we're not watching VBoxManage */
+					new SubProgressMonitor(monitor, 8));
+		else
+			status = Status.OK_STATUS;
+
+		monitor.done();
 		
 		if (monitor.isCanceled() || status.getSeverity() == IStatus.CANCEL) {
 			launchInfo.cancel();

Modified: branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxPreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxPreferencePage.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxPreferencePage.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -47,6 +47,12 @@
  */
 public class VirtualBoxPreferencePage extends BaseVirtualMachinePreferencePage {
 
+	/**
+	 * 
+	 */
+	private static final String BASE_DHCP_ADDRESS = "10.0.2.2";
+
+
 	public VirtualBoxPreferencePage(IVirtualMachineConfiguration config) {
 		super(config);
 	}
@@ -67,7 +73,8 @@
 		IVirtualBoxConfiguration config = new VirtualBoxConfiguration(new DialogSettings("temp"));
 		commonPrefPage.saveTo(config);
 		config.setSharedFolders(sharedFoldersPrefPage.getSharedFolders());
-		vmPrefPage.saveTo(config);
+		if (vmPrefPage != null)
+			vmPrefPage.saveTo(config);
 		return config;
 	}
 	
@@ -86,7 +93,7 @@
 					 */
 					@Override
 					protected void addCustomAddresses(Set<String> addrs) {
-						addrs.add("10.0.2.2");
+						addrs.add(BASE_DHCP_ADDRESS);
 						super.addCustomAddresses(addrs);
 					}
 				};
@@ -123,7 +130,7 @@
 				String target = "127.0.0.1";
 				String targetPort = "2222";
 				String hostPort = "22";
-				String host = "10.0.2.2";
+				String host = BASE_DHCP_ADDRESS;
  
 				Map<String, String> machineInfo = VirtualBoxUtils.getVirtualMachineInfo(configuration);
 				
@@ -301,4 +308,16 @@
 			IPreferenceStore preferenceStore) {
 		return new VirtualBoxSettingsPreferencePage(preferenceStore);
 	}
+
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.api.maemosdk.ui.preferences.BaseMachinePreferencePage#isSpecialHostAddress(java.net.InetAddress)
+	 */
+	@Override
+	public boolean isSpecialHostAddress(InetAddress address) {
+		if (!(address instanceof Inet4Address))
+			return false;
+		byte[] addr = address.getAddress();
+		return addr[0] == 10 && addr[1] == 0;
+	}
 }

Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareMachineController.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareMachineController.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareMachineController.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -21,8 +21,8 @@
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
+import org.maemo.esbox.internal.api.maemosdk.core.LaunchedMachineInfo;
 import org.maemo.esbox.internal.api.vm.core.BaseLaunchableVirtualMachineController;
-import org.maemo.esbox.internal.api.vm.core.LaunchedMachineInfo;
 import org.maemo.esbox.vm.core.IVirtualMachine;
 import org.maemo.esbox.vm.vmware.IVMwareConfiguration;
 import org.maemo.mica.common.core.HostUtils;
@@ -66,9 +66,7 @@
 		// won't necessarily be the program we expect.)
 		for (IProcess process : allProcesses) {
 			if (process.getCommandLine().contains(vmx.getName())) {
-				if (process.getName().contains(program.getName())
-						|| process.getName().toLowerCase().contains("vmware")
-						|| process.getName().contains("vmware-vmx")) {
+				if (vmwareProcessMatches(program, process)) {
 					matches.add(process);
 				}
 			}
@@ -81,7 +79,7 @@
 		// lines are empty.  Be looser.
 		if (HostUtils.isWindows()) {
 			for (IProcess process : allProcesses) {
-				if (process.getName().contains(program.getName())) {
+				if (vmwareProcessMatches(program, process)) {
 					matches.add(process);
 				}
 			}
@@ -90,6 +88,13 @@
 		return (IProcess[]) matches.toArray(new IProcess[matches.size()]);
 	}
 
+	private boolean vmwareProcessMatches(File program, IProcess process) {
+		String suffix = HostUtils.isWindows() ? "(.exe)?" : "";
+		return process.getName().toLowerCase().matches(".*" + program.getName() + suffix)
+				|| process.getName().toLowerCase().matches(".*vmware" + suffix)
+				|| process.getName().matches(".*vmware-vmx" + suffix);
+	}
+
 	protected boolean doIsMachineRunning() {
 		// We can't tell if the machine stopped running just based on the process stopping
 		// (VMware may have used another instance to host the machine, or, vmrun has exited
@@ -187,7 +192,7 @@
 	 * @see org.maemo.esbox.internal.api.vm.core.BaseVirtualMachineController#doStartMachineImpl(org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	@Override
-	protected IStatus doStartVirtualMachine(IProgressMonitor monitor)
+	protected IStatus doStartVirtualMachine(IProgressMonitor monitor, boolean connectToMachine)
 			throws MachineException {
 		
 		monitor.beginTask("Starting VMware...", 10);
@@ -224,6 +229,8 @@
 		
 		LaunchedMachineInfo watchStatus = null;
 		
+		monitor.subTask("Waiting for VMware to start...");
+		
 		if (usingVMrun) {
 			// wait for this to finish
 			launchInfo.monitor.waitForCompletion(null);
@@ -255,9 +262,12 @@
 				watchStatus = launchInfo;
 		}
 		
-		status = probeUntilConnect(
-				watchStatus,
-				new SubProgressMonitor(monitor, 8));
+		if (connectToMachine)
+			status = probeUntilConnect(
+					watchStatus,
+					new SubProgressMonitor(monitor, 8));
+		else
+			status = Status.OK_STATUS;	
 		
 		if (monitor.isCanceled() || status.getSeverity() == IStatus.CANCEL) {
 			launchInfo.cancel();

Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwarePreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwarePreferencePage.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwarePreferencePage.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -60,7 +60,8 @@
 		IVMwareConfiguration config = new VMwareConfiguration(new DialogSettings("temp"));
 		commonPrefPage.saveTo(config);
 		config.setSharedFolders(sharedFoldersPrefPage.getSharedFolders());
-		vmPrefPage.saveTo(config);
+		if (vmPrefPage != null)
+			vmPrefPage.saveTo(config);
 		return new VMwareMachine("Test VMWare Machine", config); 
 	}
 	
@@ -202,7 +203,7 @@
 			}
 		}
 		
-		if (vmnet != null) {
+		if (vmnet != null && hostAddr != null) {
 			setupForVMnet(reporter, vmnet, hostAddr);
 		} else {
 			setupForUnknownNetwork(reporter, isNAT);	
@@ -353,4 +354,12 @@
 		}
 	}
 
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.api.maemosdk.ui.preferences.BaseMachinePreferencePage#isSpecialHostAddress(java.net.InetAddress)
+	 */
+	@Override
+	public boolean isSpecialHostAddress(InetAddress address) {
+		return false;
+	}
 }

Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareSettingsPreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareSettingsPreferencePage.java	2009-10-07 19:15:06 UTC (rev 2277)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareSettingsPreferencePage.java	2009-10-07 20:04:28 UTC (rev 2278)
@@ -13,10 +13,19 @@
 
 import java.lang.reflect.Field;
 
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.jface.preference.DirectoryFieldEditor;
 import org.eclipse.jface.preference.FileFieldEditor;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Text;
 import org.maemo.esbox.internal.api.maemosdk.ui.preferences.BaseMachinePreferencePage;
@@ -39,7 +48,7 @@
 	//private StringFieldEditor feVMWAREExeName;
 	//private StringFieldEditor feVMWARELaunchPattern;
 	/*private*/ final BaseMachinePreferencePage vmPrefPage;
-	private RadioGroupFieldEditor feVMwareProductType;
+	private RadioGroupFieldEditor feVMwareProductType;	// may be null
 	private DirectoryFieldEditor feVMWAREPath;
 
 	/**
@@ -60,28 +69,29 @@
 	protected void createFieldEditors() {
 		Text text;
 		
-		String[][] namesAndValues;
 		if (HostUtils.isOSX()) {
-			namesAndValues = new String[][] {
-					{ "Fusion", IVMwareConfiguration.PRODUCT_FUSION }
-			};
+			// don't show radio button with only one choice
+			//namesAndValues = new String[][] {
+			//		{ "Fusion", IVMwareConfiguration.PRODUCT_FUSION }
+			//};
 		} else {
+			String[][] namesAndValues;
 			namesAndValues = new String[][] {
 					{ "Player", IVMwareConfiguration.PRODUCT_PLAYER },
 					{ "Workstation", IVMwareConfiguration.PRODUCT_WORKSTATION },
 					{ "Server", IVMwareConfiguration.PRODUCT_SERVER },
 			};
+			feVMwareProductType = new RadioGroupFieldEditor(
+					VMwarePreferenceConstants.VMWARE_PRODUCT,
+					"Product Type:",
+					3, namesAndValues,
+					getFieldEditorParent());
+			
+			Composite radioBoxControl = feVMwareProductType.getRadioBoxControl(getFieldEditorParent());
+			radioBoxControl.setToolTipText("Set the VMware product type to use.");
+			addField(feVMwareProductType);
 		}
-		feVMwareProductType = new RadioGroupFieldEditor(
-				VMwarePreferenceConstants.VMWARE_PRODUCT,
-				"Product Type:",
-				3, namesAndValues,
-				getFieldEditorParent());
 		
-		Composite radioBoxControl = feVMwareProductType.getRadioBoxControl(getFieldEditorParent());
-		radioBoxControl.setToolTipText("Set the VMware product type to use.");
-		addField(feVMwareProductType);
-		
 		/*
 		feVMWAREExeName = new FileFieldEditor(
 				VMwarePreferenceConstants.VMWARE_EXE_NAME,
@@ -100,7 +110,7 @@
 		text = feVMWAREPath.getTextControl(getFieldEditorParent()); 
 		text.setToolTipText(
 						"Specify the full path to a VMware installation");
-
+		
 		/*
 		feVMWARELaunchPattern = new StringFieldEditor(
 				VMwarePreferenceConstants.VMWARE_LAUNCH_PATTERN,
@@ -160,15 +170,20 @@
 	 * @return
 	 */
 	private String getCurrentProductName() {
-		// horrible horrible private fields
-		Field field;
-		try {
-			field = RadioGroupFieldEditor.class.getDeclaredField("value");
-			field.setAccessible(true);
-			
-			return (String) field.get(feVMwareProductType);
-		} catch (Exception e) {
-			return null;
+		if (feVMwareProductType != null) {
+			// horrible horrible private fields
+			Field field;
+			try {
+				field = RadioGroupFieldEditor.class.getDeclaredField("value");
+				field.setAccessible(true);
+				
+				return (String) field.get(feVMwareProductType);
+			} catch (Exception e) {
+				return null;
+			}
+		} else {
+			// OS X
+			return IVMwareConfiguration.PRODUCT_FUSION;
 		}
 	}
 }



More information about the Esbox-commits mailing list