wlansecuritysettings/wlaneapsettingsui/pap/configui/src/papuiview.cpp
changeset 22 093cf0757204
parent 20 8b3129ac4c0f
child 24 32d555d93984
child 29 77618ad58aba
child 33 938269283a16
equal deleted inserted replaced
20:8b3129ac4c0f 22:093cf0757204
     1 /*
       
     2 * Copyright (c) 2001-2010 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 the License "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: Implementation of PAP UI settings dialog
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 14 %
       
    20 */
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include "papuiview.h"
       
    24 #include "papuisettingarray.h"
       
    25 #include "papuipwsettingitem.h"
       
    26 #include "papui.hrh"
       
    27 #include <papui.rsg>
       
    28 #include <eikdialg.h>
       
    29 #include <AknDialog.h>
       
    30 #include <aknlists.h>
       
    31 #include <akntextsettingpage.h>
       
    32 #include <aknsettingitemlist.h>
       
    33 #include <aknnavi.h>
       
    34 #include <aknnavide.h>
       
    35 #include <aknnotewrappers.h>
       
    36 #include <StringLoader.h>
       
    37 #include <EapTlsPeapUiConnection.h>
       
    38 #include <EapTlsPeapUiDataConnection.h>
       
    39 #include <EapTlsPeapUiTlsPeapData.h>
       
    40 #include <featmgr.h>
       
    41 #include <hlplch.h>
       
    42 
       
    43 
       
    44 // CONSTANTS
       
    45 // UID of general settings app, in which help texts are included
       
    46 const TUid KHelpUidPlugin = { 0x100058EC };
       
    47  
       
    48 // MODULE DATA STRUCTURES
       
    49 enum TSettingIds
       
    50     {
       
    51     EUsernameItem=0,
       
    52     EPasswordPromptItem,
       
    53     EPasswordItem
       
    54     };
       
    55 
       
    56 
       
    57 // ============================ MEMBER FUNCTIONS ===============================
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // CPapUiDialog::CPapUiDialog
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 CPapUiDialog::CPapUiDialog( CEapTlsPeapUiConnection* aConnection, 
       
    64                               TInt& aButtonId ) 
       
    65 : CAknDialog(),
       
    66   iConnection( aConnection ),
       
    67   iNaviPane( 0 ), 
       
    68   iNaviDecorator( 0 ),   
       
    69   iButtonId( &aButtonId ),
       
    70   iSettingPwPrompt( ETrue ),
       
    71   iIsUIConstructionCompleted( EFalse ),
       
    72   iUsernameCancelled( EFalse )
       
    73     {    
       
    74     }
       
    75 
       
    76 
       
    77 // ---------------------------------------------------------
       
    78 // CPapUiDialog::ConstructAndRunLD
       
    79 // ---------------------------------------------------------
       
    80 //
       
    81 TInt CPapUiDialog::ConstructAndRunLD( TInt aResourceId )
       
    82     {
       
    83     CleanupStack::PushL( this );
       
    84 
       
    85     iSettingArray = CPapSettingItemArray::NewL();
       
    86     
       
    87     User::LeaveIfError( iConnection->Connect() );
       
    88 
       
    89     // Basic data
       
    90     iDataConnection = iConnection->GetDataConnection();
       
    91     if ( iDataConnection == 0 )
       
    92         {
       
    93         User::Leave( KErrNoMemory );
       
    94         }
       
    95     User::LeaveIfError( iDataConnection->Open() );
       
    96     User::LeaveIfError( iDataConnection->GetData( &iUiData ) );
       
    97         
       
    98     //Copy the eapol UI data to the temporary data shown on the setting UI
       
    99     iSettingUsername.Copy( iUiData->GetPapUserName() );
       
   100     iSettingPwPrompt = *( iUiData->GetPapPasswordPrompt() );
       
   101     iSettingPassword.Copy( iUiData->GetPapPassword() );    
       
   102 
       
   103     #if defined(_DEBUG) || defined(DEBUG)    
       
   104     RDebug::Print(_L("When read from eapol, iSettingUsername = %S"), &iSettingUsername );
       
   105     RDebug::Print(_L("When read from eapol, iSettingPwPrompt = %d"), iSettingPwPrompt );
       
   106     RDebug::Print(_L("When read from eapol, iSettingPassword = %S"), &iSettingPassword );
       
   107     #endif    
       
   108     
       
   109     FeatureManager::InitializeLibL();
       
   110     
       
   111     ConstructL( R_PAP_MENUBAR );
       
   112     
       
   113     // ExecuteLD will PushL( this ), so we have to Pop it first...
       
   114     CleanupStack::Pop( this );
       
   115     
       
   116     return CAknDialog::ExecuteLD( aResourceId );
       
   117     }
       
   118     
       
   119 
       
   120 // -----------------------------------------------------------------------------
       
   121 // CPapUiDialog::~CPapUiDialog
       
   122 // -----------------------------------------------------------------------------
       
   123 //
       
   124 CPapUiDialog::~CPapUiDialog()
       
   125     {
       
   126 
       
   127     delete iNaviDecorator;
       
   128             
       
   129     if ( iSettingArray )
       
   130         {
       
   131         iSettingArray->Array()->ResetAndDestroy();
       
   132         delete iSettingArray;
       
   133         }
       
   134 
       
   135     iSettingListBox = NULL;
       
   136 
       
   137     if ( iDataConnection )
       
   138         {
       
   139         iDataConnection->Close();        
       
   140         delete iDataConnection;
       
   141         }
       
   142 
       
   143     if ( iConnection )
       
   144         {
       
   145         iConnection->Close();        
       
   146         }
       
   147     
       
   148     delete iPreviousText;
       
   149         
       
   150     FeatureManager::UnInitializeLib();
       
   151     }
       
   152 
       
   153 
       
   154 // ---------------------------------------------------------
       
   155 // CPapUiDialog::HandleListBoxEventL
       
   156 // ---------------------------------------------------------
       
   157 //
       
   158 void CPapUiDialog::HandleListBoxEventL( CEikListBox* /*aListBox*/,
       
   159                                                    TListBoxEvent aEventType )
       
   160     {
       
   161     switch ( aEventType )
       
   162         {
       
   163         case EEventEnterKeyPressed:
       
   164         case EEventItemSingleClicked:
       
   165             {
       
   166             OkToExitL( EPapUiCmdChange );         
       
   167             break;
       
   168             }
       
   169 
       
   170         case EEventItemActioned:
       
   171         case EEventEditingStarted:
       
   172         case EEventEditingStopped:
       
   173         case EEventPenDownOnItem:
       
   174         case EEventItemDraggingActioned:
       
   175             {
       
   176             break;
       
   177             }
       
   178 
       
   179         default:
       
   180             {
       
   181             break;
       
   182             };
       
   183         };
       
   184     }    
       
   185 
       
   186 
       
   187 // -----------------------------------------------------------------------------
       
   188 // CPapUiDialog::PreLayoutDynInitL
       
   189 // -----------------------------------------------------------------------------
       
   190 //
       
   191 void CPapUiDialog::PreLayoutDynInitL()
       
   192     {
       
   193     ChangeTitleL( ETrue );
       
   194     
       
   195     TUid naviPaneUid;
       
   196     naviPaneUid.iUid = EEikStatusPaneUidNavi;
       
   197     CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
       
   198     CEikStatusPaneBase::TPaneCapabilities subPane = 
       
   199                                 statusPane->PaneCapabilities( naviPaneUid );
       
   200     if ( subPane.IsPresent()&&subPane.IsAppOwned() )
       
   201         {
       
   202         iNaviPane = static_cast<CAknNavigationControlContainer*>( 
       
   203                                         statusPane->ControlL( naviPaneUid ) );
       
   204 
       
   205         // Set empty text to hide tabs.
       
   206         iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC );
       
   207         iNaviPane->PushL( *iNaviDecorator );
       
   208         }           
       
   209 
       
   210     
       
   211     // Initialize setting page 
       
   212     iSettingListBox = static_cast<CAknSettingStyleListBox*>( 
       
   213                                     ControlOrNull( EPapSettingsListBox ) );
       
   214     iSettingListBox->SetMopParent( this );
       
   215     iSettingListBox->CreateScrollBarFrameL( ETrue );
       
   216     iSettingListBox->ScrollBarFrame()->SetScrollBarVisibilityL( 
       
   217                                                 CEikScrollBarFrame::EOff,
       
   218                                                 CEikScrollBarFrame::EAuto );
       
   219     iSettingListBox->SetListBoxObserver( this );
       
   220     DrawSettingsListL();
       
   221 
       
   222     iIsUIConstructionCompleted = ETrue;
       
   223 
       
   224     }
       
   225 
       
   226 
       
   227 // -----------------------------------------------------------------------------
       
   228 // CPapUiDialog::ChangeTitleL
       
   229 // -----------------------------------------------------------------------------
       
   230 //
       
   231 void CPapUiDialog::ChangeTitleL( TBool aIsStarted )
       
   232     {
       
   233     TUid titlePaneUid;
       
   234     titlePaneUid.iUid = EEikStatusPaneUidTitle;
       
   235 
       
   236     CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
       
   237     CEikStatusPaneBase::TPaneCapabilities subPane = 
       
   238                                 statusPane->PaneCapabilities( titlePaneUid );
       
   239     
       
   240     if ( subPane.IsPresent() && subPane.IsAppOwned() )
       
   241         {
       
   242         CAknTitlePane* titlePane = static_cast<CAknTitlePane*>(
       
   243                                         statusPane->ControlL( titlePaneUid) );
       
   244         if ( aIsStarted )
       
   245             {
       
   246             // Store previous application title text
       
   247             const TDesC* prevText = titlePane->Text();    
       
   248             iPreviousText = HBufC::NewL( prevText->Length() );
       
   249             iPreviousText->Des().Append( *prevText );
       
   250             TDesC* titleText = iEikonEnv->AllocReadResourceLC( 
       
   251                                                     R_PAP_SETTINGS_TITLE );
       
   252             titlePane->SetTextL( *titleText );
       
   253             CleanupStack::PopAndDestroy( titleText ); 
       
   254             }
       
   255         else
       
   256             {
       
   257             // Set calling application title text back
       
   258             titlePane->SetTextL( *iPreviousText );    
       
   259             }    
       
   260         }
       
   261     }
       
   262 
       
   263 
       
   264 // -----------------------------------------------------------------------------
       
   265 // CPapUiDialog::OkToExitL
       
   266 // -----------------------------------------------------------------------------
       
   267 //
       
   268 TBool CPapUiDialog::OkToExitL( TInt aButtonId )
       
   269     {
       
   270     #if defined(_DEBUG) || defined(DEBUG)
       
   271     RDebug::Print(_L("CPapUiDialog::OkToExitL") );
       
   272     #endif   
       
   273     
       
   274     TBool ret( EFalse );
       
   275     switch ( aButtonId )
       
   276         {
       
   277         case EEikBidOk:
       
   278             {
       
   279             if( iIsUIConstructionCompleted )
       
   280                 {
       
   281                 if ( iSettingListBox->IsFocused() )
       
   282                     {
       
   283                     ShowSettingPageL( EFalse );
       
   284                     }    
       
   285                 }
       
   286             else
       
   287                 {
       
   288                 #if defined(_DEBUG) || defined(DEBUG)
       
   289 				RDebug::Print(_L("CPapUiDialog::OkToExitL - UI not ready - Ignoring key press.\n") );
       
   290 				#endif
       
   291                 }
       
   292                 
       
   293             break;
       
   294             }
       
   295 
       
   296         case EAknSoftkeyOptions:
       
   297             {
       
   298             DisplayMenuL();
       
   299             break;
       
   300             }
       
   301 
       
   302         case EAknSoftkeyBack:
       
   303         case EAknCmdExit:
       
   304             {
       
   305             UpdateEapolData();
       
   306             ChangeTitleL( EFalse );
       
   307             ret = ETrue;
       
   308             break;
       
   309             }
       
   310         
       
   311         case EPapUiCmdChange:
       
   312             {
       
   313             if( iIsUIConstructionCompleted )
       
   314     			{
       
   315         		ShowSettingPageL( EFalse );
       
   316     			}
       
   317     	    else
       
   318     			{
       
   319     			#if defined(_DEBUG) || defined(DEBUG)
       
   320     			RDebug::Print(_L("CPapUiDialog::ProcessCommandL - UI not ready - Ignoring key press.\n") );
       
   321     			#endif
       
   322     			}
       
   323 
       
   324             break;
       
   325             }
       
   326 
       
   327         default:
       
   328             {
       
   329             break;
       
   330             }
       
   331         }
       
   332 
       
   333     if ( ret )
       
   334         {
       
   335         *iButtonId = aButtonId;
       
   336         }
       
   337 
       
   338     return ret;
       
   339     }
       
   340 
       
   341 
       
   342 // -----------------------------------------------------------------------------
       
   343 // CPapUiDialog::DrawSettingsListL
       
   344 // -----------------------------------------------------------------------------
       
   345 //
       
   346 void CPapUiDialog::DrawSettingsListL()
       
   347     {
       
   348     iSettingArray->Array()->ResetAndDestroy();
       
   349     TInt ordinal = 0;
       
   350     
       
   351     // ---------------------------------------------------------------
       
   352     // Username setting item. If the username has never been set,
       
   353     // shows "(not defined)", otherwise shows the username.
       
   354     iSettingArray->AddTextItemL( iSettingUsername,
       
   355                                  EPapSettingPageUserName,
       
   356                                  R_PAP_USERNAME_SETTING_TITLE,
       
   357                                  R_PAP_USERNAME_PAGE,
       
   358                                  NULL,
       
   359                                  ordinal++ );
       
   360                                  
       
   361     // ---------------------------------------------------------------
       
   362     // Password prompt setting item. Radio buttons Prompt/User defined.                                
       
   363     iSettingArray->AddBinarySettingItemL( R_PAP_PASSWORD_POPUP_PAGE,
       
   364                                           R_PAP_PASSWORD_SETTING_TITLE, 
       
   365                                           R_PAP_PASSWORD_PROMPT_CHOICES,
       
   366                                           ordinal++,
       
   367                                           iSettingPwPrompt );
       
   368                                           
       
   369     // ---------------------------------------------------------------
       
   370     // Password setting item. Never visible in the setting list, but the
       
   371     // setting page opens when the user selects "User defined" in the
       
   372     // password prompt setting item.
       
   373     iSettingArray->AddPasswordItemL( iSettingPassword,
       
   374                                  EPapSettingPagePassword,
       
   375                                  R_PAP_PASSWORD_SETTING_TITLE,
       
   376                                  R_PAP_PASSWORD_SETTING_PAGE,
       
   377                                  NULL,
       
   378                                  ordinal++ );
       
   379                                  
       
   380     // Set the last item hidden
       
   381     CAknSettingItem* item = iSettingArray->Array()->At( EPasswordItem );
       
   382     item->SetHidden( ETrue );
       
   383                            
       
   384                                                                                                            
       
   385     iSettingListBox->Model()->SetItemTextArray( iSettingArray->Array() );    
       
   386     iSettingListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
       
   387     iSettingArray->Array()->RecalculateVisibleIndicesL();
       
   388     iSettingListBox->HandleItemAdditionL();
       
   389     iSettingListBox->UpdateScrollBarsL();
       
   390     }
       
   391 
       
   392 
       
   393 // -----------------------------------------------------------------------------
       
   394 // CPapUiDialog::DynInitMenuPaneL
       
   395 // -----------------------------------------------------------------------------
       
   396 //
       
   397 void CPapUiDialog::DynInitMenuPaneL( TInt aResourceId, 
       
   398                                          CEikMenuPane* aMenuPane )
       
   399     {
       
   400     CAknDialog::DynInitMenuPaneL( aResourceId, aMenuPane );
       
   401 
       
   402     if ( aResourceId == R_PAP_MENU_PANE )
       
   403         {
       
   404         if ( aMenuPane && !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
       
   405             {
       
   406             aMenuPane->DeleteMenuItem( EAknCmdHelp );
       
   407             }
       
   408 
       
   409         }
       
   410     }
       
   411 
       
   412 // -----------------------------------------------------------------------------
       
   413 // CPapUiDialog::UpdateEapolData
       
   414 // -----------------------------------------------------------------------------
       
   415 //
       
   416 void CPapUiDialog::UpdateEapolData()
       
   417     {
       
   418     #if defined(_DEBUG) || defined(DEBUG)
       
   419     RDebug::Print(_L("CPapUiDialog::UpdateEapolData") );    
       
   420     RDebug::Print(_L("Saving username: %S"), &iSettingUsername );
       
   421     RDebug::Print(_L("Saving pwprompt: %d"), iSettingPwPrompt );
       
   422     RDebug::Print(_L("Saving password: %S"), &iSettingPassword );    
       
   423     #endif
       
   424         
       
   425     // username
       
   426     if ( iSettingUsername.Length() )
       
   427         {
       
   428         ( iUiData->GetPapUserName() ).Copy( iSettingUsername );
       
   429         }
       
   430     
       
   431         
       
   432     // pwprompt
       
   433     *( iUiData->GetPapPasswordPrompt() ) = iSettingPwPrompt;
       
   434        
       
   435     // password
       
   436     ( iUiData->GetPapPassword() ).Copy( iSettingPassword );
       
   437         
       
   438     iDataConnection->Update();
       
   439     }
       
   440 
       
   441 
       
   442 // -----------------------------------------------------------------------------
       
   443 // CPapUiDialog::ProcessCommandL
       
   444 // -----------------------------------------------------------------------------
       
   445 //
       
   446 void CPapUiDialog::ProcessCommandL( TInt aCommand )
       
   447     {
       
   448     if ( MenuShowing() )
       
   449         {
       
   450         HideMenu();
       
   451         }
       
   452 
       
   453     switch( aCommand )
       
   454         {
       
   455         case EAknCmdExit:
       
   456             {
       
   457             TryExitL( aCommand );
       
   458             break;
       
   459             }
       
   460 
       
   461         case EAknCmdHelp:
       
   462             {
       
   463             HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(),
       
   464                                     iEikonEnv->EikAppUi()->AppHelpContextL() );
       
   465             break;
       
   466             }
       
   467 
       
   468         case EPapUiCmdChange:
       
   469             {
       
   470             if( iIsUIConstructionCompleted )
       
   471     			{
       
   472         		ShowSettingPageL( ETrue );
       
   473     			}
       
   474     		else
       
   475     			{
       
   476     		    #if defined(_DEBUG) || defined(DEBUG)
       
   477     			RDebug::Print(_L("CPapUiDialog::ProcessCommandL - UI not ready - Ignoring key press.\n") );
       
   478     			#endif
       
   479     			}
       
   480             break;
       
   481             }
       
   482 
       
   483         default:
       
   484             {
       
   485             break;
       
   486             }
       
   487         }
       
   488     }
       
   489     
       
   490     
       
   491 // -----------------------------------------------------------------------------
       
   492 // CPapUiDialog::ShowSettingPageL
       
   493 // -----------------------------------------------------------------------------
       
   494 //
       
   495 void CPapUiDialog::ShowSettingPageL( TInt aCalledFromMenu ) 
       
   496     {
       
   497     #if defined(_DEBUG) || defined(DEBUG)
       
   498     RDebug::Print(_L("CPapUiDialog::ShowSettingPageL") );
       
   499     #endif    
       
   500     
       
   501     TInt index = iSettingListBox->CurrentItemIndex();
       
   502     
       
   503     if ( index == EUsernameItem )
       
   504         {
       
   505         ShowUsernameSettingPageL();
       
   506         }
       
   507     
       
   508     else if ( index == EPasswordPromptItem )
       
   509         {
       
   510         // The previous value is needed for comparison,
       
   511         // after the user has done the editing
       
   512         TBool oldChoice = iSettingPwPrompt;
       
   513         
       
   514         // Show the radio button page and let the user edit
       
   515         CAknSettingItem* item = iSettingArray->Array()->At( index );
       
   516         item->EditItemL( aCalledFromMenu );
       
   517         item->StoreL();
       
   518         
       
   519         // Check the new value
       
   520         TBool newChoice = iSettingPwPrompt;
       
   521         
       
   522         // Prompt -> User defined
       
   523         if ( oldChoice && !newChoice )
       
   524             {
       
   525             // Ask to set a password
       
   526             ShowPasswordSettingPageL();
       
   527             
       
   528             // If the password item was cancelled,
       
   529             // or if username was prompted and cancelled,
       
   530             // restore "Prompt" for the password prompt setting
       
   531             if ( iSettingArray->IsPwItemCancelled() || iUsernameCancelled )
       
   532                 {
       
   533                 // Toggle the setting back to Prompt without showing the page
       
   534                 item->EditItemL( EFalse );
       
   535                 item->StoreL();
       
   536                 }
       
   537             }
       
   538         
       
   539         // User defined -> User defined        
       
   540         else if ( !oldChoice && !newChoice )
       
   541            {
       
   542            // Ask to set a new password
       
   543            ShowPasswordSettingPageL();
       
   544            }
       
   545         
       
   546         // Prompt -> Prompt
       
   547         else if ( oldChoice && newChoice )
       
   548             {
       
   549             // Do nothing
       
   550             }
       
   551 
       
   552         // User defined -> Prompt       
       
   553         else if ( !oldChoice && newChoice )
       
   554             {
       
   555             // Remove the password
       
   556             CPapUiPwSettingItem* pwItem =
       
   557                 static_cast< CPapUiPwSettingItem* >(
       
   558                     iSettingArray->Array()->At( EPasswordItem ) );
       
   559             pwItem->DeletePasswordL();
       
   560             
       
   561             }
       
   562             
       
   563         else
       
   564             {
       
   565             // It shouldn't be possible to end up here
       
   566             }
       
   567         
       
   568         }
       
   569         
       
   570     else
       
   571         {
       
   572         // shouldn't end up here
       
   573         }                
       
   574 
       
   575     DrawNow();
       
   576     }
       
   577     
       
   578 // -----------------------------------------------------------------------------
       
   579 // CPapUiDialog::ShowUsernameSettingPageL
       
   580 // -----------------------------------------------------------------------------
       
   581 //
       
   582 void CPapUiDialog::ShowUsernameSettingPageL() 
       
   583     {
       
   584     #if defined(_DEBUG) || defined(DEBUG)
       
   585     RDebug::Print(_L("CPapUiDialog::ShowUsernameSettingPageL") );
       
   586     #endif
       
   587     
       
   588     iUsernameCancelled = EFalse;
       
   589     
       
   590     CAknSettingItem* item = iSettingArray->Array()->At( EUsernameItem );
       
   591     item->EditItemL( EFalse );
       
   592     item->StoreL(); 
       
   593     }
       
   594 
       
   595 // -----------------------------------------------------------------------------
       
   596 // CPapUiDialog::ShowPasswordSettingPageL
       
   597 // -----------------------------------------------------------------------------
       
   598 //
       
   599 void CPapUiDialog::ShowPasswordSettingPageL() 
       
   600     {
       
   601     #if defined(_DEBUG) || defined(DEBUG)
       
   602     RDebug::Print(_L("CPapUiDialog::ShowPasswordSettingPageL") );
       
   603     #endif  
       
   604     
       
   605     CAknSettingItem* item = iSettingArray->Array()->At( EPasswordItem );
       
   606     
       
   607     item->EditItemL( EFalse );
       
   608     item->StoreL();
       
   609     DrawNow();
       
   610 
       
   611     // If password is set, then username must also be defined    
       
   612     if ( !iSettingUsername.Length() && !iSettingArray->IsPwItemCancelled() )
       
   613         {
       
   614         // Show an info note about missing username
       
   615         HBufC* message = NULL;
       
   616         message = StringLoader::LoadLC( R_PAP_DEFINE_USERNAME_INFO_NOTE );
       
   617  	    CAknInformationNote* note = new( ELeave ) CAknInformationNote( ETrue );
       
   618         note->ExecuteLD( *message );
       
   619 		CleanupStack::PopAndDestroy( message );
       
   620 		
       
   621 		ShowUsernameSettingPageL();
       
   622 		
       
   623 		// If the username is still empty, it can only mean that the user has
       
   624 		// cancelled the operation -> remove the temporarily accepted password
       
   625 		if ( !iSettingUsername.Length() )
       
   626 		    {
       
   627 		    iUsernameCancelled = ETrue;
       
   628 		    // Remove the password
       
   629             CPapUiPwSettingItem* pwItem =
       
   630                 static_cast< CPapUiPwSettingItem* >(
       
   631                     iSettingArray->Array()->At( EPasswordItem ) );
       
   632             pwItem->DeletePasswordL();
       
   633 		    }
       
   634         }
       
   635     
       
   636     }
       
   637 
       
   638 // -----------------------------------------------------------------------------
       
   639 // CPapUiDialog::GetHelpContext
       
   640 // -----------------------------------------------------------------------------
       
   641 //
       
   642 void CPapUiDialog::GetHelpContext( TCoeHelpContext& /* aContext */ ) const
       
   643     {
       
   644     // Avkon help dependencies removed, hence do nothing
       
   645     return;
       
   646     }
       
   647 
       
   648 //  End of File