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