[Esbox-commits] r2080 - in trunk: 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 org.maemo.esbox.help/html org.maemo.esbox.help/html/gettingstarted org.maemo.esbox.help/html/images
fabricioepa at garage.maemo.org
fabricioepa at garage.maemo.org
Tue Sep 1 21:54:08 EEST 2009
Author: fabricioepa
Date: 2009-09-01 21:54:07 +0300 (Tue, 01 Sep 2009)
New Revision: 2080
Added:
trunk/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java
trunk/org.maemo.esbox.help/html/gettingstarted/HowToDownloadHelpDocumentation.html
trunk/org.maemo.esbox.help/html/images/maemo-help-install.png
Modified:
trunk/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF
trunk/org.maemo.esbox.cpp.project/plugin.xml
trunk/org.maemo.esbox.help/html/images/hover-maemo-prefs.png
trunk/org.maemo.esbox.help/html/tocgettingstarted.html
trunk/org.maemo.esbox.help/tocgettingstarted.xml
Log:
Merge rev 2077 from work_Fabricio
Modified: trunk/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF 2009-09-01 18:31:38 UTC (rev 2079)
+++ trunk/org.maemo.esbox.cpp.project/META-INF/MANIFEST.MF 2009-09-01 18:54:07 UTC (rev 2080)
@@ -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: trunk/org.maemo.esbox.cpp.project/plugin.xml
===================================================================
--- trunk/org.maemo.esbox.cpp.project/plugin.xml 2009-09-01 18:31:38 UTC (rev 2079)
+++ trunk/org.maemo.esbox.cpp.project/plugin.xml 2009-09-01 18:54:07 UTC (rev 2080)
@@ -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: trunk/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java (from rev 2077, branches/work_Fabricio/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java)
===================================================================
--- trunk/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java (rev 0)
+++ trunk/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ApplyDoctoolsFixMarkerResolutionGenerator.java 2009-09-01 18:54:07 UTC (rev 2080)
@@ -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()
+ };
+ }
+
+
+
+}
Copied: trunk/org.maemo.esbox.help/html/gettingstarted/HowToDownloadHelpDocumentation.html (from rev 2077, branches/work_Fabricio/org.maemo.esbox.help/html/gettingstarted/HowToDownloadHelpDocumentation.html)
===================================================================
--- trunk/org.maemo.esbox.help/html/gettingstarted/HowToDownloadHelpDocumentation.html (rev 0)
+++ trunk/org.maemo.esbox.help/html/gettingstarted/HowToDownloadHelpDocumentation.html 2009-09-01 18:54:07 UTC (rev 2080)
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html lang="en">
+<head>
+ <meta name="copyright" 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 http-equiv="Content-Language" content="en-us">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>How to Download and Install Help Documentation</title>
+ <link rel="stylesheet" type="text/css" href="../help.css">
+ <style type="text/css">
+
+ <!--
+ .style1 {font-weight: bold}
+ -->
+ </style>
+</head>
+
+<body>
+ <h2 class="style1">How to Download and Install Help Documentation</h2>
+
+ <p>
+ The Help documentation is avaible as Eclipse features on Mica Update site, so open <strong>Help > Software Update </strong> page
+ and add the site url (<a href="http://mica.garage.maemo.org/update/help/" >http://mica.garage.maemo.org/update/help/</a>). Thus, you can navigate and select which documentations you want to install.
+ Notice that If you install API Reference features, the hover help on Editor will automatically use them.
+ <p><img src="../images/maemo-help-install.png" alt="Maemo Help Installation"> </p>
+ You can also click <strong>Automatic Updates</strong> and enable it. Thus, you will be noticed every time a Maemo Documentation needs to be updated. <br>
+
+
+<h3>Related Topics</h3>
+<ul>
+ <li><a href="UsingHoverHelp.html">Using Hover Help</a></li>
+</ul>
+</body>
+</html>
Modified: trunk/org.maemo.esbox.help/html/images/hover-maemo-prefs.png
===================================================================
(Binary files differ)
Copied: trunk/org.maemo.esbox.help/html/images/maemo-help-install.png (from rev 2077, branches/work_Fabricio/org.maemo.esbox.help/html/images/maemo-help-install.png)
===================================================================
(Binary files differ)
Modified: trunk/org.maemo.esbox.help/html/tocgettingstarted.html
===================================================================
--- trunk/org.maemo.esbox.help/html/tocgettingstarted.html 2009-09-01 18:31:38 UTC (rev 2079)
+++ trunk/org.maemo.esbox.help/html/tocgettingstarted.html 2009-09-01 18:54:07 UTC (rev 2080)
@@ -36,7 +36,8 @@
</h3><li><h3><a href="../html/gettingstarted/RunningPythonMaemoProject.html">Running Python Maemo Project</a>
</h3><li><h3><a href="../html/gettingstarted/DebuggingCMaemoProject.html">Debugging a C/C++ Maemo Project</a>
</h3><li><h3><a href="../html/gettingstarted/DebuggingPythonMaemoProject.html">Debugging a Python Maemo Project</a>
-</h3><li><h3><a href="../html/gettingstarted/UsingHoverHelp.html">Using Hover Help for Maemo API Libraries</a>
+</h3><li><h3><a href="../html/gettingstarted/UsingHoverHelp.html">Using Hover Help for Maemo API Libraries</a>
+</h3><li><h3><a href="../html/gettingstarted/HowToDownloadHelpDocumentation.html">How to Download and Install Help Documentation</a>
</h3></ul>
Modified: trunk/org.maemo.esbox.help/tocgettingstarted.xml
===================================================================
--- trunk/org.maemo.esbox.help/tocgettingstarted.xml 2009-09-01 18:31:38 UTC (rev 2079)
+++ trunk/org.maemo.esbox.help/tocgettingstarted.xml 2009-09-01 18:54:07 UTC (rev 2080)
@@ -27,5 +27,6 @@
<topic label="Debugging a C/C++ Maemo Project" href="html/gettingstarted/DebuggingCMaemoProject.html" />
<topic label="Debugging a Python Maemo Project" href="html/gettingstarted/DebuggingPythonMaemoProject.html" />
<topic label="Using Hover Help for Maemo API Libraries" href="html/gettingstarted/UsingHoverHelp.html" />
+ <topic label="How to Download and Install Help Documentation" href="html/gettingstarted/HowToDownloadHelpDocumentation.html" />
</toc>
More information about the Esbox-commits
mailing list