[yocto] [eclipse][PATCH] plugins/cmake: Add sysroot specific include paths

2014-05-22 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

CDT sets default include paths when a defined toolchain does not provide
include paths of its own. The default include paths point to the host
system which does not make sense for cross compiled projects.

Instead of using the default include paths we provide our own path that
points to the usr/include folder in the defined sysroot. Once this
custom include path is defined CDT does not add any additional include
paths.

[BUGFIX #5544]

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.cmake.managedbuilder/plugin.xml | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/plugins/org.yocto.cmake.managedbuilder/plugin.xml 
b/plugins/org.yocto.cmake.managedbuilder/plugin.xml
index 7aa6671..431de6e 100644
--- a/plugins/org.yocto.cmake.managedbuilder/plugin.xml
+++ b/plugins/org.yocto.cmake.managedbuilder/plugin.xml
@@ -178,9 +178,10 @@
 name=%config.debug.name
 parent=cdt.managedbuild.config.gnu.base
 toolChain
-id=org.yocto.cmake.managedbuilder.toolchain.gnu.exe.debug
-
superClass=org.yocto.cmake.managedbuilder.toolchain.gnu.exe
-supportsManagedBuild=true
+  
id=org.yocto.cmake.managedbuilder.toolchain.gnu.exe.debug
+  
languageSettingsProviders=org.yocto.cmake.managedbuilder.includeProvider
+  
superClass=org.yocto.cmake.managedbuilder.toolchain.gnu.exe
+  supportsManagedBuild=true
 targetPlatform
 
id=org.yocto.cmake.managedbuilder.target.gnu.exe.debug
 isAbstract=false
@@ -280,4 +281,16 @@
 projectType=org.yocto.sdk.ide.buildArtefact.cmake.exe
 /template
 /extension
+extension
+  point=org.eclipse.cdt.core.LanguageSettingsProvider
+   provider
+ id=org.yocto.cmake.managedbuilder.includeProvider
+ name=IncludeProvider
+ prefer-non-shared=false
+  entry
+kind=includePath
+name=${Sysroot}/usr/include
+  /entry
+   /provider
+/extension
 /plugin
-- 
1.9.0

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


[yocto] [eclipse][PATCH 0/4] Add cmake error to build failure dialog

2014-05-22 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Hi,

when problems occured during configuring the project with CMake we
showed a messge dialog with a generic 'build failed' method. In
parallel the reason for the error was captured in the configuration
console. But as the dialog did not contain any note on the existence
of this console the user might end up with no hint on what went wrong
and how he can fix it.

To help the user fix syntax errors or other errors with CMake the
error is captured and added to the message dialog. While complete
CMake log is still available in the configuration console, the dialog
now contains all information on what went wrong, e.g.
CMake Error at CMakeLists.txt:8 (include_directoriesBOGUS):
  Unknown CMake command include_directoriesBOGUS.

01..03: Enable logging the stderr from CMake to a console while
capturing it in a string
04: Add the reported CMake error to the configuration error dialog

Best regards,
Timo

Timo Mueller (4):
  plugins/cmake: Allow multiple targets when logging process output
  plugins/cmake: Enable separate capturing of cmake stderr
  plugins/cmake: Use generic output stream
  plugins/cmake: Add cmake error message to error dialog

 .../managedbuilder/YoctoCMakeMessages.properties   |  2 +-
 .../managedbuilder/job/ExecuteConfigureJob.java| 12 +---
 .../cmake/managedbuilder/util/SystemProcess.java   | 34 ++
 3 files changed, 38 insertions(+), 10 deletions(-)

-- 
1.9.0

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


[yocto] [eclipse][PATCH 2/4] plugins/cmake: Enable separate capturing of cmake stderr

2014-05-22 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The error reported by CMake was logged to the console but not used in
any error dialog shown to the user so far.

By capturing the error in a separate stream we can use it when reproting
the error to the user.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../cmake/managedbuilder/util/SystemProcess.java   | 24 +-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git 
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/util/SystemProcess.java
 
b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/util/SystemProcess.java
index 764a1f6..9fe0ce1 100644
--- 
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/util/SystemProcess.java
+++ 
b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/util/SystemProcess.java
@@ -24,6 +24,7 @@ public class SystemProcess {
private ProcessBuilder builder;
private Process process;
private StreamPipe outputRedirector;
+   private StreamPipe errorRedirector;
 
public SystemProcess(LinkedListString command) {
this(command, null);
@@ -47,7 +48,6 @@ public class SystemProcess {
if (workingDirectory != null) {
builder.directory(workingDirectory);
}
-   builder.redirectErrorStream(true);
 
if(additionalEnvironmentVariables != null  
!additionalEnvironmentVariables.isEmpty()) {

builder.environment().putAll(additionalEnvironmentVariables);
@@ -56,11 +56,21 @@ public class SystemProcess {
 
public void start(OutputStream out) throws IOException {
if (builder != null) {
+   builder.redirectErrorStream(true);
process = builder.start();
outputRedirector = redirectOutput(process, out);
}
}
 
+   public void start(OutputStream out, OutputStream err) throws 
IOException {
+   if (builder != null) {
+   builder.redirectErrorStream(false);
+   process = builder.start();
+   outputRedirector = redirectOutput(process, out);
+   errorRedirector = redirectError(process, err, out);
+   }
+   }
+
public int waitForResultAndStop() throws InterruptedException {
if (process == null) {
return -1;
@@ -69,6 +79,10 @@ public class SystemProcess {
process.waitFor();
outputRedirector.interrupt();
 
+   if (!builder.redirectErrorStream()) {
+   errorRedirector.interrupt();
+   }
+
return process.exitValue();
}
 
@@ -76,6 +90,14 @@ public class SystemProcess {
process.destroy();
}
 
+   private StreamPipe redirectError(Process process, OutputStream errOut, 
OutputStream out) {
+   InputStream err = process.getErrorStream();
+   StreamPipe stderrPipe = new StreamPipe(err, errOut, out);
+   stderrPipe.start();
+
+   return stderrPipe;
+   }
+
private StreamPipe redirectOutput(Process process, OutputStream out) {
InputStream in = process.getInputStream();
StreamPipe stdoutPipe = new StreamPipe(in, out);
-- 
1.9.0

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


[yocto] [eclipse][PATCH 1/2] plugins/cmake: Refactor creation of CMAKE_FIND_ROOT_PATH

2014-05-22 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Adding new environment variables to the list of variables that
contribute to the the CMAKE_FIND_ROOT_PATH involved manually appending
to the value string and also adding a whitespace to separate values.

The construction of the CMAKE_FIND_ROOT_PATH value is extracted to a
separate method, which expects a list of environment variables. Adding
or removing environment variables that contribute to the path is now
achieved by modifying the entries of the list.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../YoctoCMakeMakefileGenerator.java   | 35 ++
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git 
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/YoctoCMakeMakefileGenerator.java
 
b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/YoctoCMakeMakefileGenerator.java
index b77ae9e..4119aaf 100644
--- 
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/YoctoCMakeMakefileGenerator.java
+++ 
b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/YoctoCMakeMakefileGenerator.java
@@ -12,6 +12,8 @@ package org.yocto.cmake.managedbuilder;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
+import java.util.Arrays;
+import java.util.List;
 
 import org.eclipse.cdt.managedbuilder.core.IBuilder;
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
@@ -226,18 +228,13 @@ public class YoctoCMakeMakefileGenerator implements 
IManagedBuilderMakefileGener
toolchainCMakeFileContentAsString += # only search in the 
paths provided so cmake doesnt pick\n; //$NON-NLS-1$
toolchainCMakeFileContentAsString += # up libraries and tools 
from the native build machine\n; //$NON-NLS-1$
 
-   String findRootPathValue = YoctoSDKUtils.getEnvValue(project, 
STAGING_DIR_HOST); //$NON-NLS-1$
-   findRootPathValue +=  ; //$NON-NLS-1$
-   findRootPathValue += YoctoSDKUtils.getEnvValue(project, 
STAGING_DIR_NATIVE); //$NON-NLS-1$
-   findRootPathValue +=  ; //$NON-NLS-1$
-   findRootPathValue += YoctoSDKUtils.getEnvValue(project, 
CROSS_DIR); //$NON-NLS-1$
-   findRootPathValue +=  ; //$NON-NLS-1$
-   findRootPathValue += YoctoSDKUtils.getEnvValue(project, 
OECMAKE_PERLNATIVE_DIR); //$NON-NLS-1$
-   findRootPathValue +=  ; //$NON-NLS-1$
-   findRootPathValue += YoctoSDKUtils.getEnvValue(project, 
OECMAKE_EXTRA_ROOT_PATH); //$NON-NLS-1$
-   findRootPathValue +=  ; //$NON-NLS-1$
-   findRootPathValue += YoctoSDKUtils.getEnvValue(project, 
EXTERNAL_TOOLCHAIN); //$NON-NLS-1$
-   toolchainCMakeFileContentAsString += 
createCMakeSetStatement(CMAKE_FIND_ROOT_PATH, findRootPathValue, null); 
//$NON-NLS-1$
+   ListString findRootPathValues = 
Arrays.asList(STAGING_DIR_HOST, //$NON-NLS-1$
+   
STAGING_DIR_NATIVE, //$NON-NLS-1$
+   
CROSS_DIR, //$NON-NLS-1$
+   
OECMAKE_PERLNATIVE_DIR, //$NON-NLS-1$
+   
OECMAKE_EXTRA_ROOT_PATH, //$NON-NLS-1$
+   
EXTERNAL_TOOLCHAIN); //$NON-NLS-1$
+   toolchainCMakeFileContentAsString += 
createCMakeSetStatement(CMAKE_FIND_ROOT_PATH, 
getFindRootPath(findRootPathValues), null); //$NON-NLS-1$
 
toolchainCMakeFileContentAsString += 
createCMakeSetStatement(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM, ONLY, null); 
//$NON-NLS-1$ //$NON-NLS-2$
toolchainCMakeFileContentAsString += 
createCMakeSetStatement(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY, ONLY, null); 
//$NON-NLS-1$ //$NON-NLS-2$
@@ -278,4 +275,18 @@ public class YoctoCMakeMakefileGenerator implements 
IManagedBuilderMakefileGener
e.printStackTrace();
}
}
+
+   private String getFindRootPath(ListString values) {
+   String findRootPath = ;
+
+   for (String value : values) {
+   String pathValue = YoctoSDKUtils.getEnvValue(project, 
value);
+
+   if (pathValue.length()  0) {
+   findRootPath += pathValue +  ;
+   }
+   }
+
+   return findRootPath;
+   }
 }
-- 
1.9.0

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


[yocto] [eclipse][PATCH 0/2] Add oecore sysroot variable to CMAKE_FIND_ROOT_PATH

2014-05-22 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Hi,

we were not considering the oecore sysroot variables provided by the
environment script when constructing the CMAKE_FIND_ROOT_PATH in the
toolchain cmake. As the other used variables do not necessarily
contain values the CMAKE_FIND_ROOT_PATH can be empty. This can lead to
issues when searching paths or libraries with CMake.

By using the oecore sysroot variables we make sure, that the
CMAKE_FIND_ROOT_PATH contains sane values and all the find methods of
CMake are at least searching the provided sysroot.

01: Refactors the CMAKE_ROOT_PATH construction to ease the future
addition or removal of variables
02: Adds the oecore sysroot varaibles

Best regards,
Timo

Timo Mueller (2):
  plugins/cmake: Refactor creation of CMAKE_FIND_ROOT_PATH
  plugins/cmake: Add oecore sysroot variables to CMAKE_FIND_ROOT_PATH

 .../YoctoCMakeMakefileGenerator.java   | 37 +++---
 1 file changed, 25 insertions(+), 12 deletions(-)

-- 
1.9.0

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


[yocto] [eclipse][PATCH 2/2] plugins/cmake: Add oecore sysroot variables to CMAKE_FIND_ROOT_PATH

2014-05-22 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The sysroots provided by the toolchain were not added to the
CMAKE_FIND_ROOT_PATH variable. This resolved into CMake searching on the
host system breaking cross-compilation in some cases.

With the addition of the sysroot environment variables provided by
oecore, we make sure that these sysroots are scanned when CMake is
conducting searches.

[BUGFIX #6314]

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org/yocto/cmake/managedbuilder/YoctoCMakeMakefileGenerator.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/YoctoCMakeMakefileGenerator.java
 
b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/YoctoCMakeMakefileGenerator.java
index 4119aaf..cac6b84 100644
--- 
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/YoctoCMakeMakefileGenerator.java
+++ 
b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/YoctoCMakeMakefileGenerator.java
@@ -228,7 +228,9 @@ public class YoctoCMakeMakefileGenerator implements 
IManagedBuilderMakefileGener
toolchainCMakeFileContentAsString += # only search in the 
paths provided so cmake doesnt pick\n; //$NON-NLS-1$
toolchainCMakeFileContentAsString += # up libraries and tools 
from the native build machine\n; //$NON-NLS-1$
 
-   ListString findRootPathValues = 
Arrays.asList(STAGING_DIR_HOST, //$NON-NLS-1$
+   ListString findRootPathValues = 
Arrays.asList(OECORE_NATIVE_SYSROOT, //$NON-NLS-1$
+   
OECORE_TARGET_SYSROOT, //$NON-NLS-1$
+   
STAGING_DIR_HOST, //$NON-NLS-1$

STAGING_DIR_NATIVE, //$NON-NLS-1$

CROSS_DIR, //$NON-NLS-1$

OECMAKE_PERLNATIVE_DIR, //$NON-NLS-1$
-- 
1.9.0

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


[yocto] [eclipse][PATCH 3/4] plugins/cmake: Use generic output stream

2014-05-22 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

This enables logging the process output to something other than a
eclipse console. e.g. a log file or string that can be reused for
dialogs and messages.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/cmake/managedbuilder/job/ExecuteConfigureJob.java| 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 354d930..f90a2d7 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/managedbuilder/job/ExecuteConfigureJob.java
@@ -11,6 +11,7 @@
 package org.yocto.cmake.managedbuilder.job;
 
 import java.io.IOException;
+import java.io.OutputStream;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.LinkedList;
@@ -157,7 +158,7 @@ public class ExecuteConfigureJob extends Job {
}
 
private IStatus buildProject(IProgressMonitor monitor,
-   IOConsoleOutputStream cos) throws IOException, 
InterruptedException {
+   OutputStream cos) throws IOException, 
InterruptedException {
monitor.subTask(

YoctoCMakeMessages.getString(ExecuteConfigureJob.buildingMakefile)); 
//$NON-NLS-1$
configureProcess.start(cos);
-- 
1.9.0

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


[yocto] [eclipse][PATCH 1/4] plugins/cmake: Allow multiple targets when logging process output

2014-05-22 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Until now the stream pipe was connecting one input stream with one
output stream. This for example allowed showing the output of a process
in an eclipse console. If the output is required elsewhere, e.g. in a
message dialog, the only possiblity was to read out the whole console
afterwards.

The stream pipe is extended so that we can now write the process output
to multiple target while the process is running, e.g. a eclipse console
and a byte stream.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/cmake/managedbuilder/util/SystemProcess.java | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/util/SystemProcess.java
 
b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/util/SystemProcess.java
index 9ca6e60..764a1f6 100644
--- 
a/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/util/SystemProcess.java
+++ 
b/plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/util/SystemProcess.java
@@ -87,12 +87,12 @@ public class SystemProcess {
 
private class StreamPipe extends Thread {
private InputStream in;
-   private OutputStream out;
+   private OutputStream[] outputs;
boolean shutdown = false;
 
-   public StreamPipe(InputStream in, OutputStream out) {
+   public StreamPipe(InputStream in, OutputStream... outputs) {
this.in = in;
-   this.out = out;
+   this.outputs = outputs;
}
 
@Override
@@ -102,7 +102,9 @@ public class SystemProcess {
 
try {
while(!shutdown  ((length = in.read(buffer)) 
 -1)) {
-   out.write(buffer, 0, length);
+   for (OutputStream out : outputs) {
+   out.write(buffer, 0, length);
+   }
}
} catch (IOException e) {
e.printStackTrace();
-- 
1.9.0

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


[yocto] [eclipse][PATCH 4/4] plugins/cmake: Add cmake error message to error dialog

2014-05-22 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

In case cmake reported an error during project configuration the
resulting error dialog showed a generic 'build failed' message. The
specific error message which can help the user find the problem was
hidden in cmake console.

Along with logging the cmake error to the configure console it is now also
captured and added to the error dialog.

[BUGFIX #6313]

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../yocto/cmake/managedbuilder/YoctoCMakeMessages.properties  |  2 +-
 .../yocto/cmake/managedbuilder/job/ExecuteConfigureJob.java   | 11 +++
 2 files changed, 8 insertions(+), 5 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 55773ac..651ace5 100644
--- 
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
@@ -15,7 +15,7 @@ ExecuteConfigureJob.consoleName=Configure using CMake [{0}]
 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.error.buildFailed=Build of project failed with the 
following error:\n{0}
 ExecuteConfigureJob.cmakeWarning.dialogTitle=Unable to run command cmake
 ExecuteConfigureJob.cmakeWarning.dialogMessage=Please make sure that cmake is 
installed properly on this machine.
 
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 f90a2d7..84e8c62 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/managedbuilder/job/ExecuteConfigureJob.java
@@ -10,6 +10,7 @@
  
***/
 package org.yocto.cmake.managedbuilder.job;
 
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.Arrays;
@@ -124,10 +125,11 @@ public class ExecuteConfigureJob extends Job {
IOConsoleOutputStream cos =

ConsoleUtility.getConsoleOutput(YoctoCMakeMessages.getFormattedString(ExecuteConfigureJob.consoleName,
 //$NON-NLS-1$
project.getName()));
+   ByteArrayOutputStream ces = new ByteArrayOutputStream();
monitor.worked(1);
 
try {
-   return buildProject(monitor, cos);
+   return buildProject(monitor, cos, ces);
} catch (IOException e) {
if(e.getMessage().startsWith(Cannot run program 
\cmake\)) { //$NON-NLS-1$
Display.getDefault().asyncExec(new Runnable() {
@@ -158,16 +160,17 @@ public class ExecuteConfigureJob extends Job {
}
 
private IStatus buildProject(IProgressMonitor monitor,
-   OutputStream cos) throws IOException, 
InterruptedException {
+   OutputStream stdout, OutputStream stderr) throws 
IOException, InterruptedException {
monitor.subTask(

YoctoCMakeMessages.getString(ExecuteConfigureJob.buildingMakefile)); 
//$NON-NLS-1$
-   configureProcess.start(cos);
+   configureProcess.start(stdout, stderr);
int exitValue = configureProcess.waitForResultAndStop();
monitor.worked(15);
 
if (exitValue != 0) {
return new Status(Status.ERROR, Activator.PLUGIN_ID,
-   
YoctoCMakeMessages.getString(ExecuteConfigureJob.error.buildFailed) +   + 
exitValue); //$NON-NLS-1$ //$NON-NLS-2$
+   
YoctoCMakeMessages.getFormattedString(ExecuteConfigureJob.error.buildFailed, 
//$NON-NLS-1$
+   
stderr.toString().trim()));
}
 
return Status.OK_STATUS;
-- 
1.9.0

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


[yocto] [PATCHv4 0/7][eclipse-poky] Add target profile quick switch

2013-06-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Hi,

Changes in v4:
- Rebase of patch series

Changes in v3:
- Only grey out project specific profile if not configured.
- Fix Bug where multiple menu item could be selected at the same time

Changes in v2:
Handle error when project specific profile is not configure more
gracefully. Instead of showing an error message the button is now
greyed out.

From original cover letter
snip
if a user wants to change the used target profile of a project he
currently has to open the project preferences. This can be tedious if
he has to switch the profile often.

This is a small addition which allows the user to quickly switch the
used target profile of a project. Instead of having to open the
project preferences the user can select the project in the navigator
and then choose the desired target profile from a drop-down menu in
the toolbar or from the project menu.
/snip

01: Small i18n fix
02..04: Refactoring the project specific utils
05..06: Introduce the target profile toolbar switch
07: Adds the target profile switch to the project menu

Best regards,
Timo

Timo Mueller (7):
  plugins/sdk.ide: Use an internationalized dialog title
  plugins/sdk.ide: Extract project specific util methods
  plugins/sdk.ide: Move project specific util methods
  plugins/sdk.ide: Remove project context from method names
  plugins/sdk.ide: Add command to switch the target profile
  plugins/sdk.ide: Add profile switch menu to the toolbar
  plugins/sdk.ide: Add profile switch menu to the project menu

 .../OSGI-INF/l10n/bundle.properties|   4 +
 plugins/org.yocto.sdk.ide/plugin.xml   | 100 -
 .../sdk/ide/ProjectSpecificContributionItem.java   |  69 ++
 .../sdk/ide/TargetProfileContributionItem.java | 126 +++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   4 +
 .../src/org/yocto/sdk/ide/YoctoUISetting.java  |   3 +-
 .../sdk/ide/actions/ProfileSwitchHandler.java  | 134 
 .../natures/YoctoSDKAutotoolsProjectNature.java|   3 +-
 .../ide/preferences/YoctoSDKPreferencePage.java|  11 +-
 .../preferences/YoctoSDKProjectPropertyPage.java   | 128 +--
 .../sdk/ide/utils/ProjectPreferenceUtils.java  | 240 +
 .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 --
 .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
 13 files changed, 698 insertions(+), 245 deletions(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java

-- 
1.8.1.4

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


[yocto] [PATCHv4 3/7] plugins/sdk.ide: Move project specific util methods

2013-06-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Move project specific methods to the new util class to allow public
usage of theses methods.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../preferences/YoctoSDKProjectPropertyPage.java   | 119 ++---
 .../sdk/ide/utils/ProjectPreferenceUtils.java  | 102 ++
 2 files changed, 108 insertions(+), 113 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 20078f8..58ef594 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -13,12 +13,8 @@
 package org.yocto.sdk.ide.preferences;
 
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -27,7 +23,6 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.ui.IWorkbenchPropertyPage;
 import org.eclipse.ui.dialogs.PropertyPage;
-import org.osgi.service.prefs.BackingStoreException;
 import org.yocto.sdk.ide.YoctoProfileElement;
 import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
@@ -40,7 +35,6 @@ import org.yocto.sdk.ide.YoctoUIElement;
 import org.yocto.sdk.ide.YoctoUISetting;
 import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
-import org.yocto.sdk.ide.utils.YoctoSDKUtilsConstants;
 
 public class YoctoSDKProjectPropertyPage extends PropertyPage implements
IWorkbenchPropertyPage {
@@ -80,10 +74,10 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
 
yoctoProfileSetting = new YoctoProfileSetting(
new 
YoctoProfileElement(globalProfileElement.getProfilesAsString(), 
selectedProfile), this, false);
-   boolean useProjectSpecificSetting = 
getUseProjectSpecificOptionFromProjectPreferences(project);
+   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOptionFromProjectPreferences(project);
 
if (useProjectSpecificSetting) {
-   yoctoUISetting = new 
YoctoUISetting(getElemFromProjectPreferences(project));
+   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElemFromProjectPreferences(project));
} else {
yoctoUISetting = new 
YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
}
@@ -161,11 +155,11 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
return false;
}
 
-   
saveUseProjectSpecificOptionToProjectPreferences(project, true);
+   
ProjectPreferenceUtils.saveUseProjectSpecificOptionToProjectPreferences(project,
 true);

ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(),
 project);
-   
saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(), project);
+   
ProjectPreferenceUtils.saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(),
 project);
} else {
-   
saveUseProjectSpecificOptionToProjectPreferences(project, false);
+   
ProjectPreferenceUtils.saveUseProjectSpecificOptionToProjectPreferences(project,
 false);

ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(),
 project);
}
 
@@ -174,107 +168,6 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
return super.performOk();
}
 
-   private void saveUseProjectSpecificOptionToProjectPreferences(IProject 
project, boolean useProjectSpecificSetting) {
-   IScopeContext projectScope = new ProjectScope(project);
-   IEclipsePreferences projectNode = 
projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
-   if (projectNode == null) {
-   return;
-   }
-
-   if (useProjectSpecificSetting) {
-   
projectNode.put(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, 
IPreferenceStore.TRUE

[yocto] [PATCHv4 2/7] plugins/sdk.ide: Extract project specific util methods

2013-06-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Project specific util methods are moved to a separate util class. This
way the general util class will get more concise and other project
specific methods can be move to this new util class later.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../natures/YoctoSDKAutotoolsProjectNature.java|   3 +-
 .../ide/preferences/YoctoSDKPreferencePage.java|  11 +-
 .../preferences/YoctoSDKProjectPropertyPage.java   |  11 +-
 .../sdk/ide/utils/ProjectPreferenceUtils.java  | 138 +
 .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 --
 .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
 6 files changed, 154 insertions(+), 130 deletions(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
index fb53c53..ce80d77 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
@@ -18,6 +18,7 @@ import 
org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.core.resources.IProject;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoUIElement;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 
 public class YoctoSDKAutotoolsProjectNature extends YoctoSDKProjectNature {
@@ -35,7 +36,7 @@ public class YoctoSDKAutotoolsProjectNature extends 
YoctoSDKProjectNature {
public static void configureAutotoolsOptions(IProject project) {
IManagedBuildInfo info = 
ManagedBuildManager.getBuildInfo(project);
IConfiguration icfg = info.getDefaultConfiguration();
-   YoctoUIElement elem = 
YoctoSDKUtils.getElemFromProjectEnv(project);
+   YoctoUIElement elem = 
ProjectPreferenceUtils.getElemFromProjectEnv(project);
String sysroot_str = elem.getStrSysrootLoc();
String id = icfg.getId();
String CFLAGS_str = YoctoSDKUtils.getEnvValue(project, 
CFLAGS);
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 211c4f9..e8123e2 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -34,6 +34,7 @@ import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.natures.YoctoSDKProjectNature;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 import org.yocto.sdk.ide.YoctoSDKMessages;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
@@ -240,10 +241,10 @@ public class YoctoSDKPreferencePage extends 
PreferencePage implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(


YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
-   YoctoSDKUtils.saveElemToProjectEnv(elem, project);
+   ProjectPreferenceUtils.saveElemToProjectEnv(elem, 
project);
}
}
 
@@ -254,14 +255,14 @@ public class YoctoSDKPreferencePage extends 
PreferencePage implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
}
}
 
private void updateProjects(HashSetIProject yoctoProjects, 
YoctoUIElement elem) {
for (IProject project : yoctoProjects)
{
-   YoctoSDKUtils.saveElemToProjectEnv(elem, project);
+   ProjectPreferenceUtils.saveElemToProjectEnv(elem, 
project);
}
}
 
@@ -295,7 +296,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
private boolean projectUsesProfile(IProject project, String profile

[yocto] [PATCHv4 1/7] plugins/sdk.ide: Use an internationalized dialog title

2013-06-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index e5a7897..d192538 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -42,7 +42,6 @@ import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.preferences.PreferenceConstants;
 
 public class YoctoUISetting {
-
private static final String ENV_SCRIPT_FILE_PREFIX = 
environment-setup-;
 
private SelectionListener fSelectionListener;
@@ -375,7 +374,7 @@ public class YoctoUISetting {
if ((result != SDKCheckResults.SDK_PASS)  showErrorDialog) {
Display display = Display.getCurrent();
ErrorDialog.openError(display.getActiveShell(),
-   Yocto 
Project Configuration Error,
+   
YoctoSDKChecker.SDKCheckRequestFrom.Other.getErrorMessage(),

YoctoSDKChecker.getErrorMessage(result, from),
new 
Status(Status.ERROR, YoctoSDKPlugin.PLUGIN_ID, result.getMessage()));
 
-- 
1.8.1.4

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


[yocto] [PATCHv4 4/7] plugins/sdk.ide: Remove project context from method names

2013-06-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Through the context of the ProjectPreferenceUtil class we can infer
that all methods act on project preferences. Having this context
information duplicated in the method name is not needed anymore and
can be removed to get a cleaner API.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../sdk/ide/preferences/YoctoSDKPreferencePage.java|  6 +++---
 .../ide/preferences/YoctoSDKProjectPropertyPage.java   | 18 +-
 .../yocto/sdk/ide/utils/ProjectPreferenceUtils.java| 12 ++--
 .../sdk/ide/wizard/NewYoctoProjectTemplateProcess.java |  2 +-
 4 files changed, 19 insertions(+), 19 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index e8123e2..4e6ca2a 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -241,7 +241,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
+   ProjectPreferenceUtils.saveProfiles(profileElement, 
project);
YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(


YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
ProjectPreferenceUtils.saveElemToProjectEnv(elem, 
project);
@@ -255,7 +255,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
+   ProjectPreferenceUtils.saveProfiles(profileElement, 
project);
}
}
 
@@ -296,7 +296,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
private boolean projectUsesProfile(IProject project, String profile)
{
-   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
+   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfiles(project);
 
if (!profileElement.getSelectedProfile().equals(profile)) {
return false;
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 58ef594..a85cbd9 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -65,7 +65,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage 
implements
IProject project = getProject();
 
YoctoProfileElement globalProfileElement= 
YoctoSDKUtils.getProfilesFromDefaultStore();
-   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
+   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfiles(project);
 
String selectedProfile = profileElement.getSelectedProfile();
if (!globalProfileElement.contains(selectedProfile)) {
@@ -74,10 +74,10 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
 
yoctoProfileSetting = new YoctoProfileSetting(
new 
YoctoProfileElement(globalProfileElement.getProfilesAsString(), 
selectedProfile), this, false);
-   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOptionFromProjectPreferences(project);
+   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOption(project);
 
if (useProjectSpecificSetting) {
-   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElemFromProjectPreferences(project));
+   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElem(project));
} else {
yoctoUISetting = new 
YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
}
@@ -155,12 +155,12 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
return false

[yocto] [PATCHv4 7/7] plugins/sdk.ide: Add profile switch menu to the project menu

2013-06-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If a project with a yocto nature is selected, the project menu will
show a target profile menu which allows the user to switch the used
target profile of the project.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.sdk.ide/plugin.xml | 25 +
 1 file changed, 25 insertions(+)

diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index aaa0a35..c082c3a 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -251,6 +251,15 @@
  point=org.eclipse.ui.menus
   menuContribution
 allPopups=true
+locationURI=menu:project
+ menu
+   id=org.yocto.sdk.ide.profiles.menu
+   label=%command.targetProfileSwitch.label
+   tooltip=%command.targetProfileSwitch.description
+ /menu
+  /menuContribution
+  menuContribution
+allPopups=true
 locationURI=toolbar:org.eclipse.ui.main.toolbar?after=additions
  toolbar
id=org.yocto.sdk.ide.profiles.toolbar
@@ -284,6 +293,22 @@
   /menuContribution
   menuContribution
 allPopups=false
+locationURI=menu:org.yocto.sdk.ide.profiles.menu
+ dynamic
+   class=org.yocto.sdk.ide.ProjectSpecificContributionItem
+   id=org.yocto.sdk.ide.dynamic.projectSpecific.targetProfile
+ /dynamic
+ separator
+   name=org.yocto.sdk.ide.profiles.separator
+   visible=true
+ /separator
+ dynamic
+   class=org.yocto.sdk.ide.TargetProfileContributionItem
+   id=org.yocto.sdk.ide.dynamic.targetProfile
+ /dynamic
+  /menuContribution
+  menuContribution
+allPopups=false
 locationURI=menu:org.yocto.sdk.ide.profiles.toolbar.dropdown
  dynamic
class=org.yocto.sdk.ide.ProjectSpecificContributionItem
-- 
1.8.1.4

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


[yocto] [PATCHv4 5/7] plugins/sdk.ide: Add command to switch the target profile

2013-06-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The command can be used in a radio group to switch the target profile
of a selected project.

Radio items should call this command handing over the name of the
target profile as the command's parameter.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../OSGI-INF/l10n/bundle.properties|   3 +
 plugins/org.yocto.sdk.ide/plugin.xml   |  18 
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   3 +
 .../sdk/ide/actions/ProfileSwitchHandler.java  | 110 +
 4 files changed, 134 insertions(+)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java

diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties 
b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
index 48eb653..1191af6 100644
--- a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -6,6 +6,9 @@ extension.name.2 = YoctoSDKCMakeNature
 command.name = ReconfigureYoctoProject
 command.label.0 = Change Yocto Project Settings
 command.mnemonic = C
+command.targetProfileSwitch.name = Change Target Profile
+command.targetProfileSwitch.description = Changes the target profile of a 
selected project
+command.targetProfileSwitch.parameter.name = Selected Target Profile
 projectType.name.0 = Yocto Project ADT Autotools Project
 projectProperties.label.0 = Yocto Project Settings
 Bundle-Vendor = yoctoproject.org
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index 7ea55c7..62f1297 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -225,5 +225,23 @@
  /filter
   /page
/extension
+   extension
+ point=org.eclipse.ui.commands
+  command
+defaultHandler=org.yocto.sdk.ide.actions.ProfileSwitchHandler
+description=%command.targetProfileSwitch.description
+id=org.yocto.sdk.ide.targetProfile.switch
+name=%command.targetProfileSwitch.name
+ commandParameter
+   id=org.eclipse.ui.commands.radioStateParameter
+   name=%command.targetProfileSwitch.parameter.name
+   optional=false
+ /commandParameter
+ state
+   class=org.eclipse.ui.handlers.RadioState:project-specific
+   id=org.eclipse.ui.commands.radioState
+ /state
+  /command
+   /extension
 
 /plugin
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 4ff1574..a953d6f 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -89,6 +89,9 @@ Preferences.Profile.Standard.Modification.Message = Standard 
cross development p
 Preferences.Profile.ProjectSpecific.Title = Use project specific settings
 Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
 
+Preferences.Profile.ProjectSpecific.Error.Title = Could not change to project 
specific target profile
+Preferences.Profile.ProjectSpecific.Error.Message = The project specific 
target profile is not defined for the project {0}.\nYou can define it in the 
project's property page.
+
 Console.SDK.Name = Yocto Project Console
 
 LaunchConfig.Type.Name = 
org.eclipse.ui.externaltools.ProgramLaunchConfigurationType
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
new file mode 100644
index 000..e12597e
--- /dev/null
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
@@ -0,0 +1,110 @@
+/***
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ * 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:
+ * BMW Car IT - initial implementation
+ 
***/
+package org.yocto.sdk.ide.actions;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import

[yocto] [PATCHv4 6/7] plugins/sdk.ide: Add profile switch menu to the toolbar

2013-06-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If a project with a yocto nature is selected, the toolbar will show a
target profile menu which allows the user to switch the used target
profile of the project.

The content of this menu is dynamically created using the list of
globally defined target profiles. Additionally it will also contain
the project specific profile.

If the project specific profile is not yet defined for the selected
project, the button will be greyed out.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../OSGI-INF/l10n/bundle.properties|   1 +
 plugins/org.yocto.sdk.ide/plugin.xml   |  57 +-
 .../sdk/ide/ProjectSpecificContributionItem.java   |  69 +++
 .../sdk/ide/TargetProfileContributionItem.java | 126 +
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   1 +
 .../sdk/ide/actions/ProfileSwitchHandler.java  |  26 -
 6 files changed, 278 insertions(+), 2 deletions(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java

diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties 
b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
index 1191af6..2031154 100644
--- a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -7,6 +7,7 @@ command.name = ReconfigureYoctoProject
 command.label.0 = Change Yocto Project Settings
 command.mnemonic = C
 command.targetProfileSwitch.name = Change Target Profile
+command.targetProfileSwitch.label = Target Profiles
 command.targetProfileSwitch.description = Changes the target profile of a 
selected project
 command.targetProfileSwitch.parameter.name = Selected Target Profile
 projectType.name.0 = Yocto Project ADT Autotools Project
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index 62f1297..aaa0a35 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -81,6 +81,10 @@
 id=org.yocto.sdk.ide.command.reconfigYocto
 name=%command.name
   /command
+  command
+id=org.yocto.sdk.ide.command.disabled
+name=DisabledCommand
+  /command
/extension
extension
  point=org.eclipse.ui.handlers
@@ -243,5 +247,56 @@
  /state
   /command
/extension
-
+   extension
+ point=org.eclipse.ui.menus
+  menuContribution
+allPopups=true
+locationURI=toolbar:org.eclipse.ui.main.toolbar?after=additions
+ toolbar
+   id=org.yocto.sdk.ide.profiles.toolbar
+command
+  commandId=org.yocto.sdk.ide.command.reconfigYocto
+  id=org.yocto.sdk.ide.profiles.toolbar.dropdown
+  label=%command.targetProfileSwitch.label
+  mode=FORCE_TEXT
+  style=pulldown
+  tooltip=%command.targetProfileSwitch.description
+   visibleWhen
+ checkEnabled=false
+  and
+ count
+   value=1
+ /count
+ iterate
+   operator=and
+adapt
+  type=org.eclipse.core.resources.IResource
+   test
+ 
property=org.eclipse.core.resources.projectNature
+ value=org.yocto.sdk.ide.YoctoSDKNature
+   /test
+/adapt
+ /iterate
+  /and
+   /visibleWhen
+/command
+ /toolbar
+  /menuContribution
+  menuContribution
+allPopups=false
+locationURI=menu:org.yocto.sdk.ide.profiles.toolbar.dropdown
+ dynamic
+   class=org.yocto.sdk.ide.ProjectSpecificContributionItem
+   id=org.yocto.sdk.ide.dynamic.projectSpecific.targetProfile
+ /dynamic
+ separator
+   name=org.yocto.sdk.ide.profiles.separator
+   visible=true
+ /separator
+ dynamic
+   class=org.yocto.sdk.ide.TargetProfileContributionItem
+   id=org.yocto.sdk.ide.dynamic.targetProfile
+ /dynamic
+  /menuContribution
+   /extension
 /plugin
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
new file mode 100644
index 000..c29d278
--- /dev/null
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
@@ -0,0 +1,69

[yocto] [eclipse-poky][PATCH] plugin/sdk.ide: Pre-populate project specific profile form

2013-06-26 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

On initial setup the profile form is populated with the values from
the previously selected target profile. This allows the user to
quickly make project specific adaptions of an existing profile.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../sdk/ide/preferences/YoctoSDKProjectPropertyPage.java   | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 9f99caf..408ce76 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -31,14 +31,15 @@ import org.osgi.service.prefs.BackingStoreException;
 import org.yocto.sdk.ide.YoctoProfileElement;
 import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
+import org.yocto.sdk.ide.YoctoSDKChecker;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.YoctoSDKMessages;
-import org.yocto.sdk.ide.utils.YoctoSDKUtils;
-import org.yocto.sdk.ide.utils.YoctoSDKUtilsConstants;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoUIElement;
 import org.yocto.sdk.ide.YoctoUISetting;
+import org.yocto.sdk.ide.utils.YoctoSDKUtils;
+import org.yocto.sdk.ide.utils.YoctoSDKUtilsConstants;
 
 public class YoctoSDKProjectPropertyPage extends PropertyPage implements
IWorkbenchPropertyPage {
@@ -288,6 +289,15 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
public void switchToProjectSpecificProfile()
{
YoctoUIElement profileElement = 
getElemFromProjectPreferences(getProject());
+   SDKCheckResults result = 
YoctoSDKChecker.checkYoctoSDK(profileElement);
+
+   if ((result != SDKCheckResults.SDK_PASS)) {
+   /* Project specific profile has not yet been defined,
+* leave settings from previously selected profile
+*/
+   return;
+   }
+
yoctoUISetting.setCurrentInput(profileElement);
}
 
-- 
1.8.1.4

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


[yocto] [PATCH][eclipse-poky] plugin/sdk.ide: Pre-populate project specific profile form

2013-06-25 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

On initial setup the profile form is populated with the values from
the previously selected target profile. This allows the user to
quickly make project specific adaptions of an existing profile.

If a project specific profile is already defined the form will show the
values from this configuration.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../sdk/ide/preferences/YoctoSDKProjectPropertyPage.java   | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 9f99caf..408ce76 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -31,14 +31,15 @@ import org.osgi.service.prefs.BackingStoreException;
 import org.yocto.sdk.ide.YoctoProfileElement;
 import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
+import org.yocto.sdk.ide.YoctoSDKChecker;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.YoctoSDKMessages;
-import org.yocto.sdk.ide.utils.YoctoSDKUtils;
-import org.yocto.sdk.ide.utils.YoctoSDKUtilsConstants;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoUIElement;
 import org.yocto.sdk.ide.YoctoUISetting;
+import org.yocto.sdk.ide.utils.YoctoSDKUtils;
+import org.yocto.sdk.ide.utils.YoctoSDKUtilsConstants;
 
 public class YoctoSDKProjectPropertyPage extends PropertyPage implements
IWorkbenchPropertyPage {
@@ -288,6 +289,15 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
public void switchToProjectSpecificProfile()
{
YoctoUIElement profileElement = 
getElemFromProjectPreferences(getProject());
+   SDKCheckResults result = 
YoctoSDKChecker.checkYoctoSDK(profileElement);
+
+   if ((result != SDKCheckResults.SDK_PASS)) {
+   /* Project specific profile has not yet been defined,
+* leave settings from previously selected profile
+*/
+   return;
+   }
+
yoctoUISetting.setCurrentInput(profileElement);
}
 
-- 
1.8.1.4

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


[yocto] [PATCHv3 4/8] plugins/sdk.ide: Remove project context from method names

2013-06-25 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Through the context of the ProjectPreferenceUtil class we can infer
that all methods act on project preferences. Having this context
information duplicated in the method name is not needed anymore and
can be removed to get a cleaner API.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../sdk/ide/preferences/YoctoSDKPreferencePage.java  |  6 +++---
 .../sdk/ide/preferences/YoctoSDKProjectPropertyPage.java | 16 
 .../org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java  | 12 ++--
 .../sdk/ide/wizard/NewYoctoProjectTemplateProcess.java   |  2 +-
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index e8123e2..4e6ca2a 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -241,7 +241,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
+   ProjectPreferenceUtils.saveProfiles(profileElement, 
project);
YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(


YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
ProjectPreferenceUtils.saveElemToProjectEnv(elem, 
project);
@@ -255,7 +255,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
+   ProjectPreferenceUtils.saveProfiles(profileElement, 
project);
}
}
 
@@ -296,7 +296,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
private boolean projectUsesProfile(IProject project, String profile)
{
-   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
+   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfiles(project);
 
if (!profileElement.getSelectedProfile().equals(profile)) {
return false;
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 1f82fe1..f6026ee 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -64,7 +64,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage 
implements
IProject project = getProject();
 
YoctoProfileElement globalProfileElement= 
YoctoSDKUtils.getProfilesFromDefaultStore();
-   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
+   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfiles(project);
 
String selectedProfile = profileElement.getSelectedProfile();
if (!globalProfileElement.contains(selectedProfile)) {
@@ -73,10 +73,10 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
 
yoctoProfileSetting = new YoctoProfileSetting(
new 
YoctoProfileElement(globalProfileElement.getProfilesAsString(), 
selectedProfile), this, false);
-   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOptionFromProjectPreferences(project);
+   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOption(project);
 
if (useProjectSpecificSetting) {
-   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElemFromProjectPreferences(project));
+   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElem(project));
} else {
yoctoUISetting = new 
YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
}
@@ -154,12 +154,12 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
return false

[yocto] [PATCHv3 1/8] plugins/sdk.ide: Use an internationalized dialog title

2013-06-25 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index e5a7897..d192538 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -42,7 +42,6 @@ import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.preferences.PreferenceConstants;
 
 public class YoctoUISetting {
-
private static final String ENV_SCRIPT_FILE_PREFIX = 
environment-setup-;
 
private SelectionListener fSelectionListener;
@@ -375,7 +374,7 @@ public class YoctoUISetting {
if ((result != SDKCheckResults.SDK_PASS)  showErrorDialog) {
Display display = Display.getCurrent();
ErrorDialog.openError(display.getActiveShell(),
-   Yocto 
Project Configuration Error,
+   
YoctoSDKChecker.SDKCheckRequestFrom.Other.getErrorMessage(),

YoctoSDKChecker.getErrorMessage(result, from),
new 
Status(Status.ERROR, YoctoSDKPlugin.PLUGIN_ID, result.getMessage()));
 
-- 
1.8.1.4

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


[yocto] [PATCHv3 5/8] plugins/sdk.ide: Add command to switch the target profile

2013-06-25 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The command can be used in a radio group to switch the target profile
of a selected project.

Radio items should call this command handing over the name of the
target profile as the command's parameter.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../OSGI-INF/l10n/bundle.properties|   3 +
 plugins/org.yocto.sdk.ide/plugin.xml   |  18 
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   3 +
 .../sdk/ide/actions/ProfileSwitchHandler.java  | 110 +
 4 files changed, 134 insertions(+)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java

diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties 
b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
index 48eb653..1191af6 100644
--- a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -6,6 +6,9 @@ extension.name.2 = YoctoSDKCMakeNature
 command.name = ReconfigureYoctoProject
 command.label.0 = Change Yocto Project Settings
 command.mnemonic = C
+command.targetProfileSwitch.name = Change Target Profile
+command.targetProfileSwitch.description = Changes the target profile of a 
selected project
+command.targetProfileSwitch.parameter.name = Selected Target Profile
 projectType.name.0 = Yocto Project ADT Autotools Project
 projectProperties.label.0 = Yocto Project Settings
 Bundle-Vendor = yoctoproject.org
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index 7ea55c7..62f1297 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -225,5 +225,23 @@
  /filter
   /page
/extension
+   extension
+ point=org.eclipse.ui.commands
+  command
+defaultHandler=org.yocto.sdk.ide.actions.ProfileSwitchHandler
+description=%command.targetProfileSwitch.description
+id=org.yocto.sdk.ide.targetProfile.switch
+name=%command.targetProfileSwitch.name
+ commandParameter
+   id=org.eclipse.ui.commands.radioStateParameter
+   name=%command.targetProfileSwitch.parameter.name
+   optional=false
+ /commandParameter
+ state
+   class=org.eclipse.ui.handlers.RadioState:project-specific
+   id=org.eclipse.ui.commands.radioState
+ /state
+  /command
+   /extension
 
 /plugin
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 4ff1574..a953d6f 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -89,6 +89,9 @@ Preferences.Profile.Standard.Modification.Message = Standard 
cross development p
 Preferences.Profile.ProjectSpecific.Title = Use project specific settings
 Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
 
+Preferences.Profile.ProjectSpecific.Error.Title = Could not change to project 
specific target profile
+Preferences.Profile.ProjectSpecific.Error.Message = The project specific 
target profile is not defined for the project {0}.\nYou can define it in the 
project's property page.
+
 Console.SDK.Name = Yocto Project Console
 
 LaunchConfig.Type.Name = 
org.eclipse.ui.externaltools.ProgramLaunchConfigurationType
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
new file mode 100644
index 000..e12597e
--- /dev/null
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
@@ -0,0 +1,110 @@
+/***
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ * 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:
+ * BMW Car IT - initial implementation
+ 
***/
+package org.yocto.sdk.ide.actions;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import

[yocto] [PATCHv3 0/8][eclipse-poky] Add target profile quick switch

2013-06-25 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Hi,

in conclusion to the previous discussion, we've agreed that the quick
switch menu will enable the user to select only configured profiles.
An unconfigured project specific profile will be shown as a greyed out
option in the menu.

There also has been a bug where the projects specific settings and one
profile could be marked as selected at the same time. I could only
reproduce by naming the target profile project-specific which
collides with the radioParamter used for the menu. This case is
resolved in this patch set. I've additionally merged the two places
where the state of the menu was set so have one consistent place.

In any case, I've added one patch marked as TESTING to enable tracing
in the relevant components. In case the problem prevails, please
enable the tracing for th org.yocto.sdk.ide plugin and send me the
output.

Changes in v3:
- Only grey out project specific profile if not configured.
- Fix Bug where multiple menu item could be selected at the same time

Changes in v2:
Handle error when project specific profile is not configure more
gracefully. Instead of showing an error message the button is now
greyed out.

Patches 01..07 contain the implementation with the greyed out menu
button.

After playing around with the two options discussed in the first patch
series, I started to prefer inserting a different button in the menu
allowing the user to quickly navigate to the project preferences
instead of just greying it out. I've added this in the last patch of
the series, so you can compare yourself.

From original cover letter
snip
if a user wants to change the used target profile of a project he
currently has to open the project preferences. This can be tedious if
he has to switch the profile often.

This is a small addition which allows the user to quickly switch the
used target profile of a project. Instead of having to open the
project preferences the user can select the project in the navigator
and then choose the desired target profile from a drop-down menu in
the toolbar or from the project menu.
/snip

01: Small i18n fix
02..04: Refactoring the project specific utils
05..06: Introduce the target profile toolbar switch
07: Adds the target profile switch to the project menu
08: TESTING: Enalbe tracing to pin down the multi-select problem

Best regards,
Timo

Timo Mueller (8):
  plugins/sdk.ide: Use an internationalized dialog title
  plugins/sdk.ide: Extract project specific util methods
  plugins/sdk.ide: Move project specific util methods
  plugins/sdk.ide: Remove project context from method names
  plugins/sdk.ide: Add command to switch the target profile
  plugins/sdk.ide: Add profile switch menu to the toolbar
  plugins/sdk.ide: Add profile switch menu to the project menu
  TESTING: add tracing for radio menu

 plugins/org.yocto.sdk.ide/.options |   2 +
 .../OSGI-INF/l10n/bundle.properties|   4 +
 plugins/org.yocto.sdk.ide/plugin.xml   | 100 -
 .../sdk/ide/ProjectSpecificContributionItem.java   |  69 ++
 .../sdk/ide/TargetProfileContributionItem.java | 139 
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   4 +
 .../src/org/yocto/sdk/ide/YoctoUISetting.java  |   3 +-
 .../sdk/ide/actions/ProfileSwitchHandler.java  | 134 
 .../natures/YoctoSDKAutotoolsProjectNature.java|   3 +-
 .../ide/preferences/YoctoSDKPreferencePage.java|  11 +-
 .../preferences/YoctoSDKProjectPropertyPage.java   | 130 ++-
 .../sdk/ide/utils/ProjectPreferenceUtils.java  | 240 +
 .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 --
 .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
 14 files changed, 714 insertions(+), 246 deletions(-)
 create mode 100644 plugins/org.yocto.sdk.ide/.options
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java

-- 
1.8.1.4

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


[yocto] [PATCHv3 6/8] plugins/sdk.ide: Add profile switch menu to the toolbar

2013-06-25 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If a project with a yocto nature is selected, the toolbar will show a
target profile menu which allows the user to switch the used target
profile of the project.

The content of this menu is dynamically created using the list of
globally defined target profiles. Additionally it will also contain
the project specific profile.

If the project specific profile is not yet defined for the selected
project, the button will be greyed out.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../OSGI-INF/l10n/bundle.properties|   1 +
 plugins/org.yocto.sdk.ide/plugin.xml   |  57 +-
 .../sdk/ide/ProjectSpecificContributionItem.java   |  69 +++
 .../sdk/ide/TargetProfileContributionItem.java | 126 +
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   1 +
 .../sdk/ide/actions/ProfileSwitchHandler.java  |  26 -
 6 files changed, 278 insertions(+), 2 deletions(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java

diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties 
b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
index 1191af6..2031154 100644
--- a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -7,6 +7,7 @@ command.name = ReconfigureYoctoProject
 command.label.0 = Change Yocto Project Settings
 command.mnemonic = C
 command.targetProfileSwitch.name = Change Target Profile
+command.targetProfileSwitch.label = Target Profiles
 command.targetProfileSwitch.description = Changes the target profile of a 
selected project
 command.targetProfileSwitch.parameter.name = Selected Target Profile
 projectType.name.0 = Yocto Project ADT Autotools Project
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index 62f1297..aaa0a35 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -81,6 +81,10 @@
 id=org.yocto.sdk.ide.command.reconfigYocto
 name=%command.name
   /command
+  command
+id=org.yocto.sdk.ide.command.disabled
+name=DisabledCommand
+  /command
/extension
extension
  point=org.eclipse.ui.handlers
@@ -243,5 +247,56 @@
  /state
   /command
/extension
-
+   extension
+ point=org.eclipse.ui.menus
+  menuContribution
+allPopups=true
+locationURI=toolbar:org.eclipse.ui.main.toolbar?after=additions
+ toolbar
+   id=org.yocto.sdk.ide.profiles.toolbar
+command
+  commandId=org.yocto.sdk.ide.command.reconfigYocto
+  id=org.yocto.sdk.ide.profiles.toolbar.dropdown
+  label=%command.targetProfileSwitch.label
+  mode=FORCE_TEXT
+  style=pulldown
+  tooltip=%command.targetProfileSwitch.description
+   visibleWhen
+ checkEnabled=false
+  and
+ count
+   value=1
+ /count
+ iterate
+   operator=and
+adapt
+  type=org.eclipse.core.resources.IResource
+   test
+ 
property=org.eclipse.core.resources.projectNature
+ value=org.yocto.sdk.ide.YoctoSDKNature
+   /test
+/adapt
+ /iterate
+  /and
+   /visibleWhen
+/command
+ /toolbar
+  /menuContribution
+  menuContribution
+allPopups=false
+locationURI=menu:org.yocto.sdk.ide.profiles.toolbar.dropdown
+ dynamic
+   class=org.yocto.sdk.ide.ProjectSpecificContributionItem
+   id=org.yocto.sdk.ide.dynamic.projectSpecific.targetProfile
+ /dynamic
+ separator
+   name=org.yocto.sdk.ide.profiles.separator
+   visible=true
+ /separator
+ dynamic
+   class=org.yocto.sdk.ide.TargetProfileContributionItem
+   id=org.yocto.sdk.ide.dynamic.targetProfile
+ /dynamic
+  /menuContribution
+   /extension
 /plugin
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
new file mode 100644
index 000..c29d278
--- /dev/null
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
@@ -0,0 +1,69

[yocto] [PATCHv3 2/8] plugins/sdk.ide: Extract project specific util methods

2013-06-25 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Project specific util methods are moved to a separate util class. This
way the general util class will get more concise and other project
specific methods can be move to this new util class later.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../natures/YoctoSDKAutotoolsProjectNature.java|   3 +-
 .../ide/preferences/YoctoSDKPreferencePage.java|  11 +-
 .../preferences/YoctoSDKProjectPropertyPage.java   |  13 +-
 .../sdk/ide/utils/ProjectPreferenceUtils.java  | 138 +
 .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 --
 .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
 6 files changed, 155 insertions(+), 131 deletions(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
index fb53c53..ce80d77 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
@@ -18,6 +18,7 @@ import 
org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.core.resources.IProject;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoUIElement;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 
 public class YoctoSDKAutotoolsProjectNature extends YoctoSDKProjectNature {
@@ -35,7 +36,7 @@ public class YoctoSDKAutotoolsProjectNature extends 
YoctoSDKProjectNature {
public static void configureAutotoolsOptions(IProject project) {
IManagedBuildInfo info = 
ManagedBuildManager.getBuildInfo(project);
IConfiguration icfg = info.getDefaultConfiguration();
-   YoctoUIElement elem = 
YoctoSDKUtils.getElemFromProjectEnv(project);
+   YoctoUIElement elem = 
ProjectPreferenceUtils.getElemFromProjectEnv(project);
String sysroot_str = elem.getStrSysrootLoc();
String id = icfg.getId();
String CFLAGS_str = YoctoSDKUtils.getEnvValue(project, 
CFLAGS);
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 211c4f9..e8123e2 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -34,6 +34,7 @@ import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.natures.YoctoSDKProjectNature;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 import org.yocto.sdk.ide.YoctoSDKMessages;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
@@ -240,10 +241,10 @@ public class YoctoSDKPreferencePage extends 
PreferencePage implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(


YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
-   YoctoSDKUtils.saveElemToProjectEnv(elem, project);
+   ProjectPreferenceUtils.saveElemToProjectEnv(elem, 
project);
}
}
 
@@ -254,14 +255,14 @@ public class YoctoSDKPreferencePage extends 
PreferencePage implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
}
}
 
private void updateProjects(HashSetIProject yoctoProjects, 
YoctoUIElement elem) {
for (IProject project : yoctoProjects)
{
-   YoctoSDKUtils.saveElemToProjectEnv(elem, project);
+   ProjectPreferenceUtils.saveElemToProjectEnv(elem, 
project);
}
}
 
@@ -295,7 +296,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
private boolean projectUsesProfile(IProject project, String profile

[yocto] [PATCHv3 7/8] plugins/sdk.ide: Add profile switch menu to the project menu

2013-06-25 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If a project with a yocto nature is selected, the project menu will
show a target profile menu which allows the user to switch the used
target profile of the project.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.sdk.ide/plugin.xml | 25 +
 1 file changed, 25 insertions(+)

diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index aaa0a35..c082c3a 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -251,6 +251,15 @@
  point=org.eclipse.ui.menus
   menuContribution
 allPopups=true
+locationURI=menu:project
+ menu
+   id=org.yocto.sdk.ide.profiles.menu
+   label=%command.targetProfileSwitch.label
+   tooltip=%command.targetProfileSwitch.description
+ /menu
+  /menuContribution
+  menuContribution
+allPopups=true
 locationURI=toolbar:org.eclipse.ui.main.toolbar?after=additions
  toolbar
id=org.yocto.sdk.ide.profiles.toolbar
@@ -284,6 +293,22 @@
   /menuContribution
   menuContribution
 allPopups=false
+locationURI=menu:org.yocto.sdk.ide.profiles.menu
+ dynamic
+   class=org.yocto.sdk.ide.ProjectSpecificContributionItem
+   id=org.yocto.sdk.ide.dynamic.projectSpecific.targetProfile
+ /dynamic
+ separator
+   name=org.yocto.sdk.ide.profiles.separator
+   visible=true
+ /separator
+ dynamic
+   class=org.yocto.sdk.ide.TargetProfileContributionItem
+   id=org.yocto.sdk.ide.dynamic.targetProfile
+ /dynamic
+  /menuContribution
+  menuContribution
+allPopups=false
 locationURI=menu:org.yocto.sdk.ide.profiles.toolbar.dropdown
  dynamic
class=org.yocto.sdk.ide.ProjectSpecificContributionItem
-- 
1.8.1.4

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


[yocto] [PATCHv3 3/8] plugins/sdk.ide: Move project specific util methods

2013-06-25 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Move project specific methods to the new util class to allow public
usage of theses methods.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../preferences/YoctoSDKProjectPropertyPage.java   | 121 ++---
 .../sdk/ide/utils/ProjectPreferenceUtils.java  | 102 +
 2 files changed, 109 insertions(+), 114 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index f075c5b..1f82fe1 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -13,12 +13,8 @@
 package org.yocto.sdk.ide.preferences;
 
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -27,19 +23,17 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.ui.IWorkbenchPropertyPage;
 import org.eclipse.ui.dialogs.PropertyPage;
-import org.osgi.service.prefs.BackingStoreException;
 import org.yocto.sdk.ide.YoctoProfileElement;
 import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.YoctoSDKMessages;
-import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
-import org.yocto.sdk.ide.utils.YoctoSDKUtils;
-import org.yocto.sdk.ide.utils.YoctoSDKUtilsConstants;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoUIElement;
 import org.yocto.sdk.ide.YoctoUISetting;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
+import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 
 public class YoctoSDKProjectPropertyPage extends PropertyPage implements
IWorkbenchPropertyPage {
@@ -79,10 +73,10 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
 
yoctoProfileSetting = new YoctoProfileSetting(
new 
YoctoProfileElement(globalProfileElement.getProfilesAsString(), 
selectedProfile), this, false);
-   boolean useProjectSpecificSetting = 
getUseProjectSpecificOptionFromProjectPreferences(project);
+   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOptionFromProjectPreferences(project);
 
if (useProjectSpecificSetting) {
-   yoctoUISetting = new 
YoctoUISetting(getElemFromProjectPreferences(project));
+   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElemFromProjectPreferences(project));
} else {
yoctoUISetting = new 
YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
}
@@ -160,11 +154,11 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
return false;
}
 
-   
saveUseProjectSpecificOptionToProjectPreferences(project, true);
+   
ProjectPreferenceUtils.saveUseProjectSpecificOptionToProjectPreferences(project,
 true);

ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(),
 project);
-   
saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(), project);
+   
ProjectPreferenceUtils.saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(),
 project);
} else {
-   
saveUseProjectSpecificOptionToProjectPreferences(project, false);
+   
ProjectPreferenceUtils.saveUseProjectSpecificOptionToProjectPreferences(project,
 false);

ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(),
 project);
}
 
@@ -173,107 +167,6 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
return super.performOk();
}
 
-   private void saveUseProjectSpecificOptionToProjectPreferences(IProject 
project, boolean useProjectSpecificSetting) {
-   IScopeContext projectScope = new ProjectScope(project);
-   IEclipsePreferences projectNode = 
projectScope.getNode

Re: [yocto] [PATCHv2 0/8][eclipse-poky] Add target profile quick switch

2013-06-23 Thread Timo Mueller

Hi Jessica,

Am 21.06.2013 23:47, schrieb Zhang, Jessica:

Hi Timo,


 So what's the purpose of Project Specific Settings, my
 understanding is it's something that only local to project instead of
 global name space, e.g. profile?

Yes, that's the main idea.


 OK, I've played a little bit  of

 toggling between profiles, and project specific setting and notice
 the following behaviors that can be confusing:

 1. As your preference that user can specify project specific
 settings.  I've noticed for this case, if I haven't entered any
 project specific settings via the preference wizard, it'll always
 copy the profile settings prior to its selection, then in this case I
 don't think it makes much sense since we already have the profiles to
 cover all the settings

That's independent of this patch set, right?

The original idea behind copying the settings of the currently selected
profile was to give the user a starting point for creating the project
specific settings. The assumption was that the user most of the times
only does small modifications to an existing profile.

Sure, if the user doesn't alter the settings, the project specific ones
match an already defined target profile. One difference remains, if
he changes the target profile it will update all projects that use this
profile. The project that is using it's own configuration won't be
changed, although the settings are similar.

An alternative to copying the inital settings would be to blank out
the form, when the checkbox is checked. If the assumption is not
correct and we think that this is easier to understand for the user,
I'll provide a patch set changing this behaviour.




 2.  OK, now let's move to the case of that I do have explicit setup a
 project specific settings in the project property view apply it and
 exit the window.  After that, in the drop down list, when I toggle
 between the options, e.g. I have two profiles besides the project
 specific settings, then every time after I made the selection and
 check in the project properties view, the settings matches my
 selection.  So this is good and consistent behavior.

 3. If  inside the project properties window, I uncheck the Use
 project specific settings box, and select a profile then apply the
 changes close the window.  Now in the drop down list I will see both
 the project specific setting and the selected profile are selected.
 Then next time when I go back, and re-check Use project specific
 settings box, my project specific setting will be gone, instead the
 settings will show as my previous profile settings.

That's a bug in my implementation. They should always be in sink as
you explained in your second point.




 Overall, I think we still need to play a little bit more of different
 setting selections via different approaches, some of the inconsistent
 behavior can get user lost.

 Thanks, Jessica -Original Message- From:
 yocto-boun...@yoctoproject.org
 [mailto:yocto-boun...@yoctoproject.org] On Behalf Of Timo Mueller
 Sent: Friday, June 21, 2013 5:45 AM To: yocto@yoctoproject.org Cc:
 Timo Mueller Subject: [yocto] [PATCHv2 0/8][eclipse-poky] Add target
 profile quick switch

 From: Timo Mueller timo.muel...@bmw-carit.de

 Changes in v2: Handle error when project specific profile is not
 configured more gracefully. Instead of showing an error message the
 button is now greyed out.

 Patches 01..07 contain the implementation with the greyed out menu
 button.

 After playing around with the two options discussed in the first
 patch series, I started to prefer inserting a different button in the
 menu allowing the user to quickly navigate to the project preferences
 instead of just greying it out. I've added this in the last patch of
 the series, so you can compare yourself.

 From original cover letter snip if a user wants to change the used
 target profile of a project he currently has to open the project
 preferences. This can be tedious if he has to switch the profile
 often.

 This is a small addition which allows the user to quickly switch the
 used target profile of a project. Instead of having to open the
 project preferences the user can select the project in the navigator
 and then choose the desired target profile from a drop-down menu in
 the toolbar or from the project menu. /snip

 01: Small i18n fix 02..04: Refactoring the project specific utils
 05..06: Introduce the target profile toolbar switch 07: Adds the
 target profile switch to the project menu 08: Experimental: Add
 button to open project preferences

 Best regards, Timo

Thanks, for the input. I'll fix the bug and send a v3.

Best regards,
Timo

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


[yocto] [PATCHv2 4/8] plugins/sdk.ide: Remove project context from method names

2013-06-21 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Through the context of the ProjectPreferenceUtil class we can infer
that all methods act on project preferences. Having this context
information duplicated in the method name is not needed anymore and
can be removed to get a cleaner API.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../sdk/ide/preferences/YoctoSDKPreferencePage.java  |  6 +++---
 .../sdk/ide/preferences/YoctoSDKProjectPropertyPage.java | 16 
 .../org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java  | 12 ++--
 .../sdk/ide/wizard/NewYoctoProjectTemplateProcess.java   |  2 +-
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index e8123e2..4e6ca2a 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -241,7 +241,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
+   ProjectPreferenceUtils.saveProfiles(profileElement, 
project);
YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(


YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
ProjectPreferenceUtils.saveElemToProjectEnv(elem, 
project);
@@ -255,7 +255,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
+   ProjectPreferenceUtils.saveProfiles(profileElement, 
project);
}
}
 
@@ -296,7 +296,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
private boolean projectUsesProfile(IProject project, String profile)
{
-   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
+   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfiles(project);
 
if (!profileElement.getSelectedProfile().equals(profile)) {
return false;
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 1f82fe1..f6026ee 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -64,7 +64,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage 
implements
IProject project = getProject();
 
YoctoProfileElement globalProfileElement= 
YoctoSDKUtils.getProfilesFromDefaultStore();
-   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
+   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfiles(project);
 
String selectedProfile = profileElement.getSelectedProfile();
if (!globalProfileElement.contains(selectedProfile)) {
@@ -73,10 +73,10 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
 
yoctoProfileSetting = new YoctoProfileSetting(
new 
YoctoProfileElement(globalProfileElement.getProfilesAsString(), 
selectedProfile), this, false);
-   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOptionFromProjectPreferences(project);
+   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOption(project);
 
if (useProjectSpecificSetting) {
-   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElemFromProjectPreferences(project));
+   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElem(project));
} else {
yoctoUISetting = new 
YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
}
@@ -154,12 +154,12 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
return false

[yocto] [PATCHv2 8/8] plugins/sdk.ide: Add project configuration button

2013-06-21 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

This changes the behaviour of the project specific profile button. If
the project specific profile is not yet defined for the selected
project, the list will contain a button to open the project
preferences instead of the greying out the button.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.sdk.ide/plugin.xml  | 4 
 .../src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java| 8 +---
 .../src/org/yocto/sdk/ide/YoctoSDKMessages.properties | 1 +
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index c082c3a..04ed40e 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -81,10 +81,6 @@
 id=org.yocto.sdk.ide.command.reconfigYocto
 name=%command.name
   /command
-  command
-id=org.yocto.sdk.ide.command.disabled
-name=DisabledCommand
-  /command
/extension
extension
  point=org.eclipse.ui.handlers
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
index 41374a6..13e0e7a 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
@@ -27,9 +27,11 @@ import org.yocto.sdk.ide.actions.ProfileSwitchHandler;
 import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 
 public class ProjectSpecificContributionItem extends 
TargetProfileContributionItem {
+   private static final String CONFIGURE_PROJECT_SPECIFIC_PROFILE =
+   
Preferences.Profile.ProjectSpecific.Configure.Label; //$NON-NLS-N$
private static final String PROJECT_SPECIFIC_PROFILE =
Preferences.Profile.ProjectSpecific.Profile.Label; 
//$NON-NLS-N$
-   private static final String DISABLED_COMMAND_ID = 
org.yocto.sdk.ide.command.disabled; //$NON-NLS-N$
+   private static final String RECONFIG_YOCTO_COMMAND_ID = 
org.yocto.sdk.ide.command.reconfigYocto; //$NON-NLS-N$
 
private IServiceLocator serviceLocator;
 
@@ -50,10 +52,10 @@ public class ProjectSpecificContributionItem extends 
TargetProfileContributionIt
if ((result != SDKCheckResults.SDK_PASS)) {
CommandContributionItemParameter parameter = new 
CommandContributionItemParameter(serviceLocator,

null,
-   
DISABLED_COMMAND_ID,
+   
RECONFIG_YOCTO_COMMAND_ID,

CommandContributionItem.STYLE_PUSH);
 
-   parameter.label = 
YoctoSDKMessages.getString(PROJECT_SPECIFIC_PROFILE);
+   parameter.label = 
YoctoSDKMessages.getString(CONFIGURE_PROJECT_SPECIFIC_PROFILE);
 
items.add(new CommandContributionItem(parameter));
} else {
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index e71b7dd..f545c2b 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -89,6 +89,7 @@ Preferences.Profile.Standard.Modification.Message = Standard 
cross development p
 Preferences.Profile.ProjectSpecific.Title = Use project specific settings
 Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
 Preferences.Profile.ProjectSpecific.Profile.Label = Project specific profile
+Preferences.Profile.ProjectSpecific.Configure.Label = Configure project 
specific profile ...
 
 Preferences.Profile.ProjectSpecific.Error.Title = Could not change to project 
specific target profile
 Preferences.Profile.ProjectSpecific.Error.Message = The project specific 
target profile is not defined for the project {0}.\nYou can define it in the 
project's property page.  
-- 
1.8.1.4

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


[yocto] [PATCHv2 5/8] plugins/sdk.ide: Add command to switch the target profile

2013-06-21 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The command can be used in a radio group to switch the target profile
of a selected project.

Radio items should call this command handing over the name of the
target profile as the command's parameter.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../OSGI-INF/l10n/bundle.properties|   3 +
 plugins/org.yocto.sdk.ide/plugin.xml   |  18 
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   3 +
 .../sdk/ide/actions/ProfileSwitchHandler.java  | 110 +
 4 files changed, 134 insertions(+)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java

diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties 
b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
index 48eb653..1191af6 100644
--- a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -6,6 +6,9 @@ extension.name.2 = YoctoSDKCMakeNature
 command.name = ReconfigureYoctoProject
 command.label.0 = Change Yocto Project Settings
 command.mnemonic = C
+command.targetProfileSwitch.name = Change Target Profile
+command.targetProfileSwitch.description = Changes the target profile of a 
selected project
+command.targetProfileSwitch.parameter.name = Selected Target Profile
 projectType.name.0 = Yocto Project ADT Autotools Project
 projectProperties.label.0 = Yocto Project Settings
 Bundle-Vendor = yoctoproject.org
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index 7ea55c7..62f1297 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -225,5 +225,23 @@
  /filter
   /page
/extension
+   extension
+ point=org.eclipse.ui.commands
+  command
+defaultHandler=org.yocto.sdk.ide.actions.ProfileSwitchHandler
+description=%command.targetProfileSwitch.description
+id=org.yocto.sdk.ide.targetProfile.switch
+name=%command.targetProfileSwitch.name
+ commandParameter
+   id=org.eclipse.ui.commands.radioStateParameter
+   name=%command.targetProfileSwitch.parameter.name
+   optional=false
+ /commandParameter
+ state
+   class=org.eclipse.ui.handlers.RadioState:project-specific
+   id=org.eclipse.ui.commands.radioState
+ /state
+  /command
+   /extension
 
 /plugin
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 4ff1574..d6b5cdb 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -89,6 +89,9 @@ Preferences.Profile.Standard.Modification.Message = Standard 
cross development p
 Preferences.Profile.ProjectSpecific.Title = Use project specific settings
 Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
 
+Preferences.Profile.ProjectSpecific.Error.Title = Could not change to project 
specific target profile
+Preferences.Profile.ProjectSpecific.Error.Message = The project specific 
target profile is not defined for the project {0}.\nYou can define it in the 
project's property page.  
+
 Console.SDK.Name = Yocto Project Console
 
 LaunchConfig.Type.Name = 
org.eclipse.ui.externaltools.ProgramLaunchConfigurationType
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
new file mode 100644
index 000..38e3e6d
--- /dev/null
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
@@ -0,0 +1,110 @@
+/***
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ * 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:
+ * BMW Car IT - initial implementation
+ 
***/
+package org.yocto.sdk.ide.actions;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import

[yocto] [PATCHv2 6/8] plugins/sdk.ide: Add profile switch menu to the toolbar

2013-06-21 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If a project with a yocto nature is selected, the toolbar will show a
target profile menu which allows the user to switch the used target
profile of the project.

The content of this menu is dynamically created using the list of
globally defined target profiles. Additionally it will also contain
the project specific profile.

If the project specific profile is not yet defined for the selected
project, the button will be greyed out.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../OSGI-INF/l10n/bundle.properties|   1 +
 plugins/org.yocto.sdk.ide/plugin.xml   |  57 +-
 .../sdk/ide/ProjectSpecificContributionItem.java   |  89 +++
 .../sdk/ide/TargetProfileContributionItem.java | 125 +
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   1 +
 .../sdk/ide/actions/ProfileSwitchHandler.java  |  26 -
 6 files changed, 297 insertions(+), 2 deletions(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java

diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties 
b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
index 1191af6..2031154 100644
--- a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -7,6 +7,7 @@ command.name = ReconfigureYoctoProject
 command.label.0 = Change Yocto Project Settings
 command.mnemonic = C
 command.targetProfileSwitch.name = Change Target Profile
+command.targetProfileSwitch.label = Target Profiles
 command.targetProfileSwitch.description = Changes the target profile of a 
selected project
 command.targetProfileSwitch.parameter.name = Selected Target Profile
 projectType.name.0 = Yocto Project ADT Autotools Project
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index 62f1297..aaa0a35 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -81,6 +81,10 @@
 id=org.yocto.sdk.ide.command.reconfigYocto
 name=%command.name
   /command
+  command
+id=org.yocto.sdk.ide.command.disabled
+name=DisabledCommand
+  /command
/extension
extension
  point=org.eclipse.ui.handlers
@@ -243,5 +247,56 @@
  /state
   /command
/extension
-
+   extension
+ point=org.eclipse.ui.menus
+  menuContribution
+allPopups=true
+locationURI=toolbar:org.eclipse.ui.main.toolbar?after=additions
+ toolbar
+   id=org.yocto.sdk.ide.profiles.toolbar
+command
+  commandId=org.yocto.sdk.ide.command.reconfigYocto
+  id=org.yocto.sdk.ide.profiles.toolbar.dropdown
+  label=%command.targetProfileSwitch.label
+  mode=FORCE_TEXT
+  style=pulldown
+  tooltip=%command.targetProfileSwitch.description
+   visibleWhen
+ checkEnabled=false
+  and
+ count
+   value=1
+ /count
+ iterate
+   operator=and
+adapt
+  type=org.eclipse.core.resources.IResource
+   test
+ 
property=org.eclipse.core.resources.projectNature
+ value=org.yocto.sdk.ide.YoctoSDKNature
+   /test
+/adapt
+ /iterate
+  /and
+   /visibleWhen
+/command
+ /toolbar
+  /menuContribution
+  menuContribution
+allPopups=false
+locationURI=menu:org.yocto.sdk.ide.profiles.toolbar.dropdown
+ dynamic
+   class=org.yocto.sdk.ide.ProjectSpecificContributionItem
+   id=org.yocto.sdk.ide.dynamic.projectSpecific.targetProfile
+ /dynamic
+ separator
+   name=org.yocto.sdk.ide.profiles.separator
+   visible=true
+ /separator
+ dynamic
+   class=org.yocto.sdk.ide.TargetProfileContributionItem
+   id=org.yocto.sdk.ide.dynamic.targetProfile
+ /dynamic
+  /menuContribution
+   /extension
 /plugin
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
new file mode 100644
index 000..41374a6
--- /dev/null
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
@@ -0,0 +1,89

[yocto] [PATCH 5/7] plugins/sdk.ide: Add command to switch the target profile

2013-06-13 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The command can be used in a radio group to switch the target profile
of a selected project.

Radio items should call this command handing over the name of the
target profile as the command's parameter.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../OSGI-INF/l10n/bundle.properties|   3 +
 plugins/org.yocto.sdk.ide/plugin.xml   |  18 +++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   3 +
 .../sdk/ide/actions/ProfileSwitchHandler.java  | 130 +
 4 files changed, 154 insertions(+)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java

diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties 
b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
index 48eb653..1191af6 100644
--- a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -6,6 +6,9 @@ extension.name.2 = YoctoSDKCMakeNature
 command.name = ReconfigureYoctoProject
 command.label.0 = Change Yocto Project Settings
 command.mnemonic = C
+command.targetProfileSwitch.name = Change Target Profile
+command.targetProfileSwitch.description = Changes the target profile of a 
selected project
+command.targetProfileSwitch.parameter.name = Selected Target Profile
 projectType.name.0 = Yocto Project ADT Autotools Project
 projectProperties.label.0 = Yocto Project Settings
 Bundle-Vendor = yoctoproject.org
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index 7ea55c7..62f1297 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -225,5 +225,23 @@
  /filter
   /page
/extension
+   extension
+ point=org.eclipse.ui.commands
+  command
+defaultHandler=org.yocto.sdk.ide.actions.ProfileSwitchHandler
+description=%command.targetProfileSwitch.description
+id=org.yocto.sdk.ide.targetProfile.switch
+name=%command.targetProfileSwitch.name
+ commandParameter
+   id=org.eclipse.ui.commands.radioStateParameter
+   name=%command.targetProfileSwitch.parameter.name
+   optional=false
+ /commandParameter
+ state
+   class=org.eclipse.ui.handlers.RadioState:project-specific
+   id=org.eclipse.ui.commands.radioState
+ /state
+  /command
+   /extension
 
 /plugin
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 4ff1574..d6b5cdb 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -89,6 +89,9 @@ Preferences.Profile.Standard.Modification.Message = Standard 
cross development p
 Preferences.Profile.ProjectSpecific.Title = Use project specific settings
 Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
 
+Preferences.Profile.ProjectSpecific.Error.Title = Could not change to project 
specific target profile
+Preferences.Profile.ProjectSpecific.Error.Message = The project specific 
target profile is not defined for the project {0}.\nYou can define it in the 
project's property page.  
+
 Console.SDK.Name = Yocto Project Console
 
 LaunchConfig.Type.Name = 
org.eclipse.ui.externaltools.ProgramLaunchConfigurationType
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
new file mode 100644
index 000..f751244
--- /dev/null
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
@@ -0,0 +1,130 @@
+/***
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ * 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:
+ * BMW Car IT - initial implementation
+ 
***/
+package org.yocto.sdk.ide.actions;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog

[yocto] [PATCH 4/7] plugins/sdk.ide: Remove project context from method names

2013-06-13 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Through the context of the ProjectPreferenceUtil class we can infer
that all methods act on project preferences. Having this context
information duplicated in the method name is not needed anymore and
can be removed to get a cleaner API.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../sdk/ide/preferences/YoctoSDKPreferencePage.java  |  6 +++---
 .../sdk/ide/preferences/YoctoSDKProjectPropertyPage.java | 16 
 .../org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java  | 12 ++--
 .../sdk/ide/wizard/NewYoctoProjectTemplateProcess.java   |  2 +-
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index e8123e2..4e6ca2a 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -241,7 +241,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
+   ProjectPreferenceUtils.saveProfiles(profileElement, 
project);
YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(


YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
ProjectPreferenceUtils.saveElemToProjectEnv(elem, 
project);
@@ -255,7 +255,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
+   ProjectPreferenceUtils.saveProfiles(profileElement, 
project);
}
}
 
@@ -296,7 +296,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
private boolean projectUsesProfile(IProject project, String profile)
{
-   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
+   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfiles(project);
 
if (!profileElement.getSelectedProfile().equals(profile)) {
return false;
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 1f82fe1..f6026ee 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -64,7 +64,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage 
implements
IProject project = getProject();
 
YoctoProfileElement globalProfileElement= 
YoctoSDKUtils.getProfilesFromDefaultStore();
-   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfilesFromProjectPreferences(project);
+   YoctoProfileElement profileElement = 
ProjectPreferenceUtils.getProfiles(project);
 
String selectedProfile = profileElement.getSelectedProfile();
if (!globalProfileElement.contains(selectedProfile)) {
@@ -73,10 +73,10 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
 
yoctoProfileSetting = new YoctoProfileSetting(
new 
YoctoProfileElement(globalProfileElement.getProfilesAsString(), 
selectedProfile), this, false);
-   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOptionFromProjectPreferences(project);
+   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOption(project);
 
if (useProjectSpecificSetting) {
-   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElemFromProjectPreferences(project));
+   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElem(project));
} else {
yoctoUISetting = new 
YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
}
@@ -154,12 +154,12 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
return false

[yocto] [PATCH 1/7] plugins/sdk.ide: Use an internationalized dialog title

2013-06-13 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de


Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index e5a7897..d192538 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -42,7 +42,6 @@ import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.preferences.PreferenceConstants;
 
 public class YoctoUISetting {
-
private static final String ENV_SCRIPT_FILE_PREFIX = 
environment-setup-;
 
private SelectionListener fSelectionListener;
@@ -375,7 +374,7 @@ public class YoctoUISetting {
if ((result != SDKCheckResults.SDK_PASS)  showErrorDialog) {
Display display = Display.getCurrent();
ErrorDialog.openError(display.getActiveShell(),
-   Yocto 
Project Configuration Error,
+   
YoctoSDKChecker.SDKCheckRequestFrom.Other.getErrorMessage(),

YoctoSDKChecker.getErrorMessage(result, from),
new 
Status(Status.ERROR, YoctoSDKPlugin.PLUGIN_ID, result.getMessage()));
 
-- 
1.8.1.4

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


[yocto] [PATCH 2/7] plugins/sdk.ide: Extract project specific util methods

2013-06-13 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Project specific util methods are moved to a separate util class. This
way the general util class will get more concise and other project
specific methods can be move to this new util class later.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../natures/YoctoSDKAutotoolsProjectNature.java|   3 +-
 .../ide/preferences/YoctoSDKPreferencePage.java|  11 +-
 .../preferences/YoctoSDKProjectPropertyPage.java   |  13 +-
 .../sdk/ide/utils/ProjectPreferenceUtils.java  | 138 +
 .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 --
 .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
 6 files changed, 155 insertions(+), 131 deletions(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
index fb53c53..ce80d77 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
@@ -18,6 +18,7 @@ import 
org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.core.resources.IProject;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoUIElement;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 
 public class YoctoSDKAutotoolsProjectNature extends YoctoSDKProjectNature {
@@ -35,7 +36,7 @@ public class YoctoSDKAutotoolsProjectNature extends 
YoctoSDKProjectNature {
public static void configureAutotoolsOptions(IProject project) {
IManagedBuildInfo info = 
ManagedBuildManager.getBuildInfo(project);
IConfiguration icfg = info.getDefaultConfiguration();
-   YoctoUIElement elem = 
YoctoSDKUtils.getElemFromProjectEnv(project);
+   YoctoUIElement elem = 
ProjectPreferenceUtils.getElemFromProjectEnv(project);
String sysroot_str = elem.getStrSysrootLoc();
String id = icfg.getId();
String CFLAGS_str = YoctoSDKUtils.getEnvValue(project, 
CFLAGS);
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 211c4f9..e8123e2 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -34,6 +34,7 @@ import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.natures.YoctoSDKProjectNature;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
 import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 import org.yocto.sdk.ide.YoctoSDKMessages;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
@@ -240,10 +241,10 @@ public class YoctoSDKPreferencePage extends 
PreferencePage implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(


YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
-   YoctoSDKUtils.saveElemToProjectEnv(elem, project);
+   ProjectPreferenceUtils.saveElemToProjectEnv(elem, 
project);
}
}
 
@@ -254,14 +255,14 @@ public class YoctoSDKPreferencePage extends 
PreferencePage implements IWorkbench
 
for (IProject project : yoctoProjects)
{
-   
YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
+   
ProjectPreferenceUtils.saveProfilesToProjectPreferences(profileElement, 
project);
}
}
 
private void updateProjects(HashSetIProject yoctoProjects, 
YoctoUIElement elem) {
for (IProject project : yoctoProjects)
{
-   YoctoSDKUtils.saveElemToProjectEnv(elem, project);
+   ProjectPreferenceUtils.saveElemToProjectEnv(elem, 
project);
}
}
 
@@ -295,7 +296,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
private boolean projectUsesProfile(IProject project, String profile

[yocto] [PATCH 6/7] plugins/sdk.ide: Add profile switch menu to the toolbar

2013-06-13 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If a project with a yocto nature is selected, the toolbar will show a
target profile menu which allows the user to switch the used target
profile of the project.

The content of this menu is dynamically created using the list of
globally defined target profiles.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../OSGI-INF/l10n/bundle.properties|   2 +
 plugins/org.yocto.sdk.ide/plugin.xml   |  57 ++
 .../sdk/ide/TargetProfileContributionItem.java | 121 +
 .../sdk/ide/actions/ProfileSwitchHandler.java  |  26 -
 4 files changed, 205 insertions(+), 1 deletion(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java

diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties 
b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
index 1191af6..f60df76 100644
--- a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -7,8 +7,10 @@ command.name = ReconfigureYoctoProject
 command.label.0 = Change Yocto Project Settings
 command.mnemonic = C
 command.targetProfileSwitch.name = Change Target Profile
+command.targetProfileSwitch.label = Target Profiles
 command.targetProfileSwitch.description = Changes the target profile of a 
selected project
 command.targetProfileSwitch.parameter.name = Selected Target Profile
+command.targetProfileSwitch.projectSpeficic.label = Project Specific
 projectType.name.0 = Yocto Project ADT Autotools Project
 projectProperties.label.0 = Yocto Project Settings
 Bundle-Vendor = yoctoproject.org
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index 62f1297..9ff8473 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -243,5 +243,62 @@
  /state
   /command
/extension
+   extension
+ point=org.eclipse.ui.menus
+  menuContribution
+allPopups=true
+locationURI=toolbar:org.eclipse.ui.main.toolbar?after=additions
+ toolbar
+   id=org.yocto.sdk.ide.profiles.toolbar
+command
+  commandId=org.yocto.sdk.ide.command.reconfigYocto
+  id=org.yocto.sdk.ide.profiles.toolbar.dropdown
+  label=%command.targetProfileSwitch.label
+  mode=FORCE_TEXT
+  style=pulldown
+  tooltip=%command.targetProfileSwitch.description
+   visibleWhen
+ checkEnabled=false
+  and
+ count
+   value=1
+ /count
+ iterate
+   operator=and
+adapt
+  type=org.eclipse.core.resources.IResource
+   test
+ 
property=org.eclipse.core.resources.projectNature
+ value=org.yocto.sdk.ide.YoctoSDKNature
+   /test
+/adapt
+ /iterate
+  /and
+   /visibleWhen
+/command
+ /toolbar
+  /menuContribution
+  menuContribution
+allPopups=false
+locationURI=menu:org.yocto.sdk.ide.profiles.toolbar.dropdown
+ command
+   commandId=org.yocto.sdk.ide.targetProfile.switch
+   label=%command.targetProfileSwitch.projectSpeficic.label
+   style=radio
+parameter
+  name=org.eclipse.ui.commands.radioStateParameter
+  value=project-specific
+/parameter
+ /command
+ separator
+   name=org.yocto.sdk.ide.profiles.separator
+   visible=true
+ /separator
+ dynamic
+   class=org.yocto.sdk.ide.TargetProfileContributionItem
+   id=org.yocto.sdk.ide.dynamic.targetProfile
+ /dynamic
+  /menuContribution
+   /extension
 
 /plugin
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
new file mode 100644
index 000..88b4a11
--- /dev/null
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
@@ -0,0 +1,121 @@
+/***
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ * 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:
+ * BMW Car

[yocto] [PATCH 0/7][eclipse-poky] Add target profile quick switch

2013-06-13 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Hi,

if a user wants to change the used target profile of a project he
currently has to open the project preferences. This can be tedious if
he has to switch the profile often.

This is a small addition which allows the user to quickly switch the
used target profile of a project. Instead of having to open the
project preferences the user can select the project in the navigator
and then choose the desired target profile from a drop-down menu in
the toolbar or from the project menu.

01: Small i18n fix
02..04: Refactoring the project specific utils
05..06: Introduce the target profile toolbar switch
07: Adds the target profile switch to the project menu

Best regards,
Timo

Timo Mueller (7):
  plugins/sdk.ide: Use an internationalized dialog title
  plugins/sdk.ide: Extract project specific util methods
  plugins/sdk.ide: Move project specific util methods
  plugins/sdk.ide: Remove project context from method names
  plugins/sdk.ide: Add command to switch the target profile
  plugins/sdk.ide: Add profile switch menu to the toolbar
  plugins/sdk.ide: Add profile switch menu to the project menu

 .../OSGI-INF/l10n/bundle.properties|   5 +
 plugins/org.yocto.sdk.ide/plugin.xml   | 105 +
 .../sdk/ide/TargetProfileContributionItem.java | 121 +++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   3 +
 .../src/org/yocto/sdk/ide/YoctoUISetting.java  |   3 +-
 .../sdk/ide/actions/ProfileSwitchHandler.java  | 154 +
 .../natures/YoctoSDKAutotoolsProjectNature.java|   3 +-
 .../ide/preferences/YoctoSDKPreferencePage.java|  11 +-
 .../preferences/YoctoSDKProjectPropertyPage.java   | 130 ++-
 .../sdk/ide/utils/ProjectPreferenceUtils.java  | 240 +
 .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 118 --
 .../ide/wizard/NewYoctoProjectTemplateProcess.java |   3 +-
 12 files changed, 651 insertions(+), 245 deletions(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java

-- 
1.8.1.4

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


[yocto] [PATCH 3/7] plugins/sdk.ide: Move project specific util methods

2013-06-13 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Move project specific methods to the new util class to allow public
usage of theses methods.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../preferences/YoctoSDKProjectPropertyPage.java   | 121 ++---
 .../sdk/ide/utils/ProjectPreferenceUtils.java  | 102 +
 2 files changed, 109 insertions(+), 114 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index f075c5b..1f82fe1 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -13,12 +13,8 @@
 package org.yocto.sdk.ide.preferences;
 
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -27,19 +23,17 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.ui.IWorkbenchPropertyPage;
 import org.eclipse.ui.dialogs.PropertyPage;
-import org.osgi.service.prefs.BackingStoreException;
 import org.yocto.sdk.ide.YoctoProfileElement;
 import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
 import org.yocto.sdk.ide.YoctoSDKMessages;
-import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
-import org.yocto.sdk.ide.utils.YoctoSDKUtils;
-import org.yocto.sdk.ide.utils.YoctoSDKUtilsConstants;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoUIElement;
 import org.yocto.sdk.ide.YoctoUISetting;
+import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
+import org.yocto.sdk.ide.utils.YoctoSDKUtils;
 
 public class YoctoSDKProjectPropertyPage extends PropertyPage implements
IWorkbenchPropertyPage {
@@ -79,10 +73,10 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
 
yoctoProfileSetting = new YoctoProfileSetting(
new 
YoctoProfileElement(globalProfileElement.getProfilesAsString(), 
selectedProfile), this, false);
-   boolean useProjectSpecificSetting = 
getUseProjectSpecificOptionFromProjectPreferences(project);
+   boolean useProjectSpecificSetting = 
ProjectPreferenceUtils.getUseProjectSpecificOptionFromProjectPreferences(project);
 
if (useProjectSpecificSetting) {
-   yoctoUISetting = new 
YoctoUISetting(getElemFromProjectPreferences(project));
+   yoctoUISetting = new 
YoctoUISetting(ProjectPreferenceUtils.getElemFromProjectPreferences(project));
} else {
yoctoUISetting = new 
YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
}
@@ -160,11 +154,11 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
return false;
}
 
-   
saveUseProjectSpecificOptionToProjectPreferences(project, true);
+   
ProjectPreferenceUtils.saveUseProjectSpecificOptionToProjectPreferences(project,
 true);

ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(),
 project);
-   
saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(), project);
+   
ProjectPreferenceUtils.saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(),
 project);
} else {
-   
saveUseProjectSpecificOptionToProjectPreferences(project, false);
+   
ProjectPreferenceUtils.saveUseProjectSpecificOptionToProjectPreferences(project,
 false);

ProjectPreferenceUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(),
 project);
}
 
@@ -173,107 +167,6 @@ public class YoctoSDKProjectPropertyPage extends 
PropertyPage implements
return super.performOk();
}
 
-   private void saveUseProjectSpecificOptionToProjectPreferences(IProject 
project, boolean useProjectSpecificSetting) {
-   IScopeContext projectScope = new ProjectScope(project);
-   IEclipsePreferences projectNode = 
projectScope.getNode

[yocto] [PATCH 7/7] plugins/sdk.ide: Add profile switch menu to the project menu

2013-06-13 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If a project with a yocto nature is selected, the project menu will
show a target profile menu which allows the user to switch the used
target profile of the project.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.sdk.ide/plugin.xml | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/plugins/org.yocto.sdk.ide/plugin.xml 
b/plugins/org.yocto.sdk.ide/plugin.xml
index 9ff8473..c766ba2 100644
--- a/plugins/org.yocto.sdk.ide/plugin.xml
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -247,6 +247,15 @@
  point=org.eclipse.ui.menus
   menuContribution
 allPopups=true
+locationURI=menu:project
+ menu
+   id=org.yocto.sdk.ide.profiles.menu
+   label=%command.targetProfileSwitch.label
+   tooltip=%command.targetProfileSwitch.description
+ /menu
+  /menuContribution
+  menuContribution
+allPopups=true
 locationURI=toolbar:org.eclipse.ui.main.toolbar?after=additions
  toolbar
id=org.yocto.sdk.ide.profiles.toolbar
@@ -280,6 +289,27 @@
   /menuContribution
   menuContribution
 allPopups=false
+locationURI=menu:org.yocto.sdk.ide.profiles.menu
+ command
+   commandId=org.yocto.sdk.ide.targetProfile.switch
+   label=%command.targetProfileSwitch.projectSpeficic.label
+   style=radio
+parameter
+  name=org.eclipse.ui.commands.radioStateParameter
+  value=project-specific
+/parameter
+ /command
+ separator
+   name=org.yocto.sdk.ide.profiles.separator
+   visible=true
+ /separator
+ dynamic
+   class=org.yocto.sdk.ide.TargetProfileContributionItem
+   id=org.yocto.sdk.ide.dynamic.targetProfile
+ /dynamic
+  /menuContribution
+  menuContribution
+allPopups=false
 locationURI=menu:org.yocto.sdk.ide.profiles.toolbar.dropdown
  command
commandId=org.yocto.sdk.ide.targetProfile.switch
-- 
1.8.1.4

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


[yocto] [PATCH] plugins/sdk.ide: Fix setting default profile

2013-03-14 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

This fixes a regression where the default profile was not changed if
the content of the UI settings were identical.

The regression was introduced with
f93aabf17df2c9a8971c4b428f67a9273c011233

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java  | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index d6a7c4f..2c482f7 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -123,11 +123,14 @@ public class YoctoSDKPreferencePage extends 
PreferencePage implements IWorkbench
YoctoUIElement savedElement = 
YoctoSDKUtils.getElemFromStore(getPreferenceStore());
YoctoUIElement modifiedElement = 
yoctoUISetting.getCurrentInput();
 
-   if (savedElement.equals(modifiedElement)) {
+   YoctoProfileElement savedProfileElement = 
YoctoSDKUtils.getProfilesFromDefaultStore();
+   YoctoProfileElement profileElement = 
yoctoProfileSetting.getCurrentInput();
+
+   if (savedElement.equals(modifiedElement) 
+   
profileElement.getSelectedProfile().equals(savedProfileElement.getSelectedProfile()))
 {
return true;
}
 
-   YoctoProfileElement profileElement = 
yoctoProfileSetting.getCurrentInput();
HashSetIProject yoctoProjects = 
getAffectedProjects(profileElement.getSelectedProfile());
 
if (!yoctoProjects.isEmpty()) {
-- 
1.7.11.7

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


[yocto] [PATCH 1/5] plugins/sdk.ide: Rephrase error messages

2013-03-05 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de


Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoSDKMessages.properties | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 4a4fb60..f3ba7e2 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -20,14 +20,14 @@ Poky.SDK.Target.Empty.Advice = You need specify Target 
Architecture before build
 Poky.Sysroot.Empty = Specified Sysroot Location is empty.
 Poky.Sysroot.Empty.Advice = You need specify Sysroot Location before building 
any project.
 Poky.Sysroot.Nonexist = Specified Sysroot Location does not exist.
-Poky.Qemu.Kernel.Empty.Advice = You need specify a valid Sysroot Location 
before building any project.
+Poky.Sysroot.Nonexist.Advice = You need specify a valid Sysroot Location 
before building any project.
 Poky.Qemu.Kernel.Empty =  Specified QEMU kernel location is emtpy.
 Poky.Qemu.Kernel.Empty.Advice = You need specify QEMU kernel image file 
Location before building any project.
 Poky.Qemu.Kernel.Nonexist = Specified QEMU kernel image file does not exist.
 Poky.Qemu.Kernel.Empty.Advice = You need specify a valid QEMU kernel image 
file before building any project.
 Poky.ADT.Sysroot.Wrongversion = The ADT version you're using is too old.
 Poky.ADT.Sysroot.Wrongversion.Advice = OECORE related items are not found in 
environment setup files.\nPlease upgrade to our latest ADT Version!
-Poky.Env.Script.Nonexist = Specified Build Tree Toolchain Root does not 
contain any toolchain yet.
+Poky.Env.Script.Nonexist = Specified toolchain directory does not contain a 
toolchain generated with meta-ide-support.
 Poky.Env.Script.Nonexist.Advice = Please run bitbake meta-ide-support to 
build the toolchain.
 Poky.Toolchain.No.Sysroot = Specified Toolchain Root Location does not contain 
a sysroot directory.
 Poky.Toolchain.No.Sysroot.Advice = Please install a valid toolchain sysroot.
-- 
1.7.11.7

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


[yocto] [PATCH 0/5][eclipse-poky] Improve SDK check error messages

2013-03-05 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Hi,

these are some minor changes to improve the display of the SDK check
error messages on the property and preference pages.

The 'lifetime' of the error messages has been changed slightly. If an
SDK check failed the error message will now only be shown until the
user changes the settings (typing, selecting). If he does so a new
message is shown asking him to revalidate changes by clicking apply
again.

01..02: Refining error messages
03..05: Clear error message when user changes the settings

Best regards,
Timo

Timo Mueller (5):
  plugins/sdk.ide: Rephrase error messages
  plugins/sdk.ide: Add new error message for unselected target arch
  plugins/sdk.ide: Fix setting layout of parent composite
  plugins/sdk.ide: Relay events from child widgets to the parent
composite
  plugins/sdk.ide: Inform user that the settings have to revalidated

 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java |  1 -
 .../yocto/sdk/ide/YoctoProjectSpecificSetting.java |  1 -
 .../src/org/yocto/sdk/ide/YoctoSDKChecker.java |  6 
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  7 ++--
 .../src/org/yocto/sdk/ide/YoctoUISetting.java  | 40 +++---
 .../ide/preferences/YoctoSDKPreferencePage.java| 28 ++-
 .../preferences/YoctoSDKProjectPropertyPage.java   | 32 -
 7 files changed, 104 insertions(+), 11 deletions(-)

-- 
1.7.11.7

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


[yocto] [PATCH 2/5] plugins/sdk.ide: Add new error message for unselected target arch

2013-03-05 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If the toolchain location contains environment scripts but no target
architecture is selected show an appropriate error message.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java| 6 ++
 .../src/org/yocto/sdk/ide/YoctoSDKMessages.properties   | 2 ++
 2 files changed, 8 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
index 9579021..5f790ee 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
@@ -31,6 +31,8 @@ public class YoctoSDKChecker {
Poky.SDK.Location.Nonexist, true),
SDK_TARGET_EMPTY(
Poky.SDK.Target.Empty, true),
+   SDK_NO_TARGET_SELECTED(
+   Poky.SDK.No.Target.Selected, false),
SYSROOT_EMPTY(
Poky.Sysroot.Empty, true),
SYSROOT_NONEXIST(
@@ -130,6 +132,10 @@ public class YoctoSDKChecker {
}
}
 
+   if (elem.getStrTarget().isEmpty()  
elem.getStrTargetsArray().length  0) {
+   return SDKCheckResults.SDK_NO_TARGET_SELECTED;
+   }
+
if (elem.getIntTargetIndex()  0 || 
elem.getStrTarget().isEmpty()) {
//if this is poky tree mode, prompt user whether 
bitbake meta-ide-support is executed?
if (elem.getEnumPokyMode() == 
YoctoUIElement.PokyMode.POKY_TREE_MODE)
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index f3ba7e2..07a0009 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -17,6 +17,8 @@ Poky.SDK.Location.Nonexist = Specified SDK toolchain 
directory does not exist.
 Poky.SDK.Location.Nonexist.Advice = Please specify a valid toolchain directory.
 Poky.SDK.Target.Empty = Specified location does not contain environment script 
file.
 Poky.SDK.Target.Empty.Advice = You need specify Target Architecture before 
building any project.
+Poky.SDK.No.Target.Selected = Target Architecture is not defined.
+Poky.SDK.No.Target.Selected.Advice = Please choose a Target Architecture.
 Poky.Sysroot.Empty = Specified Sysroot Location is empty.
 Poky.Sysroot.Empty.Advice = You need specify Sysroot Location before building 
any project.
 Poky.Sysroot.Nonexist = Specified Sysroot Location does not exist.
-- 
1.7.11.7

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


[yocto] [PATCH 3/5] plugins/sdk.ide: Fix setting layout of parent composite

2013-03-05 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The layout of the parent composite is set in every yocto settings
element. Depending on the order in which the elements are added to the
composite this may lead to different layouts being used.

Layout of the composite is now set in the preference/property pages
instead of setting this in every child component.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java| 1 -
 .../src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java  | 1 -
 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java | 1 -
 .../src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java   | 2 ++
 .../src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java  | 2 ++
 5 files changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 0f36e99..f56fea4 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -60,7 +60,6 @@ public class YoctoProfileSetting {
public void createComposite(Composite composite) {
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
GridLayout layout = new GridLayout(2, false);
-   composite.setLayout(layout);
 
Group storeYoctoConfigurationsGroup = new Group (composite, 
SWT.NONE);
layout = new GridLayout(1, false);
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
index 13acb8e..2a55a64 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
@@ -41,7 +41,6 @@ public class YoctoProjectSpecificSetting {
public void createComposite(Composite composite) {
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
GridLayout layout = new GridLayout(2, false);
-   composite.setLayout(layout);
 
Group storeYoctoConfigurationsGroup = new Group (composite, 
SWT.NONE);
layout = new GridLayout(2, false);
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index f27019d..3aa38d9 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -184,7 +184,6 @@ public class YoctoUISetting {
{
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
GridLayout layout = new GridLayout(2, false);
-   composite.setLayout(layout);
 
Group crossCompilerGroup= new Group(composite, SWT.NONE);
layout= new GridLayout(2, false);
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 1a8c8ca..97c602b 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -22,6 +22,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.IWorkbench;
@@ -76,6 +77,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
protected Control createContents(Composite parent) {
initializeDialogUnits(parent);
final Composite composite= new Composite(parent, SWT.NONE);
+   composite.setLayout(new GridLayout(2, false));
 
yoctoProfileSetting.createComposite(composite);
yoctoUISetting.createComposite(composite);
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index ca148af..effd432 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -16,6 +16,7 @@ import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IAdaptable;
 import

[yocto] [PATCH 4/5] plugins/sdk.ide: Relay events from child widgets to the parent composite

2013-03-05 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If the content of the YoctoUISettings changes, because a contained
widget reports a modify or selection event, an corresponding event is
triggered on the parent composite. UI elements containing the
YoctoUISettings can now register listeners and be notified when the
content changes.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoUISetting.java  | 38 +++---
 1 file changed, 34 insertions(+), 4 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index 3aa38d9..95209b6 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -31,6 +31,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.DirectoryDialog;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
@@ -48,6 +49,8 @@ public class YoctoUISetting {
private ModifyListener fModifyListener;
private YoctoUIElement yoctoUIElement;
 
+   private Group crossCompilerGroup;
+
private Button btnSDKRoot;
private Button btnQemu;
private Button btnPokyRoot;
@@ -79,15 +82,43 @@ public class YoctoUISetting {
 
public void widgetSelected(SelectionEvent e) {
controlChanged(e.widget);
+   relayEvent(e);
+   }
+
+   private void relayEvent(SelectionEvent e) {
+   Event event = new Event();
+   event.data = e.data;
+   event.detail = e.detail;
+   event.display = e.display;
+   event.doit = e.doit;
+   event.height = e.height;
+   event.item = e.item;
+   event.stateMask = e.stateMask;
+   event.text = e.text;
+   event.time = e.time;
+   event.widget = e.widget;
+   event.width = e.width;
+   event.x = e.x;
+   event.y = e.y;
+   
crossCompilerGroup.getParent().notifyListeners(SWT.Selection, event);
}
-   };  
+   };
 
fModifyListener= new ModifyListener() {
public void modifyText(ModifyEvent e) {
controlModified(e.widget);
+   relayEvent(e);
}
-   };
 
+   private void relayEvent(ModifyEvent e) {
+   Event event = new Event();
+   event.data = e.data;
+   event.display = e.display;
+   event.time = e.time;
+   event.widget = e.widget;
+   
crossCompilerGroup.getParent().notifyListeners(SWT.Modify, event);
+   }
+   };
}
 
private Control addControls(Control fControl, final String sKey, String 
sValue)
@@ -185,7 +216,7 @@ public class YoctoUISetting {
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
GridLayout layout = new GridLayout(2, false);
 
-   Group crossCompilerGroup= new Group(composite, SWT.NONE);
+   crossCompilerGroup = new Group(composite, SWT.NONE);
layout= new GridLayout(2, false);
crossCompilerGroup.setLayout(layout);
gd= new GridData(SWT.FILL, SWT.CENTER, true, false);
@@ -521,5 +552,4 @@ public class YoctoUISetting {
}
 
}
-
 }
-- 
1.7.11.7

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


[yocto] [PATCH 5/5] plugins/sdk.ide: Inform user that the settings have to revalidated

2013-03-05 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If the last validation resulted in an error and the user made changes
to the settings the error message is replaced by a message asking the
user to revalidate.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  1 +
 .../src/org/yocto/sdk/ide/YoctoUISetting.java  |  1 +
 .../ide/preferences/YoctoSDKPreferencePage.java| 26 ++-
 .../preferences/YoctoSDKProjectPropertyPage.java   | 30 +-
 4 files changed, 56 insertions(+), 2 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 07a0009..e6d8fa1 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -37,6 +37,7 @@ Poky.Toolchain.Host.Mismatch = Toolchain and host arch 
mismatch.
 Poky.Toolchain.Host.Mismatch.Advice = Make sure you use 32bit toolchain for 
32bit host and same for 64bit machines!
 
 Default.Advice = \nDo IDE-wide settings from Window  Preferences  Yocto 
Project ADT\nOr do Project-wide settings from Project  Change Yocto Project 
Settings.
+Poky.SDK.Revalidation.Message = Please apply the changes to revalidate.
 
 Poky.SDK.Error.Origin.Wizard = Yocto Wizard Configuration Error:
 Poky.SDK.Error.Origin.Menu = Yocto Menu Configuration Error:
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index 95209b6..e5a7897 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -300,6 +300,7 @@ public class YoctoUISetting {
btnPokyRoot.addSelectionListener(fSelectionListener);
btnQemu.addSelectionListener(fSelectionListener);
btnDevice.addSelectionListener(fSelectionListener);
+   targetArchCombo.addSelectionListener(fSelectionListener);
textRootLoc.addModifyListener(fModifyListener);
textKernelLoc.addModifyListener(fModifyListener);
textQemuOption.addModifyListener(fModifyListener);
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 97c602b..f013cf8 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -25,6 +25,8 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 import org.yocto.sdk.ide.YoctoProfileElement;
@@ -44,10 +46,13 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
private static final String NEW_DIALOG_MESSAGE = 
Preferences.Profile.New.Dialog.Message;
private static final String UPDATE_DIALOG_TITLE = 
Preferences.Profile.Update.Dialog.Title;
private static final String UPDATE_DIALOG_MESSAGE = 
Preferences.Profile.Update.Dialog.Message;
+   private static final String REVALIDATION_MESSAGE = 
Poky.SDK.Revalidation.Message;
 
private YoctoProfileSetting yoctoProfileSetting;
private YoctoUISetting yoctoUISetting;
 
+   private Listener changeListener;
+
public YoctoSDKPreferencePage() {
//super(GRID);
IPreferenceStore defaultStore = 
YoctoSDKPlugin.getDefault().getPreferenceStore();
@@ -66,6 +71,16 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
YoctoProfileElement profileElement = new 
YoctoProfileElement(profiles, selectedProfile);
this.yoctoProfileSetting = new 
YoctoProfileSetting(profileElement, this, true);
+
+   changeListener = new Listener() {
+   @Override
+   public void handleEvent(Event event) {
+   if (getErrorMessage() != null) {
+   setErrorMessage(null);
+   
setMessage(YoctoSDKMessages.getString(REVALIDATION_MESSAGE), INFORMATION);
+   }
+   }
+   };
}
 
/*
@@ -82,6 +97,9 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
yoctoProfileSetting.createComposite(composite

Re: [yocto] [eclipse-poky][PATCH 0/4] Refactorings in org.yocto.sdk.ide plugin

2013-03-05 Thread Timo Mueller

Hi Atanas,

Am 05.03.2013 17:51, schrieb Atanas Gegov:

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

Hi,

This patch series does some refactoring in the org.yocto.sdk.ide plugin.
The natures and the utils get their own packages. Some methods and members were
also moved to suitable classes.


What are you trying to improve? What is the idea of moving all these 
classes around?
Please provide some more detail of what you are trying to accomplish 
with this patch set.




Cheers,
Atanas


Best regards,
Timo
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [PATCH] plugins/sdk.ide: Remove profile edit buttons from property page

2013-02-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The project property page for yocto project settings contains the same
edit buttons as the preference page. As editing profiles is not
allowed in the property page these buttons have been permanently
disabled.

This removes them completely from the property page. The remaining
profile drop-down box allows the user to select a cross development
profile for the project.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java | 30 --
 .../ide/preferences/YoctoSDKPreferencePage.java|  2 +-
 .../preferences/YoctoSDKProjectPropertyPage.java   |  3 +--
 3 files changed, 24 insertions(+), 11 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index cc3e167..0f36e99 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -49,10 +49,12 @@ public class YoctoProfileSetting {
 
private YoctoProfileElement profileElement;
private PreferencePage preferencePage;
+   private final boolean editable;
 
-   public YoctoProfileSetting(YoctoProfileElement profileElement, 
PreferencePage preferencePage) {
+   public YoctoProfileSetting(YoctoProfileElement profileElement, 
PreferencePage preferencePage, final boolean editable) {
this.profileElement = profileElement;
this.preferencePage = preferencePage;
+   this.editable = editable;
}
 
public void createComposite(Composite composite) {
@@ -61,7 +63,11 @@ public class YoctoProfileSetting {
composite.setLayout(layout);
 
Group storeYoctoConfigurationsGroup = new Group (composite, 
SWT.NONE);
-   layout = new GridLayout(3, false);
+   layout = new GridLayout(1, false);
+   if (isEditable()) {
+   layout.numColumns = 3;
+   }
+
storeYoctoConfigurationsGroup.setLayout(layout);
gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
gd.horizontalSpan = 2;
@@ -101,9 +107,11 @@ public class YoctoProfileSetting {
sdkConfigsCombo.addListener(SWT.Selection, selectionListener);
sdkConfigsCombo.addListener(SWT.Modify, selectionListener);
 
-   createSaveAsProfileButton(storeYoctoConfigurationsGroup);
-   createRenameButton(storeYoctoConfigurationsGroup);
-   createRemoveButton(storeYoctoConfigurationsGroup);
+   if (isEditable()) {
+   
createSaveAsProfileButton(storeYoctoConfigurationsGroup);
+   createRenameButton(storeYoctoConfigurationsGroup);
+   createRemoveButton(storeYoctoConfigurationsGroup);
+   }
}
 
private void createSaveAsProfileButton(Group 
storeYoctoConfigurationsGroup) {
@@ -225,8 +233,14 @@ public class YoctoProfileSetting {
}
 
public void setButtonsEnabledState(boolean isEnabled) {
-   btnConfigRename.setEnabled(isEnabled);
-   btnConfigRemove.setEnabled(isEnabled);
-   btnConfigSaveAs.setEnabled(isEnabled);
+   if (isEditable()) {
+   btnConfigRename.setEnabled(isEnabled);
+   btnConfigRemove.setEnabled(isEnabled);
+   btnConfigSaveAs.setEnabled(isEnabled);
+   }
+   }
+
+   private boolean isEditable() {
+   return editable;
}
 }
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 4d57b45..3e0fa54 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -64,7 +64,7 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
this.yoctoUISetting = new YoctoUISetting(elem);
 
YoctoProfileElement profileElement = new 
YoctoProfileElement(profiles, selectedProfile);
-   this.yoctoProfileSetting = new 
YoctoProfileSetting(profileElement, this);
+   this.yoctoProfileSetting = new 
YoctoProfileSetting(profileElement, this, true);
}
 
/*
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index eef56c1..7f0d25e 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins

[yocto] [PATCH 0/5][eclipse-poky] Refactor handling of SDK check errors

2013-02-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Hi,

I tried to display the messages resulting from validating the
YoctoUISettings in the message area of the properties/preference pages
instead of showing a dialog. This led to some refactoring of the
validation functionality and also the messages.

If for example the user entered a SDK toolchain directory that doesn't
exist in the global preferences a dialog will show up showing the
error and telling him how he can do IDE-wide settings. As he is
currently trying to do IDE-wide settings this advice is not really
necessary and the dialog can be really annoying.

I split up the messages into a one line error message and an
advice. This message can be shown in the page's message area instead
of opening a dialog with every configuration error. The advice can
still be used when we want to show a dialog to help the user,
e.g. when creating a new project.

On a side note I reactivated the YoctoSDKChecker class and moved all
the validation code from the utils, getting rid of some duplicated and
inconsistent code.

Best regards,
Timo

PS: This patch set is based on plugins/sdk.ide: Remove profile edit
buttons from property page

Timo Mueller (5):
  plugins/sdk.ide: Move SDK check functionality to separate class
  plugins/sdk.ide: Refactored the construction of mesages with
SDKCheckResults
  plugins/sdk.ide: Show SDK check errors in message area
  plugins/sdk.ide: Removed validation from setCurrentInput
  plugins/sdk.ide: Use standard error dialog to show SDK check errors

 .../src/org/yocto/sdk/ide/YoctoSDKChecker.java | 372 +++--
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  42 ++-
 .../org/yocto/sdk/ide/YoctoSDKProjectNature.java   |   9 +-
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java   | 255 --
 .../src/org/yocto/sdk/ide/YoctoUISetting.java  |  47 +--
 .../ide/preferences/YoctoSDKPreferencePage.java|  84 +++--
 .../preferences/YoctoSDKProjectPropertyPage.java   |  87 +++--
 .../sdk/ide/wizard/NewYoctoCProjectTemplate.java   |  18 +-
 8 files changed, 344 insertions(+), 570 deletions(-)

-- 
1.7.11.7

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


[yocto] [PATCH 2/5] plugins/sdk.ide: Refactored the construction of mesages with SDKCheckResults

2013-02-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The message keys are now stored with the enum values simplifying the
construction of error messages.

Error messages have also been split up into a one line error message
and an advice. The one line error message can for example be used in
UI Parts with limited space (e.g. message area on property and
preference pages). Dialogs or log messages can use the complete
message to give the user a hint on what to do in order to fix the
error.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoSDKChecker.java | 159 +
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  42 --
 2 files changed, 99 insertions(+), 102 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
index fd50f18..9579021 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
@@ -1,5 +1,7 @@
 
/***
  * Copyright (c) 2010 Intel Corporation.
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ * 
  * 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
@@ -7,6 +9,7 @@
  *
  * Contributors:
  * Intel - initial API and implementation
+ * BMW Car IT - include error and advice messages with check results
  
***/
 package org.yocto.sdk.ide;
 
@@ -17,45 +20,76 @@ import java.io.FilenameFilter;
 import java.io.IOException;
 
 public class YoctoSDKChecker {
+   private static final String[] saInvalidVer = {1.0, 0.9, 0.9+};
+   private static final String SYSROOTS_DIR = sysroots;
 
public static enum SDKCheckResults {
-   SDK_PASS,
-   POKY_DEVICE_EMPTY,
-   TOOLCHAIN_LOCATION_EMPTY,
-   TOOLCHAIN_LOCATION_NONEXIST,
-   SDK_TARGET_EMPTY,
-   QEMU_KERNEL_EMPTY,
-   SYSROOT_EMPTY,
-   QEMU_KERNEL_NONEXIST,
-   SYSROOT_NONEXIST,
-   WRONG_ADT_VERSION,
-   ENV_SETUP_SCRIPT_NONEXIST,
-   TOOLCHAIN_NO_SYSROOT,
-   TOOLCHAIN_HOST_MISMATCH
+   SDK_PASS(, false),
+   TOOLCHAIN_LOCATION_EMPTY(
+   Poky.SDK.Location.Empty, true),
+   TOOLCHAIN_LOCATION_NONEXIST(
+   Poky.SDK.Location.Nonexist, true),
+   SDK_TARGET_EMPTY(
+   Poky.SDK.Target.Empty, true),
+   SYSROOT_EMPTY(
+   Poky.Sysroot.Empty, true),
+   SYSROOT_NONEXIST(
+   Poky.Sysroot.Nonexist, true),
+   QEMU_KERNEL_EMPTY(
+   Poky.Qemu.Kernel.Empty, true),
+   QEMU_KERNEL_NONEXIST(
+   Poky.Qemu.Kernel.Nonexist, true),
+   WRONG_ADT_VERSION(
+   Poky.ADT.Sysroot.Wrongversion, false),
+   ENV_SETUP_SCRIPT_NONEXIST(
+   Poky.Env.Script.Nonexist, false),
+   TOOLCHAIN_NO_SYSROOT(
+   Poky.Toolchain.No.Sysroot, false),
+   TOOLCHAIN_HOST_MISMATCH(
+   Poky.Toolchain.Host.Mismatch, false);
+
+   private static final String DEFAULT_ADVICE = Default.Advice;
+   private static final String ADVICE_SUFFIX = .Advice;
+
+   private final String messageID;
+   private final boolean addDefaultAdvice;
+
+   private SDKCheckResults(final String messageID, final boolean 
addDefaultAdvice) {
+   this.messageID = messageID;
+   this.addDefaultAdvice = addDefaultAdvice;
+   }
+
+   public String getMessage() {
+   return YoctoSDKMessages.getString(messageID);
+   }
+
+   public String getAdvice() {
+   String advice = YoctoSDKMessages.getString(messageID + 
ADVICE_SUFFIX);
+
+   if (addDefaultAdvice) {
+   advice += 
YoctoSDKMessages.getString(DEFAULT_ADVICE);
+   }
+
+   return advice;
+   }
};
 
public static enum SDKCheckRequestFrom {
-   Wizard,
-   Menu,
-   Preferences,
-   Other
-   };
+   Wizard(Poky.SDK.Error.Origin.Wizard),
+   Menu(Poky.SDK.Error.Origin.Menu),
+   Preferences(Poky.SDK.Error.Origin.Preferences

[yocto] [PATCH 5/5] plugins/sdk.ide: Use standard error dialog to show SDK check errors

2013-02-27 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de


Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoUISetting.java| 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index ba80cb1..f27019d 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -14,6 +14,8 @@ import java.io.File;
 import java.util.ArrayList;
 
 import org.eclipse.cdt.ui.templateengine.uitree.InputUIElement;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
@@ -32,8 +34,6 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.swt.widgets.Widget;
 import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
@@ -343,13 +343,11 @@ public class YoctoUISetting {
//Show Error Message on the Label to help users.
if ((result != SDKCheckResults.SDK_PASS)  showErrorDialog) {
Display display = Display.getCurrent();
-   Shell shell = new Shell(display);
-   MessageBox msgBox = new MessageBox(shell, 
SWT.ICON_ERROR | SWT.OK);
-   msgBox.setText(Yocto Project Configuration Error);
-   
msgBox.setMessage(YoctoSDKChecker.getErrorMessage(result, from));
-   msgBox.open();
-   if (shell != null)
-   shell.dispose();
+   ErrorDialog.openError(display.getActiveShell(),
+   Yocto 
Project Configuration Error,
+   
YoctoSDKChecker.getErrorMessage(result, from),
+   new 
Status(Status.ERROR, YoctoSDKPlugin.PLUGIN_ID, result.getMessage()));
+
}
 
return result;
-- 
1.7.11.7

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


[yocto] [PATCH 3/5] plugin/sdk.ide: Change name of target profiles to cross development profiles

2013-02-26 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de


Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoSDKMessages.properties  | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index e779f7d..0323d1c 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -51,18 +51,18 @@ Preferences.Profile.Validator.InvalidName.Quote = Warning: 
The profile name cann
 Preferences.Profile.Validator.InvalidName.Empty = Please provide a new profile 
name.
 Preferences.Profile.Validator.InvalidName.Exists = Warning: The profile 
already exists.
 
-Preferences.Profiles.Title = Target profiles:
+Preferences.Profiles.Title = Cross development profiles:
 Preferences.Profile.New.Title = Save as ...
-Preferences.Profile.New.Dialog.Title = Save as new target profile
+Preferences.Profile.New.Dialog.Title = Save as new cross development profile
 Preferences.Profile.New.Dialog.Message = Please input a profile name.
 Preferences.Profile.Rename.Title = Rename
-Preferences.Profile.Rename.Dialog.Title = Rename target profile
+Preferences.Profile.Rename.Dialog.Title = Rename cross development profile
 Preferences.Profile.Rename.Dialog.Message = Please input a new profile name.
 Preferences.Profile.Remove.Title = Remove
-Preferences.Profile.Remove.Dialog.Title = Remove target profile
-Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove 
the target profile {0}?\nProjects using this target profile will be 
reconfigured to use the standard profile.
-Preferences.Profile.Standard.Modification.Title = Modify standard target 
profile
-Preferences.Profile.Standard.Modification.Message = Standard target profile 
cannot be removed or renamed.
+Preferences.Profile.Remove.Dialog.Title = Remove cross development profile
+Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove 
the cross development profile {0}?\nProjects using this cross development 
profile will be reconfigured to use the standard profile.
+Preferences.Profile.Standard.Modification.Title = Modify standard cross 
development profile
+Preferences.Profile.Standard.Modification.Message = Standard cross development 
profile cannot be removed or renamed.
 
 Preferences.Profile.ProjectSpecific.Title = Use project specific settings
 Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
-- 
1.7.11.7

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


[yocto] [PATCH 5/5] plugin/sdk.ide: Update projects on profile update

2013-02-26 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If a cross development profile is changed that is used by projects,
the user will be warned that these projects will also be changed. If
the user accepts the affected projects are updated and are marked
dirty. Next time the projects are built a reconfigure will also be
triggered.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  2 ++
 .../ide/preferences/YoctoSDKPreferencePage.java| 32 +-
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 0323d1c..e5748f7 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -61,6 +61,8 @@ Preferences.Profile.Rename.Dialog.Message = Please input a 
new profile name.
 Preferences.Profile.Remove.Title = Remove
 Preferences.Profile.Remove.Dialog.Title = Remove cross development profile
 Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove 
the cross development profile {0}?\nProjects using this cross development 
profile will be reconfigured to use the standard profile.
+Preferences.Profile.Update.Dialog.Title = Update cross development profile
+Preferences.Profile.Update.Dialog.Message = Do you really want to the update 
the cross development profile {0}?\nProjects using this cross development 
profile will be reconfigured.
 Preferences.Profile.Standard.Modification.Title = Modify standard cross 
development profile
 Preferences.Profile.Standard.Modification.Message = Standard cross development 
profile cannot be removed or renamed.
 
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index b5963cf..4d57b45 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
@@ -40,6 +41,8 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
private static final String NEW_DIALOG_TITLE = 
Preferences.Profile.New.Dialog.Title;
private static final String NEW_DIALOG_MESSAGE = 
Preferences.Profile.New.Dialog.Message;
+   private static final String UPDATE_DIALOG_TITLE = 
Preferences.Profile.Update.Dialog.Title;
+   private static final String UPDATE_DIALOG_MESSAGE = 
Preferences.Profile.Update.Dialog.Message;
 
private YoctoProfileSetting yoctoProfileSetting;
private YoctoUISetting yoctoUISetting;
@@ -93,15 +96,32 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 */
public boolean performOk() {
try {
-   
yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, true);
+   
yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
+
+   YoctoUIElement savedElement = 
YoctoSDKUtils.getElemFromStore(getPreferenceStore());
+   YoctoUIElement modifiedElement = 
yoctoUISetting.getCurrentInput();
 
-   YoctoUIElement elem = yoctoUISetting.getCurrentInput();
-   YoctoSDKUtils.saveElemToStore(elem, 
getPreferenceStore());
+   if (savedElement.equals(modifiedElement)) {
+   return true;
+   }
 
YoctoProfileElement profileElement = 
yoctoProfileSetting.getCurrentInput();
+   HashSetIProject yoctoProjects = 
getAffectedProjects(profileElement.getSelectedProfile());
+
+   if (!yoctoProjects.isEmpty()) {
+   boolean deleteConfirmed =
+   MessageDialog.openConfirm(null, 
YoctoSDKMessages.getString(UPDATE_DIALOG_TITLE),
+   
YoctoSDKMessages.getFormattedString(UPDATE_DIALOG_MESSAGE, 
profileElement.getSelectedProfile()));
+
+   if (!deleteConfirmed) {
+   return false;
+   }
+   }
+
+   YoctoSDKUtils.saveElemToStore(modifiedElement

[yocto] [PATCH 03/18] poky-ref-manual: Remove folder and eclipse artifacts

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de


Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../poky-ref-manual-eclipse-customization.xsl  | 27 --
 1 file changed, 27 deletions(-)
 delete mode 100644 
documentation/poky-ref-manual/poky-ref-manual-eclipse-customization.xsl

diff --git 
a/documentation/poky-ref-manual/poky-ref-manual-eclipse-customization.xsl 
b/documentation/poky-ref-manual/poky-ref-manual-eclipse-customization.xsl
deleted file mode 100644
index 3412208..000
--- a/documentation/poky-ref-manual/poky-ref-manual-eclipse-customization.xsl
+++ /dev/null
@@ -1,27 +0,0 @@
-?xml version='1.0'?
-xsl:stylesheet
-   xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
-   xmlns=http://www.w3.org/1999/xhtml;
-   xmlns:fo=http://www.w3.org/1999/XSL/Format;
-   version=1.0
-
-  xsl:import
- 
href=http://docbook.sourceforge.net/release/xsl/current/eclipse/eclipse3.xsl; 
/
-
-  xsl:param name=chunker.output.indent select='yes'/
-  xsl:param name=chunk.quietly select=1/
-  xsl:param name=chunk.first.sections select=1/
-  xsl:param name=chunk.section.depth select=10/
-  xsl:param name=use.id.as.filename select=1/
-  xsl:param name=ulink.target select='_self' /
-  xsl:param name=base.dir select='html/poky-ref-manual/'/
-  xsl:param name=html.stylesheet select='../book.css'/
-  xsl:param name=eclipse.manifest select=0/
-  xsl:param name=create.plugin.xml select=0/
-  xsl:param name=suppress.navigation select=1/
-  xsl:param name=generate.index select=0/
-  xsl:param name=chapter.autolabel select=1 /
-  xsl:param name=appendix.autolabel select=A /
-  xsl:param name=section.autolabel select=1 /
-  xsl:param name=section.label.includes.component.label select=1 /
-/xsl:stylesheet
-- 
1.7.11.7

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


[yocto] [PATCH 02/18] Makefile: Modify DOC filter for eclipse-generate target

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Filter now explicitely lists the doc parts from which eclipse help can
be generated.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 documentation/Makefile | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/documentation/Makefile b/documentation/Makefile
index fac2c85..773c41f 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -332,9 +332,17 @@ eclipse: eclipse-generate eclipse-resolve-links
 .PHONY : eclipse-generate eclipse-resolve-links
 
 eclipse-generate:
-ifeq ($(DOC),mega-manual)
+ifeq ($(filter $(DOC), adt-manual bsp-guide dev-manual kernel-dev 
profile-manual ref-manual yocto-project-qs),)
@echo  
-   @echo ERROR: You cannot generate eclipse documentation for the 
mega-manual
+   @echo ERROR: You can only create eclipse documentation
+   @echoof the following documentation parts:
+   @echo- adt-manual
+   @echo- bsp-guide
+   @echo- dev-manual
+   @echo- kernel-dev
+   @echo- profile-manual
+   @echo- ref-manual
+   @echo- yocto-project-qs
@echo  
 else
@echo  
-- 
1.7.11.7

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


[yocto] [PATCH 01/18] documentation: Remove 'the' from title tags

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de


Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 documentation/adt-manual/adt-manual.xml | 2 +-
 documentation/bsp-guide/bsp-guide.xml   | 2 +-
 documentation/dev-manual/dev-manual.xml | 2 +-
 documentation/ref-manual/ref-manual.xml | 2 +-
 documentation/yocto-project-qs/yocto-project-qs.xml | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/documentation/adt-manual/adt-manual.xml 
b/documentation/adt-manual/adt-manual.xml
index 479a492..fc1bc80 100644
--- a/documentation/adt-manual/adt-manual.xml
+++ b/documentation/adt-manual/adt-manual.xml
@@ -17,7 +17,7 @@
 /mediaobject
 
 title
-The Yocto Project Application Developer's Guide
+Yocto Project Application Developer's Guide
 /title
 
 authorgroup
diff --git a/documentation/bsp-guide/bsp-guide.xml 
b/documentation/bsp-guide/bsp-guide.xml
index 1cb2001..57c8458 100644
--- a/documentation/bsp-guide/bsp-guide.xml
+++ b/documentation/bsp-guide/bsp-guide.xml
@@ -17,7 +17,7 @@
 /mediaobject
 
 title
-The Yocto Project Board Support Package Developer's Guide
+Yocto Project Board Support Package Developer's Guide
 /title
 
 authorgroup
diff --git a/documentation/dev-manual/dev-manual.xml 
b/documentation/dev-manual/dev-manual.xml
index b902aaa..1a1c5e1 100644
--- a/documentation/dev-manual/dev-manual.xml
+++ b/documentation/dev-manual/dev-manual.xml
@@ -17,7 +17,7 @@
 /mediaobject
 
 title
-The Yocto Project Development Manual
+Yocto Project Development Manual
 /title
 
 authorgroup
diff --git a/documentation/ref-manual/ref-manual.xml 
b/documentation/ref-manual/ref-manual.xml
index ba7019e..d93710b 100644
--- a/documentation/ref-manual/ref-manual.xml
+++ b/documentation/ref-manual/ref-manual.xml
@@ -17,7 +17,7 @@
 /mediaobject
 
 title
-The Yocto Project Reference Manual
+Yocto Project Reference Manual
 /title
 
 authorgroup
diff --git a/documentation/yocto-project-qs/yocto-project-qs.xml 
b/documentation/yocto-project-qs/yocto-project-qs.xml
index a1c714e..6825e2c 100644
--- a/documentation/yocto-project-qs/yocto-project-qs.xml
+++ b/documentation/yocto-project-qs/yocto-project-qs.xml
@@ -4,7 +4,7 @@
 
 article id='intro'
 articleinfo
-titleThe Yocto Project Quick Start/title
+titleYocto Project Quick Start/title
 
 copyright
 yearCOPYRIGHT_YEAR;/year
-- 
1.7.11.7

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


[yocto] [PATCH 00/18][yocto-docs] Update eclipse help generation to support all documents

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Hi,

the generation of eclipse help files has been merged from the timo
branch to the master. Since the creation of the timo branch there have
been some changes to the master branch (e.g. new documentation,
renamed documentation).

This patch set does some cleanup for the renamed documentation and
adds eclipse help generation support to the new documentation.

01: Removes the 'the' from the document titles
02..04: Cleanup obsolete artifacts resulting from the merge
05..08: Add eclipse help generation for ref-manual
09..13: Add eclipse help generation for kernel-dev
14..18: Add eclipse help generation for profile-manual

Best regards,
Timo

Timo Mueller (18):
  documentation: Remove 'the' from title tags
  Makefile: Modify DOC filter for eclipse-generate target
  poky-ref-manual: Remove folder and eclipse artifacts
  ref-manual: Remove generated eclipse help
  .gitignore: Updated to ignore generated eclipse help of ref-manual
  Makefile: Remove duplicate parameters
  ref-manual: Added new customization file for eclipse help generation
  Makefile: logic to make all for ref-manual and cleanup
  kernel-dev: Move global parameters to customization file
  kernel-dev: Added Title tag
  .gitignore: Updated to ignore generated eclipse help of kernel-dev
  kernel-dev: Added new customization file for eclipse help generation
  Makefile: logic to make all for kernel-dev and cleanup
  profile-manual: Move global parameters to customization file
  profile-manual: Added Title tag
  .gitignore: Updated to ignore generated eclipse help of
profile-manual
  profile-manual: Added new customization file for eclipse help
generation
  Makefile: logic to make all for profile-manual and cleanup

 .gitignore |3 +
 documentation/Makefile |   53 +-
 documentation/adt-manual/adt-manual.xml|2 +-
 documentation/bsp-guide/bsp-guide.xml  |2 +-
 documentation/dev-manual/dev-manual.xml|2 +-
 .../kernel-dev/kernel-dev-customization.xsl|9 +-
 .../kernel-dev-eclipse-customization.xsl   |   27 +
 documentation/kernel-dev/kernel-dev.xml|4 +-
 .../poky-ref-manual-eclipse-customization.xsl  |   27 -
 .../profile-manual-customization.xsl   |9 +-
 .../profile-manual-eclipse-customization.xsl   |   27 +
 documentation/profile-manual/profile-manual.xml|4 +-
 .../poky-ref-manual/1.3-local-configuration.html   |   21 -
 .../eclipse/html/poky-ref-manual/1.3-recipes.html  |   29 -
 .../build-history-image-information.html   |   80 -
 .../build-history-package-information.html |   58 -
 .../html/poky-ref-manual/build-overview.html   |   61 -
 .../building-an-image-using-gpl-components.html|   23 -
 .../html/poky-ref-manual/centos-packages.html  |   69 -
 .../eclipse/html/poky-ref-manual/checksums.html|  164 --
 .../eclipse/html/poky-ref-manual/debugging.html|   43 -
 .../detailed-supported-distros.html|   45 -
 .../enabling-and-disabling-build-history.html  |   62 -
 .../enabling-commercially-licensed-recipes.html|   85 -
 .../examining-build-history-information.html   |   70 -
 .../eclipse/html/poky-ref-manual/faq.html  |  791 --
 .../html/poky-ref-manual/fedora-packages.html  |   62 -
 .../poky-ref-manual/figures/buildhistory-web.png   |  Bin 49966 - 0 bytes
 .../html/poky-ref-manual/figures/buildhistory.png  |  Bin 42062 - 0 bytes
 .../html/poky-ref-manual/figures/poky-title.png|  Bin 11592 - 0 bytes
 .../future-development-and-limitations.html|   33 -
 .../eclipse/html/poky-ref-manual/handbook.html |   25 -
 .../eclipse/html/poky-ref-manual/index.html|  327 ---
 .../eclipse/html/poky-ref-manual/index.xml |2 -
 .../html/poky-ref-manual/intro-getit-dev.html  |   26 -
 .../eclipse/html/poky-ref-manual/intro-getit.html  |   35 -
 .../html/poky-ref-manual/intro-manualoverview.html |   73 -
 .../html/poky-ref-manual/intro-requirements.html   |   23 -
 .../html/poky-ref-manual/intro-welcome.html|   30 -
 .../eclipse/html/poky-ref-manual/intro.html|   30 -
 .../poky-ref-manual/invalidating-shared-state.html |   53 -
 .../poky-ref-manual/license-flag-matching.html |   91 -
 .../eclipse/html/poky-ref-manual/licenses.html |   28 -
 .../html/poky-ref-manual/logging-with-bash.html|   47 -
 .../html/poky-ref-manual/logging-with-python.html  |   45 -
 .../maintaining-build-output-quality.html  |   53 -
 .../migration-1.3-bblayers-conf.html   |   27 -
 .../migration-1.3-image-features.html  |   26 -
 .../poky-ref-manual/migration-1.3-nativesdk.html   |   25 -
 .../migration-1.3-proto=-in-src-uri.html   |   32 -
 .../migration-1.3-python-function-whitespace.html  |   29 -
 .../migration-1.3-removed-recipes.html |   64 -
 .../migration

[yocto] [PATCH 06/18] Makefile: Remove duplicate parameters

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Standard stylesheet parameters are already defined in the docbook
customization file tying them to the docbook stylesheet used. Removing
these parameters simplifies the Makefile.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 documentation/Makefile | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/documentation/Makefile b/documentation/Makefile
index 773c41f..d997f3d 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -206,12 +206,7 @@ STYLESHEET = $(DOC)/*.css
 endif
 
 ifeq ($(DOC),ref-manual)
-XSLTOPTS = --stringparam html.stylesheet ref-style.css \
-   --stringparam  chapter.autolabel 1 \
-   --stringparam  appendix.autolabel A \
-   --stringparam  section.autolabel 1 \
-   --stringparam  section.label.includes.component.label 1 \
-   --xinclude
+XSLTOPTS = --xinclude
 ALLPREQ = html pdf tarball
 TARFILES = ref-manual.html ref-style.css figures/poky-title.png \
figures/buildhistory.png figures/buildhistory-web.png
-- 
1.7.11.7

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


[yocto] [PATCH 05/18] .gitignore: Updated to ignore generated eclipse help of ref-manual

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de


Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index bda1b09..03b98d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -53,3 +53,4 @@ documentation/adt-manual/eclipse/
 documentation/bsp-guide/eclipse/
 documentation/dev-manual/eclipse/
 documentation/yocto-project-qs/eclipse/
+documentation/ref-manual/eclipse/
-- 
1.7.11.7

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


[yocto] [PATCH 08/18] Makefile: logic to make all for ref-manual and cleanup

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Eclipse help documents are now created when calling the 'make all'
target on the ref-manual. Resulting files are archived into
the tarball as well. When calling 'make clean' artefacts of the
eclipse documentation build are deleted.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 documentation/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/documentation/Makefile b/documentation/Makefile
index d997f3d..c19b297 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -207,10 +207,10 @@ endif
 
 ifeq ($(DOC),ref-manual)
 XSLTOPTS = --xinclude
-ALLPREQ = html pdf tarball
+ALLPREQ = html pdf eclipse tarball
 TARFILES = ref-manual.html ref-style.css figures/poky-title.png \
-   figures/buildhistory.png figures/buildhistory-web.png
-MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
+   figures/buildhistory.png figures/buildhistory-web.png eclipse
+MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf $(DOC)/eclipse
 FIGURES = figures
 STYLESHEET = $(DOC)/*.css
 endif
-- 
1.7.11.7

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


[yocto] [PATCH 10/18] kernel-dev: Added Title tag

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The title of the document used to create metadata for output formats
such as eclipse help.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 documentation/kernel-dev/kernel-dev.xml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/documentation/kernel-dev/kernel-dev.xml 
b/documentation/kernel-dev/kernel-dev.xml
index 9682d54..d040a10 100644
--- a/documentation/kernel-dev/kernel-dev.xml
+++ b/documentation/kernel-dev/kernel-dev.xml
@@ -16,7 +16,9 @@
 /imageobject
 /mediaobject
 
-title/title
+title
+ Yocto Project Linux Kernel Development Manual
+   /title
 
 authorgroup
 author
-- 
1.7.11.7

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


[yocto] [PATCH 09/18] kernel-dev: Move global parameters to customization file

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Standard stylesheet parameters were moved to the docbook customization
file tying them to the docbook stylesheet used. Removing these
parameters simplifies the Makefile.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 documentation/Makefile| 7 +--
 documentation/kernel-dev/kernel-dev-customization.xsl | 9 ++---
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/documentation/Makefile b/documentation/Makefile
index c19b297..67017b8 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -257,12 +257,7 @@ STYLESHEET = $(DOC)/*.css
 endif
 
 ifeq ($(DOC),kernel-dev)
-XSLTOPTS = --stringparam html.stylesheet kernel-dev-style.css \
-   --stringparam  chapter.autolabel 1 \
-   --stringparam  appendix.autolabel A \
-   --stringparam  section.autolabel 1 \
-   --stringparam  section.label.includes.component.label 1 \
-   --xinclude
+XSLTOPTS = --xinclude
 ALLPREQ = html pdf tarball
 TARFILES = kernel-dev.html kernel-dev.pdf kernel-dev-style.css 
figures/kernel-dev-title.png \
figures/kernel-architecture-overview.png
diff --git a/documentation/kernel-dev/kernel-dev-customization.xsl 
b/documentation/kernel-dev/kernel-dev-customization.xsl
index 8eb6905..43e9dad 100644
--- a/documentation/kernel-dev/kernel-dev-customization.xsl
+++ b/documentation/kernel-dev/kernel-dev-customization.xsl
@@ -1,8 +1,11 @@
 ?xml version='1.0'?
 xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; 
xmlns=http://www.w3.org/1999/xhtml; 
xmlns:fo=http://www.w3.org/1999/XSL/Format; version=1.0
-  
-  xsl:import 
href=http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl; /
 
-!--  xsl:param name=generate.toc select='article nop'/xsl:param  --
+  xsl:import 
href=http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl; /
 
+  xsl:param name=html.stylesheet select='kernel-dev-style.css' /
+  xsl:param name=chapter.autolabel select=1 /
+  xsl:param name=appendix.autolabelA/xsl:param
+  xsl:param name=section.autolabel select=1 /
+  xsl:param name=section.label.includes.component.label select=1 /
 /xsl:stylesheet
-- 
1.7.11.7

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


[yocto] [PATCH 11/18] .gitignore: Updated to ignore generated eclipse help of kernel-dev

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de


Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 03b98d1..9e16853 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,3 +54,4 @@ documentation/bsp-guide/eclipse/
 documentation/dev-manual/eclipse/
 documentation/yocto-project-qs/eclipse/
 documentation/ref-manual/eclipse/
+documentation/kernel-dev/eclipse/
-- 
1.7.11.7

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


[yocto] [PATCH 12/18] kernel-dev: Added new customization file for eclipse help generation

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

This stylesheet uses the eclipse stylesheets of docbook to create
eclipse help from this documentation. In addition to simple html
files these stylesheets will also create xml files which are
needed to integrate the documentation into eclipse (e.g. toc.xml).

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../kernel-dev-eclipse-customization.xsl   | 27 ++
 1 file changed, 27 insertions(+)
 create mode 100644 
documentation/kernel-dev/kernel-dev-eclipse-customization.xsl

diff --git a/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl 
b/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl
new file mode 100644
index 000..7d1bb8d
--- /dev/null
+++ b/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl
@@ -0,0 +1,27 @@
+?xml version='1.0'?
+xsl:stylesheet
+   xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
+   xmlns=http://www.w3.org/1999/xhtml;
+   xmlns:fo=http://www.w3.org/1999/XSL/Format;
+   version=1.0
+
+  xsl:import
+ 
href=http://docbook.sourceforge.net/release/xsl/current/eclipse/eclipse3.xsl; 
/
+
+  xsl:param name=chunker.output.indent select='yes'/
+  xsl:param name=chunk.quietly select=1/
+  xsl:param name=chunk.first.sections select=1/
+  xsl:param name=chunk.section.depth select=10/
+  xsl:param name=use.id.as.filename select=1/
+  xsl:param name=ulink.target select='_self' /
+  xsl:param name=base.dir select='html/kernel-dev/'/
+  xsl:param name=html.stylesheet select='../book.css'/
+  xsl:param name=eclipse.manifest select=0/
+  xsl:param name=create.plugin.xml select=0/
+  xsl:param name=suppress.navigation select=1/
+  xsl:param name=generate.index select=0/
+  xsl:param name=chapter.autolabel select=1 /
+  xsl:param name=appendix.autolabelA/xsl:param
+  xsl:param name=section.autolabel select=1 /
+  xsl:param name=section.label.includes.component.label select=1 /
+/xsl:stylesheet
-- 
1.7.11.7

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


[yocto] [PATCH 07/18] ref-manual: Added new customization file for eclipse help generation

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

This stylesheet uses the eclipse stylesheets of docbook to create
eclipse help from this documentation. In addition to simple html
files these stylesheets will also create xml files which are
needed to integrate the documentation into eclipse (e.g. toc.xml).

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../ref-manual-eclipse-customization.xsl   | 27 ++
 1 file changed, 27 insertions(+)
 create mode 100644 
documentation/ref-manual/ref-manual-eclipse-customization.xsl

diff --git a/documentation/ref-manual/ref-manual-eclipse-customization.xsl 
b/documentation/ref-manual/ref-manual-eclipse-customization.xsl
new file mode 100644
index 000..4e6b799
--- /dev/null
+++ b/documentation/ref-manual/ref-manual-eclipse-customization.xsl
@@ -0,0 +1,27 @@
+?xml version='1.0'?
+xsl:stylesheet
+   xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
+   xmlns=http://www.w3.org/1999/xhtml;
+   xmlns:fo=http://www.w3.org/1999/XSL/Format;
+   version=1.0
+
+  xsl:import
+ 
href=http://docbook.sourceforge.net/release/xsl/current/eclipse/eclipse3.xsl; 
/
+
+  xsl:param name=chunker.output.indent select='yes'/
+  xsl:param name=chunk.quietly select=1/
+  xsl:param name=chunk.first.sections select=1/
+  xsl:param name=chunk.section.depth select=10/
+  xsl:param name=use.id.as.filename select=1/
+  xsl:param name=ulink.target select='_self' /
+  xsl:param name=base.dir select='html/ref-manual/'/
+  xsl:param name=html.stylesheet select='../book.css'/
+  xsl:param name=eclipse.manifest select=0/
+  xsl:param name=create.plugin.xml select=0/
+  xsl:param name=suppress.navigation select=1/
+  xsl:param name=generate.index select=0/
+  xsl:param name=chapter.autolabel select=1 /
+  xsl:param name=appendix.autolabelA/xsl:param
+  xsl:param name=section.autolabel select=1 /
+  xsl:param name=section.label.includes.component.label select=1 /
+/xsl:stylesheet
-- 
1.7.11.7

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


[yocto] [PATCH 13/18] Makefile: logic to make all for kernel-dev and cleanup

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Eclipse help documents are now created when calling the 'make all'
target on the kernel-dev. Resulting files are archived into
the tarball as well. When calling 'make clean' artefacts of the
eclipse documentation build are deleted.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 documentation/Makefile | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/documentation/Makefile b/documentation/Makefile
index 67017b8..3d2923d 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -258,10 +258,11 @@ endif
 
 ifeq ($(DOC),kernel-dev)
 XSLTOPTS = --xinclude
-ALLPREQ = html pdf tarball
+ALLPREQ = html pdf eclipse tarball
 TARFILES = kernel-dev.html kernel-dev.pdf kernel-dev-style.css 
figures/kernel-dev-title.png \
-   figures/kernel-architecture-overview.png
-MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
+   figures/kernel-architecture-overview.png \
+   eclipse
+MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf $(DOC)/eclipse
 FIGURES = figures
 STYLESHEET = $(DOC)/*.css
 endif
-- 
1.7.11.7

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


[yocto] [PATCH 16/18] .gitignore: Updated to ignore generated eclipse help of profile-manual

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de


Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 9e16853..cacc75b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,3 +55,4 @@ documentation/dev-manual/eclipse/
 documentation/yocto-project-qs/eclipse/
 documentation/ref-manual/eclipse/
 documentation/kernel-dev/eclipse/
+documentation/profile-manual/eclipse/
-- 
1.7.11.7

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


[yocto] [PATCH 18/18] Makefile: logic to make all for profile-manual and cleanup

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Eclipse help documents are now created when calling the 'make all'
target on the kernel-dev. Resulting files are archived into
the tarball as well. When calling 'make clean' artefacts of the
eclipse documentation build are deleted.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 documentation/Makefile | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/documentation/Makefile b/documentation/Makefile
index a9ba020..c3c6a3c 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -228,7 +228,7 @@ endif
 
 ifeq ($(DOC),profile-manual)
 XSLTOPTS = --xinclude
-ALLPREQ = html pdf tarball
+ALLPREQ = html pdf eclipse tarball
 TARFILES = profile-manual.html profile-manual.pdf profile-manual-style.css \
figures/profile-title.png figures/kernelshark-all.png \
figures/kernelshark-choose-events.png 
figures/kernelshark-i915-display.png \
@@ -245,8 +245,9 @@ TARFILES = profile-manual.html profile-manual.pdf 
profile-manual-style.css \

figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png 
figures/pybootchartgui-linux-yocto.png \
figures/pychart-linux-yocto-rpm.png 
figures/pychart-linux-yocto-rpm-nostrip.png \
figures/sched-wakeup-profile.png figures/sysprof-callers.png \
-   figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png
-MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
+   figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png 
\
+   eclipse
+MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf $(DOC)/eclipse
 FIGURES = figures
 STYLESHEET = $(DOC)/*.css
 endif
-- 
1.7.11.7

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


[yocto] [RFC v4 01/17] plugins/sdk.ide: Removed unused message

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The dialog has been merged with the project settings. Therefor the
message is no longer needed.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties  | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index b302524..17240e9 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -22,7 +22,6 @@ Poky.Env.Script.Nonexist = Specified Build Tree Toolchain 
Root does not contain
 Poky.ADT.Sysroot.Wrongversion = OECORE related items are not found in 
envrionement setup files.\nThe ADT version you're using is too old.\n Please 
upgrade to our latest ADT Version!
 Poky.Toolchain.Host.Mismatch = Toolchain and host arch mismatch.\n Make sure 
you use 32bit toolchain for 32bit host and same for 64bit machines!
 Poky.Toolchain.No.Sysroot = There's no sysroots directory under your toolchain 
directory under /opt/poky!
-Menu.SDK.Dialog.Title   = Yocto Project Settings
 
 
 Menu.SDK.Console.Configure.Message= The Yocto Project ADT has been 
successfully set up for this project.\nTo see the environment variables created 
during setup,\ngo to Project  Properties  C/C++ Build  Environment. 
-- 
1.7.11.7

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


[yocto] [RFC v4 04/17] plugins/sdk.ide: Set value of target array on input change

2013-02-08 Thread Timo Mueller
From: Atanas Gegov atanas.ge...@bmw-carit.de

The value of the target array set in the constructor is now also
affected when the input of the element is changed.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index 2e3c830..5bca41a 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -303,6 +303,8 @@ public class YoctoUISetting {
}
 
public void setCurrentInput(YoctoUIElement elem){
+   elem.setStrTargetsArray(getTargetArray(elem));
+
btnSDKRoot.setSelection(false);
btnPokyRoot.setSelection(false);

if(elem.getEnumPokyMode().equals(YoctoUIElement.PokyMode.POKY_SDK_MODE)){
-- 
1.7.11.7

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


[yocto] [RFC v4 06/17] plugins/sdk.ide: Create UI element for managing target profiles.

2013-02-08 Thread Timo Mueller
From: Atanas Gegov atanas.ge...@bmw-carit.de

A target profile is a combination of yocto settings identified by a
user-defined name. This UI element allows the user to add new profiles
and to rename or delete existing ones.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoProfileElement.java | 104 +
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java |  98 +++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   5 +
 .../sdk/ide/preferences/PreferenceConstants.java   |   1 +
 4 files changed, 208 insertions(+)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java
new file mode 100644
index 000..02626ad
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java
@@ -0,0 +1,104 @@
+/***
+ * Copyright (c) 2012 BMW Car IT GmbH.
+ * 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:
+ * BMW Car IT - initial API and implementation
+ 
***/
+package org.yocto.sdk.ide;
+
+import java.util.Comparator;
+import java.util.StringTokenizer;
+import java.util.TreeSet;
+
+import org.yocto.sdk.ide.preferences.PreferenceConstants;
+
+public class YoctoProfileElement {
+   private TreeSetString profiles = new TreeSetString(new 
ComparatorString() {
+
+   @Override
+   public int compare(String o1, String o2) {
+   int strcompare = o1.compareTo(o2);
+
+   if (strcompare == 0) {
+   return strcompare;
+   }
+
+   // Standard profile always less than anything else
+   if 
(o1.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
+   return -1;
+   }
+
+   if 
(o2.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
+   return 1;
+   }
+
+   return strcompare;
+   }
+   });
+
+   private String selectedProfile;
+
+   public YoctoProfileElement(String profilesString, String 
selectedProfile) {
+   setProfilesFromString(profilesString);
+   this.selectedProfile = selectedProfile;
+   }
+
+   public void addProfile(String profile) {
+   this.profiles.add(profile);
+   }
+
+   public boolean contains(String newText) {
+   return profiles.contains(newText);
+   }
+
+   public TreeSetString getProfiles() {
+   return profiles;
+   }
+
+   public String getProfilesAsString() {
+   String profileString = ;
+
+   for (String profile : profiles) {
+   profileString += \ + profile + \,;
+   }
+   return profileString.substring(0, profileString.length() - 1);
+   }
+
+   public String getSelectedProfile() {
+   return selectedProfile;
+   }
+
+   public void remove(String profile) {
+   this.profiles.remove(profile);
+   }
+
+   public void rename(String oldProfileName, String newProfileName) {
+   this.remove(oldProfileName);
+   this.addProfile(newProfileName);
+
+   if (selectedProfile.equals(oldProfileName)) {
+   selectedProfile = newProfileName;
+   }
+   }
+
+   public void setProfiles(TreeSetString profiles) {
+   this.profiles = profiles;
+   }
+
+   public void setProfilesFromString(String profilesString) {
+   StringTokenizer tokenizer = new StringTokenizer(profilesString, 
,);
+
+   while (tokenizer.hasMoreElements()) {
+   String config = (String) tokenizer.nextElement();
+   profiles.add(config.replace(\, ));
+   }
+   }
+
+   public void setSelectedProfile(String selectedProfile) {
+   this.selectedProfile = selectedProfile;
+   }
+}
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
new file mode 100644
index 000..7476bd3
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -0,0 +1,98

[yocto] [RFC v4 09/17] plugins/sdk.ide: Add method to allow storing the current settings

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The added method calls the performOK method on the provided preference
page to store the current content of the page.

This callback is needed so the profile UI is able to propagate changes
to the preference page it is part of.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java   | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index b35a167..7949cdf 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -10,6 +10,7 @@
  
***/
 package org.yocto.sdk.ide;
 
+import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -32,9 +33,11 @@ public class YoctoProfileSetting {
private Button btnConfigSaveAs;
 
private YoctoProfileElement profileElement;
+   private PreferencePage preferencePage;
 
-   public YoctoProfileSetting(YoctoProfileElement profileElement) {
+   public YoctoProfileSetting(YoctoProfileElement profileElement, 
PreferencePage preferencePage) {
this.profileElement = profileElement;
+   this.preferencePage = preferencePage;
}
 
public void createComposite(Composite composite) {
@@ -98,6 +101,10 @@ public class YoctoProfileSetting {

btnConfigRename.setText(YoctoSDKMessages.getString(RENAME_PROFILE_TITLE));
}
 
+   private void saveChangesOnCurrentProfile() {
+   preferencePage.performOk();
+   }
+
private void addConfigs(Combo combo) {
for (String profile : profileElement.getProfiles()) {
combo.add(profile);
-- 
1.7.11.7

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


[yocto] [RFC v4 07/17] plugins/sdk.ide: Modified preferences storage to support profiles.

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Yocto preferences are now stored using a user-defined name that
identifies a target profile. To store these preferences eclipse'
scoped preferences provider is used. The filename in the eclipse
configuration area is derived from the unique target profile name.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoSDKPlugin.java  |  9 
 .../org/yocto/sdk/ide/YoctoSDKProjectNature.java   | 10 ++--
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java   | 60 +-
 .../sdk/ide/preferences/PreferenceConstants.java   |  4 ++
 .../sdk/ide/preferences/PreferenceInitializer.java | 22 
 .../ide/preferences/YoctoSDKPreferencePage.java| 36 -
 .../preferences/YoctoSDKProjectPropertyPage.java   |  4 +-
 .../sdk/ide/wizard/NewYoctoCProjectTemplate.java   |  7 ++-
 8 files changed, 99 insertions(+), 53 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java
index b0b5447..9777396 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java
@@ -16,9 +16,12 @@ import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
 import org.osgi.framework.BundleContext;
 
 /**
@@ -65,6 +68,12 @@ public class YoctoSDKPlugin extends AbstractUIPlugin {
return plugin;
}
 
+   public static IPreferenceStore getProfilePreferenceStore(String 
profileName) {
+   int profileIdentifier = profileName.hashCode();
+
+   return new 
ScopedPreferenceStore(InstanceScope.INSTANCE,getUniqueIdentifier() + . + 
profileIdentifier);
+   }
+
public static void log(IStatus status) {
ResourcesPlugin.getPlugin().getLog().log(status);
}
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
index ec49dcc..6f16732 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
@@ -18,10 +18,13 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.StringTokenizer;
+
 import org.eclipse.cdt.core.model.CoreModel;
 import org.eclipse.cdt.core.settings.model.ICProjectDescription;
 import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
 import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
+import 
org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
+import org.eclipse.cdt.internal.autotools.core.configure.IAConfiguration;
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
 import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
 import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
@@ -34,8 +37,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchConfigurationType;
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.debug.core.ILaunchManager;
-import 
org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
-import org.eclipse.cdt.internal.autotools.core.configure.IAConfiguration;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;
 
 
@@ -151,7 +153,9 @@ public class YoctoSDKProjectNature implements 
IProjectNature {
}
 
public static void configureAutotools(IProject project) throws 
YoctoGeneralException {
-   YoctoUIElement elem = YoctoSDKUtils.getElemFromStore();
+   YoctoProfileElement profileElement = 
YoctoSDKUtils.getProfilesFromDefaultStore();
+   IPreferenceStore selecteProfileStore = 
YoctoSDKPlugin.getProfilePreferenceStore(profileElement.getSelectedProfile());
+   YoctoUIElement elem = 
YoctoSDKUtils.getElemFromStore(selecteProfileStore);
YoctoSDKUtils.SDKCheckResults result = 
YoctoSDKUtils.checkYoctoSDK(elem);
if (result != YoctoSDKUtils.SDKCheckResults.SDK_PASS){  
String strErrorMsg =  
YoctoSDKUtils.getErrorMessage(result, SDKCheckRequestFrom.Wizard);
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java

[yocto] [RFC v4 14/17] plugins/sdk.ide: Add method to rename a profile and its preference store

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

When renaming a profile the current values are stored in the profile's
new preference store.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java  | 4 
 1 file changed, 4 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 105fd9c..2767d7a 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -182,6 +182,10 @@ public class YoctoProfileSetting {
String newProfileName = 
profileNameDialog.getValue();
profileElement.rename(selectedItem, 
profileNameDialog.getValue());
 
+   if (preferencePage instanceof 
YoctoSDKPreferencePage) {
+   ((YoctoSDKPreferencePage) 
preferencePage).renameProfile(selectedItem, newProfileName);
+   }
+
sdkConfigsCombo.setItem(selectedIndex, 
newProfileName);
sdkConfigsCombo.select(selectedIndex);
}
-- 
1.7.11.7

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


[yocto] [RFC v4 15/17] plugins/sdk.ide: Add method to delete a profile

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Deletion of a profile currently has no effects on the preference
page.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java  | 4 
 1 file changed, 4 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 2767d7a..738dba7 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -146,6 +146,10 @@ public class YoctoProfileSetting {
sdkConfigsCombo.select(0);
sdkConfigsCombo.remove(selectionIndex);
profileElement.remove(selectedItem);
+
+   if (preferencePage instanceof 
YoctoSDKPreferencePage) {
+   ((YoctoSDKPreferencePage) 
preferencePage).deleteProfile(selectedItem);
+   }
}
});
}
-- 
1.7.11.7

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


[yocto] [RFC v4 17/17] plugins/sdk.ide: Added profile UI to the preference page

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Adds the UI elements that allow managing profiles to the preference
page.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 8dc089b..fb015ab 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -67,7 +67,9 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
protected Control createContents(Composite parent) {
initializeDialogUnits(parent);
final Composite result= new Composite(parent, SWT.NONE);
-   
+
+   yoctoProfileSetting.createComposite(result);
+
try {
yoctoUISetting.createComposite(result);

yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
-- 
1.7.11.7

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


[yocto] [RFC v1 0/5][eclipse-poky] Enable target profiles for projects

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Hi,

this patch set enables projects to make use of the target profiles
proposed in [RFC v4 00/17][eclipse-poky] Storing yocto settings as
target profiles.

Currently the target profiles are only used to determine the
default settings when creating a new project. Changing the used
profile on an already created projects is not possible, also if the
target profile is changed the projects are not affected.
This patch set enables the use of target profiles in the projects. You
can select the used global profile within the projet properties or use
a project specific configuration. If a global target profile is used
and its values are changed in the eclipse preferences, the projects
using this profile are updated accordingly.

Best regards
Timo

Timo Mueller (5):
  plugins/sdk.ide: Allow storage of yocto settings in project
preferences
  plugins/sdk.ide: Store profile configuration on project setup
  plugins/sdk.ide: Enable project specific yocto settings
  plugins/sdk.ide: Update projects affected by changes of a target
profile
  plugins/sdk.ide: Enable the usage of profiles in the project
properties

 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java |   3 +
 .../yocto/sdk/ide/YoctoProjectSpecificSetting.java |  89 
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   5 +-
 .../org/yocto/sdk/ide/YoctoSDKProjectNature.java   |   1 +
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java   | 149 +
 .../sdk/ide/preferences/PreferenceConstants.java   |   2 +
 .../ide/preferences/YoctoSDKPreferencePage.java|  91 -
 .../preferences/YoctoSDKProjectPropertyPage.java   |  94 ++---
 8 files changed, 410 insertions(+), 24 deletions(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java

-- 
1.7.11.7

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


[yocto] [RFC v1 2/5] plugins/sdk.ide: Store profile configuration on project setup

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de


Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java   | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
index 6f16732..b0e7121 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
@@ -154,6 +154,7 @@ public class YoctoSDKProjectNature implements 
IProjectNature {
 
public static void configureAutotools(IProject project) throws 
YoctoGeneralException {
YoctoProfileElement profileElement = 
YoctoSDKUtils.getProfilesFromDefaultStore();
+   YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, 
project);
IPreferenceStore selecteProfileStore = 
YoctoSDKPlugin.getProfilePreferenceStore(profileElement.getSelectedProfile());
YoctoUIElement elem = 
YoctoSDKUtils.getElemFromStore(selecteProfileStore);
YoctoSDKUtils.SDKCheckResults result = 
YoctoSDKUtils.checkYoctoSDK(elem);
-- 
1.7.11.7

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


[yocto] [RFC v1 1/5] plugins/sdk.ide: Allow storage of yocto settings in project preferences

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The added functions allow storing the yocto settings in the
preferences store of a project. Project-specific yocto settings as
well as the used profiles can be stored.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java   | 110 +
 1 file changed, 110 insertions(+)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
index 12af7e3..857928c 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
@@ -32,9 +32,13 @@ import 
org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
 import org.eclipse.cdt.core.settings.model.ICProjectDescription;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.jface.preference.IPreferenceStore;
+import org.osgi.service.prefs.BackingStoreException;
 import org.yocto.sdk.ide.preferences.PreferenceConstants;
 
 public class YoctoSDKUtils {
@@ -62,6 +66,7 @@ public class YoctoSDKUtils {
Other
};
 
+   private static final String PROJECT_SCOPE = org.yocto.sdk.ide;
private static final String POKY_DEVICE_EMPTY = Poky.SDK.Device.Empty;
private static final String TOOLCHAIN_LOCATION_EMPTY = 
Poky.SDK.Location.Empty;
private static final String SDK_TARGET_EMPTY  = 
Poky.SDK.Target.Empty;
@@ -397,6 +402,74 @@ public class YoctoSDKUtils {
 
}
 
+   /* Get POKY Preference settings from project's preference store */
+   public static YoctoUIElement getElemFromProjectPreferences(IProject 
project)
+   {
+   IScopeContext projectScope = new ProjectScope(project);
+   IEclipsePreferences projectNode = 
projectScope.getNode(PROJECT_SCOPE);
+   if (projectNode == null)
+   {
+   return getElemFromProjectEnv(project);
+   }
+
+   YoctoUIElement elem = new YoctoUIElement();
+   
elem.setStrToolChainRoot(projectNode.get(PreferenceConstants.TOOLCHAIN_ROOT,));
+   
elem.setStrTarget(projectNode.get(PreferenceConstants.TOOLCHAIN_TRIPLET,));
+   
elem.setStrQemuKernelLoc(projectNode.get(PreferenceConstants.QEMU_KERNEL,));
+   
elem.setStrSysrootLoc(projectNode.get(PreferenceConstants.SYSROOT,));
+   
elem.setStrQemuOption(projectNode.get(PreferenceConstants.QEMU_OPTION,));
+   String sTemp = 
projectNode.get(PreferenceConstants.TARGET_ARCH_INDEX,);
+   if (!sTemp.isEmpty())
+   
elem.setIntTargetIndex(Integer.valueOf(sTemp).intValue());
+   if 
(projectNode.get(PreferenceConstants.SDK_MODE,).equalsIgnoreCase(IPreferenceStore.TRUE))
+   {
+   
elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
+   }
+   else
+   
elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
+
+   
if(projectNode.get(PreferenceConstants.TARGET_MODE,).equalsIgnoreCase(IPreferenceStore.TRUE))
+   
elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
+   else
+   
elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
+   return elem;
+   }
+
+   /* Save POKY Preference settings to project's preference store */
+   public static void saveElemToProjectPreferences(YoctoUIElement elem, 
IProject project)
+   {
+   IScopeContext projectScope = new ProjectScope(project);
+   IEclipsePreferences projectNode = 
projectScope.getNode(PROJECT_SCOPE);
+   if (projectNode == null)
+   {
+   return;
+   }
+
+   projectNode.putInt(PreferenceConstants.TARGET_ARCH_INDEX, 
elem.getIntTargetIndex());
+   if (elem.getEnumPokyMode() == 
YoctoUIElement.PokyMode.POKY_SDK_MODE)
+   projectNode.put(PreferenceConstants.SDK_MODE, 
IPreferenceStore.TRUE);
+   else
+   projectNode.put(PreferenceConstants.SDK_MODE, 
IPreferenceStore.FALSE);
+   projectNode.put(PreferenceConstants.QEMU_KERNEL, 
elem.getStrQemuKernelLoc());
+   projectNode.put(PreferenceConstants.QEMU_OPTION, 
elem.getStrQemuOption());
+   projectNode.put(PreferenceConstants.SYSROOT, 
elem.getStrSysrootLoc());
+   if (elem.getEnumDeviceMode

[yocto] [RFC v1 3/5] plugins/sdk.ide: Enable project specific yocto settings

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Until now only global target profiles could be used to configure a
project. Now a project can have its own specific settings which are
not affected by global changes to the profile.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../yocto/sdk/ide/YoctoProjectSpecificSetting.java | 80 ++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  3 +
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java   | 39 +++
 .../sdk/ide/preferences/PreferenceConstants.java   |  2 +
 4 files changed, 124 insertions(+)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
new file mode 100644
index 000..25d4de4
--- /dev/null
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
@@ -0,0 +1,80 @@
+/***
+ * Copyright (c) 2012 BMW Car IT GmbH.
+ * 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:
+ * BMW Car IT - initial API and implementation
+ 
***/
+package org.yocto.sdk.ide;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+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.Group;
+
+public class YoctoProjectSpecificSetting {
+   private static final String PROJECT_SPECIFIC_TITLE = 
Preferences.Profile.ProjectSpecific.Title;
+   private static final String PROJECT_SPECIFIC_GROUP_TITLE = 
Preferences.Profile.ProjectSpecific.Group.Title;
+
+   private YoctoProfileSetting yoctoConfigurationsSetting;
+   private YoctoUISetting yoctoUISetting;
+
+   private Button btnUseProjectSpecificSettingsCheckbox;
+   private PreferencePage preferencePage;
+
+   public YoctoProjectSpecificSetting(YoctoProfileSetting 
yoctoConfigurationsSetting,
+   YoctoUISetting yoctoUISetting, 
PreferencePage preferencePage) {
+   this.yoctoConfigurationsSetting = yoctoConfigurationsSetting;
+   this.yoctoUISetting = yoctoUISetting;
+   this.preferencePage = preferencePage;
+   }
+
+   public void createComposite(Composite composite) {
+   GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+   GridLayout layout = new GridLayout(2, false);
+   composite.setLayout(layout);
+
+   Group storeYoctoConfigurationsGroup = new Group (composite, 
SWT.NONE);
+   layout = new GridLayout(2, false);
+   storeYoctoConfigurationsGroup.setLayout(layout);
+   gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+   gd.horizontalSpan = 2;
+   storeYoctoConfigurationsGroup.setLayoutData(gd);
+   
storeYoctoConfigurationsGroup.setText(YoctoSDKMessages.getString(PROJECT_SPECIFIC_GROUP_TITLE));
+
+   btnUseProjectSpecificSettingsCheckbox = new 
Button(storeYoctoConfigurationsGroup, SWT.CHECK);
+   
btnUseProjectSpecificSettingsCheckbox.setText(YoctoSDKMessages.getString(PROJECT_SPECIFIC_TITLE));
+   btnUseProjectSpecificSettingsCheckbox.addSelectionListener(new 
SelectionListener() {
+   @Override
+   public void widgetSelected(SelectionEvent e) {
+   if 
(btnUseProjectSpecificSettingsCheckbox.getSelection()){
+   
yoctoConfigurationsSetting.setUIFormEnabledState(false);
+   
yoctoUISetting.setUIFormEnabledState(true);
+   } else {
+   
yoctoConfigurationsSetting.setUIFormEnabledState(true);
+   
yoctoConfigurationsSetting.setButtonsEnabledState(false);
+   
yoctoUISetting.setUIFormEnabledState(false);
+   }
+   }
+
+   @Override
+   public void widgetDefaultSelected(SelectionEvent e) {}
+   });
+   }
+
+   public void setUseProjectSpecificSettings(boolean 
isUsingProjectSpecificSettings

[yocto] [RFC v1 4/5] plugins/sdk.ide: Update projects affected by changes of a target profile

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

If a target profile is modified, renamed or deleted globally the
projects using this profile are updated accordingly.
On deletion of a target profile the affected projects will set use the
standard target profile.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  2 +-
 .../ide/preferences/YoctoSDKPreferencePage.java| 91 +-
 2 files changed, 89 insertions(+), 4 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index bfdde41..e779f7d 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -60,7 +60,7 @@ Preferences.Profile.Rename.Dialog.Title = Rename target 
profile
 Preferences.Profile.Rename.Dialog.Message = Please input a new profile name.
 Preferences.Profile.Remove.Title = Remove
 Preferences.Profile.Remove.Dialog.Title = Remove target profile
-Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove 
the target profile {0}?
+Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove 
the target profile {0}?\nProjects using this target profile will be 
reconfigured to use the standard profile.
 Preferences.Profile.Standard.Modification.Title = Modify standard target 
profile
 Preferences.Profile.Standard.Modification.Message = Standard target profile 
cannot be removed or renamed.
 
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index fb015ab..b5963cf 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -10,6 +10,11 @@
  
***/
 package org.yocto.sdk.ide.preferences;
 
+import java.util.HashSet;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.InputDialog;
@@ -25,6 +30,7 @@ import org.yocto.sdk.ide.YoctoProfileElement;
 import org.yocto.sdk.ide.YoctoProfileSetting;
 import org.yocto.sdk.ide.YoctoSDKMessages;
 import org.yocto.sdk.ide.YoctoSDKPlugin;
+import org.yocto.sdk.ide.YoctoSDKProjectNature;
 import org.yocto.sdk.ide.YoctoSDKUtils;
 import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoUIElement;
@@ -80,8 +86,8 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
System.out.println(e.getMessage());
return result;
}
-
}
+
/*
 * @see IPreferencePage#performOk()
 */
@@ -95,6 +101,8 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
YoctoProfileElement profileElement = 
yoctoProfileSetting.getCurrentInput();

YoctoSDKUtils.saveProfilesToDefaultStore(profileElement);
 
+   
updateAffectedProjects(profileElement.getSelectedProfile(), elem);
+
return super.performOk();
} catch (YoctoGeneralException e) {
// TODO Auto-generated catch block
@@ -151,9 +159,86 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
public void renameProfile(String oldProfileName, String newProfileName) 
{
YoctoUIElement oldProfileElement = 
YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(oldProfileName));
YoctoSDKUtils.saveElemToStore(oldProfileElement, 
YoctoSDKPlugin.getProfilePreferenceStore(newProfileName));
+
+   renameProfileInAffectedProjects(oldProfileName, newProfileName);
+   }
+
+   public void deleteProfile(String selectedProfile)
+   {
+   resetProfileInAffectedProjects(selectedProfile);
}
 
-   public void deleteProfile(String selectedProfile) {
-   // do nothing
+   private void resetProfileInAffectedProjects(String usedProfile)
+   {
+   HashSetIProject yoctoProjects = 
getAffectedProjects(usedProfile);
+   YoctoProfileElement profileElement = 
YoctoSDKUtils.getProfilesFromDefaultStore();
+   
profileElement.setSelectedProfile(PreferenceConstants.STANDARD_PROFILE_NAME);
+
+   for (IProject project : yoctoProjects

[yocto] [RFC v1 5/5] plugins/sdk.ide: Enable the usage of profiles in the project properties

2013-02-08 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

UI elements are added to the project properties in order to use
profile capabilites with a project.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java |  3 +
 .../yocto/sdk/ide/YoctoProjectSpecificSetting.java |  9 +++
 .../preferences/YoctoSDKProjectPropertyPage.java   | 94 +-
 3 files changed, 86 insertions(+), 20 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 738dba7..cc3e167 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -28,6 +28,7 @@ import org.eclipse.swt.widgets.Listener;
 import org.yocto.sdk.ide.preferences.PreferenceConstants;
 import org.yocto.sdk.ide.preferences.ProfileNameInputValidator;
 import org.yocto.sdk.ide.preferences.YoctoSDKPreferencePage;
+import org.yocto.sdk.ide.preferences.YoctoSDKProjectPropertyPage;
 
 public class YoctoProfileSetting {
private static final String PROFILES_TITLE = 
Preferences.Profiles.Title;
@@ -91,6 +92,8 @@ public class YoctoProfileSetting {
 
if (preferencePage instanceof 
YoctoSDKPreferencePage) {
((YoctoSDKPreferencePage) 
preferencePage).switchProfile(selectedItem);
+   } else if (preferencePage instanceof 
YoctoSDKProjectPropertyPage) {
+   ((YoctoSDKProjectPropertyPage) 
preferencePage).switchProfile(selectedItem);
}
}
};
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
index 25d4de4..13acb8e 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
@@ -19,6 +19,7 @@ import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Group;
+import org.yocto.sdk.ide.preferences.YoctoSDKProjectPropertyPage;
 
 public class YoctoProjectSpecificSetting {
private static final String PROJECT_SPECIFIC_TITLE = 
Preferences.Profile.ProjectSpecific.Title;
@@ -58,10 +59,18 @@ public class YoctoProjectSpecificSetting {
if 
(btnUseProjectSpecificSettingsCheckbox.getSelection()){

yoctoConfigurationsSetting.setUIFormEnabledState(false);

yoctoUISetting.setUIFormEnabledState(true);
+
+   if (preferencePage instanceof 
YoctoSDKProjectPropertyPage) {
+   ((YoctoSDKProjectPropertyPage) 
preferencePage).switchToProjectSpecificProfile();
+   }
} else {

yoctoConfigurationsSetting.setUIFormEnabledState(true);

yoctoConfigurationsSetting.setButtonsEnabledState(false);

yoctoUISetting.setUIFormEnabledState(false);
+
+   if (preferencePage instanceof 
YoctoSDKProjectPropertyPage) {
+   ((YoctoSDKProjectPropertyPage) 
preferencePage).switchToSelectedProfile();
+   }
}
}
 
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 56cc4cb..eef56c1 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -21,6 +21,10 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.IWorkbenchPropertyPage;
 import org.eclipse.ui.dialogs.PropertyPage;
 import org.yocto.sdk.ide.YoctoGeneralException;
+import org.yocto.sdk.ide.YoctoProfileElement;
+import org.yocto.sdk.ide.YoctoProfileSetting;
+import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
+import org.yocto.sdk.ide.YoctoSDKPlugin;
 import org.yocto.sdk.ide.YoctoSDKUtils;
 import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;
 import org.yocto.sdk.ide.YoctoUIElement;
@@ -29,21 +33,56 @@ import org.yocto.sdk.ide.YoctoUISetting;
 public class YoctoSDKProjectPropertyPage extends PropertyPage implements
IWorkbenchPropertyPage

[yocto] [RFC v3 03/18] plugins/sdk.ide: Add method to enable and disable form

2013-02-03 Thread Timo Mueller
From: Atanas Gegov atanas.ge...@bmw-carit.de

The YoctoUISetting form as a whole can be disabled and enabled using
this method. A disabled form can for example show a read-only yocto
configuration.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoUISetting.java  | 44 ++
 1 file changed, 44 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index 9ec0d85..2e3c830 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -370,6 +370,50 @@ public class YoctoUISetting {
return pass;
}
 
+   public void setUIFormEnabledState(boolean isEnabled) {
+   btnSDKRoot.setEnabled(isEnabled);
+   btnPokyRoot.setEnabled(isEnabled);
+
+   root_label.setEnabled(isEnabled);
+   textRootLoc.setEnabled(isEnabled);
+   btnToolChainLoc.setEnabled(isEnabled);
+
+   sysroot_label.setEnabled(isEnabled);
+   textSysrootLoc.setEnabled(isEnabled);
+   btnSysrootLoc.setEnabled(isEnabled);
+
+   targetArchLabel.setEnabled(isEnabled);
+   targetArchCombo.setEnabled(isEnabled);
+
+   btnQemu.setEnabled(isEnabled);
+
+   if(isEnabled) {
+   /* enabling widgets regarding
+* Kernel and Custom Options
+* depends on the state of the QEMU button */
+   kernel_label.setEnabled(isEnabled);
+   option_label.setEnabled(isEnabled);
+
+   if(btnQemu.getSelection()) {
+   textKernelLoc.setEnabled(isEnabled);
+   btnKernelLoc.setEnabled(isEnabled);
+
+   textQemuOption.setEnabled(isEnabled);
+   }
+   } else {
+   /* disable all widgets regarding
+* Kernel and Custom Options */
+   kernel_label.setEnabled(isEnabled);
+   textKernelLoc.setEnabled(isEnabled);
+   btnKernelLoc.setEnabled(isEnabled);
+
+   option_label.setEnabled(isEnabled);
+   textQemuOption.setEnabled(isEnabled);
+   }
+
+   btnDevice.setEnabled(isEnabled);
+   }
+
private void updateQemuControlState()
{
boolean bQemuMode = btnQemu.getSelection();
-- 
1.7.11.7

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


[yocto] [RFC v3 04/18] plugins/sdk.ide: Set value of target array on input change

2013-02-03 Thread Timo Mueller
From: Atanas Gegov atanas.ge...@bmw-carit.de

The value of the target array set in the constructor is now also
affected when the input of the element is changed.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index 2e3c830..5bca41a 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -303,6 +303,8 @@ public class YoctoUISetting {
}
 
public void setCurrentInput(YoctoUIElement elem){
+   elem.setStrTargetsArray(getTargetArray(elem));
+
btnSDKRoot.setSelection(false);
btnPokyRoot.setSelection(false);

if(elem.getEnumPokyMode().equals(YoctoUIElement.PokyMode.POKY_SDK_MODE)){
-- 
1.7.11.7

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


[yocto] [RFC v3 01/18] plugins/sdk.ide: Removed unused message

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The dialog has been merged with the project settings. Therefor the
message is no longer needed.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties  | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index b302524..17240e9 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -22,7 +22,6 @@ Poky.Env.Script.Nonexist = Specified Build Tree Toolchain 
Root does not contain
 Poky.ADT.Sysroot.Wrongversion = OECORE related items are not found in 
envrionement setup files.\nThe ADT version you're using is too old.\n Please 
upgrade to our latest ADT Version!
 Poky.Toolchain.Host.Mismatch = Toolchain and host arch mismatch.\n Make sure 
you use 32bit toolchain for 32bit host and same for 64bit machines!
 Poky.Toolchain.No.Sysroot = There's no sysroots directory under your toolchain 
directory under /opt/poky!
-Menu.SDK.Dialog.Title   = Yocto Project Settings
 
 
 Menu.SDK.Console.Configure.Message= The Yocto Project ADT has been 
successfully set up for this project.\nTo see the environment variables created 
during setup,\ngo to Project  Properties  C/C++ Build  Environment. 
-- 
1.7.11.7

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


[yocto] [RFC v3 00/18][eclipse-poky] Storing yocto settings as target profiles

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Hi,

thanks for the feedback, I did some changes to the patch series
accordingly.

First of all I've fixed the issues with the patches (duplicate method,
missing fix for NewYoctoCProjectTemplate.java).

I also changed the functionality of the new button according to
Jessica's feedback. The logic is changed to a Save as ...
approach. If the button is clicked the current values of the form are
checked. If these are valid, the user can enter a name to store them
as a new profile.

The last patch moves the Save as ... button to the bottom of the
preference page alongside with the perform defaults and the apply
button. I created this patch as a proof of concept because I thought
it would be a good idea to move it.
I used the contributeButtons hook of the preference page to achieve
this, but this only allows adding the Save as ... button left to the
perform defaults button. So the order of the buttons is a bit
confusing.
I further checked several other preference pages of eclipse and it
seems like none of them is using this hook to add new buttons. Instead
all have a new button next to the comboboxes (e.g. Formatter for CDT
and JDT).
So I would plead against moving it to the bottom to have a more
consistent and less confusing ui.

From the original cover letter:
snip
currently the yocto settings can be changed globally through eclipse's
preferences or locally in the project properties. But the standard configuration
stored in the global preferences sometimes changes, e.g. if a new version of the
toolchain or the sysroot is released.
If you change the global settings to the updated toolchain or sysroot your old
working configuration is gone. If you want to reuse this configuration at a
later point in time you have to (remember and) re-enter everthing.
This patch set introduces the possiblity to store a configuration under a unique
name, a so called target profile, and be able to select the default target
profile that is used for new projects.
Building upon this change the target profiles could later also be used in the
project settings and be able to quickly build and debug your software for
different hard- and software combinations.
/snip

Best regards,
Timo


Atanas Gegov (4):
  plugins/sdk.ide: Extract labels to private members
  plugins/sdk.ide: Add method to enable and disable form
  plugins/sdk.ide: Set value of target array on input change
  plugins/sdk.ide: Create UI element for managing target profiles.

Timo Mueller (14):
  plugins/sdk.ide: Removed unused message
  plugins/sdk.ide: Changed method signature to be more consistent
  plugins/sdk.ide: Modified preferences storage to support profiles.
  plugins/sdk.ide: Set profile on selection change
  plugins/sdk.ide: Add method to allow storing the current settings
  plugins/sdk.ide: Add UI method to create a new profile
  plugins/sdk.ide: Add UI method to delete a profile
  plugins/sdk.ide: Add UI method to rename a profile
  plugins/sdk.ide: Add method to change values of the preference page
  plugins/sdk.ide: Add method to rename a profile and its preference
store
  plugins/sdk.ide: Add method to delete a profile
  plugins/sdk.ide: Use profiles for the preference page
  plugins/sdk.ide: Added profile UI to the preference page
  plugins/sdk.ide: Moved save as button to bottom of preference page

 .../src/org/yocto/sdk/ide/YoctoProfileElement.java | 104 ++
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java | 211 +
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  19 +-
 .../src/org/yocto/sdk/ide/YoctoSDKPlugin.java  |   9 +
 .../org/yocto/sdk/ide/YoctoSDKProjectNature.java   |  10 +-
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java   |  62 --
 .../src/org/yocto/sdk/ide/YoctoUISetting.java  |  60 +-
 .../sdk/ide/preferences/PreferenceConstants.java   |   5 +
 .../sdk/ide/preferences/PreferenceInitializer.java |  22 ++-
 .../ide/preferences/ProfileNameInputValidator.java |  63 ++
 .../ide/preferences/YoctoSDKPreferencePage.java| 133 ++---
 .../preferences/YoctoSDKProjectPropertyPage.java   |   6 +-
 .../sdk/ide/wizard/NewYoctoCProjectTemplate.java   |   7 +-
 13 files changed, 646 insertions(+), 65 deletions(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/ProfileNameInputValidator.java

-- 
1.7.11.7

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


[yocto] [RFC v3 05/18] plugins/sdk.ide: Changed method signature to be more consistent

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

YoctoUIElement should always be the first element, e.g. as in
saveElemToStore().

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java  | 2 +-
 .../src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
index 7ea4262..ab969ea 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
@@ -423,7 +423,7 @@ public class YoctoSDKUtils {
}

/* Save YoctoUIElement to project settings */
-   public static void saveElemToProjectEnv(IProject project, 
YoctoUIElement elem)
+   public static void saveElemToProjectEnv(YoctoUIElement elem, IProject 
project)
{
ConsoleOutputStream consoleOutStream = null;

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 92d476a..f2247ca 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -99,7 +99,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage 
implements

yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, true);
 
YoctoUIElement elem = yoctoUISetting.getCurrentInput();
-   YoctoSDKUtils.saveElemToProjectEnv(getProject(), elem);
+   YoctoSDKUtils.saveElemToProjectEnv(elem, getProject());
 
return super.performOk();
} catch (YoctoGeneralException e) {
-- 
1.7.11.7

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


[yocto] [RFC v3 08/18] plugins/sdk.ide: Set profile on selection change

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

When a profile is selected through the combo box the value of the
profileElement changed to contain the selected profile.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java | 23 ++
 1 file changed, 23 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 7476bd3..b35a167 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -16,7 +16,9 @@ import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Listener;
 
 public class YoctoProfileSetting {
private static final String PROFILES_TITLE = 
Preferences.Profiles.Title;
@@ -54,6 +56,27 @@ public class YoctoProfileSetting {
sdkConfigsCombo.setLayout(new GridLayout(2, false));
sdkConfigsCombo.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, 
true, false));
 
+   Listener selectionListener = new Listener() {
+   @Override
+   public void handleEvent(Event event) {
+   Object source = event.widget;
+   if (!(source instanceof Combo)) {
+   return;
+   }
+
+   Combo sdkCombo = (Combo) source;
+   if (sdkCombo.getSelectionIndex()  0) {
+   return;
+   }
+
+   String selectedItem = 
sdkCombo.getItem(sdkCombo.getSelectionIndex());
+   profileElement.setSelectedProfile(selectedItem);
+   }
+   };
+
+   sdkConfigsCombo.addListener(SWT.Selection, selectionListener);
+   sdkConfigsCombo.addListener(SWT.Modify, selectionListener);
+
createSaveAsProfileButton(storeYoctoConfigurationsGroup);
createRenameButton(storeYoctoConfigurationsGroup);
createRemoveButton(storeYoctoConfigurationsGroup);
-- 
1.7.11.7

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


[yocto] [RFC v3 09/18] plugins/sdk.ide: Add method to allow storing the current settings

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The added method calls the performOK method on the provided preference
page to store the current content of the page.

This callback is needed so the profile UI is able to propagate changes
to the preference page it is part of.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java   | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index b35a167..7949cdf 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -10,6 +10,7 @@
  
***/
 package org.yocto.sdk.ide;
 
+import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -32,9 +33,11 @@ public class YoctoProfileSetting {
private Button btnConfigSaveAs;
 
private YoctoProfileElement profileElement;
+   private PreferencePage preferencePage;
 
-   public YoctoProfileSetting(YoctoProfileElement profileElement) {
+   public YoctoProfileSetting(YoctoProfileElement profileElement, 
PreferencePage preferencePage) {
this.profileElement = profileElement;
+   this.preferencePage = preferencePage;
}
 
public void createComposite(Composite composite) {
@@ -98,6 +101,10 @@ public class YoctoProfileSetting {

btnConfigRename.setText(YoctoSDKMessages.getString(RENAME_PROFILE_TITLE));
}
 
+   private void saveChangesOnCurrentProfile() {
+   preferencePage.performOk();
+   }
+
private void addConfigs(Combo combo) {
for (String profile : profileElement.getProfiles()) {
combo.add(profile);
-- 
1.7.11.7

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


[yocto] [RFC v3 06/18] plugins/sdk.ide: Create UI element for managing target profiles.

2013-02-03 Thread Timo Mueller
From: Atanas Gegov atanas.ge...@bmw-carit.de

A target profile is a combination of yocto settings identified by a
user-defined name. This UI element allows the user to add new profiles
and to rename or delete existing ones.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoProfileElement.java | 104 +
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java |  98 +++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |   5 +
 .../sdk/ide/preferences/PreferenceConstants.java   |   1 +
 4 files changed, 208 insertions(+)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java
new file mode 100644
index 000..02626ad
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java
@@ -0,0 +1,104 @@
+/***
+ * Copyright (c) 2012 BMW Car IT GmbH.
+ * 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:
+ * BMW Car IT - initial API and implementation
+ 
***/
+package org.yocto.sdk.ide;
+
+import java.util.Comparator;
+import java.util.StringTokenizer;
+import java.util.TreeSet;
+
+import org.yocto.sdk.ide.preferences.PreferenceConstants;
+
+public class YoctoProfileElement {
+   private TreeSetString profiles = new TreeSetString(new 
ComparatorString() {
+
+   @Override
+   public int compare(String o1, String o2) {
+   int strcompare = o1.compareTo(o2);
+
+   if (strcompare == 0) {
+   return strcompare;
+   }
+
+   // Standard profile always less than anything else
+   if 
(o1.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
+   return -1;
+   }
+
+   if 
(o2.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
+   return 1;
+   }
+
+   return strcompare;
+   }
+   });
+
+   private String selectedProfile;
+
+   public YoctoProfileElement(String profilesString, String 
selectedProfile) {
+   setProfilesFromString(profilesString);
+   this.selectedProfile = selectedProfile;
+   }
+
+   public void addProfile(String profile) {
+   this.profiles.add(profile);
+   }
+
+   public boolean contains(String newText) {
+   return profiles.contains(newText);
+   }
+
+   public TreeSetString getProfiles() {
+   return profiles;
+   }
+
+   public String getProfilesAsString() {
+   String profileString = ;
+
+   for (String profile : profiles) {
+   profileString += \ + profile + \,;
+   }
+   return profileString.substring(0, profileString.length() - 1);
+   }
+
+   public String getSelectedProfile() {
+   return selectedProfile;
+   }
+
+   public void remove(String profile) {
+   this.profiles.remove(profile);
+   }
+
+   public void rename(String oldProfileName, String newProfileName) {
+   this.remove(oldProfileName);
+   this.addProfile(newProfileName);
+
+   if (selectedProfile.equals(oldProfileName)) {
+   selectedProfile = newProfileName;
+   }
+   }
+
+   public void setProfiles(TreeSetString profiles) {
+   this.profiles = profiles;
+   }
+
+   public void setProfilesFromString(String profilesString) {
+   StringTokenizer tokenizer = new StringTokenizer(profilesString, 
,);
+
+   while (tokenizer.hasMoreElements()) {
+   String config = (String) tokenizer.nextElement();
+   profiles.add(config.replace(\, ));
+   }
+   }
+
+   public void setSelectedProfile(String selectedProfile) {
+   this.selectedProfile = selectedProfile;
+   }
+}
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
new file mode 100644
index 000..7476bd3
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -0,0 +1,98

[yocto] [RFC v3 13/18] plugins/sdk.ide: Add method to change values of the preference page

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

When switching profile the values of the profile are retrieved from
the preference store. The UI is updated using the retrieved values.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java  | 4 
 1 file changed, 4 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 077dc28..105fd9c 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -88,6 +88,10 @@ public class YoctoProfileSetting {
 
String selectedItem = 
sdkCombo.getItem(sdkCombo.getSelectionIndex());
profileElement.setSelectedProfile(selectedItem);
+
+   if (preferencePage instanceof 
YoctoSDKPreferencePage) {
+   ((YoctoSDKPreferencePage) 
preferencePage).switchProfile(selectedItem);
+   }
}
};
 
-- 
1.7.11.7

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


[yocto] [RFC v3 14/18] plugins/sdk.ide: Add method to rename a profile and its preference store

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

When renaming a profile the current values are stored in the profile's
new preference store.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java  | 4 
 1 file changed, 4 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 105fd9c..2767d7a 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -182,6 +182,10 @@ public class YoctoProfileSetting {
String newProfileName = 
profileNameDialog.getValue();
profileElement.rename(selectedItem, 
profileNameDialog.getValue());
 
+   if (preferencePage instanceof 
YoctoSDKPreferencePage) {
+   ((YoctoSDKPreferencePage) 
preferencePage).renameProfile(selectedItem, newProfileName);
+   }
+
sdkConfigsCombo.setItem(selectedIndex, 
newProfileName);
sdkConfigsCombo.select(selectedIndex);
}
-- 
1.7.11.7

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


[yocto] [RFC v3 11/18] plugins/sdk.ide: Add UI method to delete a profile

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

A profile is removed from the list, when the delete button is
clicked. The deletion has to be confirmed by the user. Deleting the
standard profile is not allowed.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java | 34 ++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  4 +++
 2 files changed, 38 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 633eb67..aa6f4b2 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -10,6 +10,7 @@
  
***/
 package org.yocto.sdk.ide;
 
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.MouseAdapter;
@@ -22,6 +23,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Listener;
+import org.yocto.sdk.ide.preferences.PreferenceConstants;
 import org.yocto.sdk.ide.preferences.YoctoSDKPreferencePage;
 
 public class YoctoProfileSetting {
@@ -29,6 +31,10 @@ public class YoctoProfileSetting {
private static final String NEW_PROFILE_TITLE = 
Preferences.Profile.New.Title;
private static final String RENAME_PROFILE_TITLE = 
Preferences.Profile.Rename.Title;
private static final String REMOVE_PROFILE_TITLE = 
Preferences.Profile.Remove.Title;
+   private static final String REMOVE_DIALOG_TITLE = 
Preferences.Profile.Remove.Dialog.Title;
+   private static final String REMOVE_DIALOG_MESSAGE = 
Preferences.Profile.Remove.Dialog.Message;
+   private static final String MODIFY_STANDARD_TITLE = 
Preferences.Profile.Standard.Modification.Title;
+   private static final String MODIFY_STANDARD_MESSAGE = 
Preferences.Profile.Standard.Modification.Message;
 
private Combo sdkConfigsCombo;
private Button btnConfigRename;
@@ -105,6 +111,34 @@ public class YoctoProfileSetting {
btnConfigRemove = new Button(storeYoctoConfigurationsGroup, 
SWT.PUSH | SWT.LEAD);
btnConfigRemove.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, 
true, false, 3, 1));

btnConfigRemove.setText(YoctoSDKMessages.getString(REMOVE_PROFILE_TITLE));
+   btnConfigRemove.addMouseListener(new MouseAdapter() {
+   @Override
+   public void mouseDown(MouseEvent e) {
+   saveChangesOnCurrentProfile();
+   int selectionIndex = 
sdkConfigsCombo.getSelectionIndex();
+   String selectedItem = 
sdkConfigsCombo.getItem(selectionIndex);
+
+   if 
(selectedItem.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
+   MessageDialog.openInformation(null,
+   
YoctoSDKMessages.getString(MODIFY_STANDARD_TITLE),
+   
YoctoSDKMessages.getString(MODIFY_STANDARD_MESSAGE));
+   return;
+   }
+
+   boolean deleteConfirmed =
+   MessageDialog.openConfirm(null,
+   
YoctoSDKMessages.getString(REMOVE_DIALOG_TITLE),
+   

YoctoSDKMessages.getFormattedString(REMOVE_DIALOG_MESSAGE, selectedItem));
+
+   if (!deleteConfirmed) {
+   return;
+   }
+
+   sdkConfigsCombo.select(0);
+   sdkConfigsCombo.remove(selectionIndex);
+   profileElement.remove(selectedItem);
+   }
+   });
}
 
private void createRenameButton(Group storeYoctoConfigurationsGroup) {
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 14b7846..1a413fa 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -57,6 +57,10 @@ Preferences.Profile.New.Dialog.Title

[yocto] [RFC v3 12/18] plugins/sdk.ide: Add UI method to rename a profile

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

When the rename button is clicked a dialog shows up and the user has
to provide the new name for the profile. The validity of the name is
checked during input. If the name is valid and the users confirms the
profile is renamed. Renaming the standard profile is not allowed.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java | 38 ++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  2 ++
 2 files changed, 40 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index aa6f4b2..077dc28 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -10,6 +10,8 @@
  
***/
 package org.yocto.sdk.ide;
 
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.InputDialog;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
@@ -24,12 +26,15 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Listener;
 import org.yocto.sdk.ide.preferences.PreferenceConstants;
+import org.yocto.sdk.ide.preferences.ProfileNameInputValidator;
 import org.yocto.sdk.ide.preferences.YoctoSDKPreferencePage;
 
 public class YoctoProfileSetting {
private static final String PROFILES_TITLE = 
Preferences.Profiles.Title;
private static final String NEW_PROFILE_TITLE = 
Preferences.Profile.New.Title;
private static final String RENAME_PROFILE_TITLE = 
Preferences.Profile.Rename.Title;
+   private static final String RENAME_DIALOG_TITLE = 
Preferences.Profile.Rename.Dialog.Title;
+   private static final String RENAME_DIALOG_MESSAGE = 
Preferences.Profile.Rename.Dialog.Message;
private static final String REMOVE_PROFILE_TITLE = 
Preferences.Profile.Remove.Title;
private static final String REMOVE_DIALOG_TITLE = 
Preferences.Profile.Remove.Dialog.Title;
private static final String REMOVE_DIALOG_MESSAGE = 
Preferences.Profile.Remove.Dialog.Message;
@@ -144,6 +149,39 @@ public class YoctoProfileSetting {
private void createRenameButton(Group storeYoctoConfigurationsGroup) {
btnConfigRename = new Button(storeYoctoConfigurationsGroup, 
SWT.PUSH | SWT.LEAD);

btnConfigRename.setText(YoctoSDKMessages.getString(RENAME_PROFILE_TITLE));
+   btnConfigRename.addMouseListener(new MouseAdapter() {
+   @Override
+   public void mouseDown(MouseEvent e) {
+   saveChangesOnCurrentProfile();
+   int selectedIndex = 
sdkConfigsCombo.getSelectionIndex();
+   final String selectedItem = 
sdkConfigsCombo.getItem(selectedIndex);
+
+   if 
(selectedItem.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
+   MessageDialog.openInformation(null,
+   
YoctoSDKMessages.getString(MODIFY_STANDARD_TITLE),
+   
YoctoSDKMessages.getString(MODIFY_STANDARD_MESSAGE));
+   return;
+   }
+
+   InputDialog profileNameDialog =
+   new InputDialog(null,
+   
YoctoSDKMessages.getString(RENAME_DIALOG_TITLE),
+   
YoctoSDKMessages.getString(RENAME_DIALOG_MESSAGE),
+   
null,
+   
new ProfileNameInputValidator(profileElement, selectedItem));
+
+   int returnCode = profileNameDialog.open();
+   if (returnCode == IDialogConstants.CANCEL_ID) {
+   return;
+   }
+
+   String newProfileName = 
profileNameDialog.getValue();
+   profileElement.rename(selectedItem, 
profileNameDialog.getValue());
+
+   sdkConfigsCombo.setItem(selectedIndex, 
newProfileName);
+   sdkConfigsCombo.select(selectedIndex);
+   }
+   });
}
 
private void saveChangesOnCurrentProfile() {
diff --git 
a/plugins/org.yocto.sdk.ide/src

[yocto] [RFC v3 07/18] plugins/sdk.ide: Modified preferences storage to support profiles.

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Yocto preferences are now stored using a user-defined name that
identifies a target profile. To store these preferences eclipse'
scoped preferences provider is used. The filename in the eclipse
configuration area is derived from the unique target profile name.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoSDKPlugin.java  |  9 
 .../org/yocto/sdk/ide/YoctoSDKProjectNature.java   | 10 ++--
 .../src/org/yocto/sdk/ide/YoctoSDKUtils.java   | 60 +-
 .../sdk/ide/preferences/PreferenceConstants.java   |  4 ++
 .../sdk/ide/preferences/PreferenceInitializer.java | 22 
 .../ide/preferences/YoctoSDKPreferencePage.java| 36 -
 .../preferences/YoctoSDKProjectPropertyPage.java   |  4 +-
 .../sdk/ide/wizard/NewYoctoCProjectTemplate.java   |  7 ++-
 8 files changed, 99 insertions(+), 53 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java
index b0b5447..9777396 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java
@@ -16,9 +16,12 @@ import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
 import org.osgi.framework.BundleContext;
 
 /**
@@ -65,6 +68,12 @@ public class YoctoSDKPlugin extends AbstractUIPlugin {
return plugin;
}
 
+   public static IPreferenceStore getProfilePreferenceStore(String 
profileName) {
+   int profileIdentifier = profileName.hashCode();
+
+   return new 
ScopedPreferenceStore(InstanceScope.INSTANCE,getUniqueIdentifier() + . + 
profileIdentifier);
+   }
+
public static void log(IStatus status) {
ResourcesPlugin.getPlugin().getLog().log(status);
}
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
index ec49dcc..6f16732 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
@@ -18,10 +18,13 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.StringTokenizer;
+
 import org.eclipse.cdt.core.model.CoreModel;
 import org.eclipse.cdt.core.settings.model.ICProjectDescription;
 import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
 import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
+import 
org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
+import org.eclipse.cdt.internal.autotools.core.configure.IAConfiguration;
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
 import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
 import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
@@ -34,8 +37,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchConfigurationType;
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.debug.core.ILaunchManager;
-import 
org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
-import org.eclipse.cdt.internal.autotools.core.configure.IAConfiguration;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;
 
 
@@ -151,7 +153,9 @@ public class YoctoSDKProjectNature implements 
IProjectNature {
}
 
public static void configureAutotools(IProject project) throws 
YoctoGeneralException {
-   YoctoUIElement elem = YoctoSDKUtils.getElemFromStore();
+   YoctoProfileElement profileElement = 
YoctoSDKUtils.getProfilesFromDefaultStore();
+   IPreferenceStore selecteProfileStore = 
YoctoSDKPlugin.getProfilePreferenceStore(profileElement.getSelectedProfile());
+   YoctoUIElement elem = 
YoctoSDKUtils.getElemFromStore(selecteProfileStore);
YoctoSDKUtils.SDKCheckResults result = 
YoctoSDKUtils.checkYoctoSDK(elem);
if (result != YoctoSDKUtils.SDKCheckResults.SDK_PASS){  
String strErrorMsg =  
YoctoSDKUtils.getErrorMessage(result, SDKCheckRequestFrom.Wizard);
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java

[yocto] [RFC v3 10/18] plugins/sdk.ide: Add UI method to create a new profile

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

When the save as button is clicked a dialog shows up and the user has
to provide the name of the new profile. The validity of the name is
checked during input. If the name is valid and the users confirms the
new profile is created from the current input of the yocto settings
form.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/YoctoProfileSetting.java | 17 ++
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  7 +++
 .../ide/preferences/ProfileNameInputValidator.java | 63 ++
 .../ide/preferences/YoctoSDKPreferencePage.java| 56 ++-
 4 files changed, 142 insertions(+), 1 deletion(-)
 create mode 100644 
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/ProfileNameInputValidator.java

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 7949cdf..633eb67 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -12,6 +12,8 @@ package org.yocto.sdk.ide;
 
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -20,6 +22,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Listener;
+import org.yocto.sdk.ide.preferences.YoctoSDKPreferencePage;
 
 public class YoctoProfileSetting {
private static final String PROFILES_TITLE = 
Preferences.Profiles.Title;
@@ -88,6 +91,14 @@ public class YoctoProfileSetting {
private void createSaveAsProfileButton(Group 
storeYoctoConfigurationsGroup) {
btnConfigSaveAs = new Button(storeYoctoConfigurationsGroup, 
SWT.PUSH | SWT.LEAD);

btnConfigSaveAs.setText(YoctoSDKMessages.getString(NEW_PROFILE_TITLE));
+   btnConfigSaveAs.addMouseListener(new MouseAdapter() {
+   @Override
+   public void mouseDown(MouseEvent e) {
+   if (preferencePage instanceof 
YoctoSDKPreferencePage) {
+   ((YoctoSDKPreferencePage) 
preferencePage).performSaveAs();
+   }
+   }
+   });
}
 
private void createRemoveButton(Group storeYoctoConfigurationsGroup) {
@@ -111,6 +122,12 @@ public class YoctoProfileSetting {
}
}
 
+   public void addProfile(String profileName) {
+   int index = sdkConfigsCombo.getItemCount();
+   sdkConfigsCombo.add(profileName, index);
+   sdkConfigsCombo.select(index);
+   }
+
public void setUIFormEnabledState(boolean isEnabled) {
setButtonsEnabledState(isEnabled);
sdkConfigsCombo.setEnabled(isEnabled);
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 7200741..14b7846 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -46,8 +46,15 @@ Preferences.SDK.Target.name = Target Preferences:
 Preferences.SDK.Informing.Title   = Yocto Project ADT has been successfully 
set up. 
 Preferences.SDK.Informing.Message = You might need to reconfigure your 
existing Yocto Project Autotools Projects to use the Yocto Project ADT. Do this 
from Project  Reconfigure Project!
 
+Preferences.Profile.Validator.InvalidName.Comma = Warning: The profile name 
cannot contain a comma (,).
+Preferences.Profile.Validator.InvalidName.Quote = Warning: The profile name 
cannot contain a double quote (\).
+Preferences.Profile.Validator.InvalidName.Empty = Please provide a new profile 
name.
+Preferences.Profile.Validator.InvalidName.Exists = Warning: The profile 
already exists.
+
 Preferences.Profiles.Title = Target profiles:
 Preferences.Profile.New.Title = Save as ...
+Preferences.Profile.New.Dialog.Title = Save as new target profile
+Preferences.Profile.New.Dialog.Message = Please input a profile name.
 Preferences.Profile.Rename.Title = Rename
 Preferences.Profile.Remove.Title = Remove
 
diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/ProfileNameInputValidator.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/ProfileNameInputValidator.java
new file mode 100644
index 000..38e38b1
--- /dev/null
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences

[yocto] [RFC v3 15/18] plugins/sdk.ide: Add method to delete a profile

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Deletion of a profile currently has no effects on the preference
page.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java  | 4 
 1 file changed, 4 insertions(+)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index 2767d7a..738dba7 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -146,6 +146,10 @@ public class YoctoProfileSetting {
sdkConfigsCombo.select(0);
sdkConfigsCombo.remove(selectionIndex);
profileElement.remove(selectedItem);
+
+   if (preferencePage instanceof 
YoctoSDKPreferencePage) {
+   ((YoctoSDKPreferencePage) 
preferencePage).deleteProfile(selectedItem);
+   }
}
});
}
-- 
1.7.11.7

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


[yocto] [RFC v3 17/18] plugins/sdk.ide: Added profile UI to the preference page

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

Adds the UI elements that allow managing profiles to the preference
page.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 8dc089b..fb015ab 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -67,7 +67,9 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
protected Control createContents(Composite parent) {
initializeDialogUnits(parent);
final Composite result= new Composite(parent, SWT.NONE);
-   
+
+   yoctoProfileSetting.createComposite(result);
+
try {
yoctoUISetting.createComposite(result);

yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
-- 
1.7.11.7

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


[yocto] [RFC v3 16/18] plugins/sdk.ide: Use profiles for the preference page

2013-02-03 Thread Timo Mueller
From: Timo Mueller timo.muel...@bmw-carit.de

The preference page is now aware of profiles. By default the standard
profile is used and the values are stored to its preference store. If
a different profile is selected it's preferences store is used
instead.

Signed-off-by: Timo Mueller timo.muel...@bmw-carit.de
---
 .../ide/preferences/YoctoSDKPreferencePage.java| 28 +-
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 276e366..8dc089b 100644
--- 
a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ 
b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -13,6 +13,7 @@ package org.yocto.sdk.ide.preferences;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
@@ -39,12 +40,24 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench
 
public YoctoSDKPreferencePage() {
//super(GRID);
-setPreferenceStore(YoctoSDKPlugin.getDefault().getPreferenceStore());
-//setDescription(YoctoSDKMessages.getString(PREFERENCES_Yocto_CONFIG));
-   YoctoUIElement elem = YoctoSDKUtils.getElemFromDefaultStore();
-this.yoctoUISetting = new YoctoUISetting(elem);
+   IPreferenceStore defaultStore = 
YoctoSDKPlugin.getDefault().getPreferenceStore();
+   String profiles = 
defaultStore.getString(PreferenceConstants.PROFILES);
+   String selectedProfile = 
defaultStore.getString(PreferenceConstants.SELECTED_PROFILE);
+
+   if (profiles.isEmpty()) {
+   profiles = 
defaultStore.getDefaultString(PreferenceConstants.PROFILES);
+   selectedProfile = 
defaultStore.getDefaultString(PreferenceConstants.SELECTED_PROFILE);
+   }
+
+   
setPreferenceStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile));
+   
//setDescription(YoctoSDKMessages.getString(PREFERENCES_Yocto_CONFIG));
+   YoctoUIElement elem = 
YoctoSDKUtils.getElemFromStore(getPreferenceStore());
+   this.yoctoUISetting = new YoctoUISetting(elem);
+
+   YoctoProfileElement profileElement = new 
YoctoProfileElement(profiles, selectedProfile);
+   this.yoctoProfileSetting = new 
YoctoProfileSetting(profileElement, this);
}
-   
+
/*
 * @see IWorkbenchPreferencePage#init(IWorkbench)
 */
@@ -75,7 +88,10 @@ public class YoctoSDKPreferencePage extends PreferencePage 
implements IWorkbench

yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, true);
 
YoctoUIElement elem = yoctoUISetting.getCurrentInput();
-   YoctoSDKUtils.saveElemToDefaultStore(elem);
+   YoctoSDKUtils.saveElemToStore(elem, 
getPreferenceStore());
+
+   YoctoProfileElement profileElement = 
yoctoProfileSetting.getCurrentInput();
+   
YoctoSDKUtils.saveProfilesToDefaultStore(profileElement);
 
return super.performOk();
} catch (YoctoGeneralException e) {
-- 
1.7.11.7

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


  1   2   >