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