bluetoothengine/btui/Ecom/src/BTUISap.cpp
branchRCL_3
changeset 6 6a29d5ad0713
parent 0 f63038272f30
child 14 f7fbeaeb166a
equal deleted inserted replaced
2:0b192a3a05a4 6:6a29d5ad0713
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 #include <aknnotewrappers.h>
    19 #include <aknnotewrappers.h>
    20 #include <aknradiobuttonsettingpage.h>
    20 #include <aknradiobuttonsettingpage.h>
    21 #include <StringLoader.h>	// localisation stringloader
       
    22 #include <BtuiViewResources.rsg>		// Compiled resource ids
    21 #include <BtuiViewResources.rsg>		// Compiled resource ids
    23 #include <BTSapDomainPSKeys.h>	
    22 #include <BTSapDomainPSKeys.h>	
    24 #include <centralrepository.h> 
    23 #include <centralrepository.h> 
    25 #include <AknMediatorFacade.h>
    24 #include <AknMediatorFacade.h>
    26 #include <btengconnman.h>       // for disconnect type and connection observer
    25 #include <btengconnman.h>       // for disconnect type and connection observer
    27 #include <btengsettings.h>
    26 #include <btengsettings.h>
    28 #include <btengdevman.h>
    27 #include <btengdevman.h>
    29 #include <SecondaryDisplay/BtuiSecondaryDisplayAPI.h>
    28 #include <SecondaryDisplay/BtuiSecondaryDisplayAPI.h>
    30 #include <btfeaturescfg.h>					// For EnterpriseEnablementL()
    29 #include <btfeaturescfg.h>					// For EnterpriseEnablementL()
    31 #include <btnotif.h>
    30 #include <btnotif.h>
    32 
    31 #include <utf.h>
       
    32 #include <bluetoothuiutil.h>
    33 #include "btdevmodel.h"
    33 #include "btdevmodel.h"
    34 
    34 
    35 #include "debug.h"
    35 #include "debug.h"
    36 #include "BTUIMainView.h"
    36 #include "BTUIMainView.h"
    37 
    37 
    38 #include <utf.h>
       
    39 // ----------------------------------------------------
    38 // ----------------------------------------------------
    40 // CBTUIMainView::SetSapStatusL
    39 // CBTUIMainView::SetSapStatusL
    41 // ----------------------------------------------------
    40 // ----------------------------------------------------
    42 //
    41 //
    43 void CBTUIMainView::SetSapStatusL( TBTSapMode aValue )
    42 void CBTUIMainView::SetSapStatusL( TBTSapMode aValue )
    70 				}
    69 				}
    71 			else
    70 			else
    72 				{
    71 				{
    73 
    72 
    74 				// Create confirmation query
    73 				// Create confirmation query
    75 				HBufC* stringholder = StringLoader::LoadLC( R_BT_DISCONNECT_FROM, connectedSap );
    74 				RBuf stringholder;
       
    75 				CleanupClosePushL( stringholder );
       
    76 				BluetoothUiUtil::LoadResourceAndSubstringL( stringholder, 
       
    77 				        R_BT_DISCONNECT_FROM, connectedSap, 0 );
    76 				CAknQueryDialog* dlg = CAknQueryDialog::NewL();
    78 				CAknQueryDialog* dlg = CAknQueryDialog::NewL();
    77 
    79 
    78 				if(iCoverDisplayEnabled)
    80 				if(iCoverDisplayEnabled)
    79 					{
    81 					{
    80 					CleanupStack::PushL(dlg); 						
    82 					CleanupStack::PushL(dlg); 						
    81 				    dlg->PublishDialogL(ECmdShowDisconnectQuery, KUidCoverUiCategoryBtui); // initializes cover support    
    83 				    dlg->PublishDialogL(ECmdShowDisconnectQuery, KUidCoverUiCategoryBtui); // initializes cover support    
    82 					CleanupStack::Pop(dlg); 						
       
    83 
       
    84 					CAknMediatorFacade* covercl = AknMediatorFacade(dlg); // uses MOP, so control provided 
    84 					CAknMediatorFacade* covercl = AknMediatorFacade(dlg); // uses MOP, so control provided 
    85 					if (covercl) // returns null if __COVER_DISPLAY is not defined
    85 					if (covercl) // returns null if __COVER_DISPLAY is not defined
    86 					    {	    
    86 					    {	    
    87 					    covercl->BufStream() << BTDeviceNameConverter::ToUTF8L(connectedSap);// takes copy so consts are ok too
    87 					    covercl->BufStream() << BTDeviceNameConverter::ToUTF8L(connectedSap);// takes copy so consts are ok too
    88 					    covercl->BufStream().CommitL(); // no more data to send so commit buf
    88 					    covercl->BufStream().CommitL(); // no more data to send so commit buf
    89 					    }  
    89 					    }
       
    90 					CleanupStack::Pop(dlg);
    90 					}
    91 					}
    91 					
    92 					
    92 				TInt keypress = dlg->ExecuteLD( R_BT_DISCONNECT_FROM_QUERY, *stringholder );
    93 				TInt keypress = dlg->ExecuteLD( R_BT_DISCONNECT_FROM_QUERY, stringholder );
    93 
    94 
    94 				CleanupStack::PopAndDestroy(stringholder);	// stringholder
    95 				CleanupStack::PopAndDestroy(&stringholder);	// stringholder
    95 
    96 
    96 				if( keypress )	// User has accepted the dialog
    97 				if( keypress )	// User has accepted the dialog
    97 					{
    98 					{
    98 					legalToChange = ETrue;
    99 					legalToChange = ETrue;
    99 					}
   100 					}