Merged to both eclipse-poky-kepler and eclipse-poky-juno master.

Thanks,
Jessica

-----Original Message-----
From: yocto-boun...@yoctoproject.org [mailto:yocto-boun...@yoctoproject.org]
On Behalf Of Atanas Gegov
Sent: Friday, September 13, 2013 4:40 AM
To: yocto@yoctoproject.org
Subject: [yocto] [eclipse-poky][PATCH] plugins/cmake: Added warning dialog
on missing cmake

From: Atanas Gegov <atanas.ge...@bmw-carit.de>

If the system is not able to run the command "cmake", the user is prompted
with a MessageDialog to check the correctness of the cmake installation.
---
Hi,

this patch creates a MessageDialog to warn the user when the system was not
able to run "cmake". This happens if cmake is not installed on the build
machine (where the IDE itself is running).

Cheers,
Atanas

P.S: This patch applies on the current eclipse-poky master.

 .../managedbuilder/YoctoCMakeMessages.properties   |    2 ++
 .../managedbuilder/job/ExecuteConfigureJob.java    |   20
+++++++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/
YoctoCMakeMessages.properties
b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/
YoctoCMakeMessages.properties
index 82a5c79..55773ac 100644
---
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/
YoctoCMakeMessages.properties
+++ b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managed
+++ builder/YoctoCMakeMessages.properties
@@ -16,6 +16,8 @@ ExecuteConfigureJob.buildingMakefile=Building Makefile
ExecuteConfigureJob.warning.aborted=Build of project has been aborted
ExecuteConfigureJob.error.couldNotStart=Build of project could not be
started  ExecuteConfigureJob.error.buildFailed=Build of project failed
+ExecuteConfigureJob.cmakeWarning.dialogTitle=Unable to run command "cmake"
+ExecuteConfigureJob.cmakeWarning.dialogMessage=Please make sure that cmake
is installed properly on this machine.
 
 # File generator
 YoctoCMakeMakefileGenerator.configureJob.name=Configuring project diff
--git
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/
job/ExecuteConfigureJob.java
b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/
job/ExecuteConfigureJob.java
index 347843e..354d930 100644
---
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/
job/ExecuteConfigureJob.java
+++ b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managed
+++ builder/job/ExecuteConfigureJob.java
@@ -32,6 +32,8 @@ 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.MessageDialog;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.console.IOConsoleOutputStream;
 import org.yocto.cmake.managedbuilder.Activator;
 import org.yocto.cmake.managedbuilder.YoctoCMakeMessages;
@@ -126,9 +128,21 @@ public class ExecuteConfigureJob extends Job {
                try {
                        return buildProject(monitor, cos);
                } catch (IOException e) {
-                       return new Status(Status.ERROR,
-                                       Activator.PLUGIN_ID, Status.OK,
-
YoctoCMakeMessages.getString("ExecuteConfigureJob.error.couldNotStart"), e);
//$NON-NLS-1$
+                       if(e.getMessage().startsWith("Cannot run program
\"cmake\"")) { //$NON-NLS-1$
+                               Display.getDefault().asyncExec(new
Runnable() {
+                                       @Override
+                                       public void run() {
+
MessageDialog.openWarning(null,
+
YoctoCMakeMessages.getString("ExecuteConfigureJob.cmakeWarning.dialogTitle")
, //$NON-NLS-1$
+
YoctoCMakeMessages.getString("ExecuteConfigureJob.cmakeWarning.dialogMessage
")); //$NON-NLS-1$
+                                       }
+                               });
+                               return Status.OK_STATUS;
+                       } else {
+                               return new Status(Status.ERROR,
+                                               Activator.PLUGIN_ID,
Status.OK,
+
YoctoCMakeMessages.getString("ExecuteConfigureJob.error.couldNotStart"), e);
//$NON-NLS-1$   
+                       }
                } catch (InterruptedException e) {
                        return new Status(Status.WARNING,
                                        Activator.PLUGIN_ID,
--
1.7.9.5

_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to