[Esbox-commits] r2084 - in branches/work_Raul: 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 org.maemo.esbox.scratchbox.sb1 org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core
raul at garage.maemo.org
raul at garage.maemo.org
Wed Sep 2 00:02:47 EEST 2009
Author: raul
Date: 2009-09-02 00:02:45 +0300 (Wed, 02 Sep 2009)
New Revision: 2084
Added:
branches/work_Raul/org.maemo.esbox.help/html/gettingstarted/HowToDownloadHelpDocumentation.html
branches/work_Raul/org.maemo.esbox.help/html/images/maemo-help-install.png
branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/ApplyDoctoolsFixMarkerResolutionGenerator.java
Modified:
branches/work_Raul/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ConvertCppProjectMarkerResolutionGenerator.java
branches/work_Raul/org.maemo.esbox.help/html/images/hover-maemo-prefs.png
branches/work_Raul/org.maemo.esbox.help/html/tocgettingstarted.html
branches/work_Raul/org.maemo.esbox.help/tocgettingstarted.xml
branches/work_Raul/org.maemo.esbox.scratchbox.sb1/plugin.xml
Log:
Merge revs 2059:2083 from trunk
Modified: branches/work_Raul/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ConvertCppProjectMarkerResolutionGenerator.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ConvertCppProjectMarkerResolutionGenerator.java 2009-09-01 19:32:05 UTC (rev 2083)
+++ branches/work_Raul/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/ConvertCppProjectMarkerResolutionGenerator.java 2009-09-01 21:02:45 UTC (rev 2084)
@@ -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
*
*/
Copied: branches/work_Raul/org.maemo.esbox.help/html/gettingstarted/HowToDownloadHelpDocumentation.html (from rev 2083, trunk/org.maemo.esbox.help/html/gettingstarted/HowToDownloadHelpDocumentation.html)
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/html/gettingstarted/HowToDownloadHelpDocumentation.html (rev 0)
+++ branches/work_Raul/org.maemo.esbox.help/html/gettingstarted/HowToDownloadHelpDocumentation.html 2009-09-01 21:02:45 UTC (rev 2084)
@@ -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: branches/work_Raul/org.maemo.esbox.help/html/images/hover-maemo-prefs.png
===================================================================
(Binary files differ)
Copied: branches/work_Raul/org.maemo.esbox.help/html/images/maemo-help-install.png (from rev 2083, trunk/org.maemo.esbox.help/html/images/maemo-help-install.png)
===================================================================
(Binary files differ)
Modified: branches/work_Raul/org.maemo.esbox.help/html/tocgettingstarted.html
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/html/tocgettingstarted.html 2009-09-01 19:32:05 UTC (rev 2083)
+++ branches/work_Raul/org.maemo.esbox.help/html/tocgettingstarted.html 2009-09-01 21:02:45 UTC (rev 2084)
@@ -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: branches/work_Raul/org.maemo.esbox.help/tocgettingstarted.xml
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/tocgettingstarted.xml 2009-09-01 19:32:05 UTC (rev 2083)
+++ branches/work_Raul/org.maemo.esbox.help/tocgettingstarted.xml 2009-09-01 21:02:45 UTC (rev 2084)
@@ -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>
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.sb1/plugin.xml
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.sb1/plugin.xml 2009-09-01 19:32:05 UTC (rev 2083)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.sb1/plugin.xml 2009-09-01 21:02:45 UTC (rev 2084)
@@ -114,5 +114,13 @@
class="org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1PackageManagerProvider">
</packageManagerProvider>
</extension>
-
+
+ <extension
+ point="org.eclipse.ui.ide.markerResolution">
+ <markerResolutionGenerator
+ class="org.maemo.esbox.internal.scratchbox.sb1.core.ApplyDoctoolsFixMarkerResolutionGenerator"
+ markerType="org.maemo.mica.cpp.project.builder.autotools.autotoolsProblemMarker">
+ </markerResolutionGenerator>
+ </extension>
+
</plugin>
Copied: branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/ApplyDoctoolsFixMarkerResolutionGenerator.java (from rev 2083, trunk/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/ApplyDoctoolsFixMarkerResolutionGenerator.java)
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/ApplyDoctoolsFixMarkerResolutionGenerator.java (rev 0)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/ApplyDoctoolsFixMarkerResolutionGenerator.java 2009-09-01 21:02:45 UTC (rev 2084)
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.scratchbox.sb1.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.scratchbox.sb1.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.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 {
+ 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()
+ };
+ }
+
+
+
+}
More information about the Esbox-commits
mailing list