20 #include <cmconnectionmethod.h> |
20 #include <cmconnectionmethod.h> |
21 #include <cmdestination.h> |
21 #include <cmdestination.h> |
22 #include <cmconnectionmethoddef.h> |
22 #include <cmconnectionmethoddef.h> |
23 #include <cmmanager.h> |
23 #include <cmmanager.h> |
24 #include <extendedconnpref.h> |
24 #include <extendedconnpref.h> |
25 #include <cmapplicationsettingsui.h> // CCmApplicationSettingsUi |
|
26 #include <es_enum.h> |
25 #include <es_enum.h> |
27 #include <cdbcols.h> // IAP, COMMDB_ID |
26 #include <cdbcols.h> // IAP, COMMDB_ID |
28 #include "drmutilityconnection.h" |
27 #include "drmutilityconnection.h" |
29 #include "OstTraceDefinitions.h" |
28 #include "OstTraceDefinitions.h" |
30 #ifdef OST_TRACE_COMPILER_IN_USE |
29 #ifdef OST_TRACE_COMPILER_IN_USE |
475 // DRM::CDrmUtilityConnection::ConnectUsingQueryL |
474 // DRM::CDrmUtilityConnection::ConnectUsingQueryL |
476 // --------------------------------------------------------------------------- |
475 // --------------------------------------------------------------------------- |
477 // |
476 // |
478 void DRM::CDrmUtilityConnection::ConnectUsingQueryL() |
477 void DRM::CDrmUtilityConnection::ConnectUsingQueryL() |
479 { |
478 { |
480 // Create overrides |
479 // Implement according to the new Connection Settings |
481 TConnPrefList prefList; |
480 // QT API when possible to test the implementation |
482 TExtendedConnPref prefs; |
481 CompleteSelf(KErrCancel); |
483 |
|
484 CCmApplicationSettingsUi* ui(CCmApplicationSettingsUi::NewLC()); |
|
485 TCmSettingSelection selectedConn; |
|
486 |
|
487 TBool selected(ui->RunApplicationSettingsL(selectedConn)); |
|
488 CleanupStack::PopAndDestroy(ui); |
|
489 ui=NULL; |
|
490 if (selected) |
|
491 { |
|
492 if (selectedConn.iResult == CMManager::EConnectionMethod) |
|
493 { |
|
494 prefs.SetIapId(selectedConn.iId); |
|
495 } |
|
496 else if (selectedConn.iResult == CMManager::EDestination) |
|
497 { |
|
498 prefs.SetSnapId(selectedConn.iId); |
|
499 } |
|
500 else if (selectedConn.iResult != CMManager::EDefaultConnection) |
|
501 { |
|
502 selected=EFalse; |
|
503 } |
|
504 } |
|
505 if (selected) |
|
506 { |
|
507 if (selectedConn.iResult != CMManager::EDefaultConnection) |
|
508 { |
|
509 prefList.AppendL(&prefs); |
|
510 // For ensuring possibly stale connections get disconnected first; |
|
511 iConnection.Close(); |
|
512 iConnection.Open(iSocketServ); |
|
513 |
|
514 iConnection.Start(prefList, iStatus); |
|
515 } |
|
516 else |
|
517 { |
|
518 iConnection.Start(iStatus); |
|
519 } |
|
520 SetActive(); |
|
521 } |
|
522 else |
|
523 { |
|
524 CompleteSelf(KErrCancel); |
|
525 } |
|
526 } |
482 } |
527 // --------------------------------------------------------------------------- |
483 // --------------------------------------------------------------------------- |
528 // DRM::CDrmUtilityConnection::CompleteSelf |
484 // DRM::CDrmUtilityConnection::CompleteSelf |
529 // --------------------------------------------------------------------------- |
485 // --------------------------------------------------------------------------- |
530 // |
486 // |