25 import org.eclipse.swt.widgets.TreeItem; |
25 import org.eclipse.swt.widgets.TreeItem; |
26 |
26 |
27 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildContext; |
27 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildContext; |
28 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; |
28 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo; |
29 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; |
29 import com.nokia.carbide.cpp.internal.api.sdk.ISBSv2BuildInfo; |
|
30 import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils; |
30 import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager; |
31 import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager; |
31 import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; |
32 import com.nokia.carbide.cpp.sdk.core.IBSFCatalog; |
32 import com.nokia.carbide.cpp.sdk.core.ISDKManager; |
33 import com.nokia.carbide.cpp.sdk.core.ISDKManager; |
33 import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; |
34 import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; |
34 import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; |
35 import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; |
35 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; |
36 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; |
36 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; |
37 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; |
37 import com.nokia.carbide.cpp.sdk.ui.shared.BuildTargetsPage; |
38 import com.nokia.carbide.cpp.sdk.ui.shared.BuildTargetsPage; |
|
39 import com.nokia.cpp.internal.api.utils.core.HostOS; |
38 |
40 |
39 public class ImporterBuildTargetsPage extends BuildTargetsPage { |
41 public class ImporterBuildTargetsPage extends BuildTargetsPage { |
40 |
42 |
41 private BldInfImportWizard theWizard; |
43 private BldInfImportWizard theWizard; |
42 |
44 |
75 TreeItem[] items = viewer.getTree().getItems(); |
77 TreeItem[] items = viewer.getTree().getItems(); |
76 for (int i=0; i<items.length; i++) { |
78 for (int i=0; i<items.length; i++) { |
77 TreeNode node = (TreeNode)items[i].getData(); |
79 TreeNode node = (TreeNode)items[i].getData(); |
78 if (node.getValue() instanceof ISymbianSDK && node.getValue() == sdk) { |
80 if (node.getValue() instanceof ISymbianSDK && node.getValue() == sdk) { |
79 IBSFCatalog bsfCatalog = null; |
81 IBSFCatalog bsfCatalog = null; |
80 ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); |
82 ISBSv1BuildInfo sbsv1BuildInfo = null; |
|
83 if (SBSv2Utils.enableSBSv1Support()){ |
|
84 sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); |
|
85 } |
|
86 |
81 ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); |
87 ISBSv2BuildInfo sbsv2BuildInfo = (ISBSv2BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV2_BUILDER); |
82 if (sbsv1BuildInfo != null) { |
88 if (sbsv1BuildInfo != null) { |
83 // SBSv1 only |
89 // SBSv1 only |
84 bsfCatalog = sbsv1BuildInfo.getBSFCatalog(); |
90 bsfCatalog = sbsv1BuildInfo.getBSFCatalog(); |
85 } |
91 } |
86 if (((SDKManager)sdkMgr).getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){ |
92 if (HostOS.IS_WIN32 && (((SDKManager)sdkMgr).getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0))){ |
87 // Check and see if any of the configs in the SDK |
93 // Check and see if any of the configs in the SDK |
88 // match any configuration that has been selected before |
94 // match any configuration that has been selected before |
89 // for this SDK. |
95 // for this SDK. |
90 String selectedConfigsStore[] = getPreviouslySelectedConfigs(); |
96 String selectedConfigsStore[] = getPreviouslySelectedConfigs(); |
91 viewer.setExpandedState(node, true); // must expand parent before checking, otherwise, we won't succeed |
97 viewer.setExpandedState(node, true); // must expand parent before checking, otherwise, we won't succeed |
140 IBSFCatalog bsfCatalog = null; |
146 IBSFCatalog bsfCatalog = null; |
141 if (currContext instanceof ISBSv1BuildContext) { |
147 if (currContext instanceof ISBSv1BuildContext) { |
142 // SBSv1 only |
148 // SBSv1 only |
143 ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); |
149 ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER); |
144 bsfCatalog = sbsv1BuildInfo.getBSFCatalog(); |
150 bsfCatalog = sbsv1BuildInfo.getBSFCatalog(); |
|
151 |
|
152 if (((SDKManager)sdkMgr).getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){ |
|
153 // this setting needs to be persisted. |
|
154 settingsNeedUpdate = true; |
|
155 selectedConfigsToSave.add(currContext); |
|
156 } |
145 } |
157 } |
146 if (((SDKManager)sdkMgr).getBSFScannerEnabled() || (bsfCatalog != null && bsfCatalog.getVirtualVariantPlatforms().length > 0)){ |
|
147 // this setting needs to be persisted. |
|
148 settingsNeedUpdate = true; |
|
149 selectedConfigsToSave.add(currContext); |
|
150 } |
|
151 } |
158 } |
152 if (settingsNeedUpdate) { |
159 if (settingsNeedUpdate) { |
153 // Iterate through all the persisted configs and don't add those that have the same |
160 // Iterate through all the persisted configs and don't add those that have the same |
154 // SDK ID as the ones that are currently selected, we'll replace those with the currently selected ones |
161 // SDK ID as the ones that are currently selected, we'll replace those with the currently selected ones |
155 List<String> configsToSave = new ArrayList<String>(); // the config list we'll actually persist to settings |
162 List<String> configsToSave = new ArrayList<String>(); // the config list we'll actually persist to settings |