mobilemessaging/smum/src/SmumSettingsDialogGSM.cpp
branchRCL_3
changeset 60 7fdbb852d323
child 77 da6ac9d688df
equal deleted inserted replaced
57:ebe688cedc25 60:7fdbb852d323
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *     Main settings dialog for Sms.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <SMUM.rsg>                     // resouce identifiers
       
    23 #include <smutset.h>                    // CSmsSettings
       
    24 #include <aknappui.h>                   // CEikStatusPane
       
    25 #include <akntitle.h>                   // CAknTitlePane
       
    26 #include <aknenv.h>                     // AppShutter
       
    27 #include <aknnotewrappers.h>            // Avkon note wrappers
       
    28 #include <AknQueryDialog.h>             // CAknQueryDialog
       
    29 #include <eikmenup.h>                   // CEikMenuPane
       
    30 #include <smuthdr.h>                    // CSmsHeader
       
    31 #include <StringLoader.h>               // StringLoader
       
    32 #include <AknDlgShut.h>                 // AknDialogShutter
       
    33 #include <hlplch.h>                     // HlpLauncher
       
    34 #include <featmgr.h>                    // FeatureManager
       
    35 #include <bldvariant.hrh>
       
    36 #include <aknnavi.h>                    //CAknNavigationControlContainer
       
    37 #include <csxhelp/mce.hlp.hrh>
       
    38 #include <csxhelp/sms.hlp.hrh>
       
    39 #include <messagingvariant.hrh>
       
    40 #include <RCustomerServiceProfileCache.h>
       
    41 #include <centralrepository.h>          // CRepository
       
    42 #include <messaginginternalcrkeys.h>    // Keys
       
    43 #include <messaginginternalpskeys.h>
       
    44 
       
    45 // locals
       
    46 #include "smsui.pan"    				// for panics
       
    47 #include "SmumSettingsDialogGSM.h"         // CSmumMainSettingsDialogGSM
       
    48 #include "SmumServiceCentreItemDialog.h"// CSmumAddEditServiceCentreDialog
       
    49 #include "SmumEmailServiceCentreItemDialog.h"// CSmumEmailServiceCentreDialog
       
    50 #include "SMSU.HRH"                     // resource header
       
    51 #include "SmumServiceCentresDialog.h"   // CSmumServiceCentresDialog
       
    52 #include "SmumUtil.h"
       
    53 
       
    54 #include "SmumLogging.h"
       
    55 
       
    56 // CONSTANTS
       
    57 const TInt KMuiuSettingsArrayGranularity    = 4;
       
    58 const TInt KSmumCharSettingDeduction = 2;
       
    59 // ================= MEMBER FUNCTIONS =======================
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // CSmumMainSettingsDialogGSM::NewL
       
    63 // Two-phased constructor.
       
    64 // -----------------------------------------------------------------------------
       
    65 CSmumMainSettingsDialog* CSmumMainSettingsDialogGSM::NewL(
       
    66     CSmsSettings&   aSettings, 
       
    67     TInt            aTypeOfSettings,
       
    68     TInt&           aExitCode,
       
    69     TInt&           aCharSetSupportForSendingOptions,
       
    70     CSmsHeader*     aSmsHeader )
       
    71     {
       
    72     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::NewL");
       
    73     CSmumMainSettingsDialogGSM*  self = new ( ELeave ) CSmumMainSettingsDialogGSM( 
       
    74         aSettings, aTypeOfSettings, aExitCode, 
       
    75         aCharSetSupportForSendingOptions, aSmsHeader );
       
    76     
       
    77     CleanupStack::PushL( self );
       
    78     self->ConstructL();
       
    79     CleanupStack::Pop();
       
    80     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::NewL");
       
    81     return self;
       
    82     }
       
    83     
       
    84 // -----------------------------------------------------------------------------
       
    85 // CSmumMainSettingsDialogGSM::CSmumMainSettingsDialogGSM
       
    86 // C++ default constructor can NOT contain any code, that
       
    87 // might leave.
       
    88 // -----------------------------------------------------------------------------
       
    89 CSmumMainSettingsDialogGSM::CSmumMainSettingsDialogGSM(
       
    90     CSmsSettings&   aSettings, 
       
    91     TInt            aTypeOfSettings,
       
    92     TInt&           aExitCode,
       
    93     TInt&           aCharSetSupportForSendingOptions,
       
    94     CSmsHeader*     aSmsHeader )
       
    95     :   iSettings       ( aSettings ),
       
    96         iTypeOfSettings ( aTypeOfSettings ),
       
    97         iExitCode       ( aExitCode ),
       
    98         iSmsHeader      ( aSmsHeader ),
       
    99         iHelpFeatureSupported ( EFalse ),
       
   100         iCSPFeatures ( NULL ),
       
   101         iCharacterSupport ( aCharSetSupportForSendingOptions ),
       
   102         iIdle( NULL ),
       
   103         iUseSimSCsOnly( EFalse ),
       
   104         iEmailFeatureSupported( EFalse ),
       
   105         iMskId( NULL )        
       
   106     {
       
   107     }
       
   108 
       
   109 // Destructor
       
   110 CSmumMainSettingsDialogGSM::~CSmumMainSettingsDialogGSM()
       
   111     {
       
   112     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::~CSmumMainSettingsDialogGSM");
       
   113     if ( iListBox )
       
   114         {
       
   115         iListBox->SetScrollBarFrame( NULL, CEikListBox::EOwnedExternally );
       
   116         }
       
   117     // To remove sending options from Message Settings
       
   118     RProperty::Delete( KPSUidMuiu, KMuiuRemoveMsgSentSettings ); 
       
   119     delete iPreviousTitleText;
       
   120     delete iSettingsArrayIndex;
       
   121     delete iCentralRapository;
       
   122     delete iIdle;
       
   123     // iSettingsArray, iListBox, iSettings(reference), iSettingsForReadingSCList,
       
   124     // iTitlePane, iPreviousTitleText, iSmumNaviPane are
       
   125     // plain pointers to objects owned by other classes which take
       
   126     // care also about deletion.
       
   127     // Remove default navi pane
       
   128     if ( iSmumNaviPane )
       
   129         {
       
   130         iSmumNaviPane->Pop();
       
   131         }
       
   132     // Not owned. For Lint
       
   133     iSettingsArray = NULL;
       
   134     iListBox = NULL;
       
   135     iSmsHeader = NULL;
       
   136     iTitlePane = NULL;
       
   137     iSmumNaviPane = NULL;
       
   138     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::~CSmumMainSettingsDialogGSM");
       
   139     }
       
   140 
       
   141 // -----------------------------------------------------------------------------
       
   142 // CSmumMainSettingsDialogGSM::ConstructL
       
   143 // Symbian 2nd phase constructor can leave.
       
   144 // -----------------------------------------------------------------------------
       
   145 void CSmumMainSettingsDialogGSM::ConstructL()
       
   146     {
       
   147     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::ConstructL");
       
   148     CAknDialog::ConstructL( R_MAIN_SMS_SETTINGS_CHOICE_MENUBAR );
       
   149 
       
   150     // Prepare FeatureManager, read values to members and uninitialize FeatureManager
       
   151     FeatureManager::InitializeLibL();
       
   152     iHelpFeatureSupported = FeatureManager::FeatureSupported( KFeatureIdHelp );
       
   153     // REQ:417-48417 Message forward with sender info
       
   154     iForwardWithSenderSupported = FeatureManager::FeatureSupported(KFeatureIdMsgForwardWithSender);     
       
   155     // End REQ:417-48417
       
   156     FeatureManager::UnInitializeLib();
       
   157     // Read the supported settings
       
   158     iEmailFeatureSupported = SmumUtil::CheckEmailOverSmsSupportL();
       
   159     ReadCspSupportBitsL();
       
   160     iCentralRapository = CRepository::NewL( KCRUidSmum );
       
   161     iCentralRapository->Get( KSmumRemoveReplyViaSameCentre, iRemoveReplyScSetting );
       
   162     // Check if Only Sim SC's variation is on
       
   163 	if ( SmumUtil::CheckVariationFlagsL( KCRUidMuiuVariation, KMuiuSmsFeatures ) & 
       
   164 		 KSmsFeatureIdSimServiceCentresOnly )
       
   165 		{
       
   166 		iUseSimSCsOnly = ETrue;
       
   167 		}
       
   168 	// Define the property to remove sending options from Message Settings
       
   169     TInt r = RProperty::Define( KPSUidMuiu, KMuiuRemoveMsgSentSettings, RProperty::EInt );
       
   170     if ( r != KErrAlreadyExists )
       
   171        {
       
   172         User::LeaveIfError( r );
       
   173        }
       
   174     // Initialise the value of key as 0
       
   175     RProperty::Set( KPSUidMuiu, KMuiuRemoveMsgSentSettings, 0) ;
       
   176 	
       
   177     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::ConstructL");
       
   178     }
       
   179 
       
   180 // ----------------------------------------------------
       
   181 // CSmumMainSettingsDialogGSM::OkToExitL
       
   182 // 
       
   183 // ----------------------------------------------------
       
   184 TInt CSmumMainSettingsDialogGSM::OkToExitL( TInt aButtonId )
       
   185     {
       
   186     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::OkToExitL");
       
   187     TInt returnValue;
       
   188 
       
   189     switch( aButtonId )
       
   190         {
       
   191         case ESmsSettingsChoiceMenuOpen:
       
   192         case ESmsSettingsChoiceMenuChange:
       
   193         case ESmsSettingsChoiceMenuChangeMSK:
       
   194 	        {
       
   195 	        ProcessCommandL( aButtonId );
       
   196 	        returnValue = EFalse; // Cannot exit, since MSK was pressed
       
   197 	        }     
       
   198 	        break;
       
   199         // system / menu exit
       
   200         case EAknSoftkeyCancel: 
       
   201             {
       
   202             if ( iExitCode != ESmumSmsSettingsMenuExit &&
       
   203                  iExitCode != ESmumSmsSettingsSystemExit )
       
   204                 {
       
   205                 // system exit
       
   206                 iExitCode = ESmumSmsSettingsSystemExit;
       
   207                 }
       
   208             TRAP_IGNORE( ClosingDialogL() ); // to be sure of not leaving and exiting
       
   209             returnValue = ETrue;
       
   210             }
       
   211             break;
       
   212         // back-key
       
   213         case EAknSoftkeyBack:
       
   214             {
       
   215             iExitCode = ESmumSmsSettingsBack;
       
   216             ClosingDialogL();
       
   217             returnValue = ETrue;
       
   218             }
       
   219             break;
       
   220         default :
       
   221             returnValue = CAknDialog::OkToExitL( aButtonId );
       
   222             break;
       
   223         }
       
   224 
       
   225     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::OkToExitL");
       
   226     return returnValue;
       
   227     }
       
   228 
       
   229 // ----------------------------------------------------
       
   230 // CSmumMainSettingsDialogGSM::HandleListBoxEventL
       
   231 //
       
   232 // ----------------------------------------------------
       
   233 void CSmumMainSettingsDialogGSM::HandleListBoxEventL(
       
   234     CEikListBox* /*aListBox*/, 
       
   235     TListBoxEvent aEventType )
       
   236     {
       
   237     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::HandleListBoxEventL");
       
   238     switch( aEventType )
       
   239         {
       
   240         case EEventItemDraggingActioned:
       
   241             UpdateMskL();
       
   242             break;            
       
   243         case EEventEnterKeyPressed:
       
   244         case EEventItemSingleClicked:
       
   245             CheckOpeningListBoxItemL( ETrue );
       
   246             break;
       
   247         default :
       
   248             // nothing
       
   249             break;
       
   250         }
       
   251     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::HandleListBoxEventL");
       
   252     }
       
   253 
       
   254 // ----------------------------------------------------
       
   255 // CSmumMainSettingsDialogGSM::ProcessCommandL
       
   256 //
       
   257 // ----------------------------------------------------
       
   258 void CSmumMainSettingsDialogGSM::ProcessCommandL(
       
   259     TInt aCommandId)
       
   260     {
       
   261     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::ProcessCommandL");
       
   262     CAknDialog::ProcessCommandL( aCommandId ) ;
       
   263     switch ( aCommandId )
       
   264         {
       
   265         case ESmsSettingsChoiceMenuOpen:
       
   266         case ESmsSettingsChoiceMenuChange:
       
   267             CheckOpeningListBoxItemL( EFalse );
       
   268             break;
       
   269         case ESmsSettingsChoiceMenuChangeMSK:
       
   270             CheckOpeningListBoxItemL( ETrue );
       
   271             break;
       
   272         case EAknCmdHelp:
       
   273             {
       
   274             LaunchHelpL();                
       
   275             }
       
   276             break;
       
   277         case ESmsSettingsChoiceMenuExit:
       
   278             { 
       
   279             iExitCode = ESmumSmsSettingsMenuExit;
       
   280             TryExitL( EAknSoftkeyCancel );
       
   281             }
       
   282             break;
       
   283         default :
       
   284             // nothing
       
   285             break ;
       
   286         }
       
   287     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::ProcessCommandL");
       
   288     }
       
   289 
       
   290 // ----------------------------------------------------
       
   291 // CSmumMainSettingsDialogGSM::OfferKeyEventL
       
   292 //
       
   293 // ----------------------------------------------------
       
   294 TKeyResponse CSmumMainSettingsDialogGSM::OfferKeyEventL(
       
   295     const TKeyEvent& aKeyEvent,
       
   296     TEventCode aType )
       
   297     {
       
   298 
       
   299     TKeyResponse returnValue = CAknDialog::OfferKeyEventL( aKeyEvent, aType );
       
   300 	if( aType == EEventKeyUp )
       
   301 	{
       
   302 	UpdateMskL( );
       
   303         }
       
   304 
       
   305     return returnValue;
       
   306     }
       
   307 
       
   308 // ----------------------------------------------------
       
   309 // CSmumMainSettingsDialogGSM::PreLayoutDynInitL
       
   310 //
       
   311 // ----------------------------------------------------
       
   312 void CSmumMainSettingsDialogGSM::PreLayoutDynInitL()
       
   313     {
       
   314     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::PreLayoutDynInitL");
       
   315     // Creating correct listbox depending Settings vs Sending Options 
       
   316     iListBox = STATIC_CAST( CEikTextListBox*, Control( ESmsSettingsListBoxId ));
       
   317     
       
   318     // To remove sending options from Message Settings ,set the key value as 1
       
   319     TInt err = RProperty::Set( KPSUidMuiu, KMuiuRemoveMsgSentSettings, 1 ) ;
       
   320     User::LeaveIfError(err);
       
   321     
       
   322     iSettingsArray = CSmumSettingsArray::NewL( iTypeOfSettings ? 
       
   323         R_SMS_SENDING_OPTIONS_ITEMS : R_SMS_MAIN_SETTINGS_ITEMS );
       
   324     
       
   325     // The count of setting items depends of setting type
       
   326     TInt numberOfSettingItems = iTypeOfSettings ? 
       
   327         ESmumSendOptReplyViaSameCentreLBI + 1: ESmumReplyViaSameCentreLBI + 1 ;
       
   328     iSettingsArrayIndex = new(ELeave) CArrayFixFlat<TInt>( numberOfSettingItems );
       
   329 	// Iterate through settings
       
   330 	for (TInt count = 0; count < numberOfSettingItems; count++)
       
   331 		{
       
   332         iSettingsArrayIndex->AppendL( count ); // Indicates that setting is present
       
   333 		}
       
   334     DeleteVariatedSettings();
       
   335 
       
   336     iListBox->SetListBoxObserver( this );
       
   337 
       
   338     // Arabic-indic conversion not to be done to SMSC Name
       
   339     if ( !iTypeOfSettings ) // For main settings
       
   340         {
       
   341         (*iSettingsArray)[ESmumServiceCentreInUseLBI].iLangSpecificNumConv = EFalse;
       
   342         }
       
   343     else
       
   344         {
       
   345         (*iSettingsArray)[ESmumSendOptServiceCentreInUseLBI].iLangSpecificNumConv = EFalse;
       
   346         }
       
   347 
       
   348     // Initialize listboxes to settings values
       
   349     OpeningDialogL();
       
   350 
       
   351     // scroll bars
       
   352     iListBox->CreateScrollBarFrameL( ETrue );
       
   353     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
       
   354         CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
       
   355 
       
   356     CTextListBoxModel* model = iListBox->Model();
       
   357     model->SetItemTextArray( iSettingsArray );
       
   358 
       
   359 	UpdateMskL();
       
   360     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::PreLayoutDynInitL");
       
   361     }
       
   362 
       
   363 // ---------------------------------------------------------
       
   364 // CSmumMainSettingsDialogGSM::DynInitMenuPaneL
       
   365 //
       
   366 // ---------------------------------------------------------
       
   367 void CSmumMainSettingsDialogGSM::DynInitMenuPaneL(
       
   368     TInt aMenuId, 
       
   369     CEikMenuPane* aMenuPane )
       
   370     {
       
   371     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::DynInitMenuPaneL");
       
   372     switch ( aMenuId )
       
   373         {
       
   374         case R_MAIN_SMS_SETTINGS_CHOICE_MENUPANE:
       
   375             // Check which one to show in Options-menu
       
   376             if ( ESmumServiceCentresLBI == iListBox->CurrentItemIndex() 
       
   377                 && !iTypeOfSettings )
       
   378                 {
       
   379                 // Open option is left in the menu even if no SIM service
       
   380                 // centres available and use only SIM service centres is in use.
       
   381                 // If user selects it, he gets note:
       
   382                 // No service centres, SMS service has been disabled
       
   383                 /*
       
   384                 if ( iUseSimSCsOnly && iSettings.ServiceCenterCount() == 0 )
       
   385                 	{
       
   386                 	aMenuPane->DeleteMenuItem( ESmsSettingsChoiceMenuOpen );
       
   387                 	}
       
   388                 */	
       
   389                 aMenuPane->DeleteMenuItem( ESmsSettingsChoiceMenuChange );
       
   390                 }
       
   391             else
       
   392                 {
       
   393                 aMenuPane->DeleteMenuItem( ESmsSettingsChoiceMenuOpen );
       
   394                 }
       
   395 
       
   396             // Help handling
       
   397             aMenuPane->SetItemDimmed( EAknCmdHelp,!iHelpFeatureSupported );
       
   398 
       
   399             break;
       
   400         default :
       
   401             // panic
       
   402             break;
       
   403         }
       
   404     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::DynInitMenuPaneL");
       
   405     }
       
   406 
       
   407 // ----------------------------------------------------
       
   408 // CSmumMainSettingsDialogGSM::UpdateSCInUseArrayL
       
   409 //
       
   410 // ----------------------------------------------------
       
   411 void CSmumMainSettingsDialogGSM::UpdateSCInUseArrayL()
       
   412     {
       
   413     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::UpdateSCInUseArrayL");
       
   414     // Create an sc array
       
   415     CDesCArrayFlat* array = 
       
   416         new ( ELeave ) CDesCArrayFlat( KMuiuSettingsArrayGranularity );
       
   417     TBool arrayOwnershipChanged( EFalse );
       
   418     CleanupStack::PushL( array );
       
   419     TInt serviceCentres = 0;
       
   420     serviceCentres = iSettings.ServiceCenterCount();
       
   421     const TInt listboxIndex = iTypeOfSettings ? 
       
   422         ESmumSendOptServiceCentreInUseLBI : ESmumServiceCentreInUseLBI;
       
   423     
       
   424     if( serviceCentres )
       
   425         {
       
   426         // We have service centres
       
   427         for ( TInt loop = 0; loop < serviceCentres; loop++ )
       
   428             {
       
   429             array->AppendL( iSettings.GetServiceCenter( loop ).Name());
       
   430             }
       
   431         // Delete old and replace array
       
   432         delete iSettingsArray->At( listboxIndex ).iMuiuSettingsItemArray;
       
   433         iSettingsArray->At( listboxIndex ).iMuiuSettingsItemArray = array;
       
   434         // Set the one in use visible
       
   435         SetItem( listboxIndex, iSettings.DefaultServiceCenter() );
       
   436         arrayOwnershipChanged = ETrue;
       
   437         }
       
   438     else
       
   439         {
       
   440         if ( !iUseSimSCsOnly )
       
   441         	{
       
   442 	        // No service centres defined
       
   443 	        // Read value from resources
       
   444 	        HBufC* txt = StringLoader::LoadLC( R_QTN_SELEC_SETT_VAL_FIELD_NONE, iCoeEnv );
       
   445 	        array->AppendL( *txt );
       
   446 	        // Delete old and replace array
       
   447 	        delete iSettingsArray->At( listboxIndex ).iMuiuSettingsItemArray;
       
   448 	        iSettingsArray->At( listboxIndex ).iMuiuSettingsItemArray = array;
       
   449 	        // Confirm listbox value 
       
   450 	        SetItem( listboxIndex, serviceCentres );
       
   451 	        CleanupStack::PopAndDestroy(); // txt	
       
   452 	        arrayOwnershipChanged = ETrue;
       
   453         	}
       
   454         }
       
   455     if ( arrayOwnershipChanged )
       
   456     	{
       
   457 	    CleanupStack::Pop(); //array
       
   458     	}
       
   459     else
       
   460     	{
       
   461     	CleanupStack::PopAndDestroy(); //array
       
   462     	}
       
   463     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::UpdateSCInUseArrayL");
       
   464     }
       
   465 
       
   466 // ----------------------------------------------------
       
   467 // CSmumMainSettingsDialogGSM::OpeningDialogL
       
   468 //
       
   469 // ----------------------------------------------------
       
   470 void CSmumMainSettingsDialogGSM::OpeningDialogL()
       
   471     {
       
   472     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::OpeningDialogL");
       
   473     // Fetch pointer to titlepane
       
   474     CEikStatusPane *sp =  ( STATIC_CAST(
       
   475         CAknAppUi*, ( CEikonEnv::Static()->EikAppUi())))->StatusPane();
       
   476     iTitlePane = STATIC_CAST (
       
   477         CAknTitlePane*, sp->ControlL( TUid::Uid(EEikStatusPaneUidTitle)));
       
   478     
       
   479     // Take old titlepane text safe
       
   480     iPreviousTitleText = ( *iTitlePane->Text()).Alloc();
       
   481         
       
   482     // Read new titletext and set it
       
   483     HBufC* text = StringLoader::LoadLC( iTypeOfSettings ?
       
   484         R_QTN_SMS_TITLE_SENDING : R_QTN_MCE_TITLE_SETTINGS_SMS, iCoeEnv );
       
   485     iTitlePane->SetTextL( *text );
       
   486     CleanupStack::PopAndDestroy(); // text
       
   487 
       
   488     // replace navi pane with empty one.
       
   489     iSmumNaviPane = static_cast<CAknNavigationControlContainer*>
       
   490         ( iEikonEnv->AppUiFactory()->StatusPane()->ControlL(
       
   491             TUid::Uid(EEikStatusPaneUidNavi) ) );
       
   492     if ( iSmumNaviPane )
       
   493         {
       
   494         iSmumNaviPane->PushDefaultL();
       
   495         }
       
   496 
       
   497     // Settings :
       
   498     // Service Centre in Use
       
   499     // Sending options?
       
   500     TBool isReplyMessage = EFalse;
       
   501     
       
   502     if(iTypeOfSettings)
       
   503     	{
       
   504     	isReplyMessage = iSmsHeader->Submit().ReplyPath();
       
   505     	}
       
   506     
       
   507     if ( iTypeOfSettings == 1 && iCSPFeatures & EReplyPathSupport ) // 1 = sending options
       
   508         {
       
   509         // Replypath provided?
       
   510         if ( isReplyMessage && !iRemoveReplyScSetting)
       
   511             { // yes, it's provided
       
   512             iSettingsArray->SetReplyPath( ETrue );
       
   513             }
       
   514         }
       
   515     // Update arrays
       
   516     if(!(iRemoveReplyScSetting && isReplyMessage))
       
   517     	{	
       
   518     UpdateSCInUseArrayL();
       
   519     	}
       
   520 	
       
   521 	TInt index;
       
   522     TKeyArrayFix key(0, ECmpTInt);    
       
   523     // Character Support 3.0 onwards
       
   524     if ( iTypeOfSettings ) // Sending options
       
   525         {
       
   526         if ( !iSettingsArrayIndex->Find ( ESmumSendOptCharSupportInUseLBI, key, index ) )
       
   527         	{
       
   528 	        TInt temp = iCharacterSupport;
       
   529 	        // Check if the value is modifiable
       
   530 	        // and modify setting value if needed
       
   531 	        if ( ECharSetFullLocked==temp || 
       
   532 	             ECharSetReducedLocked==temp )
       
   533 	            {
       
   534 	            temp -= KSmumCharSettingDeduction;
       
   535 	            }
       
   536 	        SetItem( index, temp );
       
   537         	}
       
   538         }
       
   539     else
       
   540         {
       
   541         if ( !iSettingsArrayIndex->Find ( ESmumCharSupportInUseLBI, key, index ) )
       
   542         	{
       
   543         	SetItem( index, ReadCharSetSupport() );
       
   544         	}
       
   545         }
       
   546 
       
   547     if ( iCSPFeatures & EDeliveryReportSupport ) // Set value only if setting is supported
       
   548         {
       
   549         if ( !iSettingsArrayIndex->Find (iTypeOfSettings ? 
       
   550                 ESmumSendOptDeliveryReportLBI : ESmumDeliveryReportLBI, key, index ) )
       
   551             {
       
   552             // Delivery Report
       
   553             SetItem( index, iSettings.DeliveryReport() ? 
       
   554                 ESmumSettingsYes : ESmumSettingsNo );
       
   555             }
       
   556         }
       
   557     // Validity Period
       
   558     TInt choicelistIndex = KErrNotFound;
       
   559     if ( iCSPFeatures & EValidityPeriodSupport )
       
   560         {
       
   561         if ( !iSettingsArrayIndex->Find ( iTypeOfSettings ? 
       
   562                 ESmumSendOptValidityPeriodLBI : ESmumValidityPeriodLBI, key, index ) )
       
   563             {
       
   564             switch( iSettings.ValidityPeriod().Int())
       
   565                 {
       
   566                 case ESmsVPHour:
       
   567                     choicelistIndex = ESmumValidityPeriodHour;
       
   568                     break;
       
   569                 case ESmsVPSixHours:
       
   570                     choicelistIndex = ESmumValidityPeriodSixHours;
       
   571                     break;
       
   572                 case ESmsVP24Hours:
       
   573                     choicelistIndex = ESmumValidityPeriod24Hours;
       
   574                     break;
       
   575                 case (3 * (TInt) ESmsVP24Hours): 
       
   576                     choicelistIndex = ESmumValidityPeriod3Days;
       
   577                     break;
       
   578                 case ESmsVPWeek:
       
   579                     choicelistIndex = ESmumValidityPeriodWeek;
       
   580                     break;
       
   581                 case ESmsVPMaximum:
       
   582                     choicelistIndex = ESmumValidityPeriodMaximum;
       
   583                     break;
       
   584                 default:
       
   585         #if defined (_DEBUG)
       
   586                     Panic( ESmsetdlgUnknownValidity );
       
   587         #else
       
   588                 // drop through in release version
       
   589                 case ESmsVPNotSupported:
       
   590                     choicelistIndex = ESmumValidityPeriodMaximum;
       
   591         #endif
       
   592                     break;
       
   593                 }
       
   594             SetItem( index, choicelistIndex);
       
   595             }
       
   596         }
       
   597     
       
   598     // Preferred Connection
       
   599     if ( !iTypeOfSettings )
       
   600         {
       
   601         if ( !iSettingsArrayIndex->Find ( ESmumPreferredConnectionLBI, key, index ) )
       
   602             {
       
   603             const TInt preferredConnection = iSettings.SmsBearer();
       
   604             switch( preferredConnection )
       
   605                 {// "prefer GPRS"
       
   606                 case CSmsSettings::ESmsBearerPacketPreferred :
       
   607                     SetItem( index, ESmumPreferGPRSConnection );
       
   608                     break;
       
   609                 // In all other cases "prefer GSM"
       
   610                 //case RMobileSmsMessaging::ESmsBearerCircuitPreferred :
       
   611                 default: 
       
   612                 //case RMobileSmsMessaging::ESmsBearerCircuitOnly :
       
   613                 //case RMobileSmsMessaging::ESmsBearerPacketOnly :
       
   614                     SetItem( index, ESmumPreferGSMConnection );
       
   615                     break;
       
   616                 }
       
   617             }
       
   618         }
       
   619     
       
   620     // Reply Path
       
   621     if ( iCSPFeatures & EReplyPathSupport && !iRemoveReplyScSetting)
       
   622         {
       
   623         // Reply Via Same Centre
       
   624         if ( !iSettingsArrayIndex->Find ( iTypeOfSettings ? 
       
   625                 ESmumSendOptReplyViaSameCentreLBI : ESmumReplyViaSameCentreLBI, key, index ) )
       
   626             {
       
   627             SetItem( index, iSettings.ReplyPath() ? ESmumSettingsYes : ESmumSettingsNo );
       
   628             }
       
   629         }
       
   630     
       
   631     // REQ:417-48417 Message forward with sender info
       
   632        if (!iTypeOfSettings && iForwardWithSenderSupported)
       
   633         {  
       
   634         if ( !iSettingsArrayIndex->Find ( ESmumForwardWithSenderInfoLBI, key, index ) )
       
   635             {
       
   636             TInt forwardWithSenderInfo;
       
   637             if ( iCentralRapository->Get( KForwardWithSenderInfo, forwardWithSenderInfo ) != KErrNone )
       
   638                 {
       
   639                 //In case of any error,set the default value to 0
       
   640                 forwardWithSenderInfo = 0;            
       
   641                 }
       
   642             SetItem(index, forwardWithSenderInfo? ESmumSettingsYes : ESmumSettingsNo);
       
   643             }                
       
   644         }
       
   645     // End REQ:417-48417
       
   646 
       
   647     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::OpeningDialogL");
       
   648     }
       
   649 
       
   650 // ----------------------------------------------------
       
   651 // CSmumMainSettingsDialogGSM::ClosingDialogL
       
   652 //
       
   653 // ----------------------------------------------------
       
   654 void CSmumMainSettingsDialogGSM::ClosingDialogL()
       
   655     {
       
   656     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::ClosingDialogL");
       
   657     TBool replyMessage = EFalse;
       
   658     
       
   659     if ( iTypeOfSettings == 1 && iCSPFeatures & EReplyPathSupport ) // 1 = sending options
       
   660         {
       
   661         // Replypath provided?
       
   662         
       
   663         if ( iSmsHeader->Submit().ReplyPath() && iRemoveReplyScSetting)
       
   664             { // yes, it's provided
       
   665             replyMessage = ETrue;
       
   666             iSettingsArray->SetReplyPath( ETrue );
       
   667             }
       
   668         }
       
   669     // Replace title with old title text
       
   670     if ( iExitCode == ESmumSmsSettingsBack )
       
   671         {
       
   672         // Replace title with old title text
       
   673         iTitlePane->SetTextL( *iPreviousTitleText );
       
   674         }
       
   675     TInt index;
       
   676     TKeyArrayFix key(0, ECmpTInt);
       
   677     // Settings :
       
   678     // Service Centre in Use
       
   679     if ( iSettings.ServiceCenterCount())
       
   680         {
       
   681         if(!replyMessage && !iRemoveReplyScSetting)
       
   682         	{
       
   683         	//Make sure array is updated if user presses end-key
       
   684         	UpdateSCInUseArrayL();
       
   685         	
       
   686             iSettings.SetDefaultServiceCenter( Item(
       
   687                 iTypeOfSettings ? 
       
   688                 ESmumSendOptServiceCentreInUseLBI : ESmumServiceCentreInUseLBI ));
       
   689         	}
       
   690         }
       
   691     // Character Support 3.0 onwards
       
   692     if ( !iSettingsArrayIndex->Find ( iTypeOfSettings ? 
       
   693             ESmumSendOptCharSupportInUseLBI : ESmumCharSupportInUseLBI, key, index ) )
       
   694     	{
       
   695     	TInt setVal = Item( index );
       
   696 	    // Take actions only if setting is not locked,
       
   697 	    // not ECharSetFullLocked or ECharSetReducedLocked  
       
   698 	    if ( setVal != iCharacterSupport &&
       
   699 	         iCharacterSupport < ECharSetFullLocked )
       
   700 	        {
       
   701 	        if ( iTypeOfSettings ) // Sending option
       
   702 	            {
       
   703 	            iCharacterSupport = setVal;
       
   704 	            }
       
   705 	        else // Main setting, save to CenRep
       
   706 	            {
       
   707 	            iCentralRapository->Set( KSmumCharSupport, setVal );
       
   708 	            }
       
   709 	        }
       
   710     	}
       
   711     // Delivery Report
       
   712     if ( iCSPFeatures & EDeliveryReportSupport )
       
   713         {
       
   714         if ( !iSettingsArrayIndex->Find ( iTypeOfSettings ? 
       
   715             ESmumSendOptDeliveryReportLBI : ESmumDeliveryReportLBI, key, index ) )
       
   716             {
       
   717             iSettings.SetDeliveryReport( Item( index ) == ESmumSettingsYes );
       
   718             }
       
   719         }
       
   720     
       
   721     // Validity Period    
       
   722     if ( iCSPFeatures & EValidityPeriodSupport )
       
   723         {
       
   724         if ( !iSettingsArrayIndex->Find ( iTypeOfSettings ? 
       
   725             ESmumSendOptValidityPeriodLBI : ESmumValidityPeriodLBI, key, index ) )
       
   726             {
       
   727             TTimeIntervalMinutes validityPeriod = iSettings.ValidityPeriod().Int();
       
   728             switch( Item( index ) )
       
   729                 {
       
   730                 case ESmumValidityPeriodHour:
       
   731                     validityPeriod = ( TInt ) ESmsVPHour;
       
   732                     break;
       
   733                 case ESmumValidityPeriodSixHours:
       
   734                     validityPeriod = ( TInt ) ESmsVPSixHours;
       
   735                     break;
       
   736                 case ESmumValidityPeriod24Hours:
       
   737                     validityPeriod = ( TInt ) ESmsVP24Hours;
       
   738                     break;
       
   739                 case ESmumValidityPeriod3Days:   
       
   740                     validityPeriod = ( 3 * ( TInt ) ESmsVP24Hours );// Instead of modifying smutset.h
       
   741                     break;
       
   742                 case ESmumValidityPeriodWeek:
       
   743                     validityPeriod = ( TInt ) ESmsVPWeek;
       
   744                     break;
       
   745                 case ESmumValidityPeriodMaximum:
       
   746                     validityPeriod = ( TInt ) ESmsVPMaximum;
       
   747                     break;
       
   748                 default:
       
   749         #if defined ( _DEBUG )
       
   750                     Panic( ESmsetdlgUnknownValidityChoice );
       
   751         #else
       
   752                     validityPeriod = ( TInt ) ESmsVP24Hours;
       
   753         #endif
       
   754                     break;
       
   755                 }
       
   756             iSettings.SetValidityPeriod( validityPeriod );
       
   757             }
       
   758         }
       
   759     
       
   760     // Preferred Connection
       
   761     if ( !iTypeOfSettings )
       
   762         {
       
   763         if ( !iSettingsArrayIndex->Find ( ESmumPreferredConnectionLBI, key, index ) )
       
   764             {
       
   765             switch( Item( index ))
       
   766                 {
       
   767                 // "prefer GPRS"
       
   768                 case ESmumPreferGPRSConnection :
       
   769                     iSettings.SetSmsBearer( CSmsSettings::ESmsBearerPacketPreferred );
       
   770                     break;
       
   771                 // "prefer GSM"
       
   772                 // case ESmumPreferGSMConnection :
       
   773                 default :
       
   774                     iSettings.SetSmsBearer( CSmsSettings::ESmsBearerCircuitPreferred );
       
   775                     break;
       
   776                 }
       
   777             }
       
   778         }
       
   779 
       
   780     // Reply Via Same Centre
       
   781     if ( iCSPFeatures & EReplyPathSupport && !iRemoveReplyScSetting )
       
   782         {
       
   783         if ( !iSettingsArrayIndex->Find ( iTypeOfSettings ? 
       
   784             ESmumSendOptReplyViaSameCentreLBI : ESmumReplyViaSameCentreLBI, key, index ) )
       
   785             {
       
   786             iSettings.SetReplyPath( Item( index ) == ESmumSettingsYes );
       
   787             }
       
   788         }
       
   789         
       
   790     // REQ:417-48417 Message forward with sender info
       
   791     if (!iTypeOfSettings && iForwardWithSenderSupported)
       
   792         {        
       
   793         if (!iSettingsArrayIndex->Find ( ESmumForwardWithSenderInfoLBI, key, index ))
       
   794             {        
       
   795             iCentralRapository->Set(KForwardWithSenderInfo , Item( index ) == ESmumSettingsYes);
       
   796             }
       
   797         }        
       
   798     // End REQ:417-48417
       
   799     
       
   800     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::ClosingDialogL");
       
   801     }
       
   802 
       
   803 // ----------------------------------------------------
       
   804 // CSmumMainSettingsDialogGSM::SetItem
       
   805 //
       
   806 // ----------------------------------------------------
       
   807 void CSmumMainSettingsDialogGSM::SetItem( TInt aSettingLBIndex, TInt aValue )
       
   808     {
       
   809     iSettingsArray->At( aSettingLBIndex ).iUserText.Copy(
       
   810         ( *iSettingsArray->At( aSettingLBIndex ).iMuiuSettingsItemArray )[aValue]);
       
   811     ( *iSettingsArray )[ aSettingLBIndex ].iCurrentNumber = aValue;
       
   812     }
       
   813 
       
   814 // ----------------------------------------------------
       
   815 // CSmumMainSettingsDialogGSM::Item
       
   816 //
       
   817 // ----------------------------------------------------
       
   818 TInt CSmumMainSettingsDialogGSM::Item( TInt aSettingLBIndex ) const
       
   819     {
       
   820     return iSettingsArray->At( aSettingLBIndex ).iCurrentNumber;
       
   821     }
       
   822 
       
   823 // ----------------------------------------------------
       
   824 // CSmumMainSettingsDialogGSM::CheckOpeningListBoxItemL
       
   825 //
       
   826 // ----------------------------------------------------
       
   827 void CSmumMainSettingsDialogGSM::CheckOpeningListBoxItemL( TBool aEnterPressed )
       
   828     {
       
   829     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::CheckOpeningListBoxItemL");
       
   830     // First get the selected index
       
   831     TInt variatedSelectionIndex = GetVariatedSelectionIndex( iListBox->CurrentItemIndex() );
       
   832     __ASSERT_DEBUG( variatedSelectionIndex >= 0 , Panic( ESmsetdlgInvalidIndex ));
       
   833     // Sending options
       
   834     if ( iTypeOfSettings )
       
   835         {
       
   836         // Focus in "Service centre in use & no SC'es defined
       
   837         if ( ESmumSendOptServiceCentreInUseLBI == variatedSelectionIndex && 
       
   838             iSettings.ServiceCenterCount() == 0 )
       
   839             {
       
   840             if ( iUseSimSCsOnly ) // Only Sim SC's variation is on
       
   841 	            { // No centres -> No sms sending
       
   842 	            SmumUtil::ShowInformationNoteL( R_QTN_MCE_SETTINGS_SMS_SERVICE_DISABLED );	
       
   843 	            }
       
   844 	        else
       
   845 		        {
       
   846 		        SmumUtil::ShowInformationNoteL( R_QTN_SMS_SETTINGS_INFO_NO_SC );
       
   847 		        }
       
   848             }
       
   849         // Focus in "Service centre in use & replypath provided
       
   850         else if ( ESmumSendOptServiceCentreInUseLBI == variatedSelectionIndex
       
   851                 && iSettingsArray->ReplyPathProvided())
       
   852             {
       
   853             CAknQueryDialog* dlg = CAknQueryDialog::NewL();
       
   854             if ( dlg->ExecuteLD( R_OVERRIDE_PROVIDED_REPLYPATH_QUERY ))
       
   855                 {
       
   856                 if (iSettingsArray->EditItemL( variatedSelectionIndex, EFalse ))// EFalse forcing opening
       
   857                     {
       
   858                     iSettingsArray->SetReplyPath( EFalse );
       
   859                     iSmsHeader->Message().SetServiceCenterAddressL( KNullDesC );
       
   860                     iListBox->DrawNow();
       
   861                     }
       
   862                 }
       
   863             }
       
   864         // Focus in "Service centre in use
       
   865         else if ( ESmumSendOptServiceCentreInUseLBI == variatedSelectionIndex )
       
   866             {
       
   867             iSettingsArray->EditItemL(
       
   868                 iListBox->CurrentItemIndex(), 
       
   869                 EFalse );// EFalse forcing opening
       
   870             iListBox->DrawNow();
       
   871             }
       
   872         // Simple listbox item
       
   873         else if ( ESmumSendOptCharSupportInUseLBI <= variatedSelectionIndex )
       
   874             {
       
   875             if ( variatedSelectionIndex == ESmumSendOptCharSupportInUseLBI )
       
   876                 {
       
   877                 // Check is the editing allowed
       
   878                 if ( iCharacterSupport == ECharSetFullLocked || 
       
   879                      iCharacterSupport == ECharSetReducedLocked )
       
   880                     {
       
   881                     // Display note and exit
       
   882                     SmumUtil::ShowInformationNoteL( R_QTN_MCE_INFO_CANNOT_CHANGE_SMS_CHARS );
       
   883                     // return immediatelly
       
   884                     return;
       
   885                     }
       
   886                 }
       
   887             iSettingsArray->EditItemL(
       
   888                 iListBox->CurrentItemIndex(), 
       
   889                 aEnterPressed );
       
   890             iListBox->DrawNow();
       
   891             }
       
   892         else
       
   893             {// Lint
       
   894             }
       
   895         }
       
   896     // Sms Settings 
       
   897     else
       
   898         {
       
   899         TBool goingToExit = EFalse;
       
   900 
       
   901         // Check if focus in two first ones and non sc defined
       
   902         if ( ESmumServiceCentreInUseLBI >= variatedSelectionIndex && 
       
   903             iSettings.ServiceCenterCount() == 0 )
       
   904             {
       
   905             //Save the used menu item to later use
       
   906             iStoreSettingsIndex = iListBox->CurrentItemIndex();
       
   907             if ( iUseSimSCsOnly ) // Only Sim SC's variation is on
       
   908 	            { // No centres -> No sms sending
       
   909 	            SmumUtil::ShowInformationNoteL( R_QTN_MCE_SETTINGS_SMS_SERVICE_DISABLED );	
       
   910 	            }
       
   911 	        else
       
   912 		        {
       
   913 	            // Run "create new sc?" -query
       
   914 	            CAknQueryDialog* dlg = CAknQueryDialog::NewL();
       
   915 	            if ( dlg->ExecuteLD( R_CREATE_NEW_SC_QUERY ))
       
   916 	                {
       
   917 	                TBuf<KSmumStringLength> name;
       
   918 	                TBuf<KSmumStringLength> number;
       
   919 	               
       
   920 	                // Add SC dialog
       
   921 	                TInt addSCDlgExitCode = ESmumSmsSettingsInitialvalue;
       
   922 	                CSmumAddEditServiceCentreDialog* scItemDialog = 
       
   923 	                    new ( ELeave ) CSmumAddEditServiceCentreDialog(
       
   924 	                        name, number, addSCDlgExitCode, iHelpFeatureSupported );
       
   925 	                CleanupStack::PushL( scItemDialog );
       
   926 	                scItemDialog->ConstructL( R_SMS_SERVICECENTRE_ITEM_CHOICE_MENUBAR );
       
   927 	                CleanupStack::Pop();// scItemDialog
       
   928 	                scItemDialog->ExecuteLD( R_ADD_EDIT_SERVICECENTRES );
       
   929 	                if ( addSCDlgExitCode == ESmumSmsSettingsMenuExit ||
       
   930 	                     addSCDlgExitCode == ESmumSmsSettingsSystemExit )
       
   931 	                    { // Exiting
       
   932 	                    goingToExit = ETrue;
       
   933 	                    }
       
   934 	                                    
       
   935 	                // Update sc array and launch service centres-dialog
       
   936 	                // if values ok, otherwise reset the listbox.
       
   937 	                if ( name.Size() && number.Size()) 
       
   938 	                    {
       
   939 	                    iSettings.AddServiceCenterL( name, number );
       
   940 	                    if ( goingToExit )
       
   941 	                        { // Exiting
       
   942 	                        iExitCode = addSCDlgExitCode;
       
   943 	                        DoDelayedExitL( 0 );
       
   944 	                        return;
       
   945 	                        }
       
   946 	                    TInt centresDlgExitCode = LaunchServiceCentresDialogL();
       
   947 	                    if ( centresDlgExitCode == ESmumSmsSettingsMenuExit ||
       
   948 	                         centresDlgExitCode == ESmumSmsSettingsSystemExit )
       
   949 	                        { // Exiting
       
   950 	                        iExitCode = centresDlgExitCode;
       
   951 	                        DoDelayedExitL( 0 );
       
   952 	                        return;
       
   953 	                        }
       
   954 	                    if( !iRemoveReplyScSetting )   
       
   955 	                    	{
       
   956 	                    	UpdateSCInUseArrayL();
       
   957 	                    	}
       
   958 	                    iListBox->DrawNow();
       
   959 	                    }
       
   960 	                else
       
   961 	                    {
       
   962 	                    if ( goingToExit )
       
   963 	                        {// Exiting
       
   964 	                        iExitCode = addSCDlgExitCode;
       
   965 	                        DoDelayedExitL( 0 );
       
   966 	                        return;
       
   967 	                        }
       
   968 	                    else
       
   969 	                        {
       
   970 	                        iListBox->Reset();
       
   971 	                        //Set the correct item in previous menu
       
   972 	                        iListBox->SetCurrentItemIndexAndDraw(iStoreSettingsIndex);
       
   973 	                        }
       
   974 	                    }
       
   975 	                }
       
   976 		        }
       
   977             }
       
   978         // Check if focus in "service centres"
       
   979         else if ( ESmumServiceCentresLBI == variatedSelectionIndex )
       
   980             {
       
   981             TInt centresDlgExitCode = LaunchServiceCentresDialogL();
       
   982             if ( centresDlgExitCode == ESmumSmsSettingsMenuExit ||
       
   983                  centresDlgExitCode == ESmumSmsSettingsSystemExit )
       
   984                 { // Exiting
       
   985                 iExitCode = centresDlgExitCode;
       
   986                 DoDelayedExitL( 0 );
       
   987                 return;
       
   988                 }
       
   989             if( !iRemoveReplyScSetting )   
       
   990             	{
       
   991             	UpdateSCInUseArrayL();
       
   992             	}
       
   993             iListBox->DrawNow();
       
   994             }
       
   995         // Check if focus in "Service centre in use"
       
   996         else if ( ESmumServiceCentreInUseLBI == variatedSelectionIndex )
       
   997             {
       
   998             iSettingsArray->EditItemL(
       
   999                 iListBox->CurrentItemIndex(), 
       
  1000                 EFalse ); // EFalse forcing opening
       
  1001             // Save default Sc
       
  1002             iSettings.SetDefaultServiceCenter( Item(
       
  1003                 iTypeOfSettings ? 
       
  1004                 ESmumSendOptServiceCentreInUseLBI : ESmumServiceCentreInUseLBI ));
       
  1005             iListBox->DrawNow();
       
  1006             }
       
  1007 		// EmailOverSms
       
  1008         else if ( iEmailFeatureSupported &&
       
  1009                     ESmumEmailServiceCentreLBI == variatedSelectionIndex )
       
  1010         	{
       
  1011             DisplayEmailOverSmsSettingsL();
       
  1012             }
       
  1013         // Focus must be then elsewhere
       
  1014         else if ( ESmumCharSupportInUseLBI <= variatedSelectionIndex )
       
  1015             {
       
  1016             if ( variatedSelectionIndex == ESmumCharSupportInUseLBI )
       
  1017                 {
       
  1018                 // Check is the editing allowed
       
  1019                 if ( iCharacterSupport == ECharSetFullLocked || 
       
  1020                      iCharacterSupport == ECharSetReducedLocked )
       
  1021                     {
       
  1022                     // Display note and exit
       
  1023                     SmumUtil::ShowInformationNoteL( R_QTN_MCE_INFO_CANNOT_CHANGE_SMS_CHARS );
       
  1024                     return;
       
  1025                     }
       
  1026                 }
       
  1027             // Simple listbox item
       
  1028             iSettingsArray->EditItemL(
       
  1029                 iListBox->CurrentItemIndex(), 
       
  1030                 aEnterPressed);
       
  1031             iListBox->DrawNow();
       
  1032             }
       
  1033         else
       
  1034             {// Lint
       
  1035             }
       
  1036         }
       
  1037     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::CheckOpeningListBoxItemL - LAST");
       
  1038     // panic
       
  1039     }
       
  1040 
       
  1041 // ----------------------------------------------------
       
  1042 // CSmumMainSettingsDialogGSM::LaunchServiceCentresDialogL
       
  1043 //
       
  1044 // ----------------------------------------------------
       
  1045 TInt CSmumMainSettingsDialogGSM::LaunchServiceCentresDialogL()
       
  1046     {
       
  1047     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::LaunchServiceCentresDialogL");
       
  1048     TInt exitCode = ESmumSmsSettingsInitialvalue;
       
  1049     // Launch Service Centres dialog
       
  1050     CSmumServiceCentresDialog* servicecentreDialog = 
       
  1051         CSmumServiceCentresDialog::NewL(
       
  1052         iSettings, exitCode, R_SMS_SERVICECENTRES_CHOICE_MENUBAR, iHelpFeatureSupported, iUseSimSCsOnly );
       
  1053     servicecentreDialog->ExecuteLD( R_SERVICECENTRELIST_DIALOG );
       
  1054     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::LaunchServiceCentresDialogL");
       
  1055     return exitCode;
       
  1056     }
       
  1057 
       
  1058 // ----------------------------------------------------
       
  1059 // CSmumMainSettingsDialogGSM::LaunchHelpL
       
  1060 // launch help using context
       
  1061 // 
       
  1062 // ----------------------------------------------------
       
  1063 void CSmumMainSettingsDialogGSM::LaunchHelpL()
       
  1064     {    
       
  1065     if ( iHelpFeatureSupported )
       
  1066         {
       
  1067         CCoeAppUi* editorAppUi = STATIC_CAST(CCoeAppUi*, ControlEnv()->AppUi());
       
  1068         CArrayFix<TCoeHelpContext>* helpContext = editorAppUi->AppHelpContextL();   
       
  1069         HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), helpContext );
       
  1070         }
       
  1071     }
       
  1072 
       
  1073 
       
  1074 // ----------------------------------------------------
       
  1075 // CSmumMainSettingsDialogGSM::GetHelpContext
       
  1076 // returns helpcontext as aContext
       
  1077 // 
       
  1078 // ----------------------------------------------------
       
  1079 void CSmumMainSettingsDialogGSM::GetHelpContext
       
  1080         (TCoeHelpContext& aContext) const
       
  1081     {    
       
  1082     const TUid KUidMce ={0x100058C5};      
       
  1083     aContext.iMajor = KUidMce;
       
  1084     aContext.iContext = KMCE_HLP_SETTINGS_SMS;
       
  1085     }
       
  1086 
       
  1087 // ----------------------------------------------------
       
  1088 // CSmumMainSettingsDialogGSM::GetVariatedSelectionIndex
       
  1089 //
       
  1090 // ---------------------------------------------------------------------------
       
  1091 TInt CSmumMainSettingsDialogGSM::GetVariatedSelectionIndex( 
       
  1092         const TInt aListSelection ) const
       
  1093     {
       
  1094 	TInt variatedValue ( aListSelection );
       
  1095 	TBool isScInUseRemoved( EFalse );
       
  1096 	if ( iUseSimSCsOnly && iSettings.ServiceCenterCount() == 0 )
       
  1097         {
       
  1098         if ( iTypeOfSettings ? 
       
  1099         	 aListSelection >= ESmumSendOptServiceCentreInUseLBI : 
       
  1100         	 aListSelection >= ESmumServiceCentreInUseLBI )
       
  1101             {
       
  1102             variatedValue += 1; // removed
       
  1103             isScInUseRemoved = ETrue;
       
  1104             }
       
  1105         }
       
  1106     if ( !iEmailFeatureSupported ) // EmailFeature on
       
  1107         {
       
  1108         // Modifies only main settings
       
  1109         if ( !iTypeOfSettings && isScInUseRemoved ?
       
  1110         	 aListSelection >= ( ESmumEmailServiceCentreLBI - 1 ) : 
       
  1111         	 aListSelection >= ESmumEmailServiceCentreLBI )
       
  1112             {
       
  1113             variatedValue += 1; // ESmumEmailServiceCentreLBI is removed
       
  1114             }
       
  1115         else if ( iRemoveReplyScSetting )
       
  1116         	{
       
  1117         	if ( iTypeOfSettings ? 
       
  1118         	 aListSelection >= ESmumSendOptServiceCentreInUseLBI : 
       
  1119         	 aListSelection >= ESmumServiceCentreInUseLBI )
       
  1120 	            {
       
  1121 	            variatedValue += 2; // ESmumEmailServiceCentreLBI
       
  1122 	            }					// ServiceCentreInUseLBI are removed
       
  1123             }
       
  1124         }
       
  1125     // REQ:417-48417 Message forward with sender info
       
  1126     if (!iTypeOfSettings)
       
  1127         {
       
  1128         if (!iForwardWithSenderSupported && variatedValue >= ESmumForwardWithSenderInfoLBI)
       
  1129             {
       
  1130             variatedValue ++; // if not support this feature, ESmumForwardWithSenderInfoLBI is removed
       
  1131             }
       
  1132         }
       
  1133     // End REQ:417-48417
       
  1134     return variatedValue;    
       
  1135     }
       
  1136 
       
  1137 // ---------------------------------------------------------------------------
       
  1138 // CSmumMainSettingsDialogGSM::DeleteVariatedSettings
       
  1139 // 
       
  1140 // ---------------------------------------------------------------------------
       
  1141 void CSmumMainSettingsDialogGSM::DeleteVariatedSettings()
       
  1142     {
       
  1143     SMUMLOGGER_ENTERFN("CSmumMainSettingsDialogGSM::DeleteVariatedSettings")
       
  1144     SMUMLOGGER_WRITE_FORMAT(
       
  1145         "DeleteVariatedSettings - Type of Settings :%d",
       
  1146         iTypeOfSettings )
       
  1147     TBool needToBeCompressed = EFalse;
       
  1148         
       
  1149     if ( !( iCSPFeatures & EReplyPathSupport ) || iRemoveReplyScSetting )
       
  1150         {
       
  1151         SMUMLOGGER_WRITE(
       
  1152             "DeleteVariatedSettings - EReplyPathSupport")
       
  1153         DeleteSettingItemFromArrays( iTypeOfSettings ? 
       
  1154             ESmumSendOptReplyViaSameCentreLBI : ESmumReplyViaSameCentreLBI );
       
  1155         needToBeCompressed = ETrue;
       
  1156         }
       
  1157     if ( !( iCSPFeatures & EValidityPeriodSupport ))
       
  1158         {
       
  1159         SMUMLOGGER_WRITE(
       
  1160             "DeleteVariatedSettings - EValidityPeriodSupport")
       
  1161         DeleteSettingItemFromArrays( iTypeOfSettings ? 
       
  1162                 ESmumSendOptValidityPeriodLBI : ESmumValidityPeriodLBI );
       
  1163         needToBeCompressed = ETrue;
       
  1164         }
       
  1165     if ( !( iCSPFeatures & EDeliveryReportSupport ))
       
  1166         {
       
  1167         SMUMLOGGER_WRITE(
       
  1168             "DeleteVariatedSettings - EDeliveryReportSupport")
       
  1169         DeleteSettingItemFromArrays( iTypeOfSettings ? 
       
  1170                 ESmumSendOptDeliveryReportLBI : ESmumDeliveryReportLBI );
       
  1171         needToBeCompressed = ETrue;
       
  1172         }
       
  1173 	// Main settings and no email support
       
  1174     if ( !iEmailFeatureSupported && !iTypeOfSettings )
       
  1175         {
       
  1176         SMUMLOGGER_WRITE(
       
  1177             "DeleteVariatedSettings - EmailFeatureSupport")
       
  1178         DeleteSettingItemFromArrays( ESmumEmailServiceCentreLBI );
       
  1179         needToBeCompressed = ETrue;
       
  1180         }        
       
  1181     TBool isReplyMessage = EFalse; 
       
  1182     if(iTypeOfSettings)
       
  1183     	{
       
  1184     	isReplyMessage = iSmsHeader->Submit().ReplyPath();
       
  1185     	}
       
  1186 	if ( iUseSimSCsOnly && iSettings.ServiceCenterCount() == 0 || 
       
  1187 		(iRemoveReplyScSetting && isReplyMessage ))
       
  1188         {
       
  1189         DeleteSettingItemFromArrays(iTypeOfSettings ? 
       
  1190         	 ESmumSendOptServiceCentreInUseLBI : ESmumServiceCentreInUseLBI );
       
  1191         needToBeCompressed = ETrue;
       
  1192         }
       
  1193         
       
  1194     // REQ:417-48417 Message forward with sender info    
       
  1195     if (!iForwardWithSenderSupported && !iTypeOfSettings)
       
  1196         {
       
  1197         TInt index;
       
  1198         TKeyArrayFix key(0, ECmpTInt); 
       
  1199         TInt found = iSettingsArrayIndex->Find(ESmumForwardWithSenderInfoLBI, key, index);
       
  1200         if (0 == found)
       
  1201             {
       
  1202             DeleteSettingItemFromArrays(index);
       
  1203             needToBeCompressed = ETrue;
       
  1204             }
       
  1205         }
       
  1206     // End REQ:417-48417
       
  1207         
       
  1208     if ( needToBeCompressed )
       
  1209         {
       
  1210         iSettingsArray->Compress();
       
  1211         iSettingsArrayIndex->Compress();
       
  1212         }
       
  1213     SMUMLOGGER_LEAVEFN("CSmumMainSettingsDialogGSM::DeleteVariatedSettings")
       
  1214     }
       
  1215 
       
  1216 // ---------------------------------------------------------------------------
       
  1217 // CSmumMainSettingsDialogGSM::DeleteSettingItemFromArrays
       
  1218 // 
       
  1219 // ---------------------------------------------------------------------------
       
  1220 void CSmumMainSettingsDialogGSM::DeleteSettingItemFromArrays( TInt aIndex )
       
  1221     {
       
  1222     SMUMLOGGER_ENTERFN("CSmumMainSettingsDialogGSM::DeleteSettingItemFromArrays")
       
  1223     // Delete from CMuiuSettingsArray
       
  1224     delete iSettingsArray->At( aIndex ).iMuiuSettingsItemArray;
       
  1225     iSettingsArray->Delete( aIndex );
       
  1226     // Delete form index array
       
  1227     iSettingsArrayIndex->Delete( aIndex );
       
  1228     SMUMLOGGER_WRITE_FORMAT(
       
  1229         "DeleteSettingItemFromArrays - Delete Setting :%d",
       
  1230         aIndex )
       
  1231     SMUMLOGGER_LEAVEFN("CSmumMainSettingsDialogGSM::DeleteSettingItemFromArrays")
       
  1232     }
       
  1233 
       
  1234 // ---------------------------------------------------------------------------
       
  1235 // CSmumMainSettingsDialogGSM::ReadCspSupportBitsL
       
  1236 // 
       
  1237 // ---------------------------------------------------------------------------
       
  1238 void CSmumMainSettingsDialogGSM::ReadCspSupportBitsL()
       
  1239     {
       
  1240     SMUMLOGGER_ENTERFN("CSmumMainSettingsDialogGSM::ReadCspSupportBitsL")
       
  1241     // Initialize as all features supported
       
  1242     iCSPFeatures =  EValidityPeriodSupport
       
  1243                     |EProtocolIDSupport
       
  1244                     |EDeliveryReportSupport
       
  1245                     |EReplyPathSupport;
       
  1246     // Bit values changed only if feature is supported
       
  1247     TInt tmpInt( KErrNotFound );
       
  1248 
       
  1249     tmpInt = SmumUtil::CheckVariationFlagsL( KCRUidMuiuVariation, KMuiuMceFeatures );
       
  1250     // Read from bits from sim cache
       
  1251     if ( tmpInt & KMceFeatureIdCSPSupport ) 
       
  1252         {
       
  1253         SMUMLOGGER_WRITE(
       
  1254             "ReadCspSupportBitsL - KMceFeatureIdCSPSupport supported" )
       
  1255         RCustomerServiceProfileCache* cspProfile = 
       
  1256             new (ELeave) RCustomerServiceProfileCache;    
       
  1257         __ASSERT_DEBUG( cspProfile, Panic( ESmsuNullPointer ) );
       
  1258         TInt error = cspProfile->Open();
       
  1259         if( KErrNone == error )
       
  1260             {
       
  1261             // Get tele services flags from CSP
       
  1262             RMobilePhone::TCspTeleservices params;
       
  1263             // If not supported (-5) or any other error
       
  1264             // we assume all settings are supported
       
  1265             error = cspProfile->CspTeleServices( params );
       
  1266             if ( KErrNone == error ) 
       
  1267                 {
       
  1268                 SMUMLOGGER_WRITE_FORMAT(
       
  1269                     "ReadCspSupportBitsL - RMobilePhone::TCspTeleservices #%d", params )
       
  1270                 if( 0 == ( params&RMobilePhone::KCspValidityPeriod ) ) 
       
  1271                     {
       
  1272                     SMUMLOGGER_WRITE(
       
  1273                         "ReadCspSupportBitsL - KCspValidityPeriod not supported" )
       
  1274                     iCSPFeatures &= ~EValidityPeriodSupport;
       
  1275                     }
       
  1276                 if( 0 == ( params&RMobilePhone::KCspProtocolID ) ) 
       
  1277                     {
       
  1278                     SMUMLOGGER_WRITE(
       
  1279                         "ReadCspSupportBitsL - KCspProtocolID not supported" )
       
  1280                     iCSPFeatures &= ~EProtocolIDSupport;
       
  1281                     }
       
  1282                 if( 0 == ( params&RMobilePhone::KCspDelConf ) ) 
       
  1283                     {
       
  1284                     SMUMLOGGER_WRITE(
       
  1285                         "ReadCspSupportBitsL - KCspDelConf not supported" )
       
  1286                     iCSPFeatures &= ~EDeliveryReportSupport;
       
  1287                     }
       
  1288                 if( 0 == ( params&RMobilePhone::KCspReplyPath ) ) 
       
  1289                     {
       
  1290                     SMUMLOGGER_WRITE(
       
  1291                         "ReadCspSupportBitsL - KCspReplyPath not supported" )
       
  1292                     iCSPFeatures &= ~EReplyPathSupport;
       
  1293                     }
       
  1294                 }
       
  1295             else
       
  1296                 {
       
  1297                 SMUMLOGGER_WRITE_FORMAT(
       
  1298                     "ReadCspSupportBitsL - cspProfile->CspTeleServices() #%d", error )
       
  1299                 }
       
  1300             cspProfile->Close();
       
  1301             }
       
  1302         else
       
  1303             {
       
  1304             SMUMLOGGER_WRITE_FORMAT(
       
  1305                     "ReadCspSupportBitsL - cspProfile->Open() #%d", error )
       
  1306             }
       
  1307         delete cspProfile;    
       
  1308         }
       
  1309     SMUMLOGGER_LEAVEFN("CSmumMainSettingsDialogGSM::ReadCspSupportBitsL")
       
  1310     }
       
  1311 
       
  1312 // ----------------------------------------------------
       
  1313 // CSmumMainSettingsDialogGSM::ReadCharSetSupport
       
  1314 // reads the setting value and sets it to member variable
       
  1315 // 
       
  1316 // ----------------------------------------------------
       
  1317 TInt CSmumMainSettingsDialogGSM::ReadCharSetSupport()
       
  1318     {
       
  1319     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::ReadCharSetSupport");
       
  1320     __ASSERT_DEBUG( iCentralRapository, Panic( ESmsuNullPointer ));
       
  1321     TInt tempCharSupport( ECharSetReduced );
       
  1322     if ( iCentralRapository )
       
  1323         {
       
  1324         if ( KErrNone == iCentralRapository->Get( 
       
  1325                 KSmumCharSupport, tempCharSupport ) )
       
  1326             {
       
  1327             // Sanity check for the read value ( accepted values between 0-3 )
       
  1328             if ( ECharSetReducedLocked<tempCharSupport || ECharSetFull>tempCharSupport )
       
  1329                 {
       
  1330                 // Set the member and the return value to Reduced mode
       
  1331                 tempCharSupport = iCharacterSupport = ECharSetReduced;
       
  1332                 }
       
  1333             else
       
  1334                 {
       
  1335                 // Use in member as it was read
       
  1336                 iCharacterSupport = tempCharSupport;
       
  1337                 // But we may have to modify the return value ...
       
  1338                 // The return value is used as setting item index
       
  1339                 // and it must be 0(ECharSetFull) or 1(ECharSetReduced)
       
  1340                 // 2 -> 0, 3 -> 1
       
  1341                 if ( ECharSetFullLocked==tempCharSupport || 
       
  1342                      ECharSetReducedLocked==tempCharSupport )
       
  1343                     {
       
  1344                     tempCharSupport -= KSmumCharSettingDeduction;
       
  1345                     }
       
  1346                 }
       
  1347             __ASSERT_DEBUG( tempCharSupport==ECharSetFull ||
       
  1348                             tempCharSupport==ECharSetReduced, 
       
  1349                             Panic( ESmsetdlgInvalidIndex ));
       
  1350             }
       
  1351         }
       
  1352     SMUMLOGGER_WRITE_FORMAT(" CSmumMainSettingsDialogGSM::ReadCharSetSupport - %d", tempCharSupport);
       
  1353     SMUMLOGGER_LEAVEFN(" CSmumMainSettingsDialogGSM::ReadCharSetSupport");
       
  1354     return tempCharSupport;
       
  1355     }
       
  1356 
       
  1357 // ---------------------------------------------------------------------------
       
  1358 // CSmumMainSettingsDialogGSM::DisplayEmailOverSmsSettingsL
       
  1359 // 
       
  1360 // ---------------------------------------------------------------------------
       
  1361 void CSmumMainSettingsDialogGSM::DisplayEmailOverSmsSettingsL()
       
  1362     {
       
  1363     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::DisplayEmailOverSmsSettingsL");
       
  1364     // Add SC dialog
       
  1365     TBuf<KSmumStringLength> gateway;
       
  1366     TBuf<KSmumStringLength> sc;
       
  1367     TBool modifiable = ETrue;
       
  1368     // Read current values
       
  1369     TRAP_IGNORE( SmumUtil::ReadEmailOverSmsSettingsL( 
       
  1370         sc, 
       
  1371         gateway, 
       
  1372         modifiable ) );
       
  1373 
       
  1374     TInt addEmailSettingsDlgExitCode = ESmumSmsSettingsInitialvalue;
       
  1375     CSmumEmailServiceCentreDialog* scItemDialog = 
       
  1376         new ( ELeave ) CSmumEmailServiceCentreDialog(
       
  1377             gateway, 
       
  1378             sc,
       
  1379             modifiable, 
       
  1380             addEmailSettingsDlgExitCode, 
       
  1381             iHelpFeatureSupported );
       
  1382 
       
  1383     CleanupStack::PushL( scItemDialog );
       
  1384     scItemDialog->ConstructL( R_SMS_SERVICECENTRE_ITEM_CHOICE_MENUBAR );
       
  1385     CleanupStack::Pop();// scItemDialog
       
  1386     scItemDialog->ExecuteLD( R_ADD_EDIT_SERVICECENTRES );
       
  1387     if ( addEmailSettingsDlgExitCode == ESmumSmsSettingsSystemExit )
       
  1388         { // Exiting
       
  1389         iExitCode = ESmumSmsSettingsMenuExit;
       
  1390         DoDelayedExitL( 0 );
       
  1391         return;
       
  1392         }
       
  1393     else // ESmumSmsSettingsBack, ESmumSmsSettingsMenuExit
       
  1394         {
       
  1395         // Save settings if modifiable
       
  1396         if ( modifiable && gateway.Length() && sc.Length() )
       
  1397             {
       
  1398             TRAP_IGNORE( SmumUtil::WriteEmailOverSmsSettingsL( 
       
  1399                 sc, 
       
  1400                 gateway, 
       
  1401                 modifiable ) );
       
  1402             }
       
  1403         // Settings ok and saved - Exit messaging
       
  1404 		if ( addEmailSettingsDlgExitCode == ESmumSmsSettingsMenuExit )
       
  1405             {
       
  1406             iExitCode = ESmumSmsSettingsMenuExit;
       
  1407             DoDelayedExitL( 0 );
       
  1408             return;
       
  1409             }
       
  1410         }
       
  1411     }
       
  1412 
       
  1413 // ---------------------------------------------------------
       
  1414 // CSmumMainSettingsDialogGSM::HandleResourceChange
       
  1415 //
       
  1416 // ---------------------------------------------------------
       
  1417 void CSmumMainSettingsDialogGSM::HandleResourceChange( TInt aType )
       
  1418     {
       
  1419     CEikDialog::HandleResourceChange( aType );
       
  1420     }
       
  1421 // ---------------------------------------------------------
       
  1422 // CSmumMainSettingsDialogGSM::UpdateMskL
       
  1423 //
       
  1424 // ---------------------------------------------------------
       
  1425 void CSmumMainSettingsDialogGSM::UpdateMskL( )
       
  1426 	{
       
  1427 	TInt resId = 0;
       
  1428 	TInt index = iListBox->CurrentItemIndex( );
       
  1429 	
       
  1430 	if ( index == KErrNotFound )
       
  1431 	    return;
       
  1432 	
       
  1433 	if( index == 0 )
       
  1434 		{ // Message type
       
  1435 		resId = R_SMUM_MSK_BUTTON_OPEN;
       
  1436 		}
       
  1437 	else
       
  1438 		{ // Char set
       
  1439 		resId = R_SMUM_MSK_BUTTON_CHANGE;
       
  1440 		}
       
  1441 		
       
  1442     if (resId != iMskId )
       
  1443         {
       
  1444         CEikButtonGroupContainer& cba = ButtonGroupContainer( );
       
  1445         const TInt KMskPosition = 3;
       
  1446         cba.SetCommandL( KMskPosition, resId );
       
  1447         cba.DrawDeferred( );    
       
  1448         iMskId = resId;        
       
  1449         }
       
  1450     
       
  1451 	}
       
  1452 	
       
  1453 // ---------------------------------------------------------
       
  1454 // CSmumMainSettingsDialogGSM::DoDelayedExitL
       
  1455 // ---------------------------------------------------------
       
  1456 void CSmumMainSettingsDialogGSM::DoDelayedExitL( const TInt aDelay )
       
  1457     {
       
  1458     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::DoDelayedExitL");
       
  1459     delete iIdle;
       
  1460     iIdle = 0;
       
  1461     iIdle = CPeriodic::NewL( EPriorityNormal - 1 );
       
  1462     iIdle->Start(   aDelay,
       
  1463                     aDelay,
       
  1464                     TCallBack( DelayedExit, this ) );
       
  1465     }
       
  1466 
       
  1467 // ---------------------------------------------------------
       
  1468 // CSmumMainSettingsDialogGSM::DelayedExit
       
  1469 // ---------------------------------------------------------
       
  1470 TInt CSmumMainSettingsDialogGSM::DelayedExit( TAny* aThis )
       
  1471     {
       
  1472     SMUMLOGGER_ENTERFN(" CSmumMainSettingsDialogGSM::DelayedExit");
       
  1473     CSmumMainSettingsDialogGSM* settings = static_cast<CSmumMainSettingsDialogGSM*>( aThis );
       
  1474     TRAP_IGNORE( settings->ClosingDialogL() ); // to be sure of not leaving and exiting
       
  1475     CAknEnv::RunAppShutter( );
       
  1476     return KErrNone;
       
  1477     }
       
  1478 //  End of File  
       
  1479