supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplsettingslauncher.cpp
branchRCL_3
changeset 55 ea98413ce11f
parent 0 667063e416a2
equal deleted inserted replaced
49:10852b179f64 55:ea98413ce11f
    90     {
    90     {
    91     Cancel();
    91     Cancel();
    92     delete iSettingsLauncher;	
    92     delete iSettingsLauncher;	
    93     iNotifier.Close();
    93     iNotifier.Close();
    94     delete iTrace;
    94     delete iTrace;
    95     iIapSelector.Close();
       
    96     }
    95     }
    97 
    96 
    98 
    97 
    99 void COMASuplSettingsLauncher::ConstructL()
    98 void COMASuplSettingsLauncher::ConstructL()
   100     {
    99     {
   101     iTrace = COMASuplTrace::NewL();	
   100     iTrace = COMASuplTrace::NewL();	
   102     iTrace->Trace(_L("COMASuplSettingsLauncher::ConstructL"), KTraceFileName, __LINE__);             
   101     iTrace->Trace(_L("COMASuplSettingsLauncher::ConstructL"), KTraceFileName, __LINE__);             
   103     iSettingsLauncher = CLocSettingsUiClient::NewL();
   102     iSettingsLauncher = CLocSettingsUiClient::NewL();
   104 	User::LeaveIfError(iNotifier.Connect());
   103     User::LeaveIfError(iNotifier.Connect());
   105 	    // Establish a connection to the RGenConAgentDialogServer
       
   106     User::LeaveIfError( iIapSelector.Connect());
       
   107     
       
   108     }
   104     }
   109 
   105 
   110 // -----------------------------------------------------------------------------
   106 // -----------------------------------------------------------------------------
   111 // COMASuplSettingsLauncher::LaunchSettings
   107 // COMASuplSettingsLauncher::LaunchSettings
   112 // If already active, just return. Order notification otherwise and set active.
   108 // If already active, just return. Order notification otherwise and set active.
   120         }
   116         }
   121    else if( IsActive() && iDialogType != ESUPLTimeoutDialog)
   117    else if( IsActive() && iDialogType != ESUPLTimeoutDialog)
   122         {
   118         {
   123         return KErrInUse;
   119         return KErrInUse;
   124         }
   120         }
   125    
   121     TRAPD(error,iSettingsLauncher->LaunchSettingsUiL( TUid::Uid( KLocSUPLSettingsUID ),
   126 	TRAPD(error,iSettingsLauncher->LaunchSettingsUiL( TUid::Uid( KLocSUPLSettingsUID ),
   122                     ELocSUPLIAPSelection,
   127 													  ELocSUPLIAPSelection,
   123                     iStatus ));
   128 													  iStatus ));
   124     if (error != KErrNone)
   129 
   125         {
   130 	iDialogType = ESUPLYesNoDialog;
   126         iCallback.SettingsUICompletedL(error);
   131 	SetActive();
   127         }
   132 	
   128     else
       
   129         {
       
   130         iDialogType = ESUPLYesNoDialog;
       
   131         if (!IsActive())
       
   132             {
       
   133             SetActive();
       
   134             }
       
   135         }
   133     return error;
   136     return error;
   134     }
   137     }
   135 
   138 
   136 // -----------------------------------------------------------------------------
   139 // -----------------------------------------------------------------------------
   137 // COMASuplSettingsLauncher::CancelLaunch
   140 // COMASuplSettingsLauncher::CancelLaunch
   290         return KErrInUse;
   293         return KErrInUse;
   291         } 
   294         } 
   292         
   295         
   293 	iDialogType = ESUPLIAPDialog;   
   296 	iDialogType = ESUPLIAPDialog;   
   294 
   297 
   295     TConnectionPrefs    prefs; // filtering conditions for the access points list
   298     
   296     prefs.iRank         = 1;
       
   297     prefs.iDirection    = ECommDbConnectionDirectionOutgoing;
       
   298     prefs.iBearerSet    = KUidCSDBearerType | KUidPacketDataBearerType;
       
   299    
   299    
   300     // Launch the IAP Selector 
   300     // Launch the IAP Selector 
   301     iStatus = KRequestPending;
   301     iStatus = KRequestPending;
   302     iIapSelector.IapConnection( iSelectedIap, prefs, iStatus );
   302     
   303     SetActive();
   303     
   304 		return KErrNone;
   304     TRAPD(error, iSettingsLauncher->LaunchSettingsUiL( TUid::Uid( KLocSUPLSettingsUID ),
   305 	}
   305                     ELocSuplIAPDialog,
   306 	
   306                     iStatus );)
   307 	
   307     if(error != KErrNone)
   308 TInt COMASuplSettingsLauncher::GetIAPName(TDes& aIAPName,TUint32& aIAPId)	
   308         {
   309 	{
   309         iCallback.SettingsUICompletedL(error);
   310 	    TRAPD( error, ConvertIAPIdtoNameL( iSelectedIap,aIAPName ));
   310         }
   311 	    aIAPId = iSelectedIap;
   311     else
   312 		return error;
   312         {
   313 	}
   313         if (!IsActive())
   314 	
   314             {
       
   315             SetActive();
       
   316             }
       
   317         }
       
   318     return error;
       
   319     }
       
   320 
       
   321 TInt COMASuplSettingsLauncher::GetIAPName(TDes& aIAPName, TUint32& aIAPId)
       
   322     {
       
   323     TRAPD( error, ConvertIAPIdtoNameL( iSelectedIap,aIAPName ));
       
   324     aIAPId = iSelectedIap;
       
   325     return error;
       
   326     }
       
   327 
   315 // ---------------------------------------------------------------------------
   328 // ---------------------------------------------------------------------------
   316 // TUint CLocSUPLSettingsUiEngine::ConvertIAPIdtoNameL()
   329 // TUint CLocSUPLSettingsUiEngine::ConvertIAPIdtoNameL()
   317 // Convert IAP ID to IAP Name. If a valid name exists for the IAP Id
   330 // Convert IAP ID to IAP Name. If a valid name exists for the IAP Id
   318 // then the name would be copied into the aIAPName field
   331 // then the name would be copied into the aIAPName field
   319 // 
   332 //