# HG changeset patch # User dadubrow # Date 1264801420 21600 # Node ID 679300bad0880b0dd21b257e2ef36faaed783569 # Parent 6f65d25899caa51c966ca2f433d2c776a212bebb Show connections view when new connection is added diff -r 6f65d25899ca -r 679300bad088 debuggercdi/com.nokia.carbide.trk.support/META-INF/MANIFEST.MF --- a/debuggercdi/com.nokia.carbide.trk.support/META-INF/MANIFEST.MF Fri Jan 29 15:11:48 2010 -0600 +++ b/debuggercdi/com.nokia.carbide.trk.support/META-INF/MANIFEST.MF Fri Jan 29 15:43:40 2010 -0600 @@ -10,9 +10,10 @@ 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 6f65d25899ca -r 679300bad088 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 Fri Jan 29 15:11:48 2010 -0600 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java Fri Jan 29 15:43:40 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) {