idlehomescreen/nativeuicontroller/src/aidialogrenderer.cpp
branchRCL_3
changeset 15 ff572dfe6d86
parent 9 f966699dea19
child 16 9674c1a575e9
equal deleted inserted replaced
9:f966699dea19 15:ff572dfe6d86
     1 /*
     1 /*
     2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    30 #include "ainativeuiplugins.h"
    30 #include "ainativeuiplugins.h"
    31 #ifdef __COVER_DISPLAY
    31 #ifdef __COVER_DISPLAY
    32 #include "aisecondarydisplayapi.h"
    32 #include "aisecondarydisplayapi.h"
    33 #endif
    33 #endif
    34 
    34 
       
    35 
       
    36 // AVKON headers
       
    37 #include <AknNoteWrappers.h>             // for Note Wrappers
       
    38 #include <AknPopup.h>                    // for Popup menus
       
    39 #include <AknWaitDialog.h>               // for CAknWaitDialog
       
    40 #include <StringLoader.h>                // for StringLoader
       
    41 #include <eiktxlbm.h>                    // for CTextListBoxModel
       
    42 #include <AknLists.h>                    // for AknPopupListEmpty
       
    43 #include <bautils.h>                     // for BaflUtils
       
    44 
       
    45 // Phonesettings headers
       
    46 #include <PsetContainer.h>               // for CPsetContainer
       
    47 #include <PsetNetwork.h>                 // for CPsetNetwork
       
    48 #include <PsetSAObserver.h>              // for CPsetSAObserver
       
    49 #include <gsmerror.h>                    // for GSM-specific error messages
       
    50 
       
    51 #include <GsNetworkPluginRsc.rsg>        // for resource IDs
       
    52 #include <CoreApplicationUIsSDKCRKeys.h> // for KCRUidCoreApplicationUIs, TCoreAppUIsNetworkConnectionAllowed
       
    53 #include <featmgr.h>
       
    54 
       
    55 const TInt KAIAlphaTagIconAdditionalChars = 5;
       
    56 // Length of long network name.
       
    57 const TInt KAIAlphaTagLongNameLength = 20;
       
    58 // Length of short network name.
       
    59 const TInt KAIAlphaTagShortNameLength = 10;
       
    60 
       
    61 // array granularity
       
    62 const TInt KAINetworkInfoArrayGranularity = 10;
       
    63 
       
    64 // Error note type ID - for Net view internal usage only
       
    65 const TInt KAIPPErrorNote = 5001;
       
    66 // Confirmation note type ID - for Net view internal usage only
       
    67 const TInt KAIPPConfirmationNote = 5002;
       
    68 //Information note type ID - for Net view internal usage only
       
    69 const TInt KAIPPInformationNote = 5003;
       
    70 
       
    71 const TInt KAIPLMNListPopupMenuItems = 3;
       
    72 
       
    73 // Some resources defined for GSNetworkPlugin are used
       
    74 _LIT(KGSNetworkPluginResource, "z:\\resource\\GsNetworkPluginRsc.rsc");
       
    75 
       
    76 enum TGSSoftKeys
       
    77 	{
       
    78 	EGSSoftkeyQuit = 1,
       
    79 	EGSSoftkeyEmpty
       
    80 	};
       
    81 
       
    82 
    35 using namespace AiNativeUiController;
    83 using namespace AiNativeUiController;
    36 
    84 
    37 // ======== MEMBER FUNCTIONS ========
    85 // ======== MEMBER FUNCTIONS ========
    38 // ----------------------------------------------------------------------------
    86 // ----------------------------------------------------------------------------
    39 // CAiDialogRenderer::NewLC()
    87 // CAiDialogRenderer::NewLC()
    42 //
    90 //
    43 CAiDialogRenderer* CAiDialogRenderer::NewLC()
    91 CAiDialogRenderer* CAiDialogRenderer::NewLC()
    44     {
    92     {
    45     CAiDialogRenderer* self = new( ELeave ) CAiDialogRenderer;
    93     CAiDialogRenderer* self = new( ELeave ) CAiDialogRenderer;
    46     CleanupStack::PushL( self );
    94     CleanupStack::PushL( self );
       
    95 	self->ConstructL();
    47     return self;
    96     return self;
    48     }
    97     }
    49 
    98 
    50 // ----------------------------------------------------------------------------
    99 // ----------------------------------------------------------------------------
    51 // CAiDialogRenderer::~CAiDialogRenderer()
   100 // CAiDialogRenderer::~CAiDialogRenderer()
    52 //
   101 //
    53 // ----------------------------------------------------------------------------
   102 // ----------------------------------------------------------------------------
    54 //
   103 //
    55 CAiDialogRenderer::~CAiDialogRenderer()
   104 CAiDialogRenderer::~CAiDialogRenderer()
    56     {
   105     {
       
   106     if ( FeatureManager::FeatureSupported( KFeatureIdFfManualSelectionPopulatedPlmnList ) )
       
   107         {
       
   108         if( iRscIndex )
       
   109             {
       
   110             CEikonEnv::Static()->DeleteResourceFile( iRscIndex );
       
   111             }
       
   112         if ( iNetwork )
       
   113             {
       
   114             if ( iSearchForNetworksActive )
       
   115             {
       
   116             // Reset back to previously used network
       
   117             iNetwork->ResetNetworkSearch();
       
   118             }
       
   119         delete iNetwork;
       
   120         }
       
   121 
       
   122         if ( iNetworkArray )
       
   123             {
       
   124             iNetworkArray->Reset();
       
   125             }
       
   126         delete iNetworkArray;
       
   127 
       
   128         if ( iDlg )
       
   129             {
       
   130             delete iDlg;
       
   131             }
       
   132         if ( iNetworkPopupList )
       
   133             {
       
   134             iNetworkPopupList->CancelPopup();
       
   135             }
       
   136 
       
   137         if ( iSettingsContainer )
       
   138             {
       
   139             delete iSettingsContainer;
       
   140             }
       
   141         }
       
   142 
       
   143     FeatureManager::UnInitializeLib();
       
   144 
    57     delete iDialog;
   145     delete iDialog;
    58     delete iText;
   146     delete iText;
    59     }
   147     }
    60 
   148 
    61 // ----------------------------------------------------------------------------
   149 // ----------------------------------------------------------------------------
    64 // ----------------------------------------------------------------------------
   152 // ----------------------------------------------------------------------------
    65 //
   153 //
    66 CAiDialogRenderer::CAiDialogRenderer()
   154 CAiDialogRenderer::CAiDialogRenderer()
    67     {
   155     {
    68     }
   156     }
    69     
   157 
    70 // ----------------------------------------------------------------------------
   158 void CAiDialogRenderer::ConstructL()
    71 // CAiDialogRenderer::DoPublishL()
   159     {
    72 //
   160     FeatureManager::InitializeLibL();
    73 // ----------------------------------------------------------------------------
   161 
    74 //
   162     if ( FeatureManager::FeatureSupported( KFeatureIdFfManualSelectionPopulatedPlmnList ) )
    75 void CAiDialogRenderer::DoPublishL( CHsContentPublisher& aPlugin, 
   163         {
    76     TInt aContent, TInt aResource, TInt /*aIndex*/  )
   164         iSettingsContainer = CPsetContainer::NewL();
       
   165         iNetwork = iSettingsContainer->CreateNetworkObjectL( *this );
       
   166 
       
   167         iApprovedNetwork = EFalse;
       
   168         CheckAndCreateDlgL( EFalse );
       
   169         iSearchForNetworksActive = EFalse;
       
   170         iPLMNListPopulateShowIsHandling = EFalse;
       
   171 
       
   172         // Open the resource file.  Assume that the resource is stored on the same
       
   173         // drive the DLL is installed on.
       
   174         TFileName file;
       
   175         Dll::FileName( file );
       
   176         TParse parse;
       
   177         parse.Set( KGSNetworkPluginResource, &file, NULL );
       
   178         file = parse.FullName();
       
   179         CEikonEnv* eikonEnv = CEikonEnv::Static();
       
   180         BaflUtils::NearestLanguageFile( eikonEnv->FsSession(), file );
       
   181         iRscIndex = eikonEnv->AddResourceFileL( file );
       
   182         }
       
   183     }
       
   184 
       
   185 void CAiDialogRenderer::DoPublishL( CHsContentPublisher& aPlugin,
       
   186      TInt aContent, TInt aResource, TInt /*aIndex*/  )
    77     {
   187     {
    78     const THsPublisherInfo& info( aPlugin.PublisherInfo() );
   188     const THsPublisherInfo& info( aPlugin.PublisherInfo() );
    79     
   189     
    80     if( info.Uid() == KDeviceStatusPluginUid )
   190     if( info.Uid() == KDeviceStatusPluginUid )
    81     	{
   191     	{
   106 #endif
   216 #endif
   107 	                iShowDialog = ETrue;
   217 	                iShowDialog = ETrue;
   108                     }
   218                     }
   109 	            if ( idleState == EPSAiForeground )
   219 	            if ( idleState == EPSAiForeground )
   110                     {
   220                     {
   111   	                ShowDialogL();	                    
   221                     ShowDialogL();
   112                     }
   222                     }
   113 	            
       
   114 	            break;
   223 	            break;
   115 	            }
   224 	            }
       
   225 
       
   226             case EAiDeviceStatusContentNetRegStatus:
       
   227                  {
       
   228                  MPsetNetworkSelect::TSelectMode mode =
       
   229                          MPsetNetworkSelect::ENetSelectModeAutomatic;
       
   230 
       
   231                  if ( iNetwork )
       
   232                      {
       
   233                      iNetwork->GetNetworkSelectMode( mode );
       
   234                      }
       
   235 
       
   236                  if ( mode == MPsetNetworkSelect::ENetSelectModeManual )
       
   237                      {
       
   238                      if ( aResource == EAiDeviceStatusResourceNetRegFail )
       
   239                          {
       
   240                          PopulatePLMNListL();
       
   241                          }
       
   242                      }
       
   243                  break;
       
   244                  }
       
   245 
       
   246 
   116 	        default:
   247 	        default:
   117 	            {
   248 	            {
   118 	            User::Leave( KErrNotFound );
   249 	            User::Leave( KErrNotFound );
   119 	            break;
   250 	            break;
   120 	            }
   251 	            }
   121 	        }
   252 	        };
   122     	}
   253     	}
   123     else
   254     else
   124    		{
   255    		{
   125    		User::Leave( KErrNotFound );	
   256    		User::Leave( KErrNotFound );
   126    		}
   257    		}
   127     }
   258     }
   128 
   259 
   129 // ----------------------------------------------------------------------------
   260 // ----------------------------------------------------------------------------
   130 // CAiDialogRenderer::DoCleanL()
   261 // CAiDialogRenderer::DoCleanL()
   191         {
   322         {
   192         ShowDialogL();
   323         ShowDialogL();
   193         }
   324         }
   194     }
   325     }
   195 
   326 
       
   327 void CAiDialogRenderer::PopulatePLMNListL()
       
   328     {
       
   329     // Ignore any subsequent EAiDeviceStatusResourcePLMNListPopulateShow content while one is handling
       
   330     if ( iPLMNListPopulateShowIsHandling )
       
   331 		{
       
   332 		return;
       
   333 		}
       
   334 
       
   335     iPLMNListPopulateShowIsHandling = ETrue;
       
   336     iSearchForNetworksActive = ETrue;
       
   337     iNetwork->GetAvailableNetworksL();
       
   338     }
       
   339 
       
   340 // ---------------------------------------------------------------------------
       
   341 //
       
   342 // While request to find networks is processed
       
   343 //
       
   344 // ---------------------------------------------------------------------------
       
   345 void CAiDialogRenderer::HandleSearchingNetworksL(
       
   346                       MPsetNetworkInfoObserver::TServiceRequest aRequest )
       
   347     {
       
   348     // Create a network info array if doesn't exist
       
   349     if ( !iNetworkArray )
       
   350         {
       
   351      	iNetworkArray = new ( ELeave )
       
   352         CNetworkInfoArray( KAINetworkInfoArrayGranularity );
       
   353      	}
       
   354 
       
   355 	if ( aRequest != MPsetNetworkInfoObserver::EServiceRequestNone )
       
   356 		{
       
   357 		CheckAndCreateDlgL( EFalse );
       
   358 		iSearchForNetworksActive = ETrue;
       
   359 		TInt res = iDlg->ExecuteLD( R_SEARCHING_NOTE );
       
   360 		if ( res == EGSSoftkeyQuit )
       
   361 			{
       
   362 			iNetwork->CancelProcess();
       
   363 			iPLMNListPopulateShowIsHandling = EFalse;
       
   364 			}
       
   365 		}
       
   366 		else // If EServiceRequestNone received, hide the "Searching..." note
       
   367 			{
       
   368 			delete iDlg;
       
   369 			iDlg = NULL;
       
   370 			}
       
   371 	}
       
   372 
       
   373 // ---------------------------------------------------------------------------
       
   374 //
       
   375 // Handles network info
       
   376 //
       
   377 // ---------------------------------------------------------------------------
       
   378 void CAiDialogRenderer::HandleNetworkInfoReceivedL(
       
   379      const CNetworkInfoArray* aInfoArray, const TInt /* aResult */ )
       
   380 	{
       
   381 	const TInt itemsCount = aInfoArray->Count();
       
   382 
       
   383 	// First delete old ones
       
   384 	iNetworkArray->Delete( 0, iNetworkArray->Count() );
       
   385 
       
   386 	// Then insert found networks
       
   387 	for ( TInt i = 0; i < itemsCount; i++ )
       
   388 		{
       
   389 		MPsetNetworkSelect::TNetworkInfo info = aInfoArray->At( i );
       
   390 		iNetworkArray->InsertL( i, info );
       
   391 		}
       
   392 
       
   393 	NetworkListL(); // After search complete, show results
       
   394 	}
       
   395 
       
   396 // ---------------------------------------------------------------------------
       
   397 //
       
   398 // While request to change network is processed, a note is shown
       
   399 //
       
   400 // ---------------------------------------------------------------------------
       
   401 void CAiDialogRenderer::HandleRequestingSelectedNetworkL( TBool aOngoing )
       
   402 	{
       
   403 	if ( aOngoing )
       
   404 		{
       
   405 		CheckAndCreateDlgL( ETrue );
       
   406 
       
   407 		if ( iDlg->ExecuteLD( R_REQUESTING_NOTE ) == EGSSoftkeyQuit )
       
   408 			{
       
   409 			iNetwork->CancelProcess();
       
   410 
       
   411 			CAknNoteDialog* dlg = new ( ELeave ) CAknNoteDialog(
       
   412 			 CAknNoteDialog::EConfirmationTone,
       
   413 			 CAknNoteDialog::EShortTimeout );
       
   414 			dlg->ExecuteLD( R_REGISTRATION_INTERRUPTED );
       
   415 			iApprovedNetwork = EFalse;
       
   416 			iPLMNListPopulateShowIsHandling = EFalse;
       
   417 			}
       
   418 		}
       
   419 	else
       
   420 		{
       
   421 		delete iDlg;
       
   422 		iDlg = NULL;
       
   423 		}
       
   424 	}
       
   425 
       
   426 // ---------------------------------------------------------------------------
       
   427 //
       
   428 // Handle network change
       
   429 //
       
   430 // ---------------------------------------------------------------------------
       
   431 void CAiDialogRenderer::HandleNetworkChangedL(
       
   432                  const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo,
       
   433                  const RMobilePhone::TMobilePhoneRegistrationStatus& aStatus,
       
   434                  const TInt aResult )
       
   435 	{
       
   436     switch ( aStatus )
       
   437 		{
       
   438 	     case RMobilePhone::ERegisteredOnHomeNetwork:
       
   439 	         {
       
   440 	         ShowNoteL( R_HOME_NETWORK_SELECTED, KAIPPConfirmationNote );
       
   441 	         PurgeNetworkList();
       
   442 	         break;
       
   443 	         }
       
   444 	     case RMobilePhone::ERegisteredRoaming:
       
   445 	         {
       
   446 	         HBufC* stringholder = NULL;
       
   447 	         if ( aCurrentInfo.iLongName.Length() > 0 &&
       
   448 	             aCurrentInfo.iLongName.Length() <=
       
   449 	             MPsetNetworkSelect::ENetLongNameSize )
       
   450 	             {
       
   451 	             stringholder = StringLoader::LoadLC( R_NETSL_NETWORKSELECTED,
       
   452 	                                                  aCurrentInfo.iLongName );
       
   453 	             }
       
   454 	         else if (aCurrentInfo.iShortName.Length() > 0 &&
       
   455 	             aCurrentInfo.iShortName.Length() <=
       
   456 	             MPsetNetworkSelect::ENetShortNameSize )
       
   457 	             {
       
   458 	             stringholder = StringLoader::LoadLC( R_NETSL_NETWORKSELECTED,
       
   459 	                                                  aCurrentInfo.iShortName );
       
   460 	         }
       
   461 
       
   462 	         CAknConfirmationNote* note = new ( ELeave ) CAknConfirmationNote( ETrue );
       
   463 	         if ( stringholder )
       
   464 	             {
       
   465                  note->ExecuteLD( *stringholder );
       
   466                  CleanupStack::PopAndDestroy( stringholder );
       
   467 	             }
       
   468 	         
       
   469 	         //After list has been used, clear it.
       
   470 	         PurgeNetworkList();
       
   471 	         break;
       
   472 	         }
       
   473 	     case RMobilePhone::ERegistrationUnknown:
       
   474 	     case RMobilePhone::ENotRegisteredNoService:
       
   475 	     case RMobilePhone::ENotRegisteredEmergencyOnly:
       
   476 	     case RMobilePhone::ENotRegisteredSearching:
       
   477 	     case RMobilePhone::ERegisteredBusy:
       
   478 	     case RMobilePhone::ERegistrationDenied:
       
   479 	     default:
       
   480 	         break;
       
   481 	    }
       
   482 
       
   483 	iPLMNListPopulateShowIsHandling = EFalse;
       
   484 	iSearchForNetworksActive = EFalse;
       
   485 	}
       
   486 
       
   487 // ---------------------------------------------------------------------------
       
   488 //
       
   489 // Handles errors.
       
   490 //
       
   491 // ---------------------------------------------------------------------------
       
   492 void CAiDialogRenderer::HandleNetworkErrorL(
       
   493 	const MPsetNetworkInfoObserver::TServiceRequest aRequest,
       
   494 	const TInt aError )
       
   495 	{
       
   496 	TInt resourceTxt = KErrNone;
       
   497 
       
   498 	switch ( aRequest )
       
   499 		{
       
   500 		case MPsetNetworkInfoObserver::EServiceRequestGetNetworkInfo:
       
   501 		    {
       
   502             iNetwork->CancelProcess();
       
   503             iApprovedNetwork = EFalse;
       
   504             break;
       
   505 		    }
       
   506 		case MPsetNetworkInfoObserver::EServiceRequestSetNetwork:
       
   507 		    {
       
   508 		    }
       
   509 		default:
       
   510 		    {
       
   511 		   break;
       
   512 		    }
       
   513 		}
       
   514 
       
   515 	TBool ignore = EFalse;
       
   516 
       
   517 	switch ( aError )
       
   518 		{
       
   519 		case KErrGsmNetCauseCallActive:
       
   520 		    {
       
   521             ignore = ETrue; // Do not show an error
       
   522             break;
       
   523 		    }
       
   524 		case KErrGsm0707NoNetworkService:
       
   525 		    {
       
   526             resourceTxt = R_NO_NETWORK_FOUND;
       
   527             break;
       
   528 		    }
       
   529 		case KErrGsmOfflineOpNotAllowed:
       
   530 		    {
       
   531             resourceTxt = R_OFFLINE_MODE;
       
   532             break;
       
   533 		    }
       
   534 		default:
       
   535 		    {
       
   536             resourceTxt = R_NO_NETWORK_ACCESS;
       
   537             break;
       
   538 		    }
       
   539 		}
       
   540 
       
   541 	if ( !ignore )
       
   542 		{
       
   543 		ShowNoteL( resourceTxt, KAIPPErrorNote );
       
   544 		iApprovedNetwork = EFalse;
       
   545 		}
       
   546 	}
       
   547 
       
   548 // ---------------------------------------------------------------------------
       
   549 //
       
   550 // Creates list of Network providers
       
   551 //
       
   552 // ---------------------------------------------------------------------------
       
   553 void CAiDialogRenderer::NetworkListL()
       
   554      {
       
   555      //if no net items were found, do not show list
       
   556      if ( iNetworkArray->Count() > 0 )
       
   557          {
       
   558          while ( !iApprovedNetwork )
       
   559              {
       
   560              AknPopupListEmpty<CEikFormattedCellListBox>* list;
       
   561              list = new ( ELeave ) CAknSinglePopupMenuStyleListBox;
       
   562              CleanupStack::PushL( list );
       
   563 
       
   564              if ( iNetworkPopupList )
       
   565                  {
       
   566                  iNetworkPopupList->CancelPopup();
       
   567                  iNetworkPopupList = NULL;
       
   568                  } //
       
   569 
       
   570              iNetworkPopupList =
       
   571                  CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL );
       
   572 
       
   573              list->ConstructL( iNetworkPopupList,
       
   574                                CEikListBox::ELeftDownInViewRect );
       
   575              list->CreateScrollBarFrameL( ETrue );
       
   576              list->ScrollBarFrame()->SetScrollBarVisibilityL(
       
   577                  CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
       
   578 
       
   579              // Fill in the list texts
       
   580              CDesCArrayFlat* items =
       
   581                  new ( ELeave ) CDesCArrayFlat( KAIPLMNListPopupMenuItems );
       
   582              CleanupStack::PushL( items );
       
   583 
       
   584              const TInt itemsCount = iNetworkArray->Count();
       
   585 
       
   586              for ( TInt loop = 0; loop < itemsCount; loop++ )
       
   587                  {
       
   588                  HBufC* insertString =
       
   589                      HBufC::NewLC(
       
   590                          KAIAlphaTagLongNameLength + KAIAlphaTagIconAdditionalChars );
       
   591                  MPsetNetworkSelect::TNetworkInfo info =
       
   592                      iNetworkArray->At( loop );
       
   593 
       
   594                  if ( info.iLongName.Length() <= 0 ||
       
   595                       info.iLongName.Length() > KAIAlphaTagLongNameLength )
       
   596                      {
       
   597                      // Short name received
       
   598                      if ( info.iShortName.Length() > 0 &&
       
   599                          info.iShortName.Length() <= KAIAlphaTagShortNameLength )
       
   600                          {
       
   601                          insertString->Des().Append( info.iShortName );
       
   602                          } //
       
   603                      } //
       
   604                  // Long name received
       
   605                  else
       
   606                      {
       
   607                      insertString->Des().Append( info.iLongName );
       
   608                      } //
       
   609 
       
   610                  items->AppendL( *insertString );
       
   611                  CleanupStack::PopAndDestroy();
       
   612                  }
       
   613 
       
   614              CTextListBoxModel* model = list->Model();
       
   615              model->SetItemTextArray( items );
       
   616              model->SetOwnershipType( ELbmOwnsItemArray );
       
   617              CleanupStack::Pop( items ); // Listbox model now owns this
       
   618 
       
   619              // Set title for list
       
   620              SetTitleToPopupL( *iNetworkPopupList, R_NETSL_FOUNDOPERATORS );
       
   621 
       
   622              TInt res = 0;
       
   623              // Show the PLMN list
       
   624              if ( items->Count() )
       
   625                  {
       
   626                  res = iNetworkPopupList->ExecuteLD();
       
   627                  } //
       
   628 
       
   629              iNetworkPopupList = NULL;
       
   630              iApprovedNetwork = ETrue; // User might want to quit
       
   631              TInt selection = list->CurrentItemIndex();
       
   632 
       
   633              CleanupStack::PopAndDestroy( list );
       
   634 
       
   635              if ( res )
       
   636                  {
       
   637                  MPsetNetworkSelect::TNetworkInfo info =
       
   638                      iNetworkArray->At( selection );
       
   639                  info.iMode = MPsetNetworkSelect::ENetSelectModeManual;
       
   640                  iNetwork->SelectNetworkL( info );
       
   641                  } //
       
   642              else // User selected "Cancel"
       
   643                  {
       
   644                  // Reset back to previously used network
       
   645                  iNetwork->ResetNetworkSearch();
       
   646                  iSearchForNetworksActive = EFalse;
       
   647                  // After list has been used, clear it
       
   648                  PurgeNetworkList();
       
   649                  iPLMNListPopulateShowIsHandling = EFalse;
       
   650                  } //
       
   651              }
       
   652          }
       
   653 
       
   654      iApprovedNetwork = EFalse; // Initialize before new search
       
   655      }
       
   656 
       
   657 // ---------------------------------------------------------------------------
       
   658 //
       
   659 // Creates dialog, if it is does not exist yet.
       
   660 //
       
   661 // ---------------------------------------------------------------------------
       
   662 //
       
   663 void CAiDialogRenderer::CheckAndCreateDlgL( TBool aDelayOff )
       
   664 	{
       
   665 	if ( !iDlg )
       
   666 	   {
       
   667 	   iDlg = new ( ELeave ) CAknWaitDialog(
       
   668 	       reinterpret_cast<CEikDialog**> ( &iDlg ), aDelayOff );
       
   669 	   }
       
   670 	}
       
   671 
       
   672 // ---------------------------------------------------------------------------
       
   673 //
       
   674 // Sets a title to a given popup list.
       
   675 //
       
   676 // ---------------------------------------------------------------------------
       
   677 void CAiDialogRenderer::SetTitleToPopupL( CAknPopupList& aList, TInt aTitleID )
       
   678 	{
       
   679 	HBufC* text = StringLoader::LoadLC( aTitleID );
       
   680 
       
   681 	aList.SetTitleL( *text );
       
   682 
       
   683 	CleanupStack::PopAndDestroy( text );
       
   684 	text = NULL;
       
   685 	}
       
   686 
       
   687 // ---------------------------------------------------------------------------
       
   688 //
       
   689 // Shows note.
       
   690 //
       
   691 // ---------------------------------------------------------------------------
       
   692 //
       
   693 void CAiDialogRenderer::ShowNoteL( TInt aResourceId, TInt aType )
       
   694 	{
       
   695 	HBufC* string = StringLoader::LoadLC( aResourceId );
       
   696 
       
   697 	switch ( aType )
       
   698 		{
       
   699 		case KAIPPErrorNote:
       
   700 		   {
       
   701 		   CAknErrorNote* note = new ( ELeave ) CAknErrorNote ( ETrue );
       
   702 		   note->ExecuteLD( *string );
       
   703 		   break;
       
   704 		   }
       
   705 		case KAIPPConfirmationNote:
       
   706 		   {
       
   707 		   CAknConfirmationNote* note =
       
   708 		       new ( ELeave ) CAknConfirmationNote( ETrue );
       
   709 		   note->ExecuteLD( *string );
       
   710 		   break;
       
   711 		   }
       
   712 		case KAIPPInformationNote:
       
   713 		   {
       
   714 		   CAknInformationNote* note =
       
   715 		       new ( ELeave ) CAknInformationNote( ETrue );
       
   716 		   note->ExecuteLD( *string );
       
   717 		   break;
       
   718 		   }
       
   719 		default:
       
   720 		   break;
       
   721 		}
       
   722 
       
   723 	CleanupStack::PopAndDestroy( string );
       
   724 	}
       
   725 
       
   726 // ---------------------------------------------------------------------------
       
   727 //
       
   728 // Empties fetched network provider's list
       
   729 //
       
   730 // ---------------------------------------------------------------------------
       
   731 //
       
   732 void CAiDialogRenderer::PurgeNetworkList()
       
   733 	{
       
   734 	if ( iNetworkArray )
       
   735 		{
       
   736 		iNetworkArray->Reset();
       
   737 		delete iNetworkArray;
       
   738 		iNetworkArray = NULL;
       
   739 		}
       
   740 	}
       
   741 
   196 // End of file
   742 // End of file