[Esbox-commits] r2077 - in branches/work_Fabricio: org.maemo.esbox.cpp.project org.maemo.esbox.cpp.project/META-INF org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core org.maemo.esbox.help/html/reference org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox org.maemo.esbox.vm.vmware org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards
fabricioepa at garage.maemo.org
fabricioepa at garage.maemo.org
Tue Sep 1 21:15:57 EEST 2009
Author: fabricioepa
Date: 2009-09-01 21:15:54 +0300 (Tue, 01 Sep 2009)
New Revision: 2077
Added:
branches/work_Fabricio/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java
Removed:
branches/work_Fabricio/org.maemo.esbox.vm.vmware/data/
Modified:
branches/work_Fabricio/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF
branches/work_Fabricio/org.maemo.esbox.cpp.project/plugin.xml
branches/work_Fabricio/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ConvertCppProjectMarkerResolutionGenerator.java
branches/work_Fabricio/org.maemo.esbox.help/html/reference/FAQ.html
branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java
branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFoldersPreferencePage.java
branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxSettingsPreferencePage.java
branches/work_Fabricio/org.maemo.esbox.vm.vmware/build.properties
branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMDescription.java
branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMInfo.java
branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMInstaller.java
branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java
branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java
branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java
branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java
branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java
branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java
Log:
Merge to rev 2076 from trunk
Modified: branches/work_Fabricio/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF 2009-09-01 18:15:54 UTC (rev 2077)
@@ -23,6 +23,9 @@
org.eclipse.cdt.core;bundle-version="5.0.2",
org.maemo.esbox.maemosdk.ui;bundle-version="2.0.0",
org.maemo.mica.maemosdk.core;bundle-version="2.0.0",
- org.maemo.mica.cpp.project.builder.make;bundle-version="2.0.0"
+ org.maemo.mica.cpp.project.builder.make;bundle-version="2.0.0",
+ org.maemo.mica.cpp.project.builder.autotools;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.sb1;bundle-version="2.0.0",
+ org.maemo.esbox.scratchbox.core;bundle-version="2.0.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Modified: branches/work_Fabricio/org.maemo.esbox.cpp.project/plugin.xml
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.cpp.project/plugin.xml 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.cpp.project/plugin.xml 2009-09-01 18:15:54 UTC (rev 2077)
@@ -170,6 +170,10 @@
class="org.maemo.esbox.internal.cpp.project.core.ConvertCppProjectMarkerResolutionGenerator"
markerType="org.eclipse.core.resources.problemmarker">
</markerResolutionGenerator>
+ <markerResolutionGenerator
+ class="org.maemo.esbox.internal.cpp.project.core.ApplyDoctoolsFixMarkerResolutionGenerator"
+ markerType="org.maemo.mica.cpp.project.builder.autotools.autotoolsProblemMarker">
+ </markerResolutionGenerator>
</extension>
<extension
Copied: branches/work_Fabricio/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java (from rev 2070, trunk/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java)
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java (rev 0)
+++ branches/work_Fabricio/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * 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.cpp.project.core;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolution2;
+import org.eclipse.ui.IMarkerResolutionGenerator2;
+import org.maemo.esbox.internal.cpp.project.Activator;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDKTarget;
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.common.project.core.ProjectManager;
+import org.maemo.mica.common.ui.dialogs.DialogUtils;
+import org.maemo.mica.cpp.project.builder.autotools.MicaAutotoolsConstants;
+import org.maemo.mica.internal.api.common.core.sdk.BaseSDKTarget;
+
+/**
+ * Apply a "quick fix" for detected errors about intltool being out of date.
+ * This really means, you need to add the "doctools" devkit.
+ * @author eswartz
+ *
+ */
+public class ApplyDoctoolsFixMarkerResolutionGenerator implements
+ IMarkerResolutionGenerator2 {
+
+ private static class FixupDoctoolsMarkerResolution implements
+ IMarkerResolution2 {
+ public String getDescription() {
+ return "Add the doctools devkit to your Scratchbox target. This provides the approved version of intltool (don't install it inside the target).";
+ }
+
+ public Image getImage() {
+ return null;
+ }
+
+ public String getLabel() {
+ return "Add doctools devkit to target";
+ }
+
+ public void run(final IMarker marker) {
+ ProgressMonitorDialog dialog = new ProgressMonitorDialog(null);
+ try {
+ dialog.run(true, true, new IRunnableWithProgress() {
+
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException,
+ InterruptedException {
+ monitor.beginTask("Adding devkit...", IProgressMonitor.UNKNOWN);
+ addDoctoolsDevkit(marker);
+ monitor.worked(1);
+ monitor.done();
+ }
+
+ });
+
+ } catch (InvocationTargetException e) {
+ Activator.getErrorLogger().logError("Unexpected error fixing marker", e.getCause());
+ return;
+ } catch (InterruptedException e) {
+ return;
+ }
+
+ boolean build = DialogUtils.showQuestionDialog(null,
+ "Updated target",
+ "Added the 'doctools' devkit to the target.\n \nDo you want to rebuild now?");
+ if (build) {
+ Job buildJob = new Job("Rebuild project") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ marker.getResource().getProject().build(IncrementalProjectBuilder.FULL_BUILD,
+ monitor);
+ return Status.OK_STATUS;
+
+ } catch (CoreException e) {
+ return e.getStatus();
+ }
+ }
+
+ };
+ buildJob.schedule();
+
+ }
+
+ }
+
+ /**
+ * @param marker
+ */
+ private void addDoctoolsDevkit(final IMarker marker) {
+ try {
+ // already checked
+ IResource rsrc = marker.getResource();
+ ISDKTarget target = ProjectManager.getInstance().getSDKTarget(rsrc.getProject());
+ // in case it changed...
+ if (target instanceof IScratchbox1SDKTarget) {
+ IScratchbox1SDKTarget sb1Target = (IScratchbox1SDKTarget) target;
+ // in case out of date
+ ((BaseSDKTarget) sb1Target).clearCache();
+ sb1Target.addDevkit("doctools");
+ marker.delete();
+
+ }
+ } catch (MicaException e) {
+ Activator.getErrorLogger().logAndShowError("Error updating devkits", e);
+ } catch (CoreException e) {
+ Activator.getErrorLogger().logError("Failed to fix marker", e);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IMarkerResolutionGenerator2#hasResolutions(org.eclipse.core.resources.IMarker)
+ */
+ public boolean hasResolutions(IMarker marker) {
+ try {
+ if (marker.getType().equals(MicaAutotoolsConstants.AUTOTOOLS_PROBLEM_MARKER_TYPE)) {
+ Object message = marker.getAttribute(IMarker.MESSAGE);
+ if (message != null && message.toString().contains("Your intltool is too old")) {
+ // make sure doctools is not already present
+ IResource rsrc = marker.getResource();
+ if (rsrc != null) {
+ ISDKTarget target = ProjectManager.getInstance().getSDKTarget(rsrc.getProject());
+ if (target instanceof IScratchbox1SDKTarget) {
+ return true;
+ }
+ }
+ }
+ }
+ } catch (CoreException e) {
+ // marker bugs
+ } catch (MicaException e) {
+ // not a Mica project
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IMarkerResolutionGenerator#getResolutions(org.eclipse.core.resources.IMarker)
+ */
+ public IMarkerResolution[] getResolutions(IMarker marker) {
+ return new IMarkerResolution[] {
+ new FixupDoctoolsMarkerResolution()
+ };
+ }
+
+
+
+}
Modified: branches/work_Fabricio/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ConvertCppProjectMarkerResolutionGenerator.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ConvertCppProjectMarkerResolutionGenerator.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ConvertCppProjectMarkerResolutionGenerator.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -25,6 +25,7 @@
import org.maemo.mica.internal.api.common.project.core.IOldFormatProjectBuilder;
/**
+ * Apply a "quick fix" support for the problem generated by the old-format project builder.
* @author eswartz
*
*/
Modified: branches/work_Fabricio/org.maemo.esbox.help/html/reference/FAQ.html
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.help/html/reference/FAQ.html 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.help/html/reference/FAQ.html 2009-09-01 18:15:54 UTC (rev 2077)
@@ -11,592 +11,18 @@
content="Copyright (c) INdT 2007-2009, (c) Nokia 2008-2009. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.">
<meta name="CHANGEDBY" content="Ed Swartz">
<meta http-equiv="Content-Language" content="en-us">
-<style type="text/css">
-<!--
-H1 {
- color: #000000;
- font-family: "Arial", sans-serif;
- font-size: 18pt
-}
-P {
- color: #000000;
- font-family: "Arial", sans-serif;
- font-size: 10pt
-}
-
-H2 {
- color: #000000;
- font-family: "Arial", sans-serif;
- font-size: 14pt
-}
-
-H3 {
- color: #000000;
- font-family: "Arial", sans-serif;
- font-size: 11pt
-}
-
-H4 {
- color: #000000;
- font-family: "Arial", sans-serif;
- font-size: 10pt;
- font-style: italic
-}
-
-BLOCKQUOTE {
- color: #000000;
- font-family: "Arial", sans-serif;
- font-size: 10pt
-}
-
-A:link {
- color: #006699
-}
--->
-</style>
</head>
<body lang="en-US" text="#000000" link="#006699" bgcolor="#ffffff"
dir="LTR">
-<h1>FAQ</h1>
-<h2><!-- no 'id' or 'title' attribute for TOC -->Table of Contents</h2>
-<h4>General questions:</h4>
-<ul>
- <li>
- <p style="margin-bottom: 0in"><a href="#what">What is ESbox?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#licensed">How is ESbox
- licensed?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#organized">How is the
- ESbox Project organized?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#releases">How do I find
- out about future releases of ESbox?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#support">Which
- operating systems does ESbox support?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#ask">How do I ask
- questions? </a></p>
- </li>
- <li>
- <p><a href="#bug">How do I report a bug or request a feature?</a></p>
- </li>
-</ul>
-<h4>Download and Installation:</h4>
-<ul>
- <li>
- <p style="margin-bottom: 0in"><a href="#howtos">Are there
- complete HowTos for setting up ESbox?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#build">Which ESbox
- build should I download?</a></p>
- </li>
- <li>
- <p><a href="#uninstall">How do I uninstall ESbox?</a></p>
- </li>
-</ul>
-<h4>Development with Scratchbox:</h4>
-<ul>
- <li>
- <p style="margin-bottom: 0in"><a href="#scratchbox-esbox|region">How
- do I work with Scratchbox in ESbox?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#esbox-windows-osx|region">How
- do I work with ESbox in Windows or Mac OS X?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#new-scratchbox-sdk|region">How
- do I install new versions of Scratchbox or new SDKs?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a
- href="#new-scratchbox-targets|region">How do I install new
- Scratchbox targets?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a
- href="#synchronize-packages|region">How do I synchronize packages
- with my project?</a></p>
- </li>
-</ul>
-<h4>Working with Nokia Internet Tablets:</h4>
-<ul>
- <li>
- <p style="margin-bottom: 0in"><a href="#development-setup|region">How
- do I set up my tablet for development?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#configure-for-esbox|region">How
- do I configure my tablet for use with ESbox?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#run-debug-tablet|region">How
- do I run and debug on a tablet?</a></p>
- </li>
- <li>
- <p style="margin-bottom: 0in"><a href="#networking-issues|region">How
- do I resolve networking issues?</a></p>
- </li>
-</ul>
-<div id="general-questions" dir="LTR">
-<hr>
-<h2>General questions:</h2>
-<div id="what" dir="LTR">
-<h3>What is ESbox?</h3>
-<p>ESbox is an Eclipse product for developing applications and
-libraries on the Maemo software platform.</p>
-<p>ESbox is strongly integrated with Scratchbox, reducing time and
-effort for configuration and increasing the productivity for Linux-based
-embedded systems development. It supports C/C++ and Python programming
-languages. Maemo 4.x, 5.x, and future SDKs will be supported.</p>
-<p>ESbox also supports deploying, running, and debugging
-applications and libraries on the Nokia Internet Tablet.</p>
-</div>
-<hr>
-<div id="licensed" dir="LTR">
-<h3>How is ESbox licensed?</h3>
-<p>This software is produced by the ESbox team combined with third
-party software developed from other Open Source Projects. This software
-has been licensed under <a
- href="http://www.eclipse.org/legal/epl-v10.html">Eclipse
-Public License Version 1.0 ("EPL")</a>.</p>
-</div>
-<hr>
-<div id="organized" dir="LTR">
-<h3>How is the ESbox Project organized?</h3>
-<p>ESbox consists of three major layers:</p>
-<ul>
- <li>
- <p>Eclipse platform</p>
- <blockquote>A popular and extensible framework for
- developing IDEs. See <a href="http://www.eclipse.org/">the
- eclipse.org website</a>.</blockquote>
- </li>
- <li>
- <p>Mica (Maemo IDE Common Architecture)</p>
- <blockquote style="margin-bottom: 0in">A plugin framework
- supporting both the ESbox and PluThon products, which provides an
- extensible platform for Maemo development:</blockquote>
- <ul>
- <li>
- <blockquote style="margin-bottom: 0in">Unified project
- model, with C/C++ and Python implementations</blockquote>
- </li>
- <li>
- <blockquote style="margin-bottom: 0in">Linux development
- (e.g. Debian packaging, autotools, externalizing strings with gettext)</blockquote>
- </li>
- <li>
- <blockquote style="margin-bottom: 0in">Support for copying files or
- mounting a project to run, debug, and profile programs on
- Maemo devices</blockquote>
- </li>
- <li>
- <blockquote>and more! See <a
- href="https://garage.maemo.org/projects/mica/">the Mica project
- website</a> for more information.</blockquote>
- </li>
- </ul>
- </li>
- <li>
- <p>ESbox product</p>
- <blockquote>A targeted set of product plugins, providing
- the top-level project and import wizards, this help, graphics, and user
- interface modifications giving ESbox its unique feel as a product.</blockquote>
- </li>
-</ul>
-</div>
-<hr>
-<div id="releases" dir="LTR">
-<h3>How do I find out about future releases of ESbox?</h3>
-<p>To find out about futures releases see the <a
- href="https://garage.maemo.org/news/?group_id=192" target="_blank">ESbox Garage Project News page</a>.
- </p>
- <p>For regular integration releases, see the
- <a href="http://esbox.garage.maemo.org/2nd_edition/releases.html" target="_blank">ESbox releases page</a>
-</div>
-<hr>
-<div id="support" dir="LTR">
-<h3>Which operating systems does ESbox support?</h3>
-<p>The ESbox product runs on Linux (32 or 64 bit), Windows XP/Vista,
-and Mac OS X.</p>
-<p>The underlying Scratchbox, on the other hand, only runs on
-Linux/i386. To support non-Linux hosts, ESbox can communicate with a
-virtual machine hosting the Maemo SDK.</p>
-<p>ESbox, though Mica, operates essentially the same way regardless
-of which host you're running on. A limitation, though, is that your
-projects or workspace must be visible to both Scratchbox and the host.
-When Scratchbox is running on a virtual machine, we support this via
-Samba sharing from the host to the VM.</p>
-<p>See the <a href="http://maemovmware.garage.maemo.org/">Maemo SDK virtual image page</a>
-for configured and supported images and the
-<a href="../tasks/virtual_machines.html">ESbox virtual machine documentation</a>.
-</div>
-<hr>
-<div id="ask" dir="LTR">
-<h3>How do I ask questions?</h3>
-<p>The <a href="https://garage.maemo.org/">garage.maemo.org</a>
-website provides some mailing <a
- href="https://garage.maemo.org/mail/?group_id=192">lists</a>. Choose a
-list to browse, search, and post messages. Keep in mind that these
-newsgroups are public, so do not include any confidential information in
-your questions. You should also read "How to ask questions the
-smart way" by Eric Raymond before participating in the newsgroups.
-</p>
-</div>
-<hr>
-<div id="bug" dir="LTR">
-<h3>How do I report a bug or request a feature?</h3>
-<p>The bug and feature trackers are stored at the <a
- href="https://garage.maemo.org/tracker/?group_id=192">ESbox project
-page</a>.</p>
-<p>Before entering a bug report, you should search to see if someone
-else has already entered a bug report similar to yours. If you find a
-bug report that outlines the problem you are seeing, you can simply
-annotate it with your comments to let the developers know that you have
-also hit the bug. Also you can add yourself to the "Monitor"
-list of the bug so that you will be notified when the status of the bug
-changes or someone adds comments.</p>
-</div>
-</div>
-<hr>
-<div id="download" dir="LTR">
-<h2>Download and Installation:</h2>
-<div id="howtos" dir="LTR">
-<h3>Are there complete HowTos for setting up ESbox?</h3>
-<p>Yes, please see the <a href="http://esbox.garage.maemo.org/2nd_edition/installation.html">ESbox installation guide</a>.
-You may install either a fully packaged product or update an existing Eclipse 3.4.2 installation over the Internet.
-</p>
-</div>
-<hr>
-<div id="uninstall" dir="LTR">
-<h3>How do I uninstall ESbox?</h3>
-<p>Removing plugins from Eclipse is easy. You can browse and manage your configuration from
-the Eclipse Software Updates dialog under Help > Software Updates.</p>
-<p>Select the <em>ESbox 2nd Edition</em> and <em>Mica 2nd Edition</em> features from the list of Installed Software
-and click Uninstall.
-</div>
-</div>
-<hr>
-<div id="development-scratchbox" dir="LTR">
-<h2><a name="download"></a>Development in Scratchbox</h2>
-<div id="scratchbox-esbox" dir="LTR"><a
- name="scratchbox-esbox|region"></a>
-<h3><a name="howtos"></a>How do I work with Scratchbox in ESbox?</h3>
-<h4>System configuration</h4>
-<p>When you first use a command or run a wizard that needs
-Scratchbox, ESbox will automatically scan for Scratchbox 1 and
-Scratchbox 2 installations.
-Currently these conditions must be met:</p>
-<ul>
- <li>
- <p>Scratchbox 1: <b>sb-conf </b> visible and configured
- on one of the paths configured in the <em>Preferences > Scratchbox 1</em>
- preferences page.</p>
- </li>
- <li>
- <p style="font-weight: medium">Scratchbox 2: <b>sb2-config </b>and
- <b>sb2 </b>visible on PATH</p>
- </li>
-</ul>
-<p >If the programs are not found, then
-the respective Scratchbox will not be usable.</p>
-<p>If your system is not properly configured for Scratchbox, or you're
-using a non-default installation which does not configure itself at startup,
-you may need to
-right-click a Scratchbox SDK (in the <em>Maemo > Installed Targets</em>
-preferences) and invoke <em>Startup</em> to enable it.</p>
-<h4>Metaphors in ESbox</h4>
-<p>In ESbox, a Scratchbox 1 or 2 installation is called an
-“SDK”. An individual target (like DIABLO_ARMEL) is a
-“target”.</p>
-<p>See the preference page <em>Window > Preferences > Maemo
-> Installed Targets </em>to
-confirm and modify the Scratchbox installations. You should see a node
-for Scratchbox 1 and/or 2, based on what you have installed, and entries
-for each recognized target underneath. If not, try the <em>Refresh </em>button. </p>
-</div>
-<hr>
-<div id="esbox-windows-osx" dir="LTR"><a
- name="esbox-windows-osx|region"></a>
-<h3>How do I work with ESbox in Windows or Mac OS X?</h3>
-<p>The Maemo SDK and tools only run on Linux/x86 at the moment, but
-you may run ESbox on Windows or Mac OS X. To do this, ESbox can use a <b>virtual
-machine</b> to handle all the building and running work.</p>
-<p>The preference page <em>Window > Preferences > ESbox
-> Build Machines </em> is the
-gateway to configuring this facility. </p>
-<p>Please see the
-<a href="http://esbox.garage.maemo.org/2nd_edition/virtual_machines.html">ESbox virtual machine support documentation</a>
-for all the details.
-<hr>
-<div id="new-scratchbox-sdk" dir="LTR"><a
- name="new-scratchbox-sdk|region"></a>
-<h3 >How do I install new versions of
-Scratchbox or new SDKs?</h3>
-<p >You can use the wizards in
-<em>File > New > Other > Maemo Installers</em> to install or upgrade
-Scratchbox 1. Currently Maemo 4 (Diablo) and Maemo 5 Beta (Fremantle)
-are supported.
-</p>
-<p>These wizards are also visible via <em>Window
-> Preferences > Maemo > Installed Targets</em> by clicking the <em>New...</em>
-button.</p>
-</div>
-<hr>
-<div id="new-scratchbox-targets" dir="LTR"><a
- name="new-scratchbox-targets|region"></a>
-<h3 >How do I install new Scratchbox
-targets?</h3>
-<p >
-ou can use the wizards in
-<em>File > New > Other > Maemo Installers</em> to install or upgrade
-Scratchbox 1 or Scratchbox 2 Targets. Currently Maemo 4 (Diablo) and Maemo 5 Beta (Fremantle)
-are supported for Scratchbox 1. Any supported Maemo SDK can be installed for
-Scratchbox 2.
-</p>
-<p>These wizards are also visible via <em>Window
-> Preferences > Maemo > Installed Targets</em> by clicking the <em>New...</em>
-button.</p>
-</div>
-<hr>
-<div id="synchronize-packages" dir="LTR"><a
- name="synchronize-packages|region"></a>
-<h3 >How do I synchronize packages
-with my project?</h3>
-<p >When you create a new project (<b>File
-> New > Project > Maemo C or C++ Project </b>or <b>File >
-New > Project > Maemo Python Project</b>), or when you invoke the <b>Project
-> Validate Installed Packages</b> command, ESbox will help you install
-the packages required by one or more projects into one or more
-Scratchbox rootstraps or with configured Nokia Internet Tablets (see the
-next section).</p>
-<p >ESbox will scan autotools-based
-projects for the packages implied by the PKG_CONFIG_CHECK macros in
-configure.ac and install these if missing. For other projects, default
-metapackages recommended by the Maemo Eclipse Integration project will
-be installed.</p>
-<h4 >Networking setup</h4>
-<p >Be sure to visit the <b>Network
-Connections </b>preferences before
-updating packages, so any proxy settinges are established. </p>
-<h4 >If you can't connect to any
-repositories...</h4>
-<p >At the time of this writing, there
-are sometimes issues where no combination of settings will
-seem to allow you to connect to the repositories to update packages
-inside Scratchbox when using proxies and running
-Scratchbox in a virtual machine. This is
-either a problem in scratchbox, in ESbox, in VMware, or in the maemo.org
-hosting providers, or some combination – you choose :).</p>
-<p >As a last resort, you may to edit <b>/etc/hosts
-</b><span style="font-style: normal"><span
- style="font-weight: medium">inside each Scratchbox rootstrap and
-enter a manual address for repository.maemo.org, e.g.:</span></span></p>
-<p style="font-style: normal; text-decoration: none"><b>206.57.28.43
-repository.maemo.org</b></p>
-<p
- style="margin-bottom: 0in; font-weight: medium; text-decoration: none">
-(<b>ping </b>the repository.maemo.org address before using the example,
-since the addresses may change.)</p>
-<p style="margin-bottom: 0in"><br>
-</p>
-<p
- style="margin-bottom: 0in; font-weight: medium; text-decoration: none">
-When updating packages inside a Nokia Internet Tablet, you may also need
-to disconnect any “static” USB, WLAN, or Bluetooth
-connections and directly connect the tablet to a WLAN that can access
-the Internet, otherwise traffic may simply flow into the host computer
-and die there.</p>
-</div>
-</div>
-<hr>
-<div id="InternetTablets" dir="LTR">
-<h2 >Working with Nokia Internet
-Tablets</h2>
-<div id="development-setup" dir="LTR"><a
- name="development-setup|region"></a>
-<h3 >How do I set up my tablet for
-development?</h3>
-<p >The first important step is to
-install the <em>maemo-pc-connectivity</em> metapackage. This will install
-the proper servers on your tablet so you can access it from your PC for
-the purpose of remote SSH launching, copying files, debugging, and using
-Scratchbox Remote Shell.</p>
-<p >You also need to set up your tablet
-for R&D mode (so you may become root, and install Debian packages,
-update the system from ESbox, etc).</p>
-<p >Also, you must install the
-host-side programs needed for communication with the tablet programs in
-maemo-pc-connectivity. (These are preinstalled in the virtual machine
-images or available in the <em>host-pc-connectivity</em> package.)</p>
-<p><b>All the details
-</b>are on the <a
- href="http://pc-connectivity.garage.maemo.org/">PC connectivity garage project page</a>.</p>
-</div>
-<hr>
-<div id="configure-for-esbox" dir="LTR"><a
- name="configure-for-esbox|region"></a>
-<h3 >How do I configure my tablet for
-use with ESbox?</h3>
-<p >ESbox integrates the Eclipse Remote
-System Explorer project, which provides a common framework for
-interacting with remote machines.</p>
-<p >ESbox will automatically create a set of
-RSE connections for the account "user" corresponding to the methods
-of network access supported by PC connectivity.
-</p>
-<p>
-For example, <em>Nokia Internet Tablet (USB)</em> is
-preconfigured with the standard USB address (192.168.2.15) and "user" account.</p>
-<p>Whenever you see these connections in ESbox dialogs, you can right-click
-and <em>Configure...</em> to edit the address or username if your configuration is different.
-Alternately, open the <em>Remote
-Systems </em> view (<em>Window
-> Show View > Other > Remote Systems > Remote Systems</em>) to see
-more complete UI.</p>
-<p>If you forget the address or otherwise mess up the connection, you can
-delete it (using the <em>Remote Systems</em> view) and it will be recreated
-anew the next time you start ESbox.</p>
-<p>
-Currently, there is no
-special behavior associated with any of these connections other than
-the name and default address.
-</p>
-</div>
-<hr>
-<div id="run-debug-tablet" dir="LTR"><a
- name="run-debug-tablet|region"></a>
-<h3 ><a name="howtos1"></a>How do I
-run and debug on a tablet?</h3>
-<p><span >ESbox supports running
-and debugging C/C++ and Python programs on a Nokia Internet Tablet. The
-N800 and N810 series are currently supported. Please <a
- href="#How do I set up my tablet for development_|outline">set up
-your tablet for development</a> first.</span></p>
-<p >After you create or import a
-project, you may right-click and invoke <em>Run / Debug As ... >
-Maemo Remote ... Application. </em> Choose
-the <tt>Copy via RSE</tt> download
-selection method, and then select one of the <tt>Nokia Internet Tablet</tt> connections.</p>
-<p>If this
-fails, see the next entry.</p>
-</div>
-<hr>
-<div id="networking-issues" dir="LTR"><a
- name="networking-issues|region"></a>
-<h3 >How do I resolve networking
-issues?</h3>
-<p >Network configurations can be
-tricky (and doubly, or triply so, if you are running on Windows or OS
-X). You can expect to become familiar with the “Connection
-problem” dialog.</p>
-<p>The primary line of
-defense is to make sure the connection works from the command line and
-that all the daemons and configurations are set up properly. See the <a
- href="http://pc-connectivity.garage.maemo.org/">PC connectivity site</a>
-for details. Also, be sure you understand the utilities provided in the
-maemo-pc-connectivity project and follow the instructions for
-configuring various types of networks. </p>
-<p >The second line of defense is to
-understand how ESbox uses Eclipse preferences to influence the network.</p>
-<p >The <em>Window > Preferences
-> General > Network Connections </em> preference
-contains the HTTP proxy configuration. This will be used when
-communicating with apt repositories (when validating packages). If you
-do use a proxy, be sure your host and your tablet are both referenced in
-the “No proxy” section. (Note: from my experience, you need
-to specify exact IP addresses here; wildcards and “slash
-notation” do not work.)</p>
-<hr style="height: 1px; width: 50%">
-<div id="Section14" dir="LTR">
-<h4 >General issues with virtual
-machines and networking:</h4>
-<p >For <b>most networking
-scenarios, </b>the tablet must be
-visible <b>to the host</b>. In
-other words, they should be on the same network.</p>
-<p >For <b>SBRSH usage</b>,
- the tablet must be visible <b>to the
-virtual machine</b>. This is because sbrsh runs in the VM
-and the tablet mounts the filesystem from a Scratchbox
-rootstrap.</p>
-<p >In
-general, I have the easiest configuration experience using a WLAN on a network common to
-the host, virtual machine, and device. This requires the <em>Bridged
-Networking </em> configuration in
-VMware or VirtualBox. Unfortunately, this is very slow for debugging too.</p>
-</div>
-<hr style="height: 1px; width: 50%">
-<div id="Section13" dir="LTR">
-<h4 >For USB networking:</h4>
-<p >By default, a USB connection will <b>mount
-</b>the removable storage from the
-tablet into your computer. Use the <em>Connection Switcher</em> toolbar icon
-to change the USB connection into a networking connection.</p>
-<p >Typically the addresses used are
-static: <tt>192.168.2.15 </tt> (for
-the tablet) and <tt>192.168.2.14 </tt> (for
-the host).</p>
-<p >If
-the command-line connection (verified with <tt>ssh</tt>) does not
-work, and the tablet is configured for USB networking, use <tt>sudo
-ifdown usb0; sudo ifup usb0</tt> to
-try to reset. This should fix things.</p>
-<p >In
-VMware, an icon in the toolbar or the <tt>VM > Removable Devices
-> Netchip RNDIS / Ethernet Gadget </tt> menu
-will help you quickly “connect” the tablet to the VM or to
-the host.</p>
-<p>In VirtualBox, use a similar pattern. Connect or disconnect the tablet
-via <em>Devices > USB Devices >
-Nokia N8x0 Internet Table</em> or the corresponding toolbar icon.
-</p>
-<p>QEMU (at this
-writing) does not support USB at all, so you will probably need to use
-WLAN.</p>
-</div>
-<hr style="height: 1px; width: 50%">
-<div id="Section12" dir="LTR">
-<h4 >For wireless networking:</h4>
-<p >The <b>maemo-pc-connectivity</b>
-package will let you configure and use several types of wireless networks
-(WLAN, ad-hoc WLAN, Bluetooth). Refer to that configuration to discover the
-configured IP addresses. For WLAN, the
-tablet will receive a semi-random IP address from the DHCP server.</p>
-<p>In any
-case, you can verify the address and update the corresponding RSE connection like this:</p>
-<ul>
- <li>
- <p >In
- the tablet, run <em>Utilities > X Terminal</em>.</p>
- </li>
- <li>
- <p >Execute <tt>/sbin/ifconfig</tt> to
- see what address is assigned to the <tt>wlan0</tt> (WLAN, ad-hoc WLAN)
- or <tt>bnep0</tt> (Bluetooth) interface.</p>
- </li>
- <li>
- <p >Copy
- this address into the connection (in ESbox UI, right-click the <em>Nokia Internet Tablet (...)</em>
- connection and use <em>Configure...</em>, or edit it via <em>Remote Systems</em> view using
- <em>Properties > Host</em>). </p>
- </li>
-</ul>
-</div>
+<iframe src="http://esbox.garage.maemo.org/2nd_edition/faq.html"
+width="100%" height="100%"
+align="left">
-</div>
-</div>
-</div>
+<a href="http://esbox.garage.maemo.org/2nd_edition/faq.html">Visit the current FAQ online.</a>
+
+</iframe>
+
</body>
</html>
Modified: branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -265,16 +265,28 @@
protected void changeSelectedMachine(String name) {
IBuildMachine machine = machineMap.get(name);
if (machine != null) {
- IComposablePreferencePage page = machineConfigPages.get(machine.getName());
+ final IComposablePreferencePage page = machineConfigPages.get(machine.getName());
if (page.getControl() == null) {
page.setContainer(getContainer());
page.createControl(machineConfigComposite);
}
machineConfigStackLayout.topControl = page.getControl();
selectedMachine = machine;
+
+ // wait a step since field editors on other pages
+ // will clear the message when they lose focus
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ page.revalidate();
+ updateApplyButton();
+ }
+ });
} else {
machineConfigStackLayout.topControl = noMachineConfigUI;
selectedMachine = null;
+ setErrorMessage(null);
+ setMessage(null, INFORMATION);
+ setValid(true);
}
machineConfigComposite.layout();
getShell().layout(true, true);
Modified: branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFoldersPreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFoldersPreferencePage.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/SharedFoldersPreferencePage.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -214,6 +214,13 @@
treeViewer.expandAll();
}
+ /* (non-Javadoc)
+ * @see org.maemo.mica.common.core.machine.IComposablePreferencePage#revalidate()
+ */
+ public void revalidate() {
+ validate();
+ }
+
protected void validate() {
setErrorMessage(null);
setMessage(null, INFORMATION);
Modified: branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm/src/org/maemo/esbox/internal/api/vm/ui/preferences/CommonVirtualMachineSettingsPreferencePage.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -317,7 +317,15 @@
config.setUserPassword(feUserPassword.getStringValue());
config.setTargetAddr(feSshTargetAddr.getPreferenceValue());
config.setHostAddr(feSshHostAddr.getPreferenceValue());
- config.setTargetPort(feSshTargetPort.getIntValue());
- config.setHostPort(feSshHostPort.getIntValue());
+ try {
+ config.setTargetPort(feSshTargetPort.getIntValue());
+ } catch (NumberFormatException e) {
+ config.setTargetPort(22);
+ }
+ try {
+ config.setHostPort(feSshHostPort.getIntValue());
+ } catch (NumberFormatException e) {
+ config.setHostPort(22);
+ }
}
}
Modified: branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxSettingsPreferencePage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxSettingsPreferencePage.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm.virtualbox/src/org/maemo/esbox/internal/vm/virtualbox/VirtualBoxSettingsPreferencePage.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -168,6 +168,7 @@
@Override
public void focusLost(FocusEvent e) {
refreshMachineNameViewer();
+ validate();
}
});
Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/build.properties
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/build.properties 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/build.properties 2009-09-01 18:15:54 UTC (rev 2077)
@@ -6,5 +6,4 @@
conf/,\
about_files/,\
about.html,\
- data/,\
icons/
Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMDescription.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMDescription.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMDescription.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -14,7 +14,7 @@
* @author raulherbster
*
*/
-public class MaemoSDKVMDescription {
+public class MaemoSDKVMDescription implements Comparable<MaemoSDKVMDescription> {
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
@@ -28,7 +28,11 @@
private String name;
+ private String version;
+
private String description;
+
+ private String licenseText;
/**
* Constructor
@@ -38,14 +42,16 @@
* @param description
*/
public MaemoSDKVMDescription(boolean isServerImage, String name,
- String description) {
+ String version, String description, String licenseText) {
this.isServerImage = isServerImage;
this.name = name;
+ this.version = version;
this.description = description;
+ this.licenseText = licenseText;
}
public MaemoSDKVMDescription() {
- this(true,"","");
+ this(true,"","","","");
}
/**
@@ -61,6 +67,13 @@
public String getName() {
return name;
}
+
+ /**
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
/**
* @return the description
@@ -69,5 +82,30 @@
return description;
}
-
+ /**
+ * @return the license of the virtual machine
+ */
+ public String getLicense() {
+ return licenseText;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null)
+ return false;
+ if (obj.getClass() != this.getClass())
+ return false;
+ MaemoSDKVMDescription descriptor = (MaemoSDKVMDescription)obj;
+ return descriptor.getName().equals(this.getName());
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(MaemoSDKVMDescription o) {
+ if (o == null)
+ return 1;
+ return (-1) * (getVersion() + (isServerImage() ? "server" : "desktop")).compareTo(o.getVersion() + (o.isServerImage() ? "server" : "desktop"));
+ }
}
Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMInfo.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMInfo.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMInfo.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -19,7 +19,7 @@
* @author raulherbster
*
*/
-public class MaemoSDKVMInfo {
+public class MaemoSDKVMInfo implements Comparable<MaemoSDKVMInfo> {
public static final String DOWNLOAD_PAGE = "http://tablets-dev.nokia.com/maemo-dev-env-downloads.php";
@@ -226,4 +226,16 @@
public IRunnableWithProgress downloadFile() {
return new DownloadExecution(this);
}
+
+ /*
+ * (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(MaemoSDKVMInfo o) {
+ if (o == null)
+ return 1;
+ return getDescriptor().compareTo(o.getDescriptor());
+ }
+
+
}
Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMInstaller.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMInstaller.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/api/vm/vmware/MaemoSDKVMInstaller.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -28,6 +28,7 @@
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.maemo.esbox.internal.api.maemosdk.ui.preferences.MaemoSDKPreferenceIds;
@@ -47,6 +48,7 @@
import org.maemo.mica.common.core.sdk.SDKManager;
import org.maemo.mica.common.core.ui.IProgressReporter;
import org.maemo.mica.internal.api.common.core.filesystem.FilesystemUtils;
+import org.maemo.mica.internal.api.common.core.sdk.SDKManagerInternal;
import org.maemo.mica.internal.api.linux.packages.core.aptinstall.AptInstallerHelper;
/**
@@ -92,7 +94,7 @@
status = this.uncompressVM(shell, monitor);
if (canProceed(status))
- status = promptPreferencesDialog(shell);
+ status = promptPreferencesDialog(shell, monitor);
if (canProceed(status) && installData.canInstallSbox())
status = this.installScratchbox(shell,monitor);
@@ -225,9 +227,9 @@
if (previousProgressValue < progressValue) {
previousProgressValue = progressValue;
monitor.worked(1);
- if (monitor.isCanceled())
- return;
}
+ if (monitor.isCanceled())
+ break;
monitor.subTask("Uncompressing " + zipEntry
+ "\t\t"
+ String.format(Locale.US, "%.2f", getProgress(lenght,totalRead)) + "%");
@@ -235,7 +237,13 @@
}
fileOutputStream.close();
zipInputStream.closeEntry();
- zipEntry = zipInputStream.getNextEntry();
+
+ if (monitor.isCanceled()) {
+ statuses[0] = Activator.createErrorStatus("Installation was cancelled.", null);
+ return;
+ } else {
+ zipEntry = zipInputStream.getNextEntry();
+ }
}
} catch (IOException ioe) {
@@ -255,10 +263,10 @@
} catch (Exception e) {
statuses[0] = Activator.createErrorStatus("Cannot uncompress Maemo SDK virtual image.", e);
reporter.appendStreamText("Cannot procced with Maemo SDK virtual image uncompressing.",true);
- }
+ }
}
});
-
+
return statuses[0];
}
@@ -324,7 +332,10 @@
* @param shell
* @return
*/
- private IStatus promptPreferencesDialog(final Shell shell) {
+ private IStatus promptPreferencesDialog(final Shell shell, IProgressMonitor monitor) {
+ monitor.subTask("Configuring Maemo SDK virtual image...");
+ reporter.logInfo("Configuring Maemo SDK virtual image...");
+
final IStatus statuses[] = new IStatus[] {Policy.getCancelStatus(Activator.getDefault())};
String vmLocation = configureInitialVMSettings();
@@ -334,24 +345,38 @@
shell.getDisplay().syncExec(new Runnable() {
public void run() {
- PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
- null, /* do not tie to a shell to avoid #4438 */
- MaemoSDKPreferenceIds.BUILD_MACHINE_PREFS_ID,
- new String[] {
- MaemoSDKPreferenceIds.ESBOX_PREFERENCE_CATEGORY_ID,
- MaemoSDKPreferenceIds.BUILD_MACHINE_PREFS_ID,
- },
- null);
- dialog.open();
-
- // check for valid build machine
- if (MachineRegistry.getInstance().getCurrentBuildMachines().length == 0)
- statuses[0] = Activator.createErrorStatus("Virtual image was not properly configured.", null);
- else
- statuses[0] = Activator.createStatus(IStatus.OK, "Virtual image configured.");
+ try {
+ SDKManagerInternal.getInstance().lock();
+
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
+ null, /* do not tie to a shell to avoid #4438 */
+ MaemoSDKPreferenceIds.BUILD_MACHINE_PREFS_ID,
+ new String[] {
+ MaemoSDKPreferenceIds.ESBOX_PREFERENCE_CATEGORY_ID,
+ MaemoSDKPreferenceIds.BUILD_MACHINE_PREFS_ID,
+ },
+ null);
+ int result = dialog.open();
+
+ // user clicked on Cancel
+ if (result == Window.CANCEL) {
+ statuses[0] = Activator.createErrorStatus("Installation was cancelled.", null);
+ return;
+ }
+
+ // check for valid build machine
+ if (MachineRegistry.getInstance().getCurrentBuildMachines().length == 0)
+ statuses[0] = Activator.createErrorStatus("Virtual image was not properly configured.", null);
+ else
+ statuses[0] = Activator.createStatus(IStatus.OK, "Virtual image configured.");
+
+ } finally {
+ SDKManagerInternal.getInstance().unlock();
+ }
}
});
}
+
return statuses[0];
}
Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMConfigurationWizardPage.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -16,6 +16,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -74,11 +75,14 @@
setControl(composite);
mainMessage = new Label(composite, SWT.WRAP);
- updateMainMessage();
+ mainMessage.setText("");
+ GridData labelData = new GridData();
+ labelData.horizontalSpan = 2;
+ labelData.horizontalAlignment = SWT.FILL;
+ Rectangle rect = getShell().getMonitor().getClientArea();
+ labelData.widthHint = rect.width / 4;
+ mainMessage.setLayoutData(labelData);
- GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
- .applyTo(mainMessage);
-
Label separator = new Label(composite, SWT.NONE);
GridDataFactory.swtDefaults().span(1, 1).align(SWT.LEFT, SWT.CENTER)
.applyTo(separator);
@@ -107,8 +111,6 @@
createProgrammingEnvironmentArea(composite);
- setValues();
-
}
/**
@@ -285,30 +287,50 @@
installPythonEnv.getSelection());
installData.setInstallSbox(installScratchbox.getSelection() || installScratchboxTargets.getSelection());
}
-
+
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ setValues();
+ }
+
+ /**
+ * Update main message area.
+ */
private void updateMainMessage() {
- String imageName = ((NewMaemoSDKVMWizard)getWizard()).getInstallData().getFileToDownload().getDescriptor().getName();
- mainMessage.setText("You just selected virtual image ''" + imageName + "'' to be installed on your machine.\n" +
- " Please, select the following options in order to properly configure your Maemo SDK virtual machine");
+ MaemoSDKVMInstallData installData = ((NewMaemoSDKVMWizard)getWizard()).getInstallData();
+ String message = "";
+ if (installData.canUsePreviousInstallation())
+ message = "You just selected a previously downloaded virtual image to be installed on your machine. Default values for virtual images with Ubuntu Server are considered in this case.";
+ else {
+ String imageName = installData.getFileToDownload().getDescriptor().getName();
+ message = "You just selected virtual image ''" + imageName + "'' to be installed on your machine.";
+ }
+ message += " Please, select the following options in order to properly configure your Maemo SDK virtual machine.";
+ mainMessage.setText(message);
+ ((Composite)getControl()).layout();
}
+ /**
+ * Set default values based on virtual image.
+ */
private void setValues() {
- boolean isServer = ((NewMaemoSDKVMWizard)getWizard()).getInstallData().getFileToDownload().getDescriptor().isServerImage();
-
+ MaemoSDKVMInstallData installData = ((NewMaemoSDKVMWizard)getWizard()).getInstallData();
+
+ // if use previous installation, it takes Server default values
+ boolean isServer = true;
+ if (!installData.canUsePreviousInstallation())
+ isServer = ((NewMaemoSDKVMWizard)getWizard()).getInstallData().getFileToDownload().getDescriptor().isServerImage();
+
installEverything.setSelection(isServer);
setInstallationDetailsButtonsSelection(isServer);
setInstallationDetailsGroupEnabled(false);
setProgrammingEnvButtonsSelection(true);
setProgrammignEnvGroupEnabled(false);
+ updateMainMessage();
+
updateInstallData();
}
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- updateMainMessage();
- setValues();
- }
}
Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMInstallerContentLabelProvider.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -125,15 +125,18 @@
* filter duplicated entries, for example, files split into two
* parts.
*/
+ String license = getLicense(content);
+
Pattern maemoVMPattern = Pattern
- .compile("Maemo([\\w\\s]*)Virtual([\\w\\s]*)Image([\\w\\s]*)");
+ .compile("Maemo(\\s)+SDK(\\s)+Virtual(\\s)+Image(\\s)+with(\\s)+Ubuntu(\\s)+(\\w)+(\\s)+([\\d]*\\.[\\d]*)(\\s)+(Server|Desktop)(\\s\\-(Part)\\s\\d)?");
Matcher matcher = maemoVMPattern.matcher(content);
while (matcher.find()) {
String virtualImageName = matcher.group(0);
+ String version = matcher.group(9);
virtualImageName = processVirtualImageName(virtualImageName);
boolean isServer = virtualImageName.toLowerCase().contains("server");
String virtualImageDescription = isServer ? MaemoSDKVMDescription.SERVER_IMAGE_DESCRIPTION : MaemoSDKVMDescription.DESKTOP_IMAGE_DESCRIPTION;
- virtualImagesDescriptors.add(new MaemoSDKVMDescription(isServer,virtualImageName,virtualImageDescription));
+ virtualImagesDescriptors.add(new MaemoSDKVMDescription(isServer,virtualImageName,version,virtualImageDescription,license));
}
} catch (Exception e) {
if (e instanceof InterruptedException)
@@ -162,6 +165,22 @@
return virtualImageName;
return virtualImageName.substring(0, indexOfPar).trim();
}
+
+ /**
+ * Get license from virtual images website.
+ * @param content
+ * @return
+ */
+ private String getLicense(String content) {
+ final String LICENSE_PATTERN = "IMPORTANT:\\s*READ\\s*CAREFULLY\\s*BEFORE\\s*INSTALLING,\\s*DOWNLOADING,\\s*OR\\s*USING\\s*THE\\s*SOFTWARE(.*?)PLEASE\\s*SUBMIT\\s*ANY\\s*ACCOMPANYING\\s*REGISTRATION\\s*FORMS\\s*TO\\s*RECEIVE\\s*REGISTRATION\\s*BENEFITS\\s*WHERE\\s*APPLICABLE";
+ Pattern licensePattern = Pattern.compile(LICENSE_PATTERN,Pattern.DOTALL | Pattern.UNIX_LINES);
+ Matcher matcher = licensePattern.matcher(content);
+ String license = "";
+ while (matcher.find()) {
+ license = matcher.group(0);
+ }
+ return license;
+ }
}
private Image vmImage;
Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMLicenseWizardPage.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -12,13 +12,14 @@
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
+import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMDescription;
import org.maemo.esbox.internal.vm.vmware.Activator;
/**
@@ -29,7 +30,7 @@
*/
public class MaemoSDKVMLicenseWizardPage extends WizardPage {
- private String license;
+ private Browser licenseText;
private boolean licenseTermsAgreed = false;
private boolean ok = false;
@@ -42,12 +43,6 @@
protected MaemoSDKVMLicenseWizardPage(NewMaemoSDKVMWizard wizard) {
super("maemovm_licensepage", "License",
Activator.MAEMO_VM_WIZBAN_DESCRIPTOR);
- try {
- license = Activator.readResourceFile("./data/license.txt");
- } catch (Exception e) {
- Activator.getErrorLogger().logAndShowError(
- "Cannot open license terms file.", e);
- }
setWizard(wizard);
ok = true;
}
@@ -60,70 +55,49 @@
* .Composite)
*/
public void createControl(Composite parent) {
- if (license != null) {
- Composite container = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout(1, false);
- container.setLayout(layout);
- GridData licenseGridData = new GridData(GridData.BEGINNING
- | GridData.FILL_BOTH);
- licenseGridData.widthHint = 500;
- licenseGridData.heightHint = 300;
- Text licenseText = new Text(container, SWT.BORDER | SWT.V_SCROLL
- | SWT.WRAP);
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout(1, false);
+ container.setLayout(layout);
+ GridData licenseGridData = new GridData(GridData.BEGINNING
+ | GridData.FILL_BOTH);
+ licenseGridData.widthHint = 500;
+ licenseGridData.heightHint = 300;
+ licenseText = new Browser(container, SWT.BORDER | SWT.WRAP);
+ licenseText.setLayoutData(licenseGridData);
+ licenseText.setText("");
- StringBuffer licenseTextBuffer = new StringBuffer();
- licenseTextBuffer
- .append("THIS LICENSE COVERS THE FOLLOWING COMPONENTS\n\n");
- // licenseTextBuffer.append(image.getDescription() + "\n");
- // licenseTextBuffer.append(flasher.getDescription() + "\n");
- licenseTextBuffer.append("\n");
+ Button agreeButton = new Button(container, SWT.RADIO);
+ agreeButton.setText("I accept the terms of the license agreements"); //$NON-NLS-1$
+ agreeButton.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent event) {
+ // do nothing
+ }
- licenseTextBuffer.append(license);
- licenseText.setLayoutData(licenseGridData);
- licenseText.setEditable(false);
- // licenseText.setBackground(FlasherUtil.COLOR_WHITE);
+ public void widgetSelected(SelectionEvent event) {
+ licenseTermsAgreed = true;
+ setPageComplete(licenseTermsAgreed);
+ }
+ });
+ Button disagreeButton = new Button(container, SWT.RADIO);
+ disagreeButton
+ .setText("I do not accept the terms of the license agreements"); //$NON-NLS-1$
+ disagreeButton.setSelection(true);
+ disagreeButton.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent event) {
+ // do nothing
+ }
- licenseText.setText(licenseTextBuffer.toString());
- licenseText.setTopIndex(0);
+ public void widgetSelected(SelectionEvent event) {
+ licenseTermsAgreed = false;
+ ((NewMaemoSDKVMWizard) getWizard()).getInstallData()
+ .setLicenseTermsAgreed(licenseTermsAgreed);
+ setPageComplete(licenseTermsAgreed);
+ }
+ });
- Button agreeButton = new Button(container, SWT.RADIO);
- agreeButton.setText("I accept the terms of the license agreements"); //$NON-NLS-1$
- agreeButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent event) {
- licenseTermsAgreed = true;
- setPageComplete(licenseTermsAgreed);
- }
- });
- Button disagreeButton = new Button(container, SWT.RADIO);
- disagreeButton
- .setText("I do not accept the terms of the license agreements"); //$NON-NLS-1$
- disagreeButton.setSelection(true);
- disagreeButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent event) {
- licenseTermsAgreed = false;
- ((NewMaemoSDKVMWizard) getWizard()).getInstallData()
- .setLicenseTermsAgreed(licenseTermsAgreed);
- setPageComplete(licenseTermsAgreed);
- }
- });
-
- setControl(container);
- } else {
- ok = false;
- final String message = "Cannot fetch license terms";
- Activator.getErrorLogger().logAndShowError(message, null); //$NON-NLS-1$
- }
-
+ setControl(container);
}
-
+
/*
* (non-Javadoc)
*
@@ -134,4 +108,17 @@
return ok && licenseTermsAgreed;
}
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+
+ MaemoSDKVMDescription descriptor = ((NewMaemoSDKVMWizard)getWizard()).getInstallData().getFileToDownload().getDescriptor();
+
+ // if an existing Maemo SDK VM is being used, the license of latest VM is used instead.
+ // the text is not HTML-formmated. Then, it is necessary to add necessary HTML tags.
+ licenseText.setText("<html><body><pre>"+descriptor.getLicense()+"</pre></body></html>");
+
+ ((Composite)getControl()).layout();
+ }
+
}
Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/MaemoSDKVMSelectionWizardPage.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -11,6 +11,7 @@
package org.maemo.esbox.internal.vm.vmware.ui.wizards;
import java.io.File;
+import java.util.Arrays;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
@@ -20,10 +21,13 @@
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
@@ -37,12 +41,12 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
-import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMDescription;
import org.maemo.esbox.internal.api.vm.vmware.MaemoSDKVMInfo;
import org.maemo.esbox.internal.vm.vmware.Activator;
import org.maemo.mica.common.core.machine.MachineRegistry;
import org.maemo.mica.common.ui.NetworkSettingsUI;
import org.maemo.mica.common.ui.dialogs.DialogUtils;
+import org.maemo.mica.internal.api.common.ui.LazyLoadingThreadTableContentProvider;
/**
* Page that displays general information about the Maemo SDK virtual image to
@@ -51,18 +55,10 @@
* @author raulherbster
*
*/
-public class MaemoSDKVMSelectionWizardPage extends WizardPage {
+public class MaemoSDKVMSelectionWizardPage extends WizardPage implements ILabelProviderListener {
+
+ private MaemoSDKVMInfo latestVMInstallData;
- private static final MaemoSDKVMInfo latestVMInstallData = getLatestVMInstallFile();
-
- private static MaemoSDKVMInfo getLatestVMInstallFile() {
- MaemoSDKVMDescription descriptor = new MaemoSDKVMDescription(true,
- "Maemo Diablo SDK Virtual Image with Ubuntu Intrepid Server",MaemoSDKVMDescription.SERVER_IMAGE_DESCRIPTION);
- MaemoSDKVMInfo downloadFile = new MaemoSDKVMInfo();
- downloadFile.setDescriptor(descriptor);
- return downloadFile;
- }
-
// Virtual images area
private Button downloadLatest;
private TableViewer virtualImagesTable;
@@ -83,6 +79,23 @@
private Text imageDescription;
/**
+ * Comparator for virtual images table viewer.
+ */
+ private class VirtualImagesComparator extends ViewerComparator {
+
+ public int compare(Viewer iviewer, Object e1, Object e2) {
+ if (e1 == null) {
+ return -1;
+ } else if (e2 == null) {
+ return 1;
+ } else {
+ return ((MaemoSDKVMInfo)e1).getDescriptor().compareTo(((MaemoSDKVMInfo)e2).getDescriptor());
+ }
+ }
+
+ }
+
+ /**
* Constructor.
*
* @param wizard
@@ -94,7 +107,7 @@
setDescription("A virtual image is a disk image with an installation of Linux/x86 " +
"capable of hosting Scratchbox and the Maemo SDK.");
setWizard(wizard);
-
+ setPageComplete(false);
textFieldsValidator = createTextFieldValidatorListener();
}
@@ -127,7 +140,7 @@
column.pack();
}
- validatePage();
+ //validatePage();
}
/**
@@ -178,10 +191,12 @@
});
MaemoSDKVMInstallerContentLabelProvider platformProvider = new MaemoSDKVMInstallerContentLabelProvider();
-
+ platformProvider.addListener(this);
virtualImagesTable.setContentProvider(platformProvider);
virtualImagesTable.setLabelProvider(platformProvider);
+ virtualImagesTable.setComparator(new VirtualImagesComparator());
+
platformProvider.addListener(new ILabelProviderListener() {
public void labelProviderChanged(LabelProviderChangedEvent event) {
@@ -355,18 +370,22 @@
imageDescription = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
imageDescription.setEditable(false);
- GridDataFactory.fillDefaults().grab(true, true).span(4, 1).applyTo(
- imageDescription);
+ GridData labelData = new GridData();
+ labelData.horizontalSpan = 4;
+ labelData.horizontalAlignment = SWT.FILL;
+ labelData.verticalSpan = 2;
+ labelData.verticalAlignment = SWT.FILL;
+ Rectangle rect = getShell().getMonitor().getClientArea();
+ labelData.widthHint = rect.width / 4;
+ imageDescription.setLayoutData(labelData);
}
private void setInitialValues() {
downloadLatest.setSelection(true);
usePreviousDownloadButton.setSelection(false);
- destinationTextField.setText(MachineRegistry.getInstance().getLocalMachine().getUserHome().toString());
+ destinationTextField.setText(MachineRegistry.getInstance().getLocalMachine().getUserHome().toOSString());
existingVirtualImageTextField.setText("");
- // set latest maemo SDK VM
- doChangeVMChoice(latestVMInstallData);
}
/**
@@ -477,6 +496,10 @@
getShell().pack();
}
+ /**
+ * Create validator for text fields.
+ * @return
+ */
protected Listener createTextFieldValidatorListener(){
return new Listener() {
public void handleEvent(Event event) {
@@ -484,5 +507,31 @@
}
};
}
+
+ /**
+ * Method to receive notification that information about images on website was properly retrieved. Based on
+ * that, it
+ */
+ public void labelProviderChanged(LabelProviderChangedEvent event) {
+ if (event.getClass() == LabelProviderChangedEvent.class) {
+ latestVMInstallData = getLatestVMInstallData(event);
+ doChangeVMChoice(latestVMInstallData);
+ setPageComplete(true);
+ validatePage();
+ ((Composite)getControl()).layout();
+ }
+ }
+
+ /**
+ * Get latest Maemo SDK VM from website.
+ * @param event the event to get resource.
+ * @return the latest Maemo SDK VM.
+ */
+ private MaemoSDKVMInfo getLatestVMInstallData(LabelProviderChangedEvent event) {
+ LazyLoadingThreadTableContentProvider provider = (LazyLoadingThreadTableContentProvider)event.getSource();
+ Object[] elements = provider.getElements(new Object[0]);
+ Arrays.sort(elements);
+ return (MaemoSDKVMInfo) elements[0];
+ }
}
Modified: branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java
===================================================================
--- branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java 2009-09-01 18:04:26 UTC (rev 2076)
+++ branches/work_Fabricio/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/ui/wizards/NewMaemoSDKVMWizard.java 2009-09-01 18:15:54 UTC (rev 2077)
@@ -17,6 +17,7 @@
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
More information about the Esbox-commits
mailing list