commsconfig/cscsettingsui/src/cscsettingsuimaincontainer.cpp
branchRCL_3
changeset 31 5886d40bb3de
parent 28 d38647835c2e
child 33 2989b291cac7
equal deleted inserted replaced
29:755430a7d64b 31:5886d40bb3de
    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>
    31 
    32 
    32 #include "cscconstants.h"
    33 #include "cscconstants.h"
    33 #include "cscsettingsui.hrh"
    34 #include "cscsettingsui.hrh"
    34 #include "cscsettingsuimodel.h"
    35 #include "cscsettingsuimodel.h"
    35 #include "cscsettingsuilogger.h"
    36 #include "cscsettingsuilogger.h"
   890         iModel.SettingsHandler().ServiceNameL( iModel.CurrentSPEntryId() ) );
   891         iModel.SettingsHandler().ServiceNameL( iModel.CurrentSPEntryId() ) );
   891     query->SetPromptL( *string );
   892     query->SetPromptL( *string );
   892     CleanupStack::PopAndDestroy( string );
   893     CleanupStack::PopAndDestroy( string );
   893     CleanupStack::Pop( query );
   894     CleanupStack::Pop( query );
   894     if ( query->RunLD() )
   895     if ( query->RunLD() )
   895         {
   896         {  
   896         // First check if there is a service plugin UID.
   897         // Checke whether current service is disabled.
   897         TInt count = iModel.ServicePluginHandler().PluginCount( 
   898         TBool  disabled = iModel.CCHHandler().IsServiceDisabled( iModel.CurrentSPEntryId() );
   898             CCSCEngServicePluginHandler::EInitialized );
   899         // The current service is deleted directly if the service is disabled.
   899 
   900         if ( disabled )
   900         TRAPD( err, LaunchCleanupPluginL( iModel.CurrentSPEntryId() ) );
   901             {            
   901         if ( KErrNone != err )
   902             // First check if there is a service plugin UID.
   902             {
   903             TInt count = iModel.ServicePluginHandler().PluginCount( 
   903             iModel.SettingsHandler().DeleteServiceL( 
   904                     CCSCEngServicePluginHandler::EInitialized );
   904                 iModel.CurrentSPEntryId() );
   905 
   905             }
   906             TRAPD( err, LaunchCleanupPluginL( iModel.CurrentSPEntryId() ) );
   906         isDelete = ETrue;
   907             if ( KErrNone != err )
       
   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             }
   907         }
   929         }
   908 
   930 
   909     CSCSETUIDEBUG( "CCSCSettingsUiMainContainer::DeleteServiceL - end" );
   931     CSCSETUIDEBUG( "CCSCSettingsUiMainContainer::DeleteServiceL - end" );
   910     return isDelete;
   932     return isDelete;
   911     }
   933     }