10843 - set in-use status for non-dynamic connections RCL_2_4
authordadubrow
Fri, 19 Mar 2010 14:43:14 -0500
branchRCL_2_4
changeset 1117 74cd9ab9faa5
parent 1116 6bb7d69e70fb
child 1124 f68b7751b408
10843 - set in-use status for non-dynamic connections
connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/AbstractConnectedService2.java
connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/messages.properties
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/AbstractConnectedService2.java	Fri Mar 19 14:40:35 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/AbstractConnectedService2.java	Fri Mar 19 14:43:14 2010 -0500
@@ -31,6 +31,7 @@
 import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatus.EStatus;
 import com.nokia.carbide.remoteconnections.internal.ServiceTester;
 import com.nokia.carbide.remoteconnections.internal.api.IConnectedService2;
+import com.nokia.carbide.remoteconnections.internal.api.IConnection2.IConnectionStatus;
 import com.nokia.cpp.internal.api.utils.core.Check;
 import com.nokia.cpp.internal.api.utils.core.ListenerList;
 import com.nokia.cpp.internal.api.utils.core.ObjectUtils;
@@ -87,9 +88,20 @@
 			this.shortDescription = shortDescription;
 			this.longDescription = longDescription;
 			fireStatusChanged();
+			if (!connection.isDynamic())
+				connection.setStatus(getInUseConnectionStatus(estatus));
 		}
 	}
-	
+
+	private IConnectionStatus getInUseConnectionStatus(EStatus serviceStatus) {
+		String desc = ""; //$NON-NLS-1$
+		if (serviceStatus.equals(EStatus.IN_USE)) {
+			desc = Messages.getString("AbstractConnectedService2.InUseDesc"); //$NON-NLS-1$
+			return new AbstractConnection.ConnectionStatus(IConnectionStatus.EConnectionStatus.IN_USE, desc, desc);
+		} else
+			return new AbstractConnection.ConnectionStatus(IConnectionStatus.EConnectionStatus.NONE, desc, desc);
+	}
+
 	public static class TestResult {
 		public TestResult(EStatus estatus, String shortDescription, String longDescription) {
 			this.estatus = estatus;
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/messages.properties	Fri Mar 19 14:40:35 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/messages.properties	Fri Mar 19 14:43:14 2010 -0500
@@ -1,5 +1,6 @@
 AbstractConnectedService.UserDisabledMessage=User disabled active status testing
 AbstractConnectedService.NoTestingLabel=Not testing service
+AbstractConnectedService2.InUseDesc=In Use
 AbstractImportExportPage.BrowseButtonLabel=Browse...
 AbstractImportExportPage.ConnectionColumnLabel=Connection
 AbstractImportExportPage.TypeColumnLabel=Type