# HG changeset patch # User fturovic # Date 1265054495 21600 # Node ID ed312e9f896173e7af5ad2e4ea9cc377615f2c4b # Parent f38db24e5dbfac2db2899bf44be30c00a4d70700# Parent 74d8d653d11ae83a656b573b25d418e00c5f31c3 daily merge diff -r f38db24e5dbf -r ed312e9f8961 builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/TestEpocEngineHelper.java --- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/TestEpocEngineHelper.java Mon Feb 01 14:01:07 2010 -0600 +++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/TestEpocEngineHelper.java Mon Feb 01 14:01:35 2010 -0600 @@ -183,4 +183,14 @@ } } } + + public void testSTDCPPSupport() throws Exception { + ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(carbideProject); + for (final IPath mmpPath : EpocEngineHelper.getMMPFilesForBuildConfiguration(cpi.getDefaultConfiguration())) { + if (EpocEngineHelper.hasSTDCPPSupport(cpi, mmpPath)){ + fail("Project does not have STDCPP Support"); + } + } + } + } diff -r f38db24e5dbf -r ed312e9f8961 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Mon Feb 01 14:01:07 2010 -0600 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Mon Feb 01 14:01:35 2010 -0600 @@ -2080,6 +2080,45 @@ return result != null ? result.booleanValue() : false; } + + /** + * Check whether or not the project and build for standard C++. + * The following rules apply: + * + * 1) If an MMP contains NOSTDCPP then it does not have std C++ support + * 2) Else If the STDCPP keyword is set it does have std C++ support + * 3) Else if TARGETTYPE is one of STDEXE|STDDLL|STDLIB it does have std C++ support + * 4) Else not std C++ support + * + * @return true if the MMP has standard C++ support + */ + public static boolean hasSTDCPPSupport(ICarbideProjectInfo projectInfo, final IPath relativeMMPPath) { + Boolean result = (Boolean) EpocEnginePlugin.runWithMMPData( + relativeMMPPath, + new DefaultMMPViewConfiguration( + projectInfo, + new AllNodesViewFilter()), + new MMPDataRunnableAdapter() { + public Object run(IMMPData data) { + if (data.getFlags().contains(EMMPStatement.NOSTDCPP)){ + return false; + } else if (data.getFlags().contains(EMMPStatement.STDCPP)){ + return true; + } + + String targetType = data.getSingleArgumentSettings().get(EMMPStatement.TARGETTYPE); + if (targetType != null) { + if (targetType.toUpperCase().matches("STDEXE|STDLIB|STDDLL")) { //$NON-NLS-1$ + return true; + } + } + + return false; + } + }); + return result != null ? result.booleanValue() : false; + } + /** * A particular MMP file is considered to be a Symbian Binary Variation iff the MMP file * has the keyword "FEATUREVARIANT" flag defined and the build configuration has a valid diff -r f38db24e5dbf -r ed312e9f8961 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/project/ICarbideBuildConfiguration.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/project/ICarbideBuildConfiguration.java Mon Feb 01 14:01:07 2010 -0600 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/project/ICarbideBuildConfiguration.java Mon Feb 01 14:01:35 2010 -0600 @@ -18,7 +18,10 @@ import java.util.List; +import org.eclipse.core.runtime.IPath; + import com.nokia.carbide.cdt.builder.BuildArgumentsInfo; +import com.nokia.carbide.cdt.builder.EpocEngineHelper; import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; /** diff -r f38db24e5dbf -r ed312e9f8961 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Mon Feb 01 14:01:07 2010 -0600 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideBuildConfiguration.java Mon Feb 01 14:01:35 2010 -0600 @@ -21,6 +21,7 @@ import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.settings.model.CMacroEntry; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICStorageElement; @@ -28,12 +29,14 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; import com.nokia.carbide.cdt.builder.BuildArgumentsInfo; import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; +import com.nokia.carbide.cdt.builder.EpocEngineHelper; import com.nokia.carbide.cdt.builder.builder.CarbideCPPBuilder; import com.nokia.carbide.cdt.builder.project.IBuildArgumentsInfo; import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; @@ -318,6 +321,10 @@ macros.add("NDEBUG"); //$NON-NLS-1$ } + if (hasSTDCPPSupport()){ + macros.add("__SYMBIAN_STDCPP_SUPPORT__"); + } + return macros; } @@ -374,4 +381,24 @@ public IROMBuilderInfo getROMBuildInfo() { return romBuilderInfo; } + + + private boolean hasSTDCPPSupport() { + + ICarbideProjectInfo cpi = getCarbideProject(); + + List buildConfig = new ArrayList(); + List normalMakMakePaths = new ArrayList(); + List testMakMakePaths = new ArrayList(); + buildConfig.add(this); + EpocEngineHelper.getMakMakeFiles(cpi.getAbsoluteBldInfPath(), buildConfig, normalMakMakePaths, testMakMakePaths, new NullProgressMonitor()); + + for (IPath mmpPath : normalMakMakePaths){ + if (EpocEngineHelper.hasSTDCPPSupport(cpi, mmpPath)){ + return true; + } + } + + return false; + } } diff -r f38db24e5dbf -r ed312e9f8961 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Mon Feb 01 14:01:07 2010 -0600 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Mon Feb 01 14:01:35 2010 -0600 @@ -139,7 +139,7 @@ for (IDefine define : carbideBuildConfig.getCompilerMacros()) { macros.add(new CMacroEntry(define.getNameAndArguments(), define.getExpansion(), 0)); } - + return macros.toArray(new ICLanguageSettingEntry[macros.size()]); } diff -r f38db24e5dbf -r ed312e9f8961 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java Mon Feb 01 14:01:07 2010 -0600 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java Mon Feb 01 14:01:35 2010 -0600 @@ -2451,7 +2451,7 @@ final IPreferenceStore prefsStore = CarbideBuilderPlugin.getDefault().getPreferenceStore(); if (prefsStore.getBoolean(BuilderPreferenceConstants.PREF_DONT_PROMPT_FOR_DEPENDENCY_MISMATCH) == false && - areWeManagingTheMakeFiles && !makeFileHasOurChanges(makefile)) { + areWeManagingTheMakeFiles && !makeFileHasOurChanges(makefile) && !WorkbenchUtils.isJUnitRunning()) { // if they are not then the user must have been building from the command line. this means that // any dependency files that exist could be stale so we need to delete them. we also need to diff -r f38db24e5dbf -r ed312e9f8961 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/EnvironmentVarsInfo2.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/EnvironmentVarsInfo2.java Mon Feb 01 14:01:07 2010 -0600 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/EnvironmentVarsInfo2.java Mon Feb 01 14:01:35 2010 -0600 @@ -461,8 +461,11 @@ private Map stringArrayToMap(String[] array) { Map map = new HashMap(array.length); for (String var : array) { - String[] split = var.split("="); - map.put(split[0], split[1]); + int idx = var.indexOf('='); + if (idx > 0) + map.put(var.substring(0, idx), var.substring(idx+1)); + else if (var.length() > 0) + map.put(var, ""); } return map; diff -r f38db24e5dbf -r ed312e9f8961 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/discovery/RandomDiscoveryAgent.java --- a/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/discovery/RandomDiscoveryAgent.java Mon Feb 01 14:01:07 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/discovery/RandomDiscoveryAgent.java Mon Feb 01 14:01:35 2010 -0600 @@ -17,6 +17,7 @@ package com.nokia.carbide.remoteconnections.tests.discovery; +import java.net.MalformedURLException; import java.net.URL; import java.util.HashSet; import java.util.Map; @@ -35,6 +36,32 @@ import com.nokia.carbide.remoteconnections.tests.extensions.TestFilter; public class RandomDiscoveryAgent implements IDeviceDiscoveryAgent { + public class RandomPrerequisiteStatus implements IPrerequisiteStatus { + + private boolean ok; + + RandomPrerequisiteStatus() { + ok = true; // modify to test + } + public String getErrorText() { + return "Test error text"; + } + + public URL getURL() { + try { + return new URL("http://www.yahoo.com"); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + return null; + } + + public boolean isOK() { + return ok; + } + + } + private static final String CONNECTION_TYPE = "com.nokia.carbide.remoteconnections.tests.extensions.IntervalConnectionType"; private Random random = new Random(); @@ -92,7 +119,6 @@ connection.setDynamic(true); connections.add(connection); manager.addConnection(connection); - manager.setCurrentConnection(connection); } private String getRandomIntervalString() { @@ -113,4 +139,12 @@ thread.stopRunning(); } + public String getDisplayName() { + return "Random Test Discovery Agent"; + } + + public IPrerequisiteStatus getPrerequisiteStatus() { + return (new RandomPrerequisiteStatus()); + } + } diff -r f38db24e5dbf -r ed312e9f8961 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/RandomCycleConnectedService.java --- a/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/RandomCycleConnectedService.java Mon Feb 01 14:01:07 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/RandomCycleConnectedService.java Mon Feb 01 14:01:35 2010 -0600 @@ -18,19 +18,27 @@ package com.nokia.carbide.remoteconnections.tests.extensions; -import com.nokia.carbide.remoteconnections.interfaces.*; -import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatus.EStatus; -import com.nokia.cpp.internal.api.utils.core.Check; -import com.nokia.cpp.internal.api.utils.core.ListenerList; +import java.text.DateFormat; +import java.util.Date; +import java.util.Random; import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.*; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; import org.osgi.framework.Version; -import java.text.DateFormat; -import java.util.Date; -import java.util.Random; +import com.nokia.carbide.remoteconnections.interfaces.IConnectedService; +import com.nokia.carbide.remoteconnections.interfaces.IConnection; +import com.nokia.carbide.remoteconnections.interfaces.IService; +import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatus.EStatus; +import com.nokia.cpp.internal.api.utils.core.ListenerList; public class RandomCycleConnectedService implements IConnectedService { diff -r f38db24e5dbf -r ed312e9f8961 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/RemoteConnectionsActivator.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/RemoteConnectionsActivator.java Mon Feb 01 14:01:07 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/RemoteConnectionsActivator.java Mon Feb 01 14:01:35 2010 -0600 @@ -18,23 +18,32 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.IFilter; import org.eclipse.swt.widgets.Control; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; +import org.osgi.service.prefs.BackingStoreException; import com.nokia.carbide.remoteconnections.interfaces.IConnectionTypeProvider; import com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager; import com.nokia.carbide.remoteconnections.internal.api.IDeviceDiscoveryAgent; +import com.nokia.carbide.remoteconnections.internal.api.IDeviceDiscoveryAgent.IPrerequisiteStatus; import com.nokia.carbide.remoteconnections.internal.registry.Registry; +import com.nokia.carbide.remoteconnections.internal.ui.DeviceDiscoveryPrequisiteErrorDialog; import com.nokia.cpp.internal.api.utils.core.Logging; +import com.nokia.cpp.internal.api.utils.ui.RunRunnableWhenWorkbenchVisibleJob; +import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; /** * The activator class controls the plug-in life cycle @@ -44,13 +53,13 @@ // The plug-in ID public static final String PLUGIN_ID = "com.nokia.carbide.remoteConnections"; //$NON-NLS-1$ - private static final String DISCOVERY_AGENT_EXTENSION = - PLUGIN_ID + ".deviceDiscoveryAgent"; //$NON-NLS-1$ + private static final String DISCOVERY_AGENT_EXTENSION = PLUGIN_ID + ".deviceDiscoveryAgent"; //$NON-NLS-1$ // The shared instance private static RemoteConnectionsActivator plugin; private Collection discoveryAgents; + private static final String IGNORE_AGENT_LOAD_ERRORS_KEY = "ignoreAgentLoadErrors"; //$NON-NLS-1$ /** * The constructor @@ -64,7 +73,47 @@ Registry instance = Registry.instance(); instance.loadExtensions(); instance.loadConnections(); - loadAndStartDeviceDiscoveryAgents(); + + RunRunnableWhenWorkbenchVisibleJob.start(new Runnable() { + public void run() { + if (!ignoreAgentLoadErrors()) + checkPrerequisites(); + + loadAndStartDeviceDiscoveryAgents(); + } + }); + } + + private boolean ignoreAgentLoadErrors() { + return getPreferenceStore().getBoolean(IGNORE_AGENT_LOAD_ERRORS_KEY); + } + + private void checkPrerequisites() { + final Map agentToStatusMap = + new HashMap(); + + // load the extensions just to check statuses + Collection agents = new ArrayList(); + loadExtensions(DISCOVERY_AGENT_EXTENSION, null, agents, null); + + for (IDeviceDiscoveryAgent agent : agents) { + IPrerequisiteStatus status = agent.getPrerequisiteStatus(); + if (!status.isOK()) { + agentToStatusMap.put(agent, status); + } + } + + if (!agentToStatusMap.isEmpty()) { + DeviceDiscoveryPrequisiteErrorDialog dlg = new DeviceDiscoveryPrequisiteErrorDialog(WorkbenchUtils.getSafeShell()); + for (Entry entry : agentToStatusMap.entrySet()) { + IDeviceDiscoveryAgent agent = entry.getKey(); + IPrerequisiteStatus status = entry.getValue(); + dlg.addAgentData(agent.getDisplayName(), status.getErrorText(), status.getURL()); + } + dlg.open(); + if (dlg.isDontAskAgainChecked()) + storeIgnoreAgentLoadErrorsFlag(); + } } public void stop(BundleContext context) throws Exception { @@ -75,6 +124,15 @@ super.stop(context); } + private void storeIgnoreAgentLoadErrorsFlag() { + getPreferenceStore().setValue(IGNORE_AGENT_LOAD_ERRORS_KEY, true); + try { + new InstanceScope().getNode(PLUGIN_ID).flush(); + } catch (BackingStoreException e) { + logError(e); + } + } + /** * Returns the shared instance * diff -r f38db24e5dbf -r ed312e9f8961 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/api/IDeviceDiscoveryAgent.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/api/IDeviceDiscoveryAgent.java Mon Feb 01 14:01:07 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/api/IDeviceDiscoveryAgent.java Mon Feb 01 14:01:35 2010 -0600 @@ -28,6 +28,31 @@ public interface IDeviceDiscoveryAgent { /** + * An interface for discovery agents to implement that the manager uses + * before loading the agent to get errors about required components. + *

