[Esbox-commits] r939 - in branches/work_Ed: org.maemo.esbox.maemosdk.core org.maemo.esbox.maemosdk.tests org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests org.maemo.esbox.maemosdk.ui org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences org.maemo.esbox.scratchbox.core org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk org.maemo.esbox.vm org.maemo.esbox.vm/META-INF org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui 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/src/org/maemo/esbox/vm/core org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui org.maemo.esbox.vm.qemu org.maemo.esbox.vm.qemu/about_files org.maemo.esbox.vm.qemu/conf org.maemo.esbox.vm.qemu/src org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu org.maemo.esbox.vm.qemu/src/org/maemo/esbox/vm/qemu

eswartz at garage.maemo.org eswartz at garage.maemo.org
Thu Nov 13 16:13:47 EET 2008


Author: eswartz
Date: 2008-11-13 16:13:47 +0200 (Thu, 13 Nov 2008)
New Revision: 939

Added:
   branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/TestBuildMachineFactory.java
   branches/work_Ed/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/BuildMachinePreferencePage.java
   branches/work_Ed/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/ESboxPreferencesPage.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/about.html
   branches/work_Ed/org.maemo.esbox.vm.qemu/about_files/
   branches/work_Ed/org.maemo.esbox.vm.qemu/about_files/epl-v10.html
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/CustomQemuConfiguration.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineFactory.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuSettingsPreferencePage.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/BaseVirtualMachinePreferencePage.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ESboxHostBuildMachineFactory.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/LinuxX86MachinePreferencesPage.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/LinuxX86On64BuildMachineWrapper.java
Removed:
   branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/EdTestQemuConfiguration.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/_org/
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/BaseVirtualMachinePreferencePage.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachinePreferencePage.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui/BaseVirtualMachinePreferencePage.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui/preferences/
Modified:
   branches/work_Ed/org.maemo.esbox.maemosdk.core/build.properties
   branches/work_Ed/org.maemo.esbox.maemosdk.core/plugin.xml
   branches/work_Ed/org.maemo.esbox.maemosdk.tests/plugin.xml
   branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/Activator.java
   branches/work_Ed/org.maemo.esbox.maemosdk.ui/build.properties
   branches/work_Ed/org.maemo.esbox.maemosdk.ui/plugin.xml
   branches/work_Ed/org.maemo.esbox.scratchbox.core/plugin.xml
   branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/AbstractScratchboxSDK.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/build.properties
   branches/work_Ed/org.maemo.esbox.vm.qemu/conf/qemu_prefs.xml
   branches/work_Ed/org.maemo.esbox.vm.qemu/plugin.xml
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/PreferenceQemuConfiguration.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuBuildMachineFactory.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachine.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineController.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferenceConstants.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferencePage.java
   branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/vm/qemu/IQemuConfiguration.java
   branches/work_Ed/org.maemo.esbox.vm/META-INF/MANIFEST.MF
   branches/work_Ed/org.maemo.esbox.vm/about.html
   branches/work_Ed/org.maemo.esbox.vm/build.properties
   branches/work_Ed/org.maemo.esbox.vm/plugin.xml
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/VirtualBuildMachineConfigurationHandler.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachine.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachineConfiguration.java
   branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui/SelectVirtualMachineDialog.java
Log:
Checkpoint commit for multi VM support. 
-- Promote idea of "Virtual Machine" to ESbox > Build Machines, and provide Local machine as a build machine in this UI
-- Provide some abstractions for preference pages combined together (IComposablePreferencePage)
-- Add "machine factory" extension for generic creation of machines from URI
-- Distinguish Linux x86 from x86-64 so we don't automatically assume a 64-bit host can build sbox
-- Fix the timing for selection of machines so that unit tests can select stock machines
-- Allow QEMU to support more than one disk image

Modified: branches/work_Ed/org.maemo.esbox.maemosdk.core/build.properties
===================================================================
--- branches/work_Ed/org.maemo.esbox.maemosdk.core/build.properties	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.maemosdk.core/build.properties	2008-11-13 14:13:47 UTC (rev 939)
@@ -4,4 +4,5 @@
                .,\
                plugin.xml,\
                about.html,\
-               conf/
+               conf/,\
+               about_files/

Modified: branches/work_Ed/org.maemo.esbox.maemosdk.core/plugin.xml
===================================================================
--- branches/work_Ed/org.maemo.esbox.maemosdk.core/plugin.xml	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.maemosdk.core/plugin.xml	2008-11-13 14:13:47 UTC (rev 939)
@@ -3,15 +3,17 @@
 <plugin>
    <extension
          point="org.eclipse.core.runtime.adapters">
+         <!-- scratchbox-specific -->
        <factory
-            adaptableType="org.maemo.mica.common.core.sdk.ISDKTarget"
+            adaptableType="org.maemo.esbox.internal.api.scratchbox.core.sdk.AbstractScratchboxSDKTarget"
             class="org.maemo.esbox.internal.maemosdk.core.adapters.MaemoTargetEnvironmentModifierAdapterFactory">
          <adapter
                type="org.maemo.mica.common.launch.adapters.ITargetEnvironmentModifierAdapter">
          </adapter>
       </factory>
+      <!-- scratchbox-specific -->
        <factory
-            adaptableType="org.maemo.mica.common.core.sdk.ISDKTarget"
+            adaptableType="org.maemo.esbox.internal.api.scratchbox.core.sdk.AbstractScratchboxSDKTarget"
             class="org.maemo.esbox.internal.api.maemosdk.core.execEnv.MaemoEmulatorExecutionEnvironmentProviderAdapterFactory">
          <adapter
                type="org.maemo.mica.common.core.execEnv.IExecutionEnvironmentProviderAdapter">
@@ -39,6 +41,7 @@
   
    <extension
          point="org.eclipse.core.runtime.adapters">
+         <!-- generic maemo -->
        <factory
             adaptableType="org.maemo.mica.common.core.sdk.ISDKTarget"
             class="org.maemo.esbox.internal.maemosdk.core.adapters.MaemoDefaultExecutionEnvironmentFactory">
@@ -46,6 +49,7 @@
                type="org.maemo.mica.common.core.adapters.IDefaultExecutionEnvironmentAdapter">
          </adapter>
        </factory>
+       <!-- generic maemo -->
       <factory
             adaptableType="org.maemo.mica.common.core.sdk.ISDKTarget"
             class="org.maemo.esbox.internal.maemosdk.core.adapters.Scratchbox1PrepareTargetProcessLaunchAdapterFactory">

Modified: branches/work_Ed/org.maemo.esbox.maemosdk.tests/plugin.xml
===================================================================
--- branches/work_Ed/org.maemo.esbox.maemosdk.tests/plugin.xml	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.maemosdk.tests/plugin.xml	2008-11-13 14:13:47 UTC (rev 939)
@@ -2,8 +2,10 @@
 <?eclipse version="3.2"?>
 <plugin>
    <extension
-         point="org.eclipse.ui.startup">
-      <startup></startup>
+         point="org.maemo.mica.common.core.build_machine_factory">
+      <build_machine_factory
+            class="org.maemo.esbox.internal.scratchbox.tests.TestBuildMachineFactory">
+      </build_machine_factory>
    </extension>
 
 </plugin>

Modified: branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/Activator.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/Activator.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/Activator.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -10,21 +10,13 @@
  *******************************************************************************/
 package org.maemo.esbox.internal.scratchbox.tests;
 
-import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
-
-import org.eclipse.ui.IStartup;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.maemo.esbox.internal.vm.qemu.QemuMachine;
-import org.maemo.esbox.vm.core.IVirtualMachine;
-import org.maemo.esbox.vm.qemu.IQemuConfiguration;
-import org.maemo.mica.common.core.HostUtils;
-import org.maemo.mica.common.core.machine.*;
-import org.osgi.framework.BundleContext;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
 
 /**
  * The activator class controls the plug-in life cycle
  */
