123 } |
121 } |
124 |
122 |
125 TBool CConnectionEngine::ConnectionSettingL() |
123 TBool CConnectionEngine::ConnectionSettingL() |
126 { |
124 { |
127 TBool selected( EFalse ); |
125 TBool selected( EFalse ); |
128 |
126 // |
129 CCmApplicationSettingsUi* settings = CCmApplicationSettingsUi::NewL(); |
127 // CCmApplicationSettingsUi* settings = CCmApplicationSettingsUi::NewL(); |
130 CleanupStack::PushL( settings ); |
128 // CleanupStack::PushL( settings ); |
131 |
129 // |
132 TUint listedItems = |
130 // TUint listedItems = |
133 CMManager::EShowDefaultConnection | |
131 // CMManager::EShowDefaultConnection | |
134 CMManager::EShowDestinations; |
132 // CMManager::EShowDestinations; |
135 |
133 // |
136 TBearerFilterArray filter; |
134 // TBearerFilterArray filter; |
137 ReportConnectionSelectionStart(); |
135 // ReportConnectionSelectionStart(); |
138 selected = settings->RunApplicationSettingsL( iUserSelection, |
136 // selected = settings->RunApplicationSettingsL( iUserSelection, |
139 listedItems, |
137 // listedItems, |
140 filter ); |
138 // filter ); |
141 |
139 // |
142 CleanupStack::PopAndDestroy( settings ); |
140 // CleanupStack::PopAndDestroy( settings ); |
143 ReportConnectionSelectionEnd(); |
141 // ReportConnectionSelectionEnd(); |
144 return selected; |
142 return selected; |
145 } |
143 } |
146 |
144 |
147 |
145 |
148 void CConnectionEngine::StartL(TConnectionType aConnectionType) |
146 void CConnectionEngine::StartL(TConnectionType aConnectionType) |
149 { |
147 { |
150 DP1("CConnectionEngine::StartL, aConnectionType=%d", aConnectionType); |
148 DP1("CConnectionEngine::StartL, aConnectionType=%d", aConnectionType); |
151 |
149 |
152 iConnection.Close(); |
150 iConnection.Close(); |
153 User::LeaveIfError( iConnection.Open( iSocketServer ) ); |
151 User::LeaveIfError( iConnection.Open( iSocketServer ) ); |
154 // Connect using UI Setting |
152 // // Connect using UI Setting |
155 if(aConnectionType == EDefaultConnection) |
153 // if(aConnectionType == EDefaultConnection) |
156 { |
154 // { |
157 iConnection.Start( iStatus ); |
155 // iConnection.Start( iStatus ); |
158 SetActive(); |
156 // SetActive(); |
159 } |
157 // } |
160 else if(aConnectionType == EUserSelectConnection) |
158 // else if(aConnectionType == EUserSelectConnection) |
161 { |
159 // { |
162 TBool selected = ConnectionSettingL(); |
160 // TBool selected = ConnectionSettingL(); |
163 |
161 // |
164 if ( selected ) |
162 // if ( selected ) |
165 { |
163 // { |
166 switch ( iUserSelection.iResult ) |
164 // switch ( iUserSelection.iResult ) |
167 { |
165 // { |
168 case CMManager::EDestination: |
166 // case CMManager::EDestination: |
169 { |
167 // { |
170 iSnapPreference.SetSnap( iUserSelection.iId ); |
168 // iSnapPreference.SetSnap( iUserSelection.iId ); |
171 iConnection.Start( iSnapPreference, iStatus ); |
169 // iConnection.Start( iSnapPreference, iStatus ); |
172 aConnectionType = ESNAPConnection; |
170 // aConnectionType = ESNAPConnection; |
173 break; |
171 // break; |
174 } |
172 // } |
175 default: // CMManager::EAlwaysAsk |
173 // default: // CMManager::EAlwaysAsk |
176 case CMManager::EDefaultConnection: |
174 // case CMManager::EDefaultConnection: |
177 { |
175 // { |
178 iConnection.Start( iStatus ); |
176 // iConnection.Start( iStatus ); |
179 break; |
177 // break; |
180 } |
178 // } |
181 } |
179 // } |
182 } |
180 // } |
183 else |
181 // else |
184 { |
182 // { |
185 TRequestStatus* status = &iStatus; |
183 // TRequestStatus* status = &iStatus; |
186 User::RequestComplete(status, KErrCancel); |
184 // User::RequestComplete(status, KErrCancel); |
187 } |
185 // } |
188 |
186 // |
189 SetActive(); |
187 // SetActive(); |
190 } |
188 // } |
191 else if (aConnectionType == EIAPConnection) |
189 // else if (aConnectionType == EIAPConnection) |
192 { |
190 // { |
193 iCommdbPreference.SetIapId((iPodcastModel.SettingsEngine().SpecificIAP()& KUseIAPMask)); |
191 // iCommdbPreference.SetIapId((iPodcastModel.SettingsEngine().SpecificIAP()& KUseIAPMask)); |
194 iCommdbPreference.SetDialogPreference(ECommDbDialogPrefDoNotPrompt); |
192 // iCommdbPreference.SetDialogPreference(ECommDbDialogPrefDoNotPrompt); |
195 iCommdbPreference.SetDirection(ECommDbConnectionDirectionOutgoing); |
193 // iCommdbPreference.SetDirection(ECommDbConnectionDirectionOutgoing); |
196 iConnection.Start( iCommdbPreference, iStatus ); |
194 // iConnection.Start( iCommdbPreference, iStatus ); |
197 SetActive(); |
195 // SetActive(); |
198 } |
196 // } |
199 // Connect using SNAP |
197 // // Connect using SNAP |
200 else |
198 // else |
201 { |
199 // { |
202 iSnapPreference.SetSnap(iPodcastModel.SettingsEngine().SpecificIAP()); |
200 // iSnapPreference.SetSnap(iPodcastModel.SettingsEngine().SpecificIAP()); |
203 iConnection.Start( iSnapPreference, iStatus ); |
201 // iConnection.Start( iSnapPreference, iStatus ); |
204 SetActive(); |
202 // SetActive(); |
205 } |
203 // } |
206 |
204 // |
207 iConnectionType = aConnectionType; |
205 iConnectionType = aConnectionType; |
208 iConnectionState = CConnectionEngine::EConnecting; |
206 iConnectionState = CConnectionEngine::EConnecting; |
209 } |
207 } |
210 |
208 |
211 void CConnectionEngine::Stop() |
209 void CConnectionEngine::Stop() |