gssettingsuis/Gs/GSNetworkPlugin/Src/GSNetworkPlugin.cpp
branchRCL_3
changeset 23 8bda91a87a00
parent 17 3b47783fdf16
equal deleted inserted replaced
22:673fb3e04649 23:8bda91a87a00
    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 
    78 /* Implementation of forbidden operator icon begins */
       
    79 _LIT( KGSNetNoIcon, "\t");
       
    80 _LIT( KGSNetForbiddenIcon, "2\t" );
       
    81 /* Implementation of forbidden operator icon ends */
    79 // Warning disabled as this constant is used inside __ASSERT_DEBUG
    82 // Warning disabled as this constant is used inside __ASSERT_DEBUG
    80 #pragma diag_suppress 177
    83 #pragma diag_suppress 177
    81 _LIT( KGSNetworkPluginAssertName, "CGSNetworkPlugin" );
    84 _LIT( KGSNetworkPluginAssertName, "CGSNetworkPlugin" );
    82 
    85 
    83 
    86 
   310 
   313 
   311     //check if the graphical list is needed... set in local variation
   314     //check if the graphical list is needed... set in local variation
   312     TBool showGraphicalList =
   315     TBool showGraphicalList =
   313         Container()->NetPluginModel()->GraphicalNetworkListSupportedL();
   316         Container()->NetPluginModel()->GraphicalNetworkListSupportedL();
   314     __GSLOGSTRING1("[GS]    NetworkListL: showGraphicalList: %d", showGraphicalList);
   317     __GSLOGSTRING1("[GS]    NetworkListL: showGraphicalList: %d", showGraphicalList);
   315 
   318    
   316     //if no net items were found, do not show list
   319     //if no net items were found, do not show list
   317     if ( iNetworkArray->Count() > 0 )
   320     if ( iNetworkArray->Count() > 0 )
   318         {
   321         {
       
   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 */
   319         while ( !iApprovedNetwork )
   327         while ( !iApprovedNetwork )
   320             {
   328             {
   321             AknPopupListEmpty<CEikFormattedCellListBox>* list;
   329             AknPopupListEmpty<CEikFormattedCellListBox>* list;
   322             if ( showGraphicalList &&
   330             /** Implementation of forbidden operator icon begins */
   323                  FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) )
   331             if (forbiddenOperator || showGraphicalList
   324                 {
   332                     && FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma))
   325                 list = new ( ELeave ) CAknSingleGraphicPopupMenuStyleListBox;
   333                 {
       
   334                 list = new (ELeave) CAknSingleGraphicPopupMenuStyleListBox;
   326                 }
   335                 }
   327             else
   336             else
   328                 {
   337                 {
   329                 list = new ( ELeave ) CAknSinglePopupMenuStyleListBox;
   338                 list = new (ELeave) CAknSinglePopupMenuStyleListBox;
   330                 }
   339                 }
   331 
   340             /** Implementation of forbidden operator icon ends */
       
   341             
   332             CleanupStack::PushL( list );
   342             CleanupStack::PushL( list );
   333             if ( iNetworkPopupList )
   343             if ( iNetworkPopupList )
   334                 {
   344                 {
   335                 iNetworkPopupList->CancelPopup();
   345                 iNetworkPopupList->CancelPopup();
   336                 iNetworkPopupList = NULL;
   346                 iNetworkPopupList = NULL;
   387                     {
   397                     {
   388                     insertString->Des().Append( info.iLongName );
   398                     insertString->Des().Append( info.iLongName );
   389                     __GSLOGSTRING1("[GS]    NetworkListL: Network Longname: %S", insertString);
   399                     __GSLOGSTRING1("[GS]    NetworkListL: Network Longname: %S", insertString);
   390                     }
   400                     }
   391 
   401 
       
   402                 /** Implementation of forbidden operator icon begins */
   392                 //set icon for network
   403                 //set icon for network
   393                 if ( showGraphicalList )
   404                 if ( forbiddenOperator )
       
   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 )
   394                     {
   416                     {
   395                     if ( FeatureManager::FeatureSupported(
   417                     if ( FeatureManager::FeatureSupported(
   396                                                   KFeatureIdProtocolWcdma ) )
   418                                                   KFeatureIdProtocolWcdma ) )
   397                         {
   419                         {
   398                         if ( info.iAccess !=
   420                         if ( info.iAccess !=
   404                             {
   426                             {
   405                             insertString->Des().Insert( 0, KGSNetGSMIcon );
   427                             insertString->Des().Insert( 0, KGSNetGSMIcon );
   406                             }
   428                             }
   407                         }
   429                         }
   408                     }
   430                     }
       
   431                 /** Implementation of forbidden operator icon ends */
   409                 items->AppendL( *insertString );
   432                 items->AppendL( *insertString );
   410                 CleanupStack::PopAndDestroy();
   433                 CleanupStack::PopAndDestroy();
   411                 }
   434                 }
   412 
   435 
   413             // For Testing purpuses ONLY
   436             // For Testing purpuses ONLY
   425             //Set title for list
   448             //Set title for list
   426             SetTitleToPopupL( *iNetworkPopupList, R_NETSL_FOUNDOPERATORS );
   449             SetTitleToPopupL( *iNetworkPopupList, R_NETSL_FOUNDOPERATORS );
   427 
   450 
   428             // Setup graphic items list for dual mode nw selection listbox
   451             // Setup graphic items list for dual mode nw selection listbox
   429             // based on the local variation
   452             // based on the local variation
   430             if ( showGraphicalList )
   453             /** Implementation of forbidden operator icon begins */
       
   454             if ( forbiddenOperator || showGraphicalList )
   431                 {
   455                 {
   432                 CAknIconArray* iconList = new (ELeave) CAknIconArray( 10 );
   456                 CAknIconArray* iconList = new (ELeave) CAknIconArray( 10 );
   433                 CleanupStack::PushL( iconList );
   457                 CleanupStack::PushL( iconList );
   434                 iconList->ConstructFromResourceL( R_NET_DUALMODE_ICONS );
   458                 iconList->ConstructFromResourceL( R_NET_DUALMODE_ICONS );
   435                 list->ItemDrawer()->ColumnData()->SetIconArray( iconList );
   459                 list->ItemDrawer()->ColumnData()->SetIconArray( iconList );
   436                 CleanupStack::Pop( iconList ); //listbox model now owns this
   460                 CleanupStack::Pop( iconList ); //listbox model now owns this
   437                 }
   461                 }
   438 
   462             /** Implementation of forbidden operator icon ends */
   439             TInt res = 0;
   463             TInt res = 0;
   440             if( items->Count() )
   464             if( items->Count() )
   441                 {
   465                 {
   442                 res = iNetworkPopupList->ExecuteLD();
   466                 res = iNetworkPopupList->ExecuteLD();
   443                 }
   467                 }
  1714         }
  1738         }
  1715 
  1739 
  1716     if( PhoneOnline() )
  1740     if( PhoneOnline() )
  1717         {
  1741         {
  1718         __GSLOGSTRING(" [CGSNetworkPlugin::UpdateNetworkTextL] Loading operational-text" );
  1742         __GSLOGSTRING(" [CGSNetworkPlugin::UpdateNetworkTextL] Loading operational-text" );
  1719         iNetworkText = iNWInfo.iLongName.AllocL();      
  1743         // The service provider name may missed in SIM card, so display the operator name
       
  1744         // which returned by NTSY here.
       
  1745         iNetworkText = iNWInfo.iOperatorNameInfo.iName.AllocL();
  1720         }
  1746         }
  1721     else
  1747     else
  1722         {
  1748         {
  1723         __GSLOGSTRING(" [CGSNetworkPlugin::UpdateNetworkTextL] Loading offline-text" );
  1749         __GSLOGSTRING(" [CGSNetworkPlugin::UpdateNetworkTextL] Loading offline-text" );
  1724         networkStatusRscId = R_CELLULAR_OFFLINE;
  1750         networkStatusRscId = R_CELLULAR_OFFLINE;