gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPlugin.cpp
branchRCL_3
changeset 67 940cad2b4a51
parent 54 7e0eff37aedb
equal deleted inserted replaced
60:2cc01806dc06 67:940cad2b4a51
    73 
    73 
    74 // LOCAL CONSTANTS
    74 // LOCAL CONSTANTS
    75 _LIT( KGSNetWCDMAIcon, "0\t" );
    75 _LIT( KGSNetWCDMAIcon, "0\t" );
    76 _LIT( KGSNetGSMIcon, "1\t" );
    76 _LIT( KGSNetGSMIcon, "1\t" );
    77 _LIT( KEmptyStr, "" );
    77 _LIT( KEmptyStr, "" );
    78 /* Implementation of forbidden operator icon begins */
    78 
    79 _LIT( KGSNetNoIcon, "\t");
       
    80 _LIT( KGSNetForbiddenIcon, "2\t" );
       
    81 /* Implementation of forbidden operator icon ends */
       
    82 // Warning disabled as this constant is used inside __ASSERT_DEBUG
    79 // Warning disabled as this constant is used inside __ASSERT_DEBUG
    83 #pragma diag_suppress 177
    80 #pragma diag_suppress 177
    84 _LIT( KGSNetworkPluginAssertName, "CGSNetworkPlugin" );
    81 _LIT( KGSNetworkPluginAssertName, "CGSNetworkPlugin" );
    85 
    82 
    86 
    83 
   313 
   310 
   314     //check if the graphical list is needed... set in local variation
   311     //check if the graphical list is needed... set in local variation
   315     TBool showGraphicalList =
   312     TBool showGraphicalList =
   316         Container()->NetPluginModel()->GraphicalNetworkListSupportedL();
   313         Container()->NetPluginModel()->GraphicalNetworkListSupportedL();
   317     __GSLOGSTRING1("[GS]    NetworkListL: showGraphicalList: %d", showGraphicalList);
   314     __GSLOGSTRING1("[GS]    NetworkListL: showGraphicalList: %d", showGraphicalList);
   318    
   315 
   319     //if no net items were found, do not show list
   316     //if no net items were found, do not show list
   320     if ( iNetworkArray->Count() > 0 )
   317     if ( iNetworkArray->Count() > 0 )
   321         {
   318         {
   322         /** Implementation of forbidden operator icon begins */
       
   323         // check if forbidden operator icon is supported
       
   324         TBool forbiddenOperator = 
       
   325                 FeatureManager::FeatureSupported( KFeatureIdFfTdScdmaForbiddenoperatoricondisplay );
       
   326         /** Implementation of forbidden operator icon ends */
       
   327         while ( !iApprovedNetwork )
   319         while ( !iApprovedNetwork )
   328             {
   320             {
   329             AknPopupListEmpty<CEikFormattedCellListBox>* list;
   321             AknPopupListEmpty<CEikFormattedCellListBox>* list;
   330             /** Implementation of forbidden operator icon begins */
   322             if ( showGraphicalList &&
   331             if (forbiddenOperator || showGraphicalList
   323                  FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) )
   332                     && FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma))
   324                 {
   333                 {
   325                 list = new ( ELeave ) CAknSingleGraphicPopupMenuStyleListBox;
   334                 list = new (ELeave) CAknSingleGraphicPopupMenuStyleListBox;
       
   335                 }
   326                 }
   336             else
   327             else
   337                 {
   328                 {
   338                 list = new (ELeave) CAknSinglePopupMenuStyleListBox;
   329                 list = new ( ELeave ) CAknSinglePopupMenuStyleListBox;
   339                 }
   330                 }
   340             /** Implementation of forbidden operator icon ends */
   331 
   341             
       
   342             CleanupStack::PushL( list );
   332             CleanupStack::PushL( list );
   343             if ( iNetworkPopupList )
   333             if ( iNetworkPopupList )
   344                 {
   334                 {
   345                 iNetworkPopupList->CancelPopup();
   335                 iNetworkPopupList->CancelPopup();
   346                 iNetworkPopupList = NULL;
   336                 iNetworkPopupList = NULL;
   397                     {
   387                     {
   398                     insertString->Des().Append( info.iLongName );
   388                     insertString->Des().Append( info.iLongName );
   399                     __GSLOGSTRING1("[GS]    NetworkListL: Network Longname: %S", insertString);
   389                     __GSLOGSTRING1("[GS]    NetworkListL: Network Longname: %S", insertString);
   400                     }
   390                     }
   401 
   391 
   402                 /** Implementation of forbidden operator icon begins */
       
   403                 //set icon for network
   392                 //set icon for network
   404                 if ( forbiddenOperator )
   393                 if ( showGraphicalList )
   405                     {
       
   406                     if ( info.iStatus == MPsetNetworkSelect::ENetStatForbidden )
       
   407                         {
       
   408                         insertString->Des().Insert( 0, KGSNetForbiddenIcon );
       
   409                         }
       
   410                     else 
       
   411                         {
       
   412                         insertString->Des().Insert( 0, KGSNetNoIcon );
       
   413                         }
       
   414                     }
       
   415                 else if ( showGraphicalList )
       
   416                     {
   394                     {
   417                     if ( FeatureManager::FeatureSupported(
   395                     if ( FeatureManager::FeatureSupported(
   418                                                   KFeatureIdProtocolWcdma ) )
   396                                                   KFeatureIdProtocolWcdma ) )
   419                         {
   397                         {
   420                         if ( info.iAccess !=
   398                         if ( info.iAccess !=
   426                             {
   404                             {
   427                             insertString->Des().Insert( 0, KGSNetGSMIcon );
   405                             insertString->Des().Insert( 0, KGSNetGSMIcon );
   428                             }
   406                             }
   429                         }
   407                         }
   430                     }
   408                     }
   431                 /** Implementation of forbidden operator icon ends */
       
   432                 items->AppendL( *insertString );
   409                 items->AppendL( *insertString );
   433                 CleanupStack::PopAndDestroy();
   410                 CleanupStack::PopAndDestroy();
   434                 }
   411                 }
   435 
   412 
   436             // For Testing purpuses ONLY
   413             // For Testing purpuses ONLY
   448             //Set title for list
   425             //Set title for list
   449             SetTitleToPopupL( *iNetworkPopupList, R_NETSL_FOUNDOPERATORS );
   426             SetTitleToPopupL( *iNetworkPopupList, R_NETSL_FOUNDOPERATORS );
   450 
   427 
   451             // Setup graphic items list for dual mode nw selection listbox
   428             // Setup graphic items list for dual mode nw selection listbox
   452             // based on the local variation
   429             // based on the local variation
   453             /** Implementation of forbidden operator icon begins */
   430             if ( showGraphicalList )
   454             if ( forbiddenOperator || showGraphicalList )
       
   455                 {
   431                 {
   456                 CAknIconArray* iconList = new (ELeave) CAknIconArray( 10 );
   432                 CAknIconArray* iconList = new (ELeave) CAknIconArray( 10 );
   457                 CleanupStack::PushL( iconList );
   433                 CleanupStack::PushL( iconList );
   458                 iconList->ConstructFromResourceL( R_NET_DUALMODE_ICONS );
   434                 iconList->ConstructFromResourceL( R_NET_DUALMODE_ICONS );
   459                 list->ItemDrawer()->ColumnData()->SetIconArray( iconList );
   435                 list->ItemDrawer()->ColumnData()->SetIconArray( iconList );
   460                 CleanupStack::Pop( iconList ); //listbox model now owns this
   436                 CleanupStack::Pop( iconList ); //listbox model now owns this
   461                 }
   437                 }
   462             /** Implementation of forbidden operator icon ends */
   438 
   463             TInt res = 0;
   439             TInt res = 0;
   464             if( items->Count() )
   440             if( items->Count() )
   465                 {
   441                 {
   466                 res = iNetworkPopupList->ExecuteLD();
   442                 res = iNetworkPopupList->ExecuteLD();
   467                 }
   443                 }