[Esbox-commits] r1062 - in branches/work_Petr: org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/command org.maemo.esbox.scratchbox.sb1 org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1 org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences org.maemo.esbox.scratchbox.sb2 org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2 org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware

eswartz at garage.maemo.org eswartz at garage.maemo.org
Fri Dec 12 15:43:40 EET 2008


Author: eswartz
Date: 2008-12-12 15:43:39 +0200 (Fri, 12 Dec 2008)
New Revision: 1062

Added:
   branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/IHelpID.java
   branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/ScratchboxAptPackageManagerBridge.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/IHelpID.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/IHelpID.java
   branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineURIQueryDecoder.java
Modified:
   branches/work_Petr/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncher.java
   branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/BuildMachinePreferencePage.java
   branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/XServerPreferencePage.java
   branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/ScratchboxPackageManagerProvider.java
   branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java
   branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/command/ScratchboxCommand.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb1/plugin.xml
   branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences/Scratchbox1PreferencesPage.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb2/plugin.xml
   branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences/Scratchbox2PreferencesPage.java
   branches/work_Petr/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/CustomQemuConfiguration.java
   branches/work_Petr/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/CustomVMwareConfiguration.java
   branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseCustomVirtualMachineConfiguration.java
   branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BasePreferenceVirtualMachineConfiguration.java
   branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineController.java
Log:
Merge revs 993:1059 from trunk

Modified: branches/work_Petr/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncher.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncher.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/MockProcessLauncher.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -189,4 +189,10 @@
 		return 0;
 	}
 
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.common.core.process.IProcessLauncher#waitToComplete(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public int waitToComplete(IProgressMonitor monitor) {
+		return 0;
+	}
 }

Copied: branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/IHelpID.java (from rev 1059, trunk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/IHelpID.java)
===================================================================
--- branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/IHelpID.java	                        (rev 0)
+++ branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/IHelpID.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * 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:
+ *    Ling Wang (Nokia) - initial API and implementation. Dec 11, 2008
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.ui;
+
+
+/**
+ * @author LWang.
+ *
+ */
+public interface IHelpID {
+	public static final String PREFIX = UIActivator.PLUGIN_ID + "."; //$NON-NLS-1$
+
+	/**
+	 *  Global preference => ESbox => Build Machines.
+	 */
+	public static final String HID_GLOBAL_PREF_ESBOX_BUILDMACHINES = PREFIX + "global_pref_esbox_buildmachines"; //$NON-NLS-1$
+
+	/**
+	 *  Global preference => ESbox => X Server.
+	 */
+	public static final String HID_GLOBAL_PREF_ESBOX_XSERVER = PREFIX + "global_pref_esbox_xserver"; //$NON-NLS-1$
+}

Modified: branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/BuildMachinePreferencePage.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/BuildMachinePreferencePage.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/BuildMachinePreferencePage.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -25,7 +25,9 @@
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 import org.maemo.esbox.internal.api.maemosdk.ui.preferences.ValidateMachineRunner;
+import org.maemo.esbox.internal.maemosdk.ui.IHelpID;
 import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
+import org.maemo.mica.common.core.GeneralUtils;
 import org.maemo.mica.common.core.machine.*;
 
 import java.util.*;
