--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/ManageConfigurationsDialog.java Wed Apr 21 14:31:25 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/ManageConfigurationsDialog.java Thu Apr 22 15:43:41 2010 -0500
@@ -31,17 +31,22 @@
import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.jface.viewers.TreeNodeContentProvider;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
+import org.eclipse.ui.dialogs.PreferencesUtil;
import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
@@ -52,9 +57,13 @@
import com.nokia.carbide.cpp.internal.qt.core.QtConfigFilter;
import com.nokia.carbide.cpp.internal.qt.core.QtCorePlugin;
import com.nokia.carbide.cpp.internal.qt.core.QtSDKFilter;
-import com.nokia.carbide.cpp.sdk.core.*;
+import com.nokia.carbide.cpp.sdk.core.ISDKManager;
+import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
import com.nokia.carbide.cpp.sdk.ui.shared.BuildTargetTreeNode;
import com.nokia.cpp.internal.api.utils.core.Check;
+import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
public class ManageConfigurationsDialog extends TrayDialog {
@@ -191,23 +200,8 @@
} catch (CoreException e) {
e.printStackTrace();
}
-
- boolean sbsv2Project = CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(cpi.getProject());
-
- properSdkViewer.setContentProvider(filteringContentProviderWrapper);
- properSdkViewer.setInput(BuildTargetTreeNode.getTreeViewerInput(sbsv2Project));
- propagateSdkTree();
- properSdkViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- // Disclose the tree if the user selected the parent node
- Object obj = event.getElement();
- if (obj instanceof BuildTargetTreeNode){
- BuildTargetTreeNode bttn = (BuildTargetTreeNode)obj;
- properSdkViewer.setExpandedState(bttn, true);
- }
- validatePage();
- }
- });
+
+ drawSDKConfigTree();
BrokenConfigurationInProjectTreeNode[] brokenTreeInput = BrokenConfigurationInProjectTreeNode.getTreeViewerInput(cpi);
if (brokenTreeInput.length > 0) {
@@ -239,11 +233,44 @@
sdkStaticHelp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
sdkStaticHelp.setText(Messages.getString("ManageConfigurationsDialog.Select_config_help_text")); //$NON-NLS-1$
+ Link fLink = new Link(parent, SWT.WRAP);
+ fLink.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ fLink.setText("\n " + Messages.getString("ManageConfigurationsDialog.Select_Filtering_Prefs_Link")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ fLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+ fLink.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ // I don't see a way to open it to a specific tab, only the page
+ if (Window.OK == PreferencesUtil.createPreferenceDialogOn(getShell(), "com.nokia.carbide.cpp.sdk.ui.preferences.BuildPlatformFilterPage", null, null, 0).open()){ //$NON-NLS-1$
+ drawSDKConfigTree();
+ }
+ }
+ });
+
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, CarbideCPPBuilderUIHelpIds.CARBIDE_BUILDER_MANAGE_CONFIGURATIONS_DLG);
return container;
}
+ private void drawSDKConfigTree() {
+ boolean sbsv2Project = CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(cpi.getProject());
+
+ properSdkViewer.setContentProvider(filteringContentProviderWrapper);
+ properSdkViewer.setInput(BuildTargetTreeNode.getTreeViewerInput(sbsv2Project));
+ propagateSdkTree();
+ properSdkViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ // Disclose the tree if the user selected the parent node
+ Object obj = event.getElement();
+ if (obj instanceof BuildTargetTreeNode){
+ BuildTargetTreeNode bttn = (BuildTargetTreeNode)obj;
+ properSdkViewer.setExpandedState(bttn, true);
+ }
+ validatePage();
+ }
+ });
+
+ }
+
/**
* Create contents of the button bar
* @param parent
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/messages.properties Wed Apr 21 14:31:25 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/api/builder/ui/messages.properties Thu Apr 22 15:43:41 2010 -0500
@@ -4,6 +4,7 @@
ManageConfigurationsDialog.Unavailable_Config_Label_ToolTip=Show the SDKs and build configurations that are unavailable to the current project
ManageConfigurationsDialog.Unavailable_SDks_and_Configs=\n Unavailable SDKs and Configurations:\n\n
ManageConfigurationsDialog.Select_config_help_text=\n Checkmark a configuration to add it to the current project, or uncheck a configuration to remove it from the build configuration.
+ManageConfigurationsDialog.Select_Filtering_Prefs_Link=See <a>Platform Filtering Preferences</a> to configure displayed build configurations.
MMPSelectionUI.BuildOrderColumnLabel=Build order
MMPSelectionUI.FileNameColumnLabel=File name
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2Utils.java Wed Apr 21 14:31:25 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2Utils.java Thu Apr 22 15:43:41 2010 -0500
@@ -51,6 +51,7 @@
public class SBSv2Utils {
private static final String SBSV2_FILTERED_CONFIGS_STORE = "sbsv2FilteredConfigs"; //$NON-NLS-1$
+ private static final String SBSV2_FILTERED_CONFIGS_STORE_INITED = "sbsv2FilteredConfigsInited"; //$NON-NLS-1$
private static final String SBSV2_FILTERED_CONFIGS_DELIMETER = ";"; //$NON-NLS-1$
/** Path, to and including the SBS script */
@@ -186,6 +187,8 @@
public static List<ISymbianBuildContext> getFilteredSBSv2BuildContexts(ISymbianSDK sdk) {
List<ISymbianBuildContext> contexts = new ArrayList<ISymbianBuildContext>();
+ initDefaultConfigsToFilter();
+
Iterator it = getUnfilteredSBSv2BuildConfigurations(false).entrySet().iterator();
while (it.hasNext()){
Map.Entry buildConfigPair = (Map.Entry)it.next();
@@ -226,6 +229,32 @@
}
/**
+ * There are many build aliases presented by default from Raptor
+ * Filter out those that are less commonly used on new workspace creation.
+ */
+ public static void initDefaultConfigsToFilter() {
+ Preferences prefs = SDKCorePlugin.getDefault().getPluginPreferences();
+ String inited = prefs.getString(SBSV2_FILTERED_CONFIGS_STORE_INITED);
+ if (inited == null || inited.length() == 0){
+ Iterator it = getUnfilteredSBSv2BuildConfigurations(false).entrySet().iterator();
+ List<String> defaultConfigsToFilter = new ArrayList<String>();
+ while (it.hasNext()){
+ Map.Entry buildConfigPair = (Map.Entry)it.next();
+ String buildAlias = (String)buildConfigPair.getKey();
+ if (buildAlias.toLowerCase().startsWith("armv6") ||
+ buildAlias.toLowerCase().startsWith("armv7") ||
+ buildAlias.toLowerCase().startsWith("armv9")){
+ defaultConfigsToFilter.add(buildAlias);
+ }
+ }
+ prefs.setValue(SBSV2_FILTERED_CONFIGS_STORE_INITED, "true");
+ setSBSv2ConfigurationsToFilter(defaultConfigsToFilter.toArray(new String[defaultConfigsToFilter.size()]));
+
+ }
+
+ }
+
+ /**
* Whether or not to display SBSv2 builder UI
* @return true if SBSv2 is installed, false otherwise
*/
@@ -356,7 +385,6 @@
}
}
return sbsAlias1.compareTo(sbsAlias2);
-
}
});
@@ -388,32 +416,6 @@
}
});
- // Sort the target string for long aliases
- Collections.sort(contexts, new Comparator<ISymbianBuildContext>() {
-
- public int compare(ISymbianBuildContext o1, ISymbianBuildContext o2) {
- String sbsAlias1 = o1.getSBSv2Alias();
- String sbsAlias2 = o2.getSBSv2Alias();
- String temp1[] = sbsAlias1.split("_");
- String temp2[] = sbsAlias2.split("_");
- String suffix1 = "";
- String suffix2 = "";
- for (int i = 2; i < temp1.length; i++){
- suffix1 += temp1[i] + "_";
- }
-
- for (int i = 2; i < temp2.length; i++){
- suffix2 += temp2[i] + "_";
- }
-
- if (sbsAlias1.split("_").length >= 3 && sbsAlias1.split("_").length >= 3 && suffix1.equals(suffix2)){
- return o1.getTargetString().compareTo(o2.getTargetString());
- }
-
- return 0;
- }
- });
-
return contexts;
}
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/BuildPlatformFilterPage.java Wed Apr 21 14:31:25 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/BuildPlatformFilterPage.java Thu Apr 22 15:43:41 2010 -0500
@@ -53,14 +53,6 @@
GridData tabFolderGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
tabFolder.setLayoutData(tabFolderGridData);
- TabItem sbsv1TabItem = new TabItem(tabFolder, SWT.NONE);
- sbsv1TabItem.setText(Messages.getString("BuildPlatformFilterPage.SBSv1TabText")); //$NON-NLS-1$
- sbsv1TabItem.setToolTipText(Messages.getString("BuildPlatformFilterPage.SBSv1TabToolTip")); //$NON-NLS-1$
-
- sbsv1Tab = new SBSv1PlatformFilterComposite(tabFolder);
- sbsv1Tab.createControls();
- sbsv1TabItem.setControl(sbsv1Tab);
-
if (SBSv2Utils.enableSBSv2Support()) {
TabItem sbsv2TabItem = new TabItem(tabFolder, SWT.NONE);
sbsv2TabItem.setText(Messages.getString("BuildPlatformFilterPage.SBSv2TabText")); //$NON-NLS-1$
@@ -70,6 +62,14 @@
sbsv2Tab.createControls();
sbsv2TabItem.setControl(sbsv2Tab);
}
+
+ TabItem sbsv1TabItem = new TabItem(tabFolder, SWT.NONE);
+ sbsv1TabItem.setText(Messages.getString("BuildPlatformFilterPage.SBSv1TabText")); //$NON-NLS-1$
+ sbsv1TabItem.setToolTipText(Messages.getString("BuildPlatformFilterPage.SBSv1TabToolTip")); //$NON-NLS-1$
+
+ sbsv1Tab = new SBSv1PlatformFilterComposite(tabFolder);
+ sbsv1Tab.createControls();
+ sbsv1TabItem.setControl(sbsv1Tab);
PlatformUI.getWorkbench().getHelpSystem().setHelp(super.getControl(), SDKUIHelpIds.SDK_BUILD_FILTER_PAGE);
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Wed Apr 21 14:31:25 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/SBSv2PlatformFilterComposite.java Thu Apr 22 15:43:41 2010 -0500
@@ -97,7 +97,9 @@
}
private void initTable(boolean refreshList) {
-
+
+ SBSv2Utils.initDefaultConfigsToFilter();
+
Object[] keySet = SBSv2Utils.getUnfilteredSBSv2BuildConfigurations(refreshList).keySet().toArray();
List<String> sbsAliases = new ArrayList<String>();
for (Object key : keySet)
@@ -123,7 +125,12 @@
public void setDefaults(){
initTable(true);
for (TableItem item : tableViewer.getTable().getItems()) {
- if (item.getText().toLowerCase().startsWith("tool") || item.getText().toLowerCase().startsWith("gccxml")) {
+ if (item.getText().toLowerCase().startsWith("tool") ||
+ item.getText().toLowerCase().startsWith("gccxml") ||
+ item.getText().toLowerCase().startsWith("armv6") ||
+ item.getText().toLowerCase().startsWith("armv7") ||
+ item.getText().toLowerCase().startsWith("armv7") ||
+ item.getText().toLowerCase().startsWith("armv9")) {
tableViewer.setChecked(item.getData(), false);
} else {
tableViewer.setChecked(item.getData(), true);
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/messages.properties Wed Apr 21 14:31:25 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/messages.properties Thu Apr 22 15:43:41 2010 -0500
@@ -123,6 +123,7 @@
BuildTargetsPage.NoBuildConfigsSelectedError=Please select at least one build configuration.
BuildTargetsPage.DifferentDrivesError=There are known build problems when the bld.inf file and SDK are on different drives ({0})
BuildTargetsPage.NoDriveSpecWarning=You have chosen an SDK EPOCROOT without a drive specification. Building will work but other features such as the indexer and MMP editor may not fully function.
+BuildTargetsPage.Select_Filtering_Prefs_Link=See <a>Platform Filtering Preferences</a> to configure displayed build configurations.
BuildPlatformFilterPage.SBSv1TabText=SBSv1
BuildPlatformFilterPage.SBSv1TabToolTip=Symbian OS Build System version 1 builder platform filtering
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetsPage.java Wed Apr 21 14:31:25 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/shared/BuildTargetsPage.java Thu Apr 22 15:43:41 2010 -0500
@@ -18,14 +18,24 @@
package com.nokia.carbide.cpp.sdk.ui.shared;
import java.text.MessageFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.dialogs.IDialogPage;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IFilter;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeNode;
+import org.eclipse.jface.viewers.TreeNodeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -33,9 +43,14 @@
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
+import org.eclipse.ui.dialogs.PreferencesUtil;
import com.nokia.carbide.cpp.internal.api.sdk.ui.TemplateUtils;
import com.nokia.carbide.cpp.internal.sdk.ui.Messages;
@@ -190,10 +205,62 @@
configLabel.setFont(font);
configLabel.setText(Messages.getString("BuildTargetsPage.BuildConfigsLabel")); //$NON-NLS-1$
configLabel.setToolTipText(Messages.getString("BuildTargetsPage.BuildConfigsToolTip")); //$NON-NLS-1$
+
+ drawSDKConfigView(parent);
+
+ filterCheckbox = new Button(parent, SWT.CHECK);
+ filterCheckbox.setText(Messages
+ .getString("BuildTargetsPage.FilterText")); //$NON-NLS-1$
+ filterCheckbox.setSelection(true); // default to checked
+ if (hideFilterCheckbox)
+ filterCheckbox.setVisible(false);
+ else
+ filteringContentProviderWrapper.setFilter(templateFilter);
+ filterCheckbox.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ TemplateSDKFilter filter = filterCheckbox.getSelection() ? templateFilter
+ : null;
+ filteringContentProviderWrapper.setFilter(filter);
+ viewer.refresh();
+ setPageComplete(validatePage());
+ }
+ });
+ filterCheckbox.setData(UID, "filterCheckbox"); //$NON-NLS-1$
+
+ Link fLink = new Link(parent, SWT.WRAP);
+ fLink.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ fLink.setText(Messages.getString("BuildTargetsPage.Select_Filtering_Prefs_Link")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ fLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+ fLink.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ // I don't see a way to open it to a specific tab, only the page
+ if (Window.OK == PreferencesUtil.createPreferenceDialogOn(getShell(), "com.nokia.carbide.cpp.sdk.ui.preferences.BuildPlatformFilterPage", null, null, 0).open()){ //$NON-NLS-1$
+ inited = false;
+ setVisible(true);
+ drawSDKConfigView(getControl().getParent());
+ TemplateSDKFilter filter = filterCheckbox.getSelection() ? templateFilter
+ : null;
+ filteringContentProviderWrapper.setFilter(filter);
+ viewer.getTree().clearAll(true);
+ viewer.refresh();
+ setPageComplete(validatePage());
+ }
+ }
+
+ });
- viewer = new ContainerCheckedTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
- viewer.setLabelProvider(new LabelProvider());
+ addOtherControls(parent);
+
+ setPageComplete(validatePage());
+ }
+
+ private void drawSDKConfigView(Composite parent) {
+
+ if (viewer == null){
+ viewer = new ContainerCheckedTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+ viewer.setLabelProvider(new LabelProvider());
+ }
TreeNodeContentProvider treeNodeContentProvider = new TreeNodeContentProvider();
filteringContentProviderWrapper =
new FilteringContentProviderWrapper(treeNodeContentProvider);
@@ -206,26 +273,6 @@
viewer.getControl().setData(UID, "buildConfigsTree"); //$NON-NLS-1$
viewer.getControl().setData("viewer", viewer); //$NON-NLS-1$
- filterCheckbox = new Button(parent, SWT.CHECK);
- filterCheckbox.setText(Messages.getString("BuildTargetsPage.FilterText")); //$NON-NLS-1$
- filterCheckbox.setSelection(true); // default to checked
- if (hideFilterCheckbox)
- filterCheckbox.setVisible(false);
- else
- filteringContentProviderWrapper.setFilter(templateFilter);
- filterCheckbox.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- TemplateSDKFilter filter = filterCheckbox.getSelection() ? templateFilter : null;
- filteringContentProviderWrapper.setFilter(filter);
- viewer.refresh();
- setPageComplete(validatePage());
- }
- });
- filterCheckbox.setData(UID, "filterCheckbox"); //$NON-NLS-1$
-
- addOtherControls(parent);
-
- setPageComplete(validatePage());
}
/**