commsconfig/cscsettingsui/src/cscsettingsuimaincontainer.cpp
branchRCL_3
changeset 33 2989b291cac7
parent 31 5886d40bb3de
equal deleted inserted replaced
31:5886d40bb3de 33:2989b291cac7
    26 #include <aknlistquerydialog.h>
    26 #include <aknlistquerydialog.h>
    27 #include <cvimpstsettingsstore.h>
    27 #include <cvimpstsettingsstore.h>
    28 #include <csxhelp/voip.hlp.hrh>
    28 #include <csxhelp/voip.hlp.hrh>
    29 #include <csc.rsg>
    29 #include <csc.rsg>
    30 #include <aknnotedialog.h>
    30 #include <aknnotedialog.h>
    31 #include <aknnotewrappers.h>
       
    32 
    31 
    33 #include "cscconstants.h"
    32 #include "cscconstants.h"
    34 #include "cscsettingsui.hrh"
    33 #include "cscsettingsui.hrh"
    35 #include "cscsettingsuimodel.h"
    34 #include "cscsettingsuimodel.h"
    36 #include "cscsettingsuilogger.h"
    35 #include "cscsettingsuilogger.h"
   891         iModel.SettingsHandler().ServiceNameL( iModel.CurrentSPEntryId() ) );
   890         iModel.SettingsHandler().ServiceNameL( iModel.CurrentSPEntryId() ) );
   892     query->SetPromptL( *string );
   891     query->SetPromptL( *string );
   893     CleanupStack::PopAndDestroy( string );
   892     CleanupStack::PopAndDestroy( string );
   894     CleanupStack::Pop( query );
   893     CleanupStack::Pop( query );
   895     if ( query->RunLD() )
   894     if ( query->RunLD() )
   896         {  
   895         {
   897         // Checke whether current service is disabled.
   896         // First check if there is a service plugin UID.
   898         TBool  disabled = iModel.CCHHandler().IsServiceDisabled( iModel.CurrentSPEntryId() );
   897         TInt count = iModel.ServicePluginHandler().PluginCount( 
   899         // The current service is deleted directly if the service is disabled.
   898             CCSCEngServicePluginHandler::EInitialized );
   900         if ( disabled )
   899 
   901             {            
   900         TRAPD( err, LaunchCleanupPluginL( iModel.CurrentSPEntryId() ) );
   902             // First check if there is a service plugin UID.
   901         if ( KErrNone != err )
   903             TInt count = iModel.ServicePluginHandler().PluginCount( 
   902             {
   904                     CCSCEngServicePluginHandler::EInitialized );
   903             iModel.SettingsHandler().DeleteServiceL( 
   905 
   904                 iModel.CurrentSPEntryId() );
   906             TRAPD( err, LaunchCleanupPluginL( iModel.CurrentSPEntryId() ) );
   905             }
   907             if ( KErrNone != err )
   906         isDelete = ETrue;
   908                 {
       
   909                 iModel.SettingsHandler().DeleteServiceL( 
       
   910                         iModel.CurrentSPEntryId() );
       
   911                 }
       
   912             isDelete = ETrue;                  
       
   913             }
       
   914         else
       
   915             {
       
   916             // A note that indicates unable to delete service is shown if the service is enabled.
       
   917             HBufC* string = NULL;
       
   918             string = StringLoader::LoadL( 
       
   919                             R_QTN_CSC_UNABLE_TO_DELETE_NOTE,
       
   920                             iModel.SettingsHandler().ServiceNameL( iModel.CurrentSPEntryId() ) );
       
   921             if ( string )
       
   922                 {
       
   923                 CleanupStack::PushL( string );   
       
   924                 CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue );
       
   925                 note->ExecuteLD( *string );
       
   926                 CleanupStack::PopAndDestroy( string );
       
   927                 }         
       
   928             }
       
   929         }
   907         }
   930 
   908 
   931     CSCSETUIDEBUG( "CCSCSettingsUiMainContainer::DeleteServiceL - end" );
   909     CSCSETUIDEBUG( "CCSCSettingsUiMainContainer::DeleteServiceL - end" );
   932     return isDelete;
   910     return isDelete;
   933     }
   911     }