@@ -112,6 +114,9 @@
 	@Override
 	protected Control createContents(Composite parent) {
 		Composite composite = new Composite(parent, SWT.NONE);
+		
+		GeneralUtils.setHelpID(composite, IHelpID.HID_GLOBAL_PREF_ESBOX_BUILDMACHINES);
+		
 		GridLayout layout = new GridLayout();
 		layout.marginWidth = layout.marginHeight = 0;
 		composite.setLayout(layout);
@@ -243,9 +248,9 @@
 	 */
 	@Override
 	protected void performDefaults() {
-		for (IComposablePreferencePage page : machineConfigPages.values()) {
-			if (page != null)
-				page.performDefaults();
+		IComposablePreferencePage page = machineConfigPages.get(selectedMachine.getName());
+		if (page != null) {
+			page.performDefaults();
 		}
 		super.performDefaults();
 	}
@@ -258,10 +263,9 @@
 		if (!super.isValid())
 			return false;
 		
-		for (IComposablePreferencePage page : machineConfigPages.values()) {
-			if (page != null && !page.isValid())
-				return false;
-		}
+		IComposablePreferencePage page = machineConfigPages.get(selectedMachine.getName());
+		if (page != null && !page.isValid())
+			return false;
 		
 		return true;
 	}

Modified: branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/XServerPreferencePage.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/XServerPreferencePage.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/XServerPreferencePage.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -18,7 +18,9 @@
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.maemo.esbox.internal.maemosdk.ui.IHelpID;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+import org.maemo.mica.common.core.GeneralUtils;
 
 
 /**
@@ -52,6 +54,8 @@
 				"Command template to launch server:", 
 				getFieldEditorParent());		
 		
+		GeneralUtils.setHelpID(getFieldEditorParent(), IHelpID.HID_GLOBAL_PREF_ESBOX_XSERVER);
+		
 		// make this string manageable
 		GC gc = new GC(getFieldEditorParent().getShell()); 
 		GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);

Copied: branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/ScratchboxAptPackageManagerBridge.java (from rev 1059, trunk/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/ScratchboxAptPackageManagerBridge.java)
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/ScratchboxAptPackageManagerBridge.java	                        (rev 0)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/ScratchboxAptPackageManagerBridge.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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.scratchbox.core;
+
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.core.machine.IFileSystemAccess;
+import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+import org.maemo.mica.linux.packages.core.aptpkgconfig.IAptPackageManagerBridge;
+
+/**
+ * @author eswartz
+ *
+ */
+public class ScratchboxAptPackageManagerBridge implements IAptPackageManagerBridge {
+
+	private final IScratchboxSDKTarget sdkTarget;
+	public ScratchboxAptPackageManagerBridge(IScratchboxSDKTarget sdkTarget) {
+		this.sdkTarget = sdkTarget;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.internal.linux.packages.core.adapters.IAptPackageManagerAdapter#createAptConfigurationFileSystemAccess()
+	 */
+	public IFileSystemAccess createAptConfigurationFileSystemAccess(boolean writeable) {
+		// no special privileges needed since the rootstrap has the user's ownership
+		return sdkTarget.getTargetFileSystemAccess();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.linux.packages.core.aptpkgconfig.IAptPackageManagerBridge#createAptGetProcessLauncherFactory()
+	 */
+	public IProcessLauncherFactory createAptGetOrDpkgProcessLauncherFactory() {
+		// in sb, apt commands must either be run as fakeroot or with different mapping modes
+		IProcessLauncherFactory aptProcessLauncherFactory;
+		aptProcessLauncherFactory = sdkTarget.getProcessLauncherFactoryForInstall();
+		return aptProcessLauncherFactory;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.linux.packages.core.aptpkgconfig.IAptPackageManagerBridge#createAptCacheProcessLauncherFactory()
+	 */
+	public IProcessLauncherFactory createAptCacheOrDpkgProcessLauncherFactory() {
+		// in sb, apt commands must either be run as fakeroot or with different mapping modes
+		IProcessLauncherFactory aptProcessLauncherFactory;
+		// we're not really installing, but sb1 and sb2 don't need special permissions either way
+		aptProcessLauncherFactory = sdkTarget.getProcessLauncherFactoryForInstall();
+		return aptProcessLauncherFactory;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.mica.internal.linux.packages.core.adapters.IAptPackageManagerAdapter#createPkgConfigProcessLauncherFactory()
+	 */
+	public IProcessLauncherFactory createPkgConfigProcessLauncherFactory() {
+		// in sb, apt commands must either be run as fakeroot or with different mapping modes
+		IProcessLauncherFactory pkgconfigProcessLauncherFactory = sdkTarget.getProcessLauncherFactory();
+		return pkgconfigProcessLauncherFactory;
+	}
+
+}

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/ScratchboxPackageManagerProvider.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/ScratchboxPackageManagerProvider.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/ScratchboxPackageManagerProvider.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -12,7 +12,6 @@
 package org.maemo.esbox.internal.api.scratchbox.core;
 
 import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
-import org.maemo.mica.common.core.process.IProcessLauncherFactory;
 import org.maemo.mica.common.core.sdk.ISDKTarget;
 import org.maemo.mica.linux.packages.core.IPackageManager;
 import org.maemo.mica.linux.packages.core.IPackageManagerProvider;
@@ -24,8 +23,7 @@
  * @author eswartz
  * 
  */
-public class ScratchboxPackageManagerProvider implements
-		IPackageManagerProvider {
+public class ScratchboxPackageManagerProvider implements IPackageManagerProvider {
 
 	/**
 	 * 
@@ -36,26 +34,15 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @seeorg.maemo.esbox.linux.packages.core.IPackageManagerProvider#
+	 * @see org.maemo.esbox.linux.packages.core.IPackageManagerProvider#
 	 * createPackageManager(org.maemo.esbox.common.core.sdk.ISDKTarget)
 	 */
 	public IPackageManager createPackageManager(ISDKTarget sdkTarget) {
 		if (!(sdkTarget instanceof IScratchboxSDKTarget))
 			return null;
 
-		// in sb2, apt commands must be run as root
-		IProcessLauncherFactory aptProcessLauncherFactory;
-		if (sdkTarget instanceof IScratchboxSDKTarget)
-			aptProcessLauncherFactory = ((IScratchboxSDKTarget) sdkTarget)
-					.getProcessLauncherFactoryForInstall();
-		else
-			aptProcessLauncherFactory = sdkTarget.getProcessLauncherFactory();
-
-		IProcessLauncherFactory pkgconfigProcessLauncherFactory = sdkTarget
-				.getProcessLauncherFactory();
-
-		IPackageManager manager = new AptPackageManager(sdkTarget,
-				aptProcessLauncherFactory, pkgconfigProcessLauncherFactory);
+		IPackageManager manager = new AptPackageManager(sdkTarget, 
+				new ScratchboxAptPackageManagerBridge((IScratchboxSDKTarget) sdkTarget));
 		return manager;
 	}
 

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -16,6 +16,7 @@
  * Helper interface to identify the platform and architecture
  * 
  * @author eswartz
+ * @deprecated see IPlatformDetectorAdapter and SDKFactory#establishPlatform()
  * 
  */
 public interface IScratchboxSDKPlatformArchitectureProvider {

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/command/ScratchboxCommand.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/command/ScratchboxCommand.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/command/ScratchboxCommand.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -12,7 +12,6 @@
 package org.maemo.esbox.scratchbox.core.command;
 
 import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.ui.console.MessageConsole;
 import org.maemo.mica.common.core.*;
 import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
@@ -244,104 +243,21 @@
 						envBlock);
 		processLauncher.usePTY(true);
 
-		final Process process = processLauncher.createProcess();
+		processLauncher.createProcess();
 		new PrintStream(console.newMessageStream()).println(commandline);
-
-		Job job = new Job(jobName) {
-
-			@Override
-			protected IStatus run(IProgressMonitor monitor) {
-				monitor.beginTask("", 2);
-				monitor.subTask("Running " + commandline);
-				try {
-					processLauncher.redirectToConsole(console);
-					try {
-						process.waitFor();
-						monitor.worked(1);
-						int exit = process.exitValue();
-						if (exit != 0) {
-							return Activator.createErrorStatus(
-									"Process failed with exit value " + exit,
-									null);
-						}
-					} catch (InterruptedException e) {
-						return CANCEL_STATUS;
-					}
-				} finally {
-					monitor.done();
-				}
-				return Status.OK_STATUS;
-			}
-		};
-		job.schedule();
-		try {
-			long deadline = System.currentTimeMillis() + timeout;
-			while (job.getResult() == null) {
-				Thread.sleep(500);
-				if (monitor.isCanceled()
-						|| (timeout != 0 && System.currentTimeMillis() >= deadline)) {
-					process.destroy();
-					job.cancel();
-					return CANCEL_STATUS;
-				}
-			}
-			return job.getResult();
-		} catch (InterruptedException e) {
+		
+		processLauncher.redirectToConsole(console);
+		int exit = processLauncher.waitToComplete(monitor);
+		
+		if (exit == -1)
 			return CANCEL_STATUS;
-		}
+		else if (exit != 0)
+			return Activator.createErrorStatus("Process terminated with exit code: " + exit, null);
+		else
+			return Status.OK_STATUS;
 	}
 
 	/**
-	 * Wait for the process to finish with a certain timeout.
-	 * 
-	 * @param timeout
-	 *            if not zero, timeout in milliseconds before throwing exception
-	 * @return exit code
-	 */
-	protected int waitForProcess(final Process process, final long timeout)
-			throws ScratchboxException {
-		final Exception[] excs = { null };
-		Runnable runnable = new Runnable() {
-
-			public void run() {
-				try {
-					process.waitFor();
-				} catch (InterruptedException e) {
-					excs[0] = e;
-				}
-			}
-
-		};
-
-		if (timeout == 0) {
-			runnable.run();
-		} else {
-			Thread thread = new Thread(runnable);
-			thread.start();
-			try {
-				thread.join(timeout);
-				if (thread.isAlive()) {
-					thread.interrupt();
-					excs[0] = new InterruptedException();
-				}
-			} catch (InterruptedException e) {
-				excs[0] = e;
-			}
-		}
-
-		if (excs[0] instanceof InterruptedException) {
-			throw new ScratchboxException("Command interrupted after "
-					+ timeout + " milliseconds");
-		} else if (excs[0] instanceof ScratchboxException) {
-			throw (ScratchboxException) excs[0];
-		} else if (excs[0] != null) {
-			throw new ScratchboxException(excs[0]);
-		}
-
-		return process.exitValue();
-	}
-
-	/**
 	 * Eat the stdout and stderr results from the process and wait for it to
 	 * finish. Optionally check whether stderr is empty.
 	 * <p>

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb1/plugin.xml
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb1/plugin.xml	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb1/plugin.xml	2008-12-12 13:43:39 UTC (rev 1062)
@@ -10,7 +10,7 @@
    <extension
          point="org.eclipse.ui.preferencePages">
       <page
-            category="org.maemo.mica.common.ui.preferenceCategory.maemo"
+            category="org.maemo.esbox.ui.preferenceCategory.esbox"
             class="org.maemo.esbox.internal.scratchbox.sb1.ui.preferences.Scratchbox1PreferencesPage"
             id="org.maemo.mica.maemosdk.sb1.preferencePage.sb1"
             name="Scratchbox 1">

Copied: branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/IHelpID.java (from rev 1059, trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/IHelpID.java)
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/IHelpID.java	                        (rev 0)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/IHelpID.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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:
+ *    Ling Wang (Nokia) - initial API and implementation. Dec 11, 2008
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb1;
+
+
+/**
+ * @author LWang.
+ *
+ */
+public interface IHelpID {
+	public static final String PREFIX = Activator.PLUGIN_ID + "."; //$NON-NLS-1$
+
+	/**
+	 *  Global preference => ESbox => Scratchbox 1.
+	 */
+	public static final String HID_GLOBAL_PREF_ESBOX_SCRATCHBOX_1 = PREFIX + "global_pref_esbox_scratchbox_1"; //$NON-NLS-1$
+}

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -40,8 +40,8 @@
 import org.maemo.mica.common.core.sdk.ISDKTarget;
 import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
 import org.maemo.mica.internal.api.common.core.sdk.BaseSDKPlatform;
-import org.maemo.mica.maemosdk.core.MaemoSDKEngine;
-import org.maemo.mica.maemosdk.core.MaemoSDKInfo;
+import org.maemo.mica.maemosdk.core.MaemoSDKPlatformEngine;
+import org.maemo.mica.maemosdk.core.MaemoSDKPlatform;
 
 public class Scratchbox1SDK extends AbstractScratchboxSDK implements
 		IScratchbox1SDK {
@@ -365,13 +365,9 @@
 				platformName = platform.substring(0, 1).toUpperCase()
 						+ platform.substring(1).toLowerCase();
 
-				List<MaemoSDKInfo> maemoSDKS = MaemoSDKEngine.getInstance()
-						.getMaemoSDKS();
-				for (MaemoSDKInfo info : maemoSDKS) {
-					if (info.getName().equalsIgnoreCase(platformName)) {
-						version = info.getVersion();
-						break;
-					}
+				MaemoSDKPlatform info = MaemoSDKPlatformEngine.getInstance().getPlatformForName(platformName);
+				if (info != null) { 
+					return info;
 				}
 			} else {
 				// TODO: look at key files or versions to determine the

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences/Scratchbox1PreferencesPage.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences/Scratchbox1PreferencesPage.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/preferences/Scratchbox1PreferencesPage.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -19,11 +19,13 @@
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.maemo.esbox.internal.scratchbox.sb1.IHelpID;
 import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
 import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
 import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK;
 import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
 import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
+import org.maemo.mica.common.core.GeneralUtils;
 import org.maemo.mica.common.core.machine.ILocalMachine;
 import org.maemo.mica.common.core.sdk.SDKFactory;
 
@@ -69,6 +71,9 @@
 	 * ()
 	 */
 	public void createFieldEditors() {
+		
+		GeneralUtils.setHelpID(getFieldEditorParent(), IHelpID.HID_GLOBAL_PREF_ESBOX_SCRATCHBOX_1);
+		
 		IScratchboxSDK sdk = null;
 		try {
 			sdk = ScratchboxSDKFacade.getInstance().getScratchboxSDK(

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb2/plugin.xml
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb2/plugin.xml	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb2/plugin.xml	2008-12-12 13:43:39 UTC (rev 1062)
@@ -10,7 +10,7 @@
    <extension
          point="org.eclipse.ui.preferencePages">
       <page
-            category="org.maemo.mica.common.ui.preferenceCategory.maemo"
+            category="org.maemo.esbox.ui.preferenceCategory.esbox"
             class="org.maemo.esbox.internal.scratchbox.sb2.ui.preferences.Scratchbox2PreferencesPage"
             id="org.maemo.mica.maemosdk.sb2.preferencePage.sb2"
             name="Scratchbox 2">

Copied: branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/IHelpID.java (from rev 1059, trunk/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/IHelpID.java)
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/IHelpID.java	                        (rev 0)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/IHelpID.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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:
+ *    Ling Wang (Nokia) - initial API and implementation. Dec 11, 2008
+ *******************************************************************************/
+package org.maemo.esbox.internal.scratchbox.sb2;
+
+
+/**
+ * @author LWang.
+ *
+ */
+public interface IHelpID {
+	public static final String PREFIX = Activator.PLUGIN_ID + "."; //$NON-NLS-1$
+
+	/**
+	 *  Global preference => ESbox => Scratchbox 2.
+	 */
+	public static final String HID_GLOBAL_PREF_ESBOX_SCRATCHBOX_2 = PREFIX + "global_pref_esbox_scratchbox_2"; //$NON-NLS-1$
+}

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences/Scratchbox2PreferencesPage.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences/Scratchbox2PreferencesPage.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/preferences/Scratchbox2PreferencesPage.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -18,6 +18,8 @@
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.internal.scratchbox.sb2.IHelpID;
+import org.maemo.mica.common.core.GeneralUtils;
 
 /**
  * General preference page for scratchbox 2
@@ -62,6 +64,8 @@
 	 */
 	public void createFieldEditors() {
 
+		GeneralUtils.setHelpID(getFieldEditorParent(), IHelpID.HID_GLOBAL_PREF_ESBOX_SCRATCHBOX_2);
+
 		feSbox2BuildMappingMode = new StringFieldEditor(
 				SB2PreferenceConstants.SB2_MAPPING_MODE.toString(),
 				"Build mapping mode:", getFieldEditorParent());

Modified: branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseCustomVirtualMachineConfiguration.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseCustomVirtualMachineConfiguration.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseCustomVirtualMachineConfiguration.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -10,9 +10,11 @@
  *******************************************************************************/
 package org.maemo.esbox.internal.api.vm.core;
 
+import com.nokia.cpp.internal.api.utils.core.TextUtils;
+
 import org.maemo.esbox.internal.vm.Activator;
 import org.maemo.esbox.vm.core.IVirtualMachineConfiguration;
-import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.*;
 import org.maemo.mica.common.core.machine.ISharedFilesystemProvider;
 import org.maemo.mica.protocol.ssh.SSHConfiguration;
 
@@ -26,13 +28,6 @@
  */
 public abstract class BaseCustomVirtualMachineConfiguration implements IVirtualMachineConfiguration {
 	
-	private static final String SSH_HOST_ADDRESS = "sshHostAddress";
-	private static final String SSH_HOST_PORT = "sshHostPort";
-	private static final String TIMEOUT = "timeout";
-	private static final String CIFS_PORT = "cifsPort";
-	private static final String COMMAND_LAUNCH_PATTERN = "commandLaunchPattern";
-	private static final String EXECUTABLE = "executable";
-	
 	protected SSHConfiguration sshConfiguration;
 	protected String executable;
 	protected String commandLaunchPattern;
@@ -45,58 +40,27 @@
 
 		setupDefaults();
 		
-		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 (decodeQueryPart(key, value)) {
-					continue;
-				} else {
-					Activator.getErrorLogger().logError("Ignoring unknown query component: " + queryPart, null);
-				}
-			} catch (NumberFormatException e) {
-				throw new MicaException("Invalid integer in query component: " + queryPart);
-			}
+		URIQueryParser parser = new URIQueryParser();
+		parser.run(getURIQueryDecoder(), uri.getQuery());
+		String[] unknownParts = parser.getUnknownQueryComponents();
+		if (unknownParts.length > 0) {
+			Activator.getErrorLogger().logError("Ignoring unknown query components in URI: " 
+					+ TextUtils.catenateStrings(unknownParts, "&"), null);
 		}
 	}
 	
 	/**
-	 * Decode a portion of the query URI.  
-	 * @param key
-	 * @param value
-	 * @return true if handled, false if not
+	 * Get the decoder for URI query components, which modifies the configuration accordingly.
+	 * @return IURIQueryDecoder, never <code>null</code>
 	 */
-	protected boolean decodeQueryPart(String key, String value) {
-		if (key.equals(SSH_HOST_ADDRESS)) {
-			sshConfiguration.setHostIPAddress(value);
-		} else if (key.equals(SSH_HOST_PORT)) {
-			sshConfiguration.setHostPort(Integer.parseInt(value));
-		} else if (key.equals(TIMEOUT)) {
-			sshConfiguration.setConnectionTimeout(Integer.parseInt(value));
-		} else if (key.equals(CIFS_PORT)) {
-			this.cifsPort = Integer.parseInt(value);
-		} else if (key.equals(COMMAND_LAUNCH_PATTERN)) {
-			this.commandLaunchPattern = value;
-		} else if (key.equals(EXECUTABLE)) {
-			this.executable = value;
-		} else {
-			return false;
-		}
-		return true;
-	}
+	protected abstract IURIQueryDecoder getURIQueryDecoder();
+	
 
 	/**
 	 * 
 	 */
 	protected void setupDefaults() {
-		this.sshConfiguration.setConnectionTimeout(1);
+		this.sshConfiguration.setConnectionTimeout(5);
 		this.executable = null;
 		this.commandLaunchPattern = null; 
 		this.cifsPort = 445;

Modified: branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BasePreferenceVirtualMachineConfiguration.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BasePreferenceVirtualMachineConfiguration.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BasePreferenceVirtualMachineConfiguration.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -66,8 +66,7 @@
 				getTargetAddr(), getTargetPort(),
 				getHostAddr(), 22,
 				getUserName(), getUserPassword(),
-				10 /*timeout*/ 
-				);
+				10 /*timeout*/);
 
 		return sshConfiguration;
 	}

Modified: branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineController.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineController.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineController.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -96,12 +96,18 @@
 	 * @return
 	 */
 	protected MachineException processOutput(String message, MachineWatcherThread thread) {
-		return new MachineException(
-				MessageFormat.format("{0}\n\nCommand line: {1}\n\nstdout:\n{2}\nstderr:\n{3}",
-					message, 
-					CommandLineArguments.toCommandLine(thread.launcher.getLaunchCommandArguments()),
-					thread.getResults().stdout,
-					thread.getResults().stderr));
+		if (thread.getResults() != null)
+			return new MachineException(
+					MessageFormat.format("{0}\n\nCommand line: {1}\n\nstdout:\n{2}\nstderr:\n{3}",
+						message, 
+						CommandLineArguments.toCommandLine(thread.launcher.getLaunchCommandArguments()),
+						thread.getResults().stdout,
+						thread.getResults().stderr));
+		else
+			return new MachineException(
+					MessageFormat.format("{0}\n\nCommand line: {1}",
+						message, 
+						CommandLineArguments.toCommandLine(thread.launcher.getLaunchCommandArguments())));
 	}
 
 	@Override
@@ -470,7 +476,7 @@
 									machine,
 									new SubProgressMonitor(monitor, 1));
 							if (!status.isOK()) {
-								Activator.getErrorLogger().logError(status.getMessage(), status.getException());
+								Activator.getErrorLogger().log(status);
 							}
 							// TODO we just log warnings instead of passing them back, otherwise "status.isOK()" checks everywhere fail
 							if (status.getSeverity() == IStatus.WARNING)

Copied: branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineURIQueryDecoder.java (from rev 1059, trunk/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineURIQueryDecoder.java)
===================================================================
--- branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineURIQueryDecoder.java	                        (rev 0)
+++ branches/work_Petr/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/core/BaseVirtualMachineURIQueryDecoder.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * 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.core;
+
+import org.maemo.mica.common.core.IURIQueryDecoder;
+import org.maemo.mica.common.core.machine.IMachineFactory;
+
+/**
+ * URI decoder for the common shared URI components 
+ * @author eswartz
+ * @see IMachineFactory#createMachine(String, java.net.URI, org.maemo.mica.common.core.machine.ISharedFilesystemProvider)
+ *
+ */
+public class BaseVirtualMachineURIQueryDecoder implements IURIQueryDecoder {
+	private static final String SSH_HOST_ADDRESS = "sshHostAddress";
+	private static final String SSH_HOST_PORT = "sshHostPort";
+	private static final String TIMEOUT = "timeout";
+	private static final String CIFS_PORT = "cifsPort";
+	private static final String COMMAND_LAUNCH_PATTERN = "commandLaunchPattern";
+	private static final String EXECUTABLE = "executable";
+	protected BaseCustomVirtualMachineConfiguration config;
+	
+	public BaseVirtualMachineURIQueryDecoder(BaseCustomVirtualMachineConfiguration config) {
+		this.config = config;
+	}
+	/**
+	 * Decode a portion of the query URI.  
+	 * @param key
+	 * @param value
+	 * @return true if handled, false if not
+	 */
+	public boolean decode(String key, String value) {
+		if (key.equals(SSH_HOST_ADDRESS)) {
+			config.sshConfiguration.setHostIPAddress(value);
+		} else if (key.equals(SSH_HOST_PORT)) {
+			config.sshConfiguration.setHostPort(Integer.parseInt(value));
+		} else if (key.equals(TIMEOUT)) {
+			config.sshConfiguration.setConnectionTimeout(Integer.parseInt(value));
+		} else if (key.equals(CIFS_PORT)) {
+			config.cifsPort = Integer.parseInt(value);
+		} else if (key.equals(COMMAND_LAUNCH_PATTERN)) {
+			config.commandLaunchPattern = value;
+		} else if (key.equals(EXECUTABLE)) {
+			config.executable = value;
+		} else {
+			return false;
+		}
+		return true;
+	}
+}

Modified: branches/work_Petr/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/CustomQemuConfiguration.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/CustomQemuConfiguration.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.vm.qemu/src/org/maemo/esbox/internal/vm/qemu/CustomQemuConfiguration.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -10,8 +10,9 @@
  *******************************************************************************/
 package org.maemo.esbox.internal.vm.qemu;
 
-import org.maemo.esbox.internal.api.vm.core.BaseCustomVirtualMachineConfiguration;
+import org.maemo.esbox.internal.api.vm.core.*;
 import org.maemo.esbox.vm.qemu.IQemuConfiguration;
+import org.maemo.mica.common.core.IURIQueryDecoder;
 import org.maemo.mica.common.core.MicaException;
 import org.maemo.mica.common.core.machine.ISharedFilesystemProvider;
 
@@ -24,15 +25,11 @@
  *
  */
 public class CustomQemuConfiguration extends BaseCustomVirtualMachineConfiguration implements IQemuConfiguration {
-	
-	private static final String INSTALL_PATH = "installPath";
-	private static final String DISK_IMAGE_PATHS = "diskImagePaths";
-	private static final String MEMORY_SIZE = "memorySize";
-	
-	private String installPath;
-	private String diskImagePaths;
-	private int memorySize;
 
+	protected String installPath;
+	protected String diskImagePaths;
+	protected int memorySize;
+
 	public CustomQemuConfiguration(URI uri, ISharedFilesystemProvider sharedFilesystemProvider) throws MicaException {
 		super(uri, sharedFilesystemProvider);
 	}	
@@ -50,22 +47,35 @@
 	}
 		
 	/* (non-Javadoc)
-	 * @see org.maemo.esbox.internal.vm.qemu.BaseCustomVirtualMachineConfiguration#decodeQueryPart(java.lang.String, java.lang.String)
+	 * @see org.maemo.esbox.internal.api.vm.core.BaseCustomVirtualMachineConfiguration#getURIQueryDecoder()
 	 */
 	@Override
-	protected boolean decodeQueryPart(String key, String value) {
-		if (super.decodeQueryPart(key, value))
-			return true;
-		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 {
-			return false;
-		}
-		return true;
+	protected IURIQueryDecoder getURIQueryDecoder() {
+		return new BaseVirtualMachineURIQueryDecoder(this) {
+			
+			private static final String INSTALL_PATH = "installPath";
+			private static final String DISK_IMAGE_PATHS = "diskImagePaths";
+			private static final String MEMORY_SIZE = "memorySize";
+
+			/* (non-Javadoc)
+			 * @see org.maemo.esbox.internal.vm.qemu.BaseCustomVirtualMachineConfiguration#decodeQueryPart(java.lang.String, java.lang.String)
+			 */
+			@Override
+			public boolean decode(String key, String value) {
+				if (super.decode(key, value))
+					return true;
+				if (key.equals(INSTALL_PATH)) {
+					CustomQemuConfiguration.this.installPath = value;
+				} else if (key.equals(DISK_IMAGE_PATHS)) {
+					CustomQemuConfiguration.this.diskImagePaths = value;
+				} else if (key.equals(MEMORY_SIZE)) {
+					CustomQemuConfiguration.this.executable = value;
+				} else {
+					return false;
+				}
+				return true;
+			}
+		};
 	}
 	
 	public String getInstallPath() {

Modified: branches/work_Petr/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/CustomVMwareConfiguration.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/CustomVMwareConfiguration.java	2008-12-12 04:28:39 UTC (rev 1061)
+++ branches/work_Petr/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/CustomVMwareConfiguration.java	2008-12-12 13:43:39 UTC (rev 1062)
@@ -10,8 +10,9 @@
  *******************************************************************************/
 package org.maemo.esbox.internal.vm.vmware;
 
-import org.maemo.esbox.internal.api.vm.core.BaseCustomVirtualMachineConfiguration;
+import org.maemo.esbox.internal.api.vm.core.*;
 import org.maemo.esbox.vm.vmware.IVMwareConfiguration;
+import org.maemo.mica.common.core.IURIQueryDecoder;
 import org.maemo.mica.common.core.MicaException;
 import org.maemo.mica.common.core.machine.ISharedFilesystemProvider;
 
@@ -42,19 +43,27 @@
 	}
 
 	/* (non-Javadoc)
-	 * @see org.maemo.esbox.internal.api.vm.core.BaseCustomVirtualMachineConfiguration#decodeQueryPart(java.lang.String, java.lang.String)
+	 * @see org.maemo.esbox.internal.api.vm.core.BaseCustomVirtualMachineConfiguration#getURIQueryDecoder()
 	 */
 	@Override
-	protected boolean decodeQueryPart(String key, String value) {
-		if (super.decodeQueryPart(key, value))
-			return true;
-		
-		if (key.equals(VMX_PATH)) {
-			vmxPath = value;
-		} else {
-			return false;
-		}
-		return true;
+	protected IURIQueryDecoder getURIQueryDecoder() {
+		return new BaseVirtualMachineURIQueryDecoder(this) {
+			/* (non-Javadoc)
+			 * @see org.maemo.esbox.internal.api.vm.core.BaseVirtualMachineURIQueryDecoder#decode(java.lang.String, java.lang.String)
+			 */
+			@Override
+			public boolean decode(String key, String value) {
+				if (super.decode(key, value))
+					return true;
+				
+				if (key.equals(VMX_PATH)) {
+					vmxPath = value;
+				} else {
+					return false;
+				}
+				return true;
+			}
+		};
 	}
 	
 	/* (non-Javadoc)



More information about the Esbox-commits mailing list