+ * Every discovery agent must implement this interface. + */ + public interface IPrerequisiteStatus { + /** + * Is the status OK? + * @return boolean + */ + boolean isOK(); + /** + * If status is not OK, return error message text. + * @return String + */ + String getErrorText(); + /** + * Optionally return a URL for user to browse to for more information on error. + * @return URL + */ + URL getURL(); + + } + + /** * Starts agent. Once started, runs until stopped. * @throws CoreException */ @@ -46,6 +71,22 @@ */ URL getInformation(); + /** + * Returns a display name for the particular discovery agent in case we need to + * let the user know errors from the agents. + * @return String + */ + String getDisplayName(); + + /** + * Manager will call this to get any status of prerequisites not satisfied before + * the manager calls start(). The agent should check its prerequisites at this time. + *

+ * If the agent has no prerequisites return a status of OK. + * @return IPrerequisiteStatus + */ + IPrerequisiteStatus getPrerequisiteStatus(); + // In addition, there may need to be an additional API to do a deeper form of discovery for // connection mechanisms that require pairing (like BT or Wifi). In these cases, normal discovery // will probably be for already paired devices, however, the user will want to discover all diff -r f38db24e5dbf -r ed312e9f8961 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ui/DeviceDiscoveryPrequisiteErrorDialog.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ui/DeviceDiscoveryPrequisiteErrorDialog.java Mon Feb 01 14:01:35 2010 -0600 @@ -0,0 +1,223 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.carbide.remoteconnections.internal.ui; + +import java.net.URL; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.TrayDialog; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.ListViewer; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.window.IShellProvider; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.SashForm; +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.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Link; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.browser.IWebBrowser; + +import com.nokia.carbide.remoteconnections.Messages; +import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; + +public class DeviceDiscoveryPrequisiteErrorDialog extends TrayDialog { + + private class AgentItem { + public String agentName; + public String agentErrorText; + public URL agentLocation; + + AgentItem(String name, String text, URL location) { + agentName = name; + agentErrorText = text; + agentLocation = location; + // if location is not null and error text doesn't contain href + // then do it here + if (agentLocation != null && !agentErrorText.contains("href")) { //$NON-NLS-1$ + String msg = MessageFormat.format(Messages.getString("DeviceDiscoveryPrequisiteErrorDialog_ErrorFormatWithURL"), //$NON-NLS-1$ + agentErrorText, location, location); + agentErrorText = msg; + } + } + } + + private Collection agentList = new ArrayList(); + private boolean dontAskAgain; + private ListViewer agentListViewer; + private Link errorText; + private Button dontAskAgainCheckBox; + + /** + * @param parentShell + */ + public DeviceDiscoveryPrequisiteErrorDialog(Shell parentShell) { + super(parentShell); + agentList.clear(); + } + + /** + * @param parentShell + */ + public DeviceDiscoveryPrequisiteErrorDialog(IShellProvider parentShell) { + super(parentShell); + agentList.clear(); + } + + public void addAgentData(String name, String errorText, URL location) { + agentList.add(new AgentItem(name, errorText, location)); + } + + public boolean isDontAskAgainChecked() { + return dontAskAgain; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + // OK button == "Close" + // no Cancel button + createButton(parent, IDialogConstants.OK_ID, IDialogConstants.CLOSE_LABEL, true); + } + + @Override + protected Control createDialogArea(Composite parent) { + initializeDialogUnits(parent); + + Composite container = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + container.setLayout(layout); + container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + // Message at top + Text topMessage = new Text(container, SWT.MULTI | SWT.WRAP); + topMessage.setText(Messages.getString("DeviceDiscoveryPrequisiteErrorDialog_Description")); //$NON-NLS-1$ + topMessage.setEditable(false); + topMessage.setDoubleClickEnabled(false); + GridData topMsgData = new GridData(SWT.LEFT, SWT.CENTER, true, false); + topMsgData.heightHint = 48; + topMessage.setLayoutData(topMsgData); + topMessage.setToolTipText(Messages.getString("DeviceDiscoveryPrequisiteErrorDialog_ToolTipText")); //$NON-NLS-1$ + + // next two panes can be resized with a sash form + SashForm sashForm = new SashForm(container, SWT.VERTICAL); + GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); + sashForm.setLayoutData(gridData); + + // this pane lists all the agent display names + agentListViewer = new ListViewer(sashForm, SWT.V_SCROLL | SWT.BORDER); + agentListViewer.setContentProvider(new ArrayContentProvider()); + agentListViewer.setLabelProvider(new LabelProvider() { + + @Override + public String getText(Object element) { + return ((AgentItem)element).agentName; + } + + }); + agentListViewer.addSelectionChangedListener(new ISelectionChangedListener() { + + public void selectionChanged(SelectionChangedEvent event) { + IStructuredSelection selection = (IStructuredSelection) event.getSelection(); + AgentItem item = (AgentItem) selection.getFirstElement(); + errorText.setText(item.agentErrorText); + } + + }); + agentListViewer.setInput(agentList); + + // pane to view the information about the selected agent + errorText = new Link(sashForm, SWT.V_SCROLL | SWT.BORDER | SWT.WRAP); + errorText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); + errorText.setToolTipText(Messages.getString("DeviceDiscoveryPrequisiteErrorDialog_ErrorTextToolTipText")); //$NON-NLS-1$ + errorText.addListener(SWT.Selection, new Listener() { + + public void handleEvent(Event event) { + // Launch an external browser + String siteText = event.text; + IWorkbench workbench = PlatformUI.getWorkbench(); + try { + IWebBrowser browser = workbench.getBrowserSupport().getExternalBrowser(); + browser.openURL(new URL(siteText)); + } catch (Exception e) { + RemoteConnectionsActivator.logError(e); + } + } + + }); + + // add initial weights to the above two panes + sashForm.setWeights(new int[] {150,200}); + + // now the don't ask again check box + dontAskAgainCheckBox = new Button(container, SWT.CHECK); + dontAskAgainCheckBox.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false)); + dontAskAgainCheckBox.setText(Messages.getString("DeviceDiscoveryPrequisiteErrorDialog_DontAskAgainLabel")); //$NON-NLS-1$ + dontAskAgainCheckBox.setToolTipText(Messages.getString("DeviceDiscoveryPrequisiteErrorDialog_DontAskAgainToolTipText")); //$NON-NLS-1$ + dontAskAgainCheckBox.addSelectionListener(new SelectionAdapter() { + + public void widgetSelected(SelectionEvent e) { + dontAskAgain = dontAskAgainCheckBox.getSelection(); + } + + }); + + // now finish by selecting the top most agent in the list + // and bringing it into view + Object o = agentListViewer.getElementAt(0); + if (o != null) + agentListViewer.setSelection(new StructuredSelection(o)); + + ISelection selection = agentListViewer.getSelection(); + if (selection != null && !selection.isEmpty()) { + agentListViewer.reveal(selection); + } + + return container; + } + + @Override + protected Point getInitialSize() { + return new Point(400,400); + } + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + // set our title to the dialog + newShell.setText(Messages.getString("DeviceDiscoveryPrequisiteErrorDialog_Title")); //$NON-NLS-1$ + } +} diff -r f38db24e5dbf -r ed312e9f8961 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/messages.properties --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/messages.properties Mon Feb 01 14:01:07 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/messages.properties Mon Feb 01 14:01:35 2010 -0600 @@ -81,6 +81,13 @@ ConnectionStatusSelectorContribution.NoDynamicOrManualConnectionsTooltip=No current connection selected. ConnectionStatusSelectorContribution.NotInUse=Not in use ConnectionStatusSelectorContribution.StatusFormat=Connection is {0}: {1} +DeviceDiscoveryPrequisiteErrorDialog_Description=At least one device discovery agent had load errors that prevent it from discovering connections to devices. Select one to get more information about its error. +DeviceDiscoveryPrequisiteErrorDialog_DontAskAgainLabel=Don't ask again +DeviceDiscoveryPrequisiteErrorDialog_DontAskAgainToolTipText=Check this to ignore further discovery agent load errors +DeviceDiscoveryPrequisiteErrorDialog_ErrorFormatWithURL={0} - For more information go to: {2} +DeviceDiscoveryPrequisiteErrorDialog_ErrorTextToolTipText=Error message for the selected agent above +DeviceDiscoveryPrequisiteErrorDialog_Title=Device Discovery Load Errors +DeviceDiscoveryPrequisiteErrorDialog_ToolTipText=Select an agent for more information about load errors. ExportPage.BrowseGroupLabel=Connections file: ExportPage.Description=Select connections to export ExportPage.FileDialogTitle=Save As diff -r f38db24e5dbf -r ed312e9f8961 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Mon Feb 01 14:01:07 2010 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContextDataCache.java Mon Feb 01 14:01:35 2010 -0600 @@ -181,9 +181,12 @@ File[] includedFiles = null; if (prefixFile != null) { - + + List systemPaths = new ArrayList(); + // Always add epoc32/include to the search path as this is implicit for includes in the HRH + systemPaths.add(new File(sdk.getEPOCROOT() + "epoc32/include")); + // add any BSF/SBV includes so the headers are picked up from the correct location - List systemPaths = new ArrayList(); IBSFPlatform bsfPlat = sdk.getBSFCatalog().findPlatform(platformString); ISBVPlatform sbvPlat = sdk.getSBVCatalog().findPlatform(platformString); if (bsfPlat != null) { diff -r f38db24e5dbf -r ed312e9f8961 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java Mon Feb 01 14:01:07 2010 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java Mon Feb 01 14:01:35 2010 -0600 @@ -194,8 +194,15 @@ public String getFamily() { String[] parts = getName().split("\\."); - if (parts.length == 3) - return parts[2]; + if (parts.length == 3){ + if (getSDKVersion().getMajor() == 5 && getName().equalsIgnoreCase(NOKIA_SF_SDK_NAME)){ + // A vendor of "symbian" and SDK major version 5 is the same as prior naming for "com.nokia.s60" & 5th Edition. + // Return "s60" so that project template generation continues to work as it's a S60 5th ed. SDK. + return ISymbianSDK.S60_FAMILY_ID; + } else { + return parts[2]; + } + } return ""; } diff -r f38db24e5dbf -r ed312e9f8961 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java Mon Feb 01 14:01:07 2010 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianSDK.java Mon Feb 01 14:01:35 2010 -0600 @@ -48,10 +48,12 @@ public static final String S80_FAMILY_ID = "Series80"; public static final String UIQ_FAMILY_ID = "UIQ"; public static final String TECHVIEW_FAMILY_ID = "TechView"; + public static final String SYMBIAN_FOUNDATION_FAMILY_ID = "symbian"; // Symbian Foundation, starting with Symbian^3 // Unique Ids include the vendor public static final String SERIES60_SDK_NAME = "com.nokia." + SERIES60_FAMILY_ID; public static final String S60_SDK_NAME = "com.nokia." + S60_FAMILY_ID; + public static final String NOKIA_SF_SDK_NAME = "com.nokia." + SYMBIAN_FOUNDATION_FAMILY_ID; // Nokia+Symbian Foundation SDK public static final String S80_SDK_NAME = "com.nokia." + S80_FAMILY_ID; public static final String UIQ_SDK_NAME = "com.symbian." + UIQ_FAMILY_ID; public static final String TECHVIEW_SDK_NAME = "com.symbian." + TECHVIEW_FAMILY_ID; diff -r f38db24e5dbf -r ed312e9f8961 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/TemplateUtils.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/TemplateUtils.java Mon Feb 01 14:01:07 2010 -0600 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/api/sdk/ui/TemplateUtils.java Mon Feb 01 14:01:35 2010 -0600 @@ -50,7 +50,7 @@ */ public static boolean sdkMatchesTemplate(ISymbianSDK symbianSDK, ITemplate template) { Version sdkVersion = symbianSDK.getSDKVersion(); - String family = symbianSDK.getFamily(); // ??? is this S60, UIQ, etc. ??? + String family = symbianSDK.getFamily(); // S60, symbian... 3rd segment of devices.xml 'name' attrib return sdkMatchesTemplate(sdkVersion, family, template); } diff -r f38db24e5dbf -r ed312e9f8961 debuggercdi/com.nokia.carbide.trk.support/META-INF/MANIFEST.MF --- a/debuggercdi/com.nokia.carbide.trk.support/META-INF/MANIFEST.MF Mon Feb 01 14:01:07 2010 -0600 +++ b/debuggercdi/com.nokia.carbide.trk.support/META-INF/MANIFEST.MF Mon Feb 01 14:01:35 2010 -0600 @@ -7,13 +7,13 @@ Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources, - com.nokia.carbide.cpp.project.core, org.eclipse.emf.ecore, org.eclipse.emf.ecore.xmi, org.eclipse.help.ui, - com.nokia.cpp.utils.core, + com.freescale.cdt.debug.cw.core, com.nokia.carbide.remoteConnections, - com.freescale.cdt.debug.cw.core, + com.nokia.cpp.utils.core, + com.nokia.cpp.utils.ui;bundle-version="1.0.0", com.nokia.tcf, com.nokia.carbide.cpp.featureTracker;bundle-version="1.0.0" Bundle-ActivationPolicy: lazy diff -r f38db24e5dbf -r ed312e9f8961 debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java --- a/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java Mon Feb 01 14:01:07 2010 -0600 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java Mon Feb 01 14:01:35 2010 -0600 @@ -20,6 +20,8 @@ import java.util.ArrayList; import java.util.List; +import org.eclipse.ui.PartInitException; + import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; import com.nokia.carbide.remoteconnections.interfaces.IConnectedService; import com.nokia.carbide.remoteconnections.interfaces.IConnection; @@ -36,6 +38,8 @@ import com.nokia.carbide.trk.support.connection.USBConnectionType; import com.nokia.carbide.trk.support.service.TRKConnectedService; import com.nokia.carbide.trk.support.service.TracingConnectedService; +import com.nokia.cpp.internal.api.utils.ui.RunRunnableWhenWorkbenchVisibleJob; +import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; /** * A singleton object that manages the device status of dynamic connections @@ -43,6 +47,9 @@ */ public class ConnectionStatusReconciler { + private static final String CONNECTIONS_VIEW_ID = + "com.nokia.carbide.remoteconnections.view.ConnectionsView"; //$NON-NLS-1$ + private class ConnectionListener implements IConnectionListener { public void connectionAdded(IConnection connection) { @@ -117,6 +124,19 @@ service.addStatusChangedListener(serviceStatusListener); } } + showConnectionsView(); + } + + private void showConnectionsView() { + RunRunnableWhenWorkbenchVisibleJob.start(new Runnable() { + public void run() { + // try to show the connections view to start service testers + try { + WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); + } catch (PartInitException e) { + } + } + }); } private void reconcileAsCurrent(IConnection connection) { diff -r f38db24e5dbf -r ed312e9f8961 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/CarbideMainTab.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/CarbideMainTab.java Mon Feb 01 14:01:07 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/CarbideMainTab.java Mon Feb 01 14:01:35 2010 -0600 @@ -89,11 +89,12 @@ } @Override - public void createControl(Composite parent) { - super.createControl(parent); + public void createBuildOptionGroup(final Composite parent, int colSpan){ + super.createBuildOptionGroup(parent, colSpan); fEnableBuildButton.setData(".uid", "CMainTab.EnableBuildButton"); //$NON-NLS-1$ //$NON-NLS-2$ fDisableBuildButton.setData(".uid", "CMainTab.DisableBuildButton"); //$NON-NLS-1$ //$NON-NLS-2$ fWorkspaceSettingsButton.setData(".uid", "CMainTab.WorkspaceSettingsButton"); //$NON-NLS-1$ //$NON-NLS-2$ fWorkpsaceSettingsLink.setData(".uid", "CMainTab.WorkspaceSettingsLink"); //$NON-NLS-1$ //$NON-NLS-2$ + } } \ No newline at end of file diff -r f38db24e5dbf -r ed312e9f8961 project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/cpp/epoc/engine/model/mmp/EMMPStatement.java --- a/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/cpp/epoc/engine/model/mmp/EMMPStatement.java Mon Feb 01 14:01:07 2010 -0600 +++ b/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/cpp/epoc/engine/model/mmp/EMMPStatement.java Mon Feb 01 14:01:35 2010 -0600 @@ -76,6 +76,12 @@ */ FEATUREVARIANT("FEATUREVARIANT", IMMPParserConfiguration.FLAG_STATEMENT), //$NON-NLS-1$ + /** + * @since 2.5 - Added with Symbian^3 + */ + STDCPP("STDCPP", IMMPParserConfiguration.FLAG_STATEMENT), //$NON-NLS-1$ + NOSTDCPP("NOSTDCPP", IMMPParserConfiguration.FLAG_STATEMENT), //$NON-NLS-1$ + HEADER("HEADER", IMMPParserConfiguration.FLAG_STATEMENT, "RESOURCE|BITMAP"), //$NON-NLS-1$ //$NON-NLS-2$ HEADERONLY("HEADERONLY", IMMPParserConfiguration.FLAG_STATEMENT, "RESOURCE|BITMAP"), //$NON-NLS-1$ //$NON-NLS-2$