-public class Activator extends AbstractUIPlugin implements IStartup, IBuildMachineConfigurationListener {
+public class Activator extends AbstractUIPlugin {
 
 	// The plug-in ID
 	public static final String PLUGIN_ID = "org.maemo.esbox.scratchbox.tests";
@@ -64,35 +56,5 @@
 	public static Activator getDefault() {
 		return plugin;
 	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.ui.IStartup#earlyStartup()
-	 */
-	public void earlyStartup() {
-		// wire ourselves up to handle selecting the build machine
-		if (WorkbenchUtils.isJUnitRunning()) {
-			MachineRegistry.getInstance().addBuildMachineConfigurationListener(
-					this);
-		}
-	}
 	
-	/* (non-Javadoc)
-	 * @see org.maemo.mica.common.core.machine.IBuildMachineConfigurationListener#buildMachineConfigurationNeeded()
-	 */
-	public void buildMachineConfigurationNeeded() {
-		// Under a JUnit test, we will forcibly inject the known VM with the known
-		// configuration
-		if (HostUtils.isWindows()) { /// TODO XXX: macos
-			IQemuConfiguration config = new EdTestQemuConfiguration();
-			QemuMachine machine = new QemuMachine(config);
-			MachineRegistry.getInstance().setCurrentBuildMachine(machine);
-		}
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.mica.common.core.machine.IBuildMachineConfigurationListener#buildMachinesChanged()
-	 */
-	public void buildMachinesChanged() {
-		
-	}
 }

Deleted: branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/EdTestQemuConfiguration.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/EdTestQemuConfiguration.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/EdTestQemuConfiguration.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.scratchbox.tests;
-
-import org.eclipse.core.runtime.Platform;
-import org.maemo.esbox.vm.qemu.IQemuConfiguration;
-import org.maemo.mica.common.core.machine.ISharedFilesystemProvider;
-import org.maemo.mica.internal.api.common.core.machine.StockSharedFilesystemProvider;
-import org.maemo.mica.protocol.ssh.SSHConfiguration;
-
-/**
- * This configuration corresponds to Ed's own qemu image.
- * @author eswartz
- *
- */
-public class EdTestQemuConfiguration implements IQemuConfiguration {
-
-	private SSHConfiguration sshConfiguration = new SSHConfiguration(
-			"127.0.0.1", 2222, 
-			"10.0.2.2", 22,
-			"devel", "qatest", 
-			10 /*timeout*/ 
-			);
-
-	/* (non-Javadoc)
-	 * @see org.maemo.mica.common.core.machine.IQemuConfiguration#getOS()
-	 */
-	public String getOS() {
-		return Platform.OS_LINUX;
-	}
-	
-	/* (non-Javadoc)
-	 * @see testrse.IQemuConfiguration#getSSHConfiguration()
-	 */
-	public SSHConfiguration getSSHConfiguration() {
-		return sshConfiguration;
-	}
-
-	/* (non-Javadoc)
-	 * @see testrse.IQemuConfiguration#getBiosPath()
-	 */
-	public String getInstallPath() {
-		return "c:/Program Files/Qemu";
-	}
-
-	/* (non-Javadoc)
-	 * @see testrse.IQemuConfiguration#getDiskImagePath()
-	 */
-	public String getDiskImagePath() {
-		return "c:/Program Files/Nokia/Carbide for Maemo/vm/hda.img";
-	}
-
-	/* (non-Javadoc)
-	 * @see testrse.IQemuConfiguration#getExecutable()
-	 */
-	public String getExecutable() {
-		return "c:/program files/qemu/qemu.exe";
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.mica.common.core.machine.IQemuConfiguration#getSharedFilesystemProvider()
-	 */
-	public ISharedFilesystemProvider getSharedFilesystemProvider() {
-		return new StockSharedFilesystemProvider(sshConfiguration.getUserName());
-	}
-
-	/* (non-Javadoc)
-	 * @see org.maemo.mica.common.core.machine.IQemuConfiguration#getCIFSPort()
-	 */
-	public int getCIFSPort() {
-		return 4445;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.vm.qemu.IQemuConfiguration#getCommandLaunchPattern()
-	 */
-	public String getCommandLaunchPattern() {
-		return "\"${QEMU}\" -kernel-kqemu -hda \"${DISK_PATH}\" -usb -L \"${INSTALL_PATH}\" " +
-		"-m ${MEMORY} -redir tcp:${SSH_PORT}::22 "+
-		"-hdb \"c:/Program Files/Nokia/Carbide for Maemo/vm/hdb.img\"";
-				
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.vm.qemu.IQemuConfiguration#getMemorySize()
-	 */
-	public int getMemorySize() {
-		return 512;
-	}
-}

Added: branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/TestBuildMachineFactory.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/TestBuildMachineFactory.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/internal/scratchbox/tests/TestBuildMachineFactory.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.scratchbox.tests;
+
+import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
+
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.machine.*;
+import org.maemo.mica.common.core.tests.TestMachineUtils;
+import org.maemo.mica.internal.api.common.core.machine.IBuildMachineImpl;
+import org.maemo.mica.protocol.ssh.ISSHMachine;
+
+/**
+ * This factory creates a machine that can be used during unit tests,
+ * in the event we're running outside Linux and the MachineRegistry can't decide.
+ * @author eswartz
+ *
+ */
+public class TestBuildMachineFactory implements IBuildMachineFactory, IBuildMachineConfigurationListener {
+
+	/**
+	 * 
+	 */
+	public TestBuildMachineFactory() {
+		if (WorkbenchUtils.isJUnitRunning())
+			MachineRegistry.getInstance().addBuildMachineConfigurationListener(this);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.common.core.machine.IBuildMachineFactory#createMachines()
+	 */
+	public IBuildMachineImpl[] getMachines() {
+		return new IBuildMachineImpl[0];
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.common.core.machine.IBuildMachineConfigurationListener#buildMachineConfigurationNeeded()
+	 */
+	public void buildMachineConfigurationNeeded() {
+		// Under a JUnit test (which registers this listener), we will forcibly inject 
+		// the known VM with the known configuration
+		ISSHMachine machine;
+		try {
+			machine = TestMachineUtils.getSSHBuildMachine();
+			if (machine instanceof IBuildMachine)
+				MachineRegistry.getInstance().setCurrentBuildMachine((IBuildMachine) machine);
+		} catch (MicaException e) {
+		}
+
+	}
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.common.core.machine.IBuildMachineConfigurationListener#buildMachinesChanged()
+	 */
+	public void buildMachinesChanged() {
+		
+	}
+
+}

Modified: branches/work_Ed/org.maemo.esbox.maemosdk.ui/build.properties
===================================================================
--- branches/work_Ed/org.maemo.esbox.maemosdk.ui/build.properties	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.maemosdk.ui/build.properties	2008-11-13 14:13:47 UTC (rev 939)
@@ -4,4 +4,5 @@
                .,\
                plugin.xml,\
                about.html,\
-               icons/
+               icons/,\
+               about_files/

Modified: branches/work_Ed/org.maemo.esbox.maemosdk.ui/plugin.xml
===================================================================
--- branches/work_Ed/org.maemo.esbox.maemosdk.ui/plugin.xml	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.maemosdk.ui/plugin.xml	2008-11-13 14:13:47 UTC (rev 939)
@@ -1,12 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.2"?>
 <plugin>
-      <extension
+ <extension
+	 point="org.eclipse.ui.preferencePages">
+	  <page
+	    name="ESbox"
+	    class="org.maemo.esbox.internal.maemosdk.ui.preferences.ESboxPreferencesPage"
+	    id="org.maemo.esbox.ui.preferenceCategory.esbox">
+	  </page>
+   </extension>
+ 
+       <extension
          point="org.eclipse.ui.preferencePages">
          <!-- Not supported yet!
       <page
             name="Gazpacho"
-            category="org.maemo.mica.common.ui.preferenceCategory.maemo"
+            category="org.maemo.esbox.ui.preferenceCategory.esbox"
             class="org.maemo.esbox.internal.maemosdk.ui.preferences.GazpachoPreferencePage"
             id="org.maemo.mica.maemosdk.ui.preferencePage.gazpacho">
       </page>
@@ -15,11 +24,18 @@
       
       <page
             name="X Server"
-            category="org.maemo.mica.common.ui.preferenceCategory.maemo"
+            category="org.maemo.esbox.ui.preferenceCategory.esbox"
             class="org.maemo.esbox.internal.maemosdk.ui.preferences.XServerPreferencePage"
-            id="org.maemo.mica.maemosdk.ui.preferencePage.xserver">
+            id="org.maemo.esbox.maemosdk.ui.preferencePage.xserver">
       </page>   
       
+      <page
+            category="org.maemo.esbox.ui.preferenceCategory.esbox"
+            class="org.maemo.esbox.internal.maemosdk.ui.preferences.BuildMachinePreferencePage"
+            id="org.maemo.esbox.maemosdk.ui.preferencePage.buildMachines"
+            name="Build Machines">
+      </page>
+    
 	</extension>
 		
    <extension

Added: branches/work_Ed/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/BuildMachinePreferencePage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/BuildMachinePreferencePage.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/BuildMachinePreferencePage.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,327 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.maemosdk.ui.preferences;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.*;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.maemo.mica.common.core.machine.*;
+
+import java.util.*;
+import java.util.List;
+
+/**
+ * Configure virtual machine preferences.  This allows the user to select which
+ * virtual machine engine to use (IBuildMachine, which we currently assume is a singleton)
+ * and how to configure it (username, password, shared folders, etc, combined with
+ * the virtual machine's own configuration UI).
+ * @author eswartz
+ *
+ */
+public class BuildMachinePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+	private static final String NONE_LABEL = "None";
+	private List<IBuildMachine> availableBuildMachines;
+	private IBuildMachine originalSelectedMachine;
+	private IBuildMachine selectedMachine;
+	private ComboViewer machineComboViewer;
+	private Composite machineConfigComposite;
+	private StackLayout machineConfigStackLayout;
+	private Map<String, IComposablePreferencePage> machineConfigPages;
+	protected Map<String, IBuildMachine> machineMap;
+	private Label noMachineConfigUI;
+	
+	/**
+	 * 
+	 */
+	public BuildMachinePreferencePage() {
+		availableBuildMachines = new ArrayList<IBuildMachine>(
+				Arrays.asList(MachineRegistry.getInstance().getAvailableBuildMachines()));
+		
+		// order the machines by preference
+		Collections.sort(availableBuildMachines, 
+			new Comparator<IBuildMachine>() {
+
+				public int compare(IBuildMachine o1, IBuildMachine o2) {
+					int o1Rank = getRank(o1);
+					int o2Rank = getRank(o2);
+					return o1Rank - o2Rank;
+				}
+
+				private int getRank(IBuildMachine o1) {
+					// XXX: HARDCODED preferential ordering of virtual machines
+					String name = o1.getName().toLowerCase();
+					if (name.contains("host") || name.contains("local"))
+						return -1;
+					if (name.contains("vmware"))
+						return 0;
+					if (name.contains("qemu"))
+						return 1;
+					if (name.contains("virtualbox"))
+						return 2;
+					return 999;
+				}
+			
+		});
+		
+		// autoselect the in-use machine if possible
+		IBuildMachine[] currentBuildMachines = MachineRegistry.getInstance().getCurrentBuildMachines();
+		for (IBuildMachine machine : currentBuildMachines) {
+			originalSelectedMachine = selectedMachine = (IBuildMachine) machine;
+			break;
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	protected Control createContents(Composite parent) {
+		Composite composite = new Composite(parent, SWT.NONE);
+		GridLayout layout = new GridLayout();
+		layout.marginWidth = layout.marginHeight = 0;
+		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.");
+		descr.setLayoutData(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));
+		
+		createBuildMachineSelectorUI(composite);
+		
+		if (selectedMachine != null)
+			machineComboViewer.setSelection(new StructuredSelection(selectedMachine.getName()));
+		else
+			machineComboViewer.setSelection(new StructuredSelection(NONE_LABEL));
+		return composite;
+	}
+
+	/**
+	 * @param parent
+	 */
+	private void createBuildMachineSelectorUI(Composite parent) {
+		Composite selectorComposite = new Composite(parent, SWT.NONE);
+		GridLayout layout = new GridLayout();
+		layout.marginWidth = layout.marginHeight = 0;
+		selectorComposite.setLayout(layout);
+		selectorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+		
+		Composite comboAndLabel = new Composite(selectorComposite, SWT.NONE);
+		comboAndLabel.setLayout(new GridLayout(2, false));
+		comboAndLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		
+		Label label = new Label(comboAndLabel, SWT.NONE);
+		label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		label.setText("Build machine:");
+		
+		CCombo machineCombo = new CCombo(comboAndLabel, SWT.READ_ONLY | SWT.BORDER | SWT.SHADOW_OUT);
+		machineCombo.setBackground(selectorComposite.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
+		
+		machineComboViewer = new ComboViewer(machineCombo);
+		machineComboViewer.getCCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
+	
+		machineConfigComposite = new Composite(selectorComposite, SWT.NONE);
+		
+		machineConfigComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+		machineConfigStackLayout = new StackLayout();
+		machineConfigStackLayout.marginWidth = 0;
+		machineConfigStackLayout.marginHeight = 0;
+		machineConfigComposite.setLayout(machineConfigStackLayout);
+		
+		noMachineConfigUI = new Label(machineConfigComposite, SWT.NONE);
+		noMachineConfigUI.setLayoutData(new GridData(GridData.FILL_BOTH));
+		noMachineConfigUI.setText("" /*"No configuration options"*/);
+		
+		machineMap = new LinkedHashMap<String, IBuildMachine>();
+		machineConfigPages = new LinkedHashMap<String, IComposablePreferencePage>();
+		
+		machineComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+			public void selectionChanged(SelectionChangedEvent event) {
+				String name = (String) ((IStructuredSelection) event.getSelection()).getFirstElement();
+				changeSelectedMachine(name);
+			}
+			
+		}) ;	
+		
+		machineComboViewer.setLabelProvider(new LabelProvider() {
+			/* (non-Javadoc)
+			 * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+			 */
+			@Override
+			public String getText(Object element) {
+				return element.toString();
+			}
+		});
+		
+		machineComboViewer.setContentProvider(new ArrayContentProvider());
+
+		// create the pref pages
+
+		// first, make a "none" entry
+		machineConfigPages.put(NONE_LABEL, null);
+		
+		// then add the pre-sorted entries
+		for (IBuildMachine machine : availableBuildMachines) {
+			IComposablePreferencePage page = machine.createPreferencePage();
+			machineConfigPages.put(machine.getName(), 
+					page);
+			page.setOwner(this);
+			machineMap.put(machine.getName(), machine);
+		}
+		
+		machineComboViewer.setInput(machineConfigPages.keySet());
+	}
+
+	/**
+	 * @param name
+	 */
+	protected void changeSelectedMachine(String name) {
+		IBuildMachine machine = machineMap.get(name);
+		if (machine != null) {
+			IComposablePreferencePage page = machineConfigPages.get(machine.getName());
+			if (page.getControl() == null) {
+				page.setContainer(getContainer());
+				page.createControl(machineConfigComposite);
+			}
+			machineConfigStackLayout.topControl = page.getControl();
+			selectedMachine = machine;
+		} else {
+			machineConfigStackLayout.topControl = noMachineConfigUI;
+			selectedMachine = null;
+		}
+		machineConfigComposite.layout();
+		getShell().layout(true, true);
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	public void init(IWorkbench workbench) {
+		// nothing to do
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+	 */
+	@Override
+	protected void performDefaults() {
+		for (IComposablePreferencePage page : machineConfigPages.values()) {
+			if (page != null)
+				page.performDefaults();
+		}
+		super.performDefaults();
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#isValid()
+	 */
+	@Override
+	public boolean isValid() {
+		if (!super.isValid())
+			return false;
+		
+		for (IComposablePreferencePage page : machineConfigPages.values()) {
+			if (page != null && !page.isValid())
+				return false;
+		}
+		
+		return true;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#performApply()
+	 */
+	@Override
+	protected void performApply() {
+		boolean changed = false;
+		for (IComposablePreferencePage page : machineConfigPages.values()) {
+			if (page != null) {
+				changed |= page.anyChanges();
+				page.performApply();
+			}
+		}
+		
+		
+		if (changed) {
+			// reset the build machines, since they were initialized from other prefs
+			MachineRegistry.getInstance().refreshBuildMachines();
+		}
+		
+		if (originalSelectedMachine != selectedMachine) {
+			MachineRegistry.getInstance().setCurrentBuildMachine((IBuildMachine) selectedMachine);
+			changed = true;
+		}
+		
+		originalSelectedMachine = selectedMachine;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#performOk()
+	 */
+	@Override
+	public boolean performOk() {
+		if (isValid()) {
+			performApply();
+			return true;
+		} else {
+			return false;
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.DialogPage#getErrorMessage()
+	 */
+	@Override
+	public String getErrorMessage() {
+		if (selectedMachine != null) {
+			IComposablePreferencePage pref = machineConfigPages.get(selectedMachine.getName());
+			if (pref != null)
+				return pref.getErrorMessage();
+		}
+		return super.getErrorMessage();
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.DialogPage#getMessage()
+	 */
+	@Override
+	public String getMessage() {
+		if (selectedMachine != null) {
+			IComposablePreferencePage pref = machineConfigPages.get(selectedMachine.getName());
+			if (pref != null)
+				return pref.getMessage();
+		}
+		return super.getMessage();
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.DialogPage#getMessageType()
+	 */
+	@Override
+	public int getMessageType() {
+		if (selectedMachine != null) {
+			IComposablePreferencePage pref = machineConfigPages.get(selectedMachine.getName());
+			if (pref != null)
+				return pref.getMessageType();
+		}
+		return super.getMessageType();
+	}
+	
+}

Added: branches/work_Ed/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/ESboxPreferencesPage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/ESboxPreferencesPage.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/ESboxPreferencesPage.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.maemosdk.ui.preferences;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+/**
+ * This is the empty parent page to ESbox preferences 
+ */
+public class ESboxPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage {
+
+	/**
+	 * Constructs a new TargetPreferencePage.
+	 */
+	public ESboxPreferencesPage() {
+		setTitle("ESbox");
+		setPreferenceStore(null);
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(final Composite parent) {		
+		
+		return new Composite(parent, SWT.NONE);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	public void init(IWorkbench workbench) {
+		
+	}
+
+}

Modified: branches/work_Ed/org.maemo.esbox.scratchbox.core/plugin.xml
===================================================================
--- branches/work_Ed/org.maemo.esbox.scratchbox.core/plugin.xml	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.scratchbox.core/plugin.xml	2008-11-13 14:13:47 UTC (rev 939)
@@ -23,15 +23,17 @@
   </extension>
     <extension
           point="org.eclipse.core.runtime.adapters">
+          <!-- specific to sbox -->
       <factory
-            adaptableType="org.maemo.mica.common.core.sdk.ISDKTarget"
+            adaptableType="org.maemo.esbox.internal.api.scratchbox.core.sdk.AbstractScratchboxSDKTarget"
             class="org.maemo.esbox.internal.scratchbox.adapters.MaemoGdbServerSupportAdapterFactory">
          <adapter
                type="org.maemo.mica.common.launch.adapters.IGdbServerSupportAdapter">
          </adapter>
       </factory>
+      	<!-- specific to sbox -->
        <factory
-            adaptableType="org.maemo.mica.common.core.sdk.ISDKTarget"
+            adaptableType="org.maemo.esbox.internal.api.scratchbox.core.sdk.AbstractScratchboxSDKTarget"
             class="org.maemo.esbox.internal.scratchbox.adapters.MaemoSbrshAutoconfigurationAdapterFactory">
          <adapter
                type="org.maemo.mica.internal.api.protocol.sbrsh.adapters.ISbrshAutoconfigurationAdapter">

Modified: branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/AbstractScratchboxSDK.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/AbstractScratchboxSDK.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/AbstractScratchboxSDK.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -266,7 +266,7 @@
 						// .tar.gz with no softlinks into /usr/bin.
 
 						envBlock = ProcessLauncherUtils.addToPATH(
-								new HostUnixMachine(Platform.OS_LINUX),
+								new HostUnixMachine(Platform.OS_LINUX, Platform.getOSArch()),
 								getRawEnvironment(),
 								envBlock != null ? envBlock
 										: defaultEnvironmentModifierBlock(),

Modified: branches/work_Ed/org.maemo.esbox.vm/META-INF/MANIFEST.MF
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/META-INF/MANIFEST.MF	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm/META-INF/MANIFEST.MF	2008-11-13 14:13:47 UTC (rev 939)
@@ -12,9 +12,10 @@
  org.maemo.mica.protocol.ssh;bundle-version="2.0.0",
  org.maemo.esbox.scratchbox.core;bundle-version="2.0.0",
  org.maemo.mica.maemosdk.core;bundle-version="2.0.0",
- org.eclipse.ui.ide;bundle-version="3.4.1"
+ org.eclipse.ui.ide;bundle-version="3.4.1",
+ org.maemo.esbox.maemosdk.ui;bundle-version="2.0.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy
 Export-Package: org.maemo.esbox.internal.api.vm.core,
- org.maemo.esbox.vm.core,
- org.maemo.esbox.vm.ui
+ org.maemo.esbox.internal.api.vm.ui.preferences,
+ org.maemo.esbox.vm.core

Modified: branches/work_Ed/org.maemo.esbox.vm/about.html
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/about.html	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm/about.html	2008-11-13 14:13:47 UTC (rev 939)
@@ -3,7 +3,7 @@
 <h3>ESbox</h3>
 
 <p><a href="http://esbox.garage.maemo.org/" target="_blank">ESbox</a> 
-is an Eclipse plug-in that helps programmers to develop applications for 
+is a set of Eclipse plug-ins that helps programmers to develop applications for 
 maemo platform on Scratchbox Apophis. It supports C/C++ and Python programming 
 languages. Maemo 4.x SDKs (and later) will be supported.
 </p>
@@ -15,7 +15,8 @@
 
 <h3>Applicable Licenses</h3>   
    
-<p>ESbox has a set of open source templates to help the development of applications. Such templates are distributed
-under <a href="about_files/COPYING.LESSER">LGPL license.</a></p>
+<p>ESbox includes a set of open source icons and other graphics. Such graphics are distributed
+under the <a href="about_files/CC-sa3.0_License.txt">Creative Commons Attribution-ShareAlike 3.0 license</a>.</p>
 
-<address> &copy; Copyright 2007-2008 INdT. All rights reserved. </address>
+
+<address> &copy; Copyright 2007-2008 INdT, 2007-2008 Nokia. All rights reserved. </address>

Modified: branches/work_Ed/org.maemo.esbox.vm/build.properties
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/build.properties	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm/build.properties	2008-11-13 14:13:47 UTC (rev 939)
@@ -4,4 +4,5 @@
                .,\
                plugin.xml,\
                about_files/,\
-               about.html
+               about.html,\
+               conf/

Modified: branches/work_Ed/org.maemo.esbox.vm/plugin.xml
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/plugin.xml	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm/plugin.xml	2008-11-13 14:13:47 UTC (rev 939)
@@ -25,15 +25,6 @@
    </extension>
    
    <extension
-         point="org.eclipse.ui.preferencePages">
-      <page
-            category="org.maemo.mica.common.ui.preferenceCategory.maemo"
-            class="org.maemo.esbox.vm.ui.preferences.VirtualMachineSelectionPreferencePage"
-            id="org.maemo.esbox.vm.preferencePage.virtualMachines"
-            name="Virtual Machines">
-      </page>
-   </extension>
-   <extension
          point="org.eclipse.ui.startup">
       <startup></startup>
    </extension>   
@@ -48,5 +39,12 @@
              version="1">
        </preferenceSetProvider>
     </extension>
-   
+   <extension
+         point="org.maemo.mica.common.core.build_machine_factory">
+      <build_machine_factory
+            class="org.maemo.esbox.internal.vm.ESboxHostBuildMachineFactory">
+      </build_machine_factory>
+   </extension>
+
+ 
 </plugin>

Added: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/BaseVirtualMachinePreferencePage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/BaseVirtualMachinePreferencePage.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/BaseVirtualMachinePreferencePage.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.ui.preferences;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+import org.maemo.mica.common.core.machine.IComposablePreferencePage;
+import org.maemo.mica.common.ui.preferences.ComposedPreferencePage;
+
+/**
+ * This is the base class for any virtual machine's preference page.  It combines the 
+ * VM-specific composable preference page with the common options preference page.
+ * @author eswartz
+ *
+ */
+public abstract class BaseVirtualMachinePreferencePage extends ComposedPreferencePage {
+
+	protected IComposablePreferencePage vmPrefPage;
+	protected CommonVirtualMachineSettingsPreferencePage commonPrefPage;
+
+	/**
+	 * 
+	 */
+	public BaseVirtualMachinePreferencePage() {
+		vmPrefPage = createVirtualMachinePreferencePage();
+		addPage(vmPrefPage);
+		commonPrefPage = new CommonVirtualMachineSettingsPreferencePage();
+		addPage(commonPrefPage);
+	}
+
+	/**
+	 * Create the specific page for this virtual machine
+	 * @return
+	 */
+	abstract protected IComposablePreferencePage createVirtualMachinePreferencePage();
+
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.common.ui.preferences.ComposedPreferencePage#createPageWrapper(org.maemo.mica.common.core.machine.IComposablePreferencePage, org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	protected Composite createPageWrapper(IComposablePreferencePage page,
+			Composite composite) {
+		Group group = new Group(composite, SWT.NONE);
+		group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+		FillLayout layout = new FillLayout();
+		layout.marginWidth = 6;
+		layout.marginHeight = 6;
+		group.setLayout(layout);
+		if (page == vmPrefPage) {
+			group.setText("Selected machine options");
+		} else {
+			group.setText("Common options");
+		}
+		return group;
+	}
+}

Copied: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java (from rev 935, branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java)
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.ui.preferences;
+
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.swt.widgets.Text;
+import org.maemo.esbox.vm.core.VirtualMachinePreferenceConstants;
+import org.maemo.mica.common.ui.preferences.BaseComposableFieldEditorPreferencePage;
+
+/**
+ * This page is included inside a VirtualMachineSelectionPreferencePage
+ * to configure settings shared between all VMs.
+ * @author eswartz
+ *
+ */
+public class CommonVirtualMachineSettingsPreferencePage extends BaseComposableFieldEditorPreferencePage {
+
+	private StringFieldEditor feUserName;
+	private StringFieldEditor feUserPassword;
+	private StringFieldEditor feSshTargetAddr;
+	private IntegerFieldEditor feSshTargetPort;
+	private StringFieldEditor feSshHostAddr;
+
+	public CommonVirtualMachineSettingsPreferencePage() {
+		super();
+		setPreferenceStore(VirtualMachinePreferenceConstants.getPreferenceStore());
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+	 */
+	@Override
+	protected void createFieldEditors() {
+		Text text;
+		
+		feUserName = new StringFieldEditor(
+				VirtualMachinePreferenceConstants.VM_USER_NAME,
+				"User:",
+				32,
+				getFieldEditorParent());
+		addField(feUserName);
+		text = feUserName.getTextControl(getFieldEditorParent());
+		text.setToolTipText("The user under whose control processes are launched and files are accessed.  This user must be capable of 'sudo' for commands that require root privileges.");
+		
+		feUserPassword = new StringFieldEditor(
+				VirtualMachinePreferenceConstants.VM_USER_PASSWORD,
+				"Password:",
+				32,
+				getFieldEditorParent());
+		addField(feUserPassword);
+		text = feUserPassword.getTextControl(getFieldEditorParent());
+		text.setEchoChar('\u25CF'); // Black Circle
+		text.setToolTipText("Password for the user mentioned above.\nWARNING: this text is not encrypted in any way.");
+
+		feSshTargetAddr = new StringFieldEditor(
+				VirtualMachinePreferenceConstants.VM_SSH_TARGET_ADDR,
+				"Target address:",
+				64,
+				getFieldEditorParent());
+		addField(feSshTargetAddr);
+		text = feSshTargetAddr.getTextControl(getFieldEditorParent());
+		text.setToolTipText("Specify the address of the machine as seen from the host.\nThis may be localhost (127.0.0.1) if the machine shares a network with the host,\nbut be sure the SSH port is configured as well.");
+
+		feSshTargetPort = new IntegerFieldEditor(
+				VirtualMachinePreferenceConstants.VM_SSH_TARGET_PORT,
+				"Target SSH port:",
+				getFieldEditorParent(),
+				5);
+		addField(feSshTargetPort);
+		text = feSshTargetPort.getTextControl(getFieldEditorParent());
+		text.setToolTipText("Specify the SSH port visible in the machine.\nThis may be different from the port seen inside the machine,\nespecially if the port is redirected to be visible to the host.");
+
+		feSshHostAddr = new StringFieldEditor(
+				VirtualMachinePreferenceConstants.VM_SSH_HOST_ADDR,
+				"Host address:",
+				64,
+				getFieldEditorParent());
+		addField(feSshHostAddr);
+		text = feSshHostAddr.getTextControl(getFieldEditorParent());
+		text.setToolTipText("Specify the address of the host as seen from the machine.");
+
+		/*
+		feSshHostPort = new IntegerFieldEditor(
+				VirtualMachinePreferenceConstants.VM_SSH_HOST_PORT,
+				"Host SSH port:",
+				getFieldEditorParent(),
+				5);
+		text = feSshHostPort.getTextControl(getFieldEditorParent());
+		text.setToolTipText("Specify the SSH port visible in the machine.\nThis may be different from the port seen inside the machine,\nespecially if the port is redirected to be visible to the host.");
+		 */
+		
+	}
+
+}


Property changes on: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Added: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ESboxHostBuildMachineFactory.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ESboxHostBuildMachineFactory.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/ESboxHostBuildMachineFactory.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.vm;
+
+import org.eclipse.core.runtime.Platform;
+import org.maemo.mica.common.core.machine.*;
+import org.maemo.mica.internal.api.common.core.machine.*;
+
+/**
+ * ESbox supports building automatically on the local host if it is 32-bit Linux.
+ * @author eswartz
+ *
+ */
+public class ESboxHostBuildMachineFactory implements IBuildMachineFactory {
+
+	private static class LinuxX86BuildMachineWrapper extends HostUnixBuildMachineBase {
+		/* (non-Javadoc)
+		 * @see org.maemo.mica.common.core.machine.IBuildMachine#createPreferencePage()
+		 */
+		public IComposablePreferencePage createPreferencePage() {
+			return new LinuxX86MachinePreferencesPage();
+		}
+	}
+
+	private static class LinuxX86On64BuildMachineWrapper extends MachineWrapper implements IBuildMachineImpl {
+
+		/**
+		 * @param localMachine
+		 */
+		public LinuxX86On64BuildMachineWrapper() {
+			super(MachineRegistry.getInstance().getLocalMachine());
+		}
+
+		/* (non-Javadoc)
+		 * @see org.maemo.mica.common.core.machine.IBuildMachine#createPreferencePage()
+		 */
+		public IBuildMachinePreferencePage createPreferencePage() {
+			return new LinuxX86MachinePreferencesPage();
+		}
+		
+	}
+
+	public ESboxHostBuildMachineFactory() {
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.common.core.machine.IBuildMachineFactory#createMachines()
+	 */
+	public IBuildMachineImpl[] getMachines() {
+		if (Platform.getOS().equals(Platform.OS_LINUX)) {
+			// Support the local machine if it's Linux/x86.
+			// This returns an ILocalMachine so that it will be auto-selected.
+			if (Platform.getOSArch().equals(Platform.ARCH_X86)) {
+				return new IBuildMachineImpl[] { new LinuxX86BuildMachineWrapper() };
+			} else if (Platform.getOSArch().equals(Platform.ARCH_X86_64)) {
+				// We don't directly support this (since it requires 32-bit compatibility
+				// libraries and all sorts of other junk).  Make sure the user has
+				// to explicitly select it.
+				return new IBuildMachineImpl[] { new LinuxX86On64BuildMachineWrapper() };
+			}
+		}
+		return new IBuildMachineImpl[0];
+	}
+
+}

Added: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/LinuxX86MachinePreferencesPage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/LinuxX86MachinePreferencesPage.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/LinuxX86MachinePreferencesPage.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.vm;
+
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.maemo.mica.common.core.machine.IBuildMachinePreferencePage;
+import org.maemo.mica.common.ui.preferences.BaseComposableFieldEditorPreferencePage;
+
+
+/**
+ * This is an empty page for a nonconfigurable host build machine.
+ */
+public class LinuxX86MachinePreferencesPage extends BaseComposableFieldEditorPreferencePage implements
+	IWorkbenchPreferencePage, IBuildMachinePreferencePage {
+
+	/**
+	 * Constructs a new TargetPreferencePage.
+	 */
+	public LinuxX86MachinePreferencesPage() {
+		setPreferenceStore(null);
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	public void init(IWorkbench workbench) {
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+	 */
+	@Override
+	protected void createFieldEditors() {
+		
+	}
+	
+}

Added: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/LinuxX86On64BuildMachineWrapper.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/LinuxX86On64BuildMachineWrapper.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/LinuxX86On64BuildMachineWrapper.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.vm;
+
+import org.maemo.mica.common.core.machine.*;
+import org.maemo.mica.internal.api.common.core.machine.IBuildMachineImpl;
+
+/**
+ * This is a build machine for scratchboxen on Linux/x86-64 hosts.  It does
+ * not implement ILocalMachine since we do not want it automatically chosen (as only 32-bit
+ * Linux is directly supported currently).   
+ * @author eswartz
+ *
+ */
+public class LinuxX86On64BuildMachineWrapper extends MachineWrapper implements IBuildMachineImpl {
+
+	/**
+	 * @param localMachine
+	 */
+	public LinuxX86On64BuildMachineWrapper(IMachine localMachine) {
+		super(localMachine);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.common.core.machine.IBuildMachine#createPreferencePage()
+	 */
+	public IBuildMachinePreferencePage createPreferencePage() {
+		return new LinuxX86MachinePreferencesPage();
+	}
+	
+}

Modified: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/VirtualBuildMachineConfigurationHandler.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/VirtualBuildMachineConfigurationHandler.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/internal/vm/VirtualBuildMachineConfigurationHandler.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -14,7 +14,6 @@
 import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
 
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.dialogs.PreferencesUtil;
 import org.maemo.esbox.vm.core.IVirtualMachine;
 import org.maemo.esbox.vm.ui.SelectVirtualMachineDialog;
 import org.maemo.mica.common.core.machine.*;

Modified: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachine.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachine.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachine.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -22,17 +22,6 @@
 public interface IVirtualMachine extends IMachine {
 
 	/**
-	 * Create the UI for editing the preferences of this machine
-	 * inside a preference dialog.  
-	 * <p>
-	 * The composite's created control should set a GridLayoutData for its layout data.
-	 * <p>
-	 * Any changes should be  
-	 * @return new Composite
-	 */
-	IVirtualMachinePreferencePage createPreferencePage();
-	
-	/**
 	 * Get the configuration for the virtual machine.
 	 * @return IVirtualMachineConfiguration instance, never <code>null</code>
 	 */

Modified: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachineConfiguration.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachineConfiguration.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachineConfiguration.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -21,10 +21,6 @@
  *
  */
 public interface IVirtualMachineConfiguration {
-
-	/** Get the OS this runs (Platform.OS_xxx) */
-	String getOS();
-	
 	/** Get the name (path + filename) of the program to launch. */
 	String getExecutable();
 

Deleted: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachinePreferencePage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachinePreferencePage.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/core/IVirtualMachinePreferencePage.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.vm.core;
-
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.jface.preference.PreferencePage;
-
-/**
- * This interface allows a pref page to be nested inside another.
- * @author eswartz
- *
- */
-public interface IVirtualMachinePreferencePage extends IPreferencePage {
-
-	/** Tell if any changes were made to VM settings */
-	boolean anyChanges();
-	
-	/** Perform the 'Apply' action (the performOk() will never be called!). */
-	void performApply();
-	
-	/** Reset to defaults */
-	void performDefaults();
-
-	int getMessageType();
-
-	void setOwner(PreferencePage page);
-}

Deleted: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui/BaseVirtualMachinePreferencePage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui/BaseVirtualMachinePreferencePage.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui/BaseVirtualMachinePreferencePage.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.vm.ui;
-
-import org.eclipse.jface.preference.*;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.maemo.esbox.vm.core.IVirtualMachinePreferencePage;
-
-/**
- * Base class for a preference page for a particular VM engine.
- * @author eswartz
- *
- */
-public abstract class BaseVirtualMachinePreferencePage extends FieldEditorPreferencePage implements IVirtualMachinePreferencePage {
-
-	protected boolean anyChanges;
-	private PreferencePage owner;
-
-	/**
-	 * 
-	 */
-	public BaseVirtualMachinePreferencePage() {
-		super(GRID);
-		noDefaultAndApplyButton();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
-	 */
-	@Override
-	public void propertyChange(PropertyChangeEvent event) {
-		super.propertyChange(event);
-		anyChanges = true;
-	}
-	
-	public void setOwner(PreferencePage owner) {
-		this.owner = owner;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.dialogs.DialogPage#setMessage(java.lang.String)
-	 */
-	@Override
-	public void setMessage(String newMessage) {
-		super.setMessage(newMessage);
-		owner.setMessage(newMessage);
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.preference.PreferencePage#setMessage(java.lang.String, int)
-	 */
-	@Override
-	public void setMessage(String newMessage, int newType) {
-		super.setMessage(newMessage, newType);
-		owner.setMessage(newMessage, newType);
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.preference.PreferencePage#setValid(boolean)
-	 */
-	@Override
-	public void setValid(boolean b) {
-		super.setValid(b);
-		owner.setValid(b);
-	}
-	
-	@Override
-	public void performApply() {
-		super.performApply();
-		anyChanges = false;
-	}
-
-	@Override
-	public void performDefaults() {
-		super.performDefaults();
-		anyChanges = false;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk()
-	 */
-	@Override
-	public boolean performOk() {
-		boolean ret = super.performOk();
-		if (ret)
-			anyChanges = false;
-		return ret;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.vm.core.IVirtualMachinePreferencePage#anyChanges()
-	 */
-	public boolean anyChanges() {
-		return anyChanges;
-	}
-
-}
\ No newline at end of file

Modified: branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui/SelectVirtualMachineDialog.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui/SelectVirtualMachineDialog.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm/src/org/maemo/esbox/vm/ui/SelectVirtualMachineDialog.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -22,7 +22,6 @@
 import org.eclipse.swt.widgets.*;
 import org.eclipse.ui.dialogs.PreferencesUtil;
 import org.maemo.esbox.internal.vm.Activator;
-import org.maemo.mica.common.ui.IPreferenceConstants;
 
 /**
  * This dialog tells the user that a build machine should be selected.
@@ -31,9 +30,11 @@
  */
 public class SelectVirtualMachineDialog extends MessageDialogWithToggle {
 
-	public static final String VIRTUAL_MACHINE_PREFS_ID = Activator.PLUGIN_ID + ".preferencePage.virtualMachines";
+	public static final String BUILD_MACHINE_PREFS_ID = "org.maemo.esbox.maemosdk.ui.preferencePage.buildMachines";
+	protected static final String ESBOX_PREFERENCE_CATEGORY_ID = "org.maemo.esbox.ui.preferenceCategory.esbox";
 	
 	private static final String BUG_ME_NOT = "SelectBuildMachineDialog.BugMeNot";
+
 	/**
 	 * 
 	 */
@@ -73,7 +74,7 @@
 		
 		Link link = new Link(msgArea, SWT.NONE);
 		link.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
-		link.setText("<a href=\"link\">Go to Virtual Machine preferences...</a>");
+		link.setText("<a href=\"link\">Go to Build Machine preferences...</a>");
 		
 		link.addSelectionListener(new SelectionAdapter() {
 			/* (non-Javadoc)
@@ -84,10 +85,10 @@
 				SelectVirtualMachineDialog.this.close();
 				PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
 						getShell(), 
-						VIRTUAL_MACHINE_PREFS_ID,
+						BUILD_MACHINE_PREFS_ID,
 						new String[] { 
-								IPreferenceConstants.MAEMO_PREFERENCE_CATEGORY_ID,
-								VIRTUAL_MACHINE_PREFS_ID, 
+								ESBOX_PREFERENCE_CATEGORY_ID,
+								BUILD_MACHINE_PREFS_ID, 
 							},
 						null);
 				dialog.open();

Added: branches/work_Ed/org.maemo.esbox.vm.qemu/about.html
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/about.html	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/about.html	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,22 @@
+<h3>About This Content</h3>
+
+<h3>ESbox</h3>
+
+<p><a href="http://esbox.garage.maemo.org/" target="_blank">ESbox</a> 
+is a set of Eclipse plug-ins that helps programmers to develop applications for 
+maemo platform on Scratchbox Apophis. It supports C/C++ and Python programming 
+languages. Maemo 4.x SDKs (and later) will be supported.
+</p>
+
+<h3>License</h3>
+
+<p>See <a href="about_files/epl-v10.html">Eclipse Public License Version 1.0 (&quot;EPL&quot;)</a>.
+</p>
+
+<h3>Applicable Licenses</h3>   
+   
+<p>ESbox includes a set of open source icons and other graphics. Such graphics are distributed
+under the <a href="about_files/CC-sa3.0_License.txt">Creative Commons Attribution-ShareAlike 3.0 license</a>.</p>
+
+
+<address> &copy; Copyright 2007-2008 INdT, 2007-2008 Nokia. All rights reserved. </address>

Added: branches/work_Ed/org.maemo.esbox.vm.qemu/about_files/epl-v10.html
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/about_files/epl-v10.html	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/about_files/epl-v10.html	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+  <o:Revision>2</o:Revision>
+  <o:TotalTime>3</o:TotalTime>
+  <o:Created>2004-03-05T23:03:00Z</o:Created>
+  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+  <o:Pages>4</o:Pages>
+  <o:Words>1626</o:Words>
+  <o:Characters>9270</o:Characters>
+   <o:Lines>77</o:Lines>
+  <o:Paragraphs>18</o:Paragraphs>
+  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+  <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+  <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ at font-face
+	{font-family:Tahoma;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-parent:"";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+p
+	{margin-right:0in;
+	mso-margin-top-alt:auto;
+	mso-margin-bottom-alt:auto;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+	{mso-style-name:"Balloon Text";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:8.0pt;
+	font-family:Tahoma;
+	mso-fareast-font-family:"Times New Roman";}
+ at page Section1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.25in 1.0in 1.25in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.Section1
+	{page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html>
\ No newline at end of file

Modified: branches/work_Ed/org.maemo.esbox.vm.qemu/build.properties
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/build.properties	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/build.properties	2008-11-13 14:13:47 UTC (rev 939)
@@ -4,4 +4,5 @@
                .,\
                plugin.xml,\
                about_files/,\
-               about.html
+               about.html,\
+               conf/

Modified: branches/work_Ed/org.maemo.esbox.vm.qemu/conf/qemu_prefs.xml
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/conf/qemu_prefs.xml	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/conf/qemu_prefs.xml	2008-11-13 14:13:47 UTC (rev 939)
@@ -8,7 +8,7 @@
 	<entry key="QEMU_INSTALL_PATH">c:/Program Files/QEMU</entry>
 	<entry key="QEMU_EXE_NAME">qemu.exe</entry>
 	<entry key="QEMU_MEMORY_SIZE">512</entry>
-	<entry key="QEMU_LAUNCH_PATTERN">"${QEMU}" -kernel-kqemu -hda "${DISK_PATH}" -usb -L "${INSTALL_PATH}" -m ${MEMORY} -redir tcp:${SSH_PORT}::22</entry>
-	<entry key="QEMU_DISK_IMAGE_PATH">c:/MaemoVMWare/MaemoSDK-0.8/maemo-sdk-0.8.vmdk</entry>
+	<entry key="QEMU_LAUNCH_PATTERN">"${QEMU}" -kernel-kqemu "${DISK_OPTIONS}" -usb -L "${INSTALL_PATH}" -m ${MEMORY} -redir tcp:${SSH_PORT}::22</entry>
+	<entry key="QEMU_DISK_IMAGE_PATHS">c:/MaemoVMWare/MaemoSDK-0.8/maemo-sdk-0.8.vmdk</entry>
 	
 </properties>
\ No newline at end of file

Modified: branches/work_Ed/org.maemo.esbox.vm.qemu/plugin.xml
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/plugin.xml	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/plugin.xml	2008-11-13 14:13:47 UTC (rev 939)
@@ -18,5 +18,11 @@
              version="1">
        </preferenceSetProvider>
     </extension>
+   <extension
+         point="org.maemo.mica.common.core.machine_factory">
+      <machineFactory scheme="qemu+ssh"
+            class="org.maemo.esbox.internal.vm.qemu.QemuMachineFactory">
+      </machineFactory>
+   </extension>
 
 </plugin>

Deleted: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/BaseVirtualMachinePreferencePage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/BaseVirtualMachinePreferencePage.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/BaseVirtualMachinePreferencePage.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.vm.qemu;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.maemo.esbox.vm.core.IVirtualMachinePreferencePage;
-
-/**
- * @author eswartz
- *
- */
-public abstract class BaseVirtualMachinePreferencePage extends PreferencePage {
-
-	protected boolean anyChanges;
-
-	/**
-	 * 
-	 */
-	public BaseVirtualMachinePreferencePage() {
-		super();
-	}
-
-	/**
-	 * @param title
-	 */
-	public BaseVirtualMachinePreferencePage(String title) {
-		super(title);
-	}
-
-	/**
-	 * @param title
-	 * @param image
-	 */
-	public BaseVirtualMachinePreferencePage(String title, ImageDescriptor image) {
-		super(title, image);
-	}
-
-	@Override
-	public void performApply() {
-		anyChanges = false;
-	}
-
-	@Override
-	public void performDefaults() {
-		
-		super.performDefaults();
-	}
-
-}
\ No newline at end of file

Added: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/CustomQemuConfiguration.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/CustomQemuConfiguration.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/CustomQemuConfiguration.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.vm.qemu;
+
+import org.maemo.esbox.vm.qemu.IQemuConfiguration;
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.machine.ISharedFilesystemProvider;
+import org.maemo.mica.protocol.ssh.SSHConfiguration;
+
+import java.net.URI;
+
+/**
+ * This configuration uses settings specified at construction time.
+ * @author eswartz
+ *
+ */
+public class CustomQemuConfiguration implements IQemuConfiguration {
+	
+	private static final String HOST_ADDRESS = "hostAddress";
+	private static final String HOST_PORT = "hostPort";
+	private static final String TIMEOUT = "timeout";
+	private static final String INSTALL_PATH = "installPath";
+	private static final String DISK_IMAGE_PATHS = "diskImagePaths";
+	private static final String MEMORY_SIZE = "memorySize";
+	private static final String COMMAND_LAUNCH_PATTERN = "commandLaunchPattern";
+	private static final String CIFS_PORT = "cifsPort";
+	
+	private final SSHConfiguration sshConfiguration;
+	private String installPath;
+	private String diskImagePaths;
+	private String executable;
+	private int memorySize;
+	private String commandLaunchPattern;
+	private ISharedFilesystemProvider sharedFilesystemProvider;
+	private int cifsPort;
+
+	public CustomQemuConfiguration(URI uri, ISharedFilesystemProvider sharedFilesystemProvider) throws MicaException {
+		
+		this.sshConfiguration = new SSHConfiguration(uri);
+		this.sharedFilesystemProvider = sharedFilesystemProvider;
+		
+		this.sshConfiguration.setConnectionTimeout(1);
+		this.installPath = null;
+		this.diskImagePaths = null;
+		this.executable = "qemu.exe";
+		this.memorySize = 512;
+		this.commandLaunchPattern = "\"${QEMU}\" -kernel-kqemu ${DISK_OPTIONS} -usb -L \"${INSTALL_PATH}\" -m ${MEMORY} -redir tcp:${SSH_PORT}::22"; 
+		this.cifsPort = 445;
+		
+		String query = uri.getQuery();
+		String[] queryParts = query.split("&");
+		for (String queryPart : queryParts) {
+			int equIdx = queryPart.indexOf("=");
+			if (equIdx < 0)
+				throw new MicaException("Invalid query component: " + queryPart);
+			
+			String key = queryPart.substring(0, equIdx);
+			String value = queryPart.substring(equIdx + 1);
+
+			try {
+				if (key.equals(HOST_ADDRESS)) {
+					sshConfiguration.setHostIPAddress(value);
+				} else if (key.equals(HOST_PORT)) {
+					sshConfiguration.setHostPort(Integer.parseInt(value));
+				} else if (key.equals(TIMEOUT)) {
+					sshConfiguration.setConnectionTimeout(Integer.parseInt(value));
+				} else if (key.equals(INSTALL_PATH)) {
+					this.installPath = value;
+				} else if (key.equals(DISK_IMAGE_PATHS)) {
+					this.diskImagePaths = value;
+				} else if (key.equals(MEMORY_SIZE)) {
+					this.executable = value;
+				} else if (key.equals(COMMAND_LAUNCH_PATTERN)) {
+					this.commandLaunchPattern = value;
+				} else if (key.equals(CIFS_PORT)) {
+					this.cifsPort = Integer.parseInt(value);
+				} else {
+					Activator.getErrorLogger().logError("Ignoring unknown query component: " + queryPart, null);
+				}
+			} catch (NumberFormatException e) {
+				throw new MicaException("Invalid integer in query component: " + queryPart);
+			}
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.vm.core.IVirtualMachineConfiguration#getSSHConfiguration()
+	 */
+	public SSHConfiguration getSSHConfiguration() {
+		return sshConfiguration;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.vm.core.IVirtualMachineConfiguration#getSharedFilesystemProvider()
+	 */
+	public ISharedFilesystemProvider getSharedFilesystemProvider() {
+		return sharedFilesystemProvider;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.vm.core.IVirtualMachineConfiguration#getCIFSPort()
+	 */
+	public int getCIFSPort() {
+		return cifsPort;
+	}
+	
+	public String getInstallPath() {
+		return installPath;
+	}
+
+	public String[] getDiskImagePaths() {
+		return diskImagePaths.split(","); 
+	}
+
+	public String getExecutable() {
+		return executable; 
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.vm.qemu.IQemuConfiguration#getMemorySize()
+	 */
+	public int getMemorySize() {
+		return memorySize;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.vm.qemu.IQemuConfiguration#getCommandLaunchPattern()
+	 */
+	public String getCommandLaunchPattern() {
+		return commandLaunchPattern; 
+	}
+
+}

Modified: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/PreferenceQemuConfiguration.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/PreferenceQemuConfiguration.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/PreferenceQemuConfiguration.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -10,7 +10,6 @@
  *******************************************************************************/
 package org.maemo.esbox.internal.vm.qemu;
 
-import org.eclipse.core.runtime.Platform;
 import org.maemo.esbox.internal.api.vm.core.BasePreferenceVirtualMachineConfiguration;
 import org.maemo.esbox.vm.qemu.IQemuConfiguration;
 
@@ -22,17 +21,12 @@
  */
 public class PreferenceQemuConfiguration extends BasePreferenceVirtualMachineConfiguration implements IQemuConfiguration {
 	
-	public String getOS() {
-		return Platform.OS_LINUX;
-	}
-	
-
 	public String getInstallPath() {
 		return getPreference(QemuPreferenceConstants.QEMU_INSTALL_PATH);
 	}
 
-	public String getDiskImagePath() {
-		return getPreference(QemuPreferenceConstants.QEMU_DISK_IMAGE_PATH); 
+	public String[] getDiskImagePaths() {
+		return getPreference(QemuPreferenceConstants.QEMU_DISK_IMAGE_PATHS).split(","); 
 	}
 
 	public String getExecutable() {

Modified: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuBuildMachineFactory.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuBuildMachineFactory.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuBuildMachineFactory.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -16,14 +16,14 @@
 
 /**
  * This factory creates virtual build machines hosted on QEMU.
- * We support only one machine at a time.
+ * We support only one machine at a time, using preferences to store its settings.
  * @author eswartz
  *
  */
 public class QemuBuildMachineFactory implements IBuildMachineFactory {
 
 	private IQemuConfiguration configuration;
-	
+	public final static String NAME = "QEMU Linux Build Machine";
 	public QemuBuildMachineFactory() {
 		this.configuration = new PreferenceQemuConfiguration();
 	}
@@ -32,8 +32,8 @@
 	/* (non-Javadoc)
 	 * @see org.maemo.mica.common.core.machine.IMachineFactory#createMachine(java.lang.String)
 	 */
-	public synchronized IBuildMachineImpl[] createMachines() {
-		IBuildMachineImpl qemuMachine = new QemuMachine(configuration);
+	public synchronized IBuildMachineImpl[] getMachines() {
+		IBuildMachineImpl qemuMachine = new QemuMachine(NAME, configuration);
 		return new IBuildMachineImpl[] { qemuMachine };
 	}
 

Modified: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachine.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachine.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachine.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -12,7 +12,6 @@
 
 import org.eclipse.core.runtime.*;
 import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.preference.IPreferencePage;
 import org.maemo.esbox.vm.core.*;
 import org.maemo.esbox.vm.qemu.IQemuConfiguration;
 import org.maemo.mica.common.core.*;
@@ -37,14 +36,13 @@
 public class QemuMachine extends SSHMachineBackend implements IVirtualMachine, IBuildMachineImpl {
 
 	public final static String ID = Activator.PLUGIN_ID + ".qemu_machine";
-	public final static String NAME = "QEMU Linux Virtual Machine";
+	//
 	private IQemuConfiguration configuration;
 	
-	public QemuMachine(IQemuConfiguration configuration) {
-		super(ID, NAME, configuration.getOS(),
+	public QemuMachine(String name, IQemuConfiguration configuration) {
+		super(ID, name, Platform.OS_LINUX, Platform.ARCH_X86,
 				new QemuMachineController(configuration),
-				configuration.getSSHConfiguration(),
-				configuration.getSharedFilesystemProvider());
+				configuration.getSSHConfiguration(), configuration.getSharedFilesystemProvider());
 		this.configuration = configuration; 
 	}
 	
@@ -61,6 +59,9 @@
 
 		ISharedFilesystemProvider sharedFilesystemProvider = 
 			getSharedFilesystemProvider();
+		if (sharedFilesystemProvider == null)
+			return Status.OK_STATUS;
+		
 		Map<IPath, IPath> sharedFolders = 
 			sharedFilesystemProvider.getSharedFolders();
 		
@@ -203,7 +204,7 @@
 	/* (non-Javadoc)
 	 * @see org.maemo.esbox.vm.core.IVirtualMachine#createPreferencePage(org.eclipse.swt.widgets.Composite)
 	 */
-	public IVirtualMachinePreferencePage createPreferencePage() {
+	public IComposablePreferencePage createPreferencePage() {
 		return new QemuPreferencePage();
 	}
 	

Modified: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineController.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineController.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineController.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -138,7 +138,15 @@
 		if (!launchPath.isAbsolute())
 			launchPath = new Path(qemuConfiguration.getInstallPath()).append(launchPath);
 		substitutor.define("QEMU", launchPath.toOSString());
-		substitutor.define("DISK_PATH", new Path(qemuConfiguration.getDiskImagePath()).toPortableString());
+		
+		StringBuilder builder = new StringBuilder();
+		char letter = 'a';
+		for (String path : qemuConfiguration.getDiskImagePaths()) {
+			builder.append("-hd" + letter + " ");
+			builder.append("\"" + new Path(path).toPortableString() + "\" ");
+			letter++;
+		}
+		substitutor.define("DISK_OPTIONS", builder.toString().trim());
 		substitutor.define("INSTALL_PATH", new Path(qemuConfiguration.getInstallPath()).toPortableString());
 		substitutor.define("MEMORY", "" + qemuConfiguration.getMemorySize());
 		substitutor.define("SSH_PORT", "" + qemuConfiguration.getSSHConfiguration().getTargetPort());

Added: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineFactory.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineFactory.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuMachineFactory.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.vm.qemu;
+
+import org.maemo.esbox.vm.qemu.IQemuConfiguration;
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.machine.*;
+
+import java.net.URI;
+
+/**
+ * This factory creates QEMU virtual machines.  
+ * @author eswartz
+ *
+ */
+public class QemuMachineFactory implements IMachineFactory {
+
+	/**
+	 * Scheme for QEMU
+	 */
+	private static final String QEMU_SCHEME = "qemu+ssh";
+
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.common.core.machine.IMachineFactory#createMachine(java.net.URI)
+	 */
+	public IMachine createMachine(String name, URI uri, ISharedFilesystemProvider sharedFilesystemProvider) throws MicaException {
+		if (!uri.getScheme().equals(QEMU_SCHEME))
+			return null;
+		
+		IQemuConfiguration qemuConfig = new CustomQemuConfiguration(uri, sharedFilesystemProvider);
+		return new QemuMachine(name, qemuConfig);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.common.core.machine.IMachineFactory#getScheme()
+	 */
+	public String getScheme() {
+		return QEMU_SCHEME;
+	}
+
+}

Modified: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferenceConstants.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferenceConstants.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferenceConstants.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -35,6 +35,7 @@
 	public static final String QEMU_EXE_NAME = "QEMU_EXE_NAME";
 	public static final String QEMU_MEMORY_SIZE = "QEMU_MEMORY_SIZE";
 	public static final String QEMU_LAUNCH_PATTERN = "QEMU_LAUNCH_PATTERN";
-	public static final String QEMU_DISK_IMAGE_PATH = "QEMU_DISK_IMAGE_PATH";
+	/** Comma separated list for hda, hdb, ... */
+	public static final String QEMU_DISK_IMAGE_PATHS = "QEMU_DISK_IMAGE_PATHS";
 	
 }

Modified: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferencePage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferencePage.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuPreferencePage.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -11,12 +11,8 @@
 
 package org.maemo.esbox.internal.vm.qemu;
 
-import org.eclipse.jface.preference.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Text;
-import org.maemo.esbox.vm.ui.BaseVirtualMachinePreferencePage;
+import org.maemo.esbox.internal.api.vm.ui.preferences.BaseVirtualMachinePreferencePage;
+import org.maemo.mica.common.core.machine.IComposablePreferencePage;
 
 /**
  * Configure QEMU preferences.  This page is NOT registered at the top level
@@ -26,80 +22,12 @@
  */
 public class QemuPreferencePage extends BaseVirtualMachinePreferencePage {
 
-	private FileFieldEditor feDiskPath;
-	private DirectoryFieldEditor feQemuPath;
-	private StringFieldEditor feQemuExeName;
-	private StringFieldEditor feQemuLaunchPattern;
-	private IntegerFieldEditor feRamSize;
-
-	/**
-	 * 
-	 */
-	public QemuPreferencePage() {
-		setPreferenceStore(QemuPreferenceConstants.getPreferenceStore());
-		setOwner(this);
-	}
-
 	/* (non-Javadoc)
-	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+	 * @see org.maemo.esbox.internal.api.vm.ui.preferences.BaseVirtualMachinePreferencePage#createVirtualMachinePreferencePage()
 	 */
 	@Override
-	protected void createFieldEditors() {
-		Text text;
-		
-		feQemuPath = new DirectoryFieldEditor(
-				QemuPreferenceConstants.QEMU_INSTALL_PATH,
-				"QEMU installation directory:", getFieldEditorParent());
-		addField(feQemuPath);
-		text = feQemuPath.getTextControl(getFieldEditorParent()); 
-		text.setToolTipText(
-			"Specify the full path to a QEMU installation (see http://bellard.org/qemu/), where various *.bin files should be located.");
-		
-		feQemuExeName = new StringFieldEditor(
-				QemuPreferenceConstants.QEMU_EXE_NAME,
-				"QEMU executable:", getFieldEditorParent());
-		addField(feQemuExeName);
-		text = feQemuExeName.getTextControl(getFieldEditorParent()); 
-		text.setToolTipText(
-				"Specify the program to launch.  If the program lives in the installation directory or on the PATH, provide a bare filename.  Otherwise, provide a full path to qemu.exe.");
-		
-		feQemuLaunchPattern = new StringFieldEditor(
-				QemuPreferenceConstants.QEMU_LAUNCH_PATTERN,
-				"QEMU command pattern:",
-				getFieldEditorParent());
-		addField(feQemuLaunchPattern);
-		text = feQemuLaunchPattern.getTextControl(getFieldEditorParent());
-		text.setToolTipText(
-			"Specify the specific command pattern to use to launch the virtual machine.");
-
-		// make this string manageable -- we want it to be long but not to force other
-		// fields off the edge
-		int width;
-		GC gc = new GC(getFieldEditorParent().getShell());
-		width = gc.getAdvanceWidth('m') * 32;
-		gc.dispose();
-
-		GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
-		gridData.widthHint = width;
-		text.setLayoutData(
-				gridData);
-		
-		feRamSize = new IntegerFieldEditor(
-				QemuPreferenceConstants.QEMU_MEMORY_SIZE,
-				"Memory size (Mb):",
-				getFieldEditorParent(),
-				5);
-		addField(feRamSize);
-		text = feRamSize.getTextControl(getFieldEditorParent());
-		text.setToolTipText("Specify the size of RAM for the machine, in megabytes.  Note: at least 512 Mb is recommended.");
-		
-		feDiskPath = new FileFieldEditor(
-				QemuPreferenceConstants.QEMU_DISK_IMAGE_PATH,
-				"Primary disk image:", getFieldEditorParent());
-		addField(feDiskPath);
-		text = feDiskPath.getTextControl(getFieldEditorParent());
-		text.setToolTipText(
-			"Specify the full path to the primary disk image.  Valid disk images are named *.vmdk, *.img, etc.\nIf you want to use other images, add -hdb <image>, etc. options to the command pattern.");
-		
+	protected IComposablePreferencePage createVirtualMachinePreferencePage() {
+		return new QemuSettingsPreferencePage();
 	}
+
 }

Added: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuSettingsPreferencePage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuSettingsPreferencePage.java	                        (rev 0)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/QemuSettingsPreferencePage.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.vm.qemu;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Text;
+import org.maemo.mica.common.ui.preferences.BaseComposableFieldEditorPreferencePage;
+
+/**
+ * Configure QEMU preferences.  This page is NOT registered at the top level
+ * of preference page UI but is nested inside the ESbox Build Machine preference UI.
+ * @author eswartz
+ *
+ */
+public class QemuSettingsPreferencePage extends BaseComposableFieldEditorPreferencePage {
+
+	private FileFieldEditor feDiskPath;
+	private DirectoryFieldEditor feQemuPath;
+	private StringFieldEditor feQemuExeName;
+	private StringFieldEditor feQemuLaunchPattern;
+	private IntegerFieldEditor feRamSize;
+
+	/**
+	 * 
+	 */
+	public QemuSettingsPreferencePage() {
+		setPreferenceStore(QemuPreferenceConstants.getPreferenceStore());
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+	 */
+	@Override
+	protected void createFieldEditors() {
+		Text text;
+		
+		feQemuPath = new DirectoryFieldEditor(
+				QemuPreferenceConstants.QEMU_INSTALL_PATH,
+				"Installation directory:", getFieldEditorParent());
+		addField(feQemuPath);
+		text = feQemuPath.getTextControl(getFieldEditorParent()); 
+		text.setToolTipText(
+			"Specify the full path to a QEMU installation (see http://bellard.org/qemu/), where various *.bin files should be located.");
+		
+		feQemuExeName = new StringFieldEditor(
+				QemuPreferenceConstants.QEMU_EXE_NAME,
+				"Executable:", getFieldEditorParent());
+		addField(feQemuExeName);
+		text = feQemuExeName.getTextControl(getFieldEditorParent()); 
+		text.setToolTipText(
+				"Specify the program to launch.  If the program lives in the installation directory or on the PATH, provide a bare filename.  Otherwise, provide a full path to qemu.exe.");
+		
+		feQemuLaunchPattern = new StringFieldEditor(
+				QemuPreferenceConstants.QEMU_LAUNCH_PATTERN,
+				"Command pattern:",
+				getFieldEditorParent());
+		addField(feQemuLaunchPattern);
+		text = feQemuLaunchPattern.getTextControl(getFieldEditorParent());
+		text.setToolTipText(
+			"Specify the specific command pattern to use to launch the virtual machine.");
+
+		// make this string manageable -- we want it to be long but not to force other
+		// fields off the edge
+		int width;
+		GC gc = new GC(getFieldEditorParent().getShell());
+		width = gc.getAdvanceWidth('m') * 32;
+		gc.dispose();
+
+		GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+		gridData.widthHint = width;
+		text.setLayoutData(
+				gridData);
+		
+		feRamSize = new IntegerFieldEditor(
+				QemuPreferenceConstants.QEMU_MEMORY_SIZE,
+				"Memory size (Mb):",
+				getFieldEditorParent(),
+				5);
+		addField(feRamSize);
+		text = feRamSize.getTextControl(getFieldEditorParent());
+		text.setToolTipText("Specify the size of RAM for the machine, in megabytes.  Note: at least 512 Mb is recommended.");
+		
+		feDiskPath = new FileFieldEditor(
+				QemuPreferenceConstants.QEMU_DISK_IMAGE_PATHS,
+				"Disk image(s):", getFieldEditorParent()) {
+			/* (non-Javadoc)
+			 * @see org.eclipse.jface.preference.FileFieldEditor#checkState()
+			 */
+			@Override
+			protected boolean checkState() {
+				// allow anything
+				return true;
+			}
+		};
+		addField(feDiskPath);
+		text = feDiskPath.getTextControl(getFieldEditorParent());
+		text.setToolTipText(
+			"Specify the full path to the primary disk image.  Valid disk images are named *.vmdk, *.img, etc.\nIf you want to use other images, add a comma and more paths.");
+		
+	}
+}

Modified: branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/vm/qemu/IQemuConfiguration.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/vm/qemu/IQemuConfiguration.java	2008-11-12 15:39:58 UTC (rev 938)
+++ branches/work_Ed/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/vm/qemu/IQemuConfiguration.java	2008-11-13 14:13:47 UTC (rev 939)
@@ -27,8 +27,8 @@
 	/** Get the installation path. */
 	String getInstallPath();
 
-	/** Get the primary disk image path. */
-	String getDiskImagePath();
+	/** Get the disk image paths, for hda, hdb, etc. */
+	String[] getDiskImagePaths();
 	
 	/** Get the memory size in Mb. */
 	int getMemorySize();



More information about the Esbox-commits mailing list