[yocto] [PATCH 2/8] plugins/sdk.ide: Create a default YoctoUIElement from the preference store
mail at timomueller.eu
mail at timomueller.eu
Tue Dec 4 01:22:17 PST 2012
From: Atanas Gegov <atanas.gegov at bmw-carit.de>
Adds a method to create a YoctoUIElement that contains the content of
the yocto settings stored in the plugin's default preference store.
---
.../src/org/yocto/sdk/ide/YoctoSDKUtils.java | 25 ++++++++++++++++++++
1 files changed, 25 insertions(+), 0 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 749fac7..16035fd 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
@@ -465,6 +465,31 @@ public class YoctoSDKUtils {
return elem;
}
+ /* Load default IDE wide POKY Preference settings into YoctoUIElement */
+ public static YoctoUIElement getDefaultElemFromStore()
+ {
+ IPreferenceStore store = YoctoSDKPlugin.getDefault().getPreferenceStore();
+ YoctoUIElement elem = new YoctoUIElement();
+ if (store.getDefaultString(PreferenceConstants.SDK_MODE).equals(IPreferenceStore.TRUE))
+ elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
+ else
+ elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
+
+ elem.setStrToolChainRoot(store.getDefaultString(PreferenceConstants.TOOLCHAIN_ROOT));
+ elem.setStrTarget(store.getDefaultString(PreferenceConstants.TOOLCHAIN_TRIPLET));
+ elem.setIntTargetIndex(store.getDefaultInt(PreferenceConstants.TARGET_ARCH_INDEX));
+ elem.setStrQemuKernelLoc(store.getDefaultString(PreferenceConstants.QEMU_KERNEL));
+ elem.setStrQemuOption(store.getDefaultString(PreferenceConstants.QEMU_OPTION));
+ elem.setStrSysrootLoc(store.getDefaultString(PreferenceConstants.SYSROOT));
+
+ if (store.getDefaultString(PreferenceConstants.TARGET_MODE).equals(IPreferenceStore.TRUE))
+ elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
+ else
+ elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
+
+ return elem;
+ }
+
public static String qemuTargetTranslate(String strTargetArch)
{
String qemu_target = "";
--
1.7.7.6
More information about the yocto
mailing list