113 CWPASecuritySettingsImpl* aSecuritySettings, |
113 CWPASecuritySettingsImpl* aSecuritySettings, |
114 const TDesC& aTitle ) |
114 const TDesC& aTitle ) |
115 { |
115 { |
116 CleanupStack::PushL( this ); |
116 CleanupStack::PushL( this ); |
117 |
117 |
118 const TInt Titles_Wpa_Main[KNumOfFieldsMain+1] = |
118 const TInt Titles_Wpa_Main[KNumOfFieldsMain+2] = |
119 { |
119 { |
120 R_WPA_MODE, |
120 R_WPA_MODE, |
121 R_WPA_EAP_CONFIG, |
121 R_WPA_EAP_CONFIG, |
122 R_WPA_MODE_PRESHARED_KEY, |
122 R_WPA_MODE_PRESHARED_KEY, |
123 R_WPA_TKIP_CIPHER |
123 R_WPA_TKIP_CIPHER, |
|
124 R_WPA_UNENCRYPTED_CONN |
124 }; |
125 }; |
125 |
126 |
126 const TInt Fields_Wpa_Main[KNumOfFieldsMain+1] = |
127 const TInt Fields_Wpa_Main[KNumOfFieldsMain+2] = |
127 { |
128 { |
128 EWpaMode, |
129 EWpaMode, |
129 EWpaEapConfig, |
130 EWpaEapConfig, |
130 EWpaPreSharedKey, |
131 EWpaPreSharedKey, |
131 EWpaWpa2Only |
132 EWpaWpa2Only, |
|
133 EWpaUnencryptedConn |
132 }; |
134 }; |
133 |
135 |
134 iSecuritySettings = aSecuritySettings; |
136 iSecuritySettings = aSecuritySettings; |
135 iConnectionName = aTitle; |
137 iConnectionName = aTitle; |
136 |
138 |
457 TInt numOfFields = iSecuritySettings->SecurityMode() == ESecurityModeWpa ? |
465 TInt numOfFields = iSecuritySettings->SecurityMode() == ESecurityModeWpa ? |
458 KNumOfFieldsMain : KNumOfFieldsMain-1; |
466 KNumOfFieldsMain : KNumOfFieldsMain-1; |
459 |
467 |
460 for( TInt i = 0; i < numOfFields; i++ ) |
468 for( TInt i = 0; i < numOfFields; i++ ) |
461 { |
469 { |
|
470 // 802.1x has no WpaMode (PSK not supported) and no Wpa2Only selection |
|
471 if ( iSecuritySettings->SecurityMode() == ESecurityMode8021x && |
|
472 (*wpaMember == EWpaMode ||*wpaMember == EWpaWpa2Only ) ) |
|
473 { |
|
474 wpaMember++; |
|
475 aRes++; |
|
476 } |
|
477 // If PSK in use, EAP plug-in configuration is not shown |
462 if ( *wpaMember == EWpaEapConfig && iSecuritySettings->WPAMode() ) |
478 if ( *wpaMember == EWpaEapConfig && iSecuritySettings->WPAMode() ) |
463 { |
479 { |
464 wpaMember++; |
480 wpaMember++; |
465 aRes++; |
481 aRes++; |
466 } |
482 } |
482 |
498 |
483 aItemArray.AppendL( *itemText ); |
499 aItemArray.AppendL( *itemText ); |
484 |
500 |
485 CleanupStack::PopAndDestroy( 2, title ); // itemText, title |
501 CleanupStack::PopAndDestroy( 2, title ); // itemText, title |
486 |
502 |
|
503 // If Eap in use, PreSharedKey is not shown |
487 wpaMember++; |
504 wpaMember++; |
488 aRes++; |
505 aRes++; |
489 } |
506 } |
490 else // EWpaMode, EWpaPreSharedKey, EWpaWpa2Only: |
507 else // EWpaMode, EWpaPreSharedKey, EWpaWpa2Only, EWpaUnencryptedConn: |
491 { |
508 { |
492 HBufC* itemText = CreateTextualListBoxItemL( *wpaMember, *aRes ); |
509 if (( *wpaMember != EWpaUnencryptedConn ) || |
493 CleanupStack::PushL( itemText ); |
510 (FeatureManager::FeatureSupported( KFeatureIdFfWlanAuthenticationOnlySupport ) ) ) |
494 aItemArray.AppendL( itemText->Des() ); |
511 { |
495 CleanupStack::PopAndDestroy( itemText ); |
512 HBufC* itemText = CreateTextualListBoxItemL( *wpaMember, *aRes ); |
|
513 CleanupStack::PushL( itemText ); |
|
514 aItemArray.AppendL( itemText->Des() ); |
|
515 CleanupStack::PopAndDestroy( itemText ); |
|
516 } |
496 } |
517 } |
497 |
518 |
498 wpaMember++; |
519 wpaMember++; |
499 aRes++; |
520 aRes++; |
500 } |
521 } |
577 valueResourceID = iSecuritySettings->Wpa2Only() ? |
598 valueResourceID = iSecuritySettings->Wpa2Only() ? |
578 R_WPA_CIPHER_NOT_ALLOWED : R_WPA_CIPHER_ALLOWED; |
599 R_WPA_CIPHER_NOT_ALLOWED : R_WPA_CIPHER_ALLOWED; |
579 break; |
600 break; |
580 } |
601 } |
581 |
602 |
|
603 case EWpaUnencryptedConn: |
|
604 { |
|
605 valueResourceID = iSecuritySettings->WPAUnencryptedConn() ? |
|
606 R_WPA_UNENCRYPTED_CONN_ALLOW : R_WPA_UNENCRYPTED_CONN_NOT_ALLOW; |
|
607 break; |
|
608 } |
|
609 |
582 case EWpaPreSharedKey: |
610 case EWpaPreSharedKey: |
583 { |
611 { |
584 valueResourceID = |
612 valueResourceID = |
585 iSecuritySettings->WPAPreSharedKey()->Length() == 0 ? |
613 iSecuritySettings->WPAPreSharedKey()->Length() == 0 ? |
586 R_WPA_PRESHARED_KEY_MUST_BE_DEFINED : 0; |
614 R_WPA_PRESHARED_KEY_MUST_BE_DEFINED : 0; |
643 // |
671 // |
644 TBool CWPASecuritySettingsDlg::ShowPopupSettingPageL( TWpaMember aData ) |
672 TBool CWPASecuritySettingsDlg::ShowPopupSettingPageL( TWpaMember aData ) |
645 { |
673 { |
646 TInt currvalue( 0 ); |
674 TInt currvalue( 0 ); |
647 TBool retval( EFalse ); |
675 TBool retval( EFalse ); |
|
676 TInt attr_resid( 0 ); |
|
677 |
648 CDesCArrayFlat* items = FillPopupSettingPageLC( aData, currvalue ); |
678 CDesCArrayFlat* items = FillPopupSettingPageLC( aData, currvalue ); |
649 |
679 |
650 TInt attr_resid = aData == EWpaMode ? R_WPA_MODE : R_WPA_TKIP_CIPHER; |
680 |
|
681 if ( aData == EWpaUnencryptedConn) |
|
682 { |
|
683 attr_resid = R_WPA_UNENCRYPTED_CONN; |
|
684 } |
|
685 else |
|
686 { |
|
687 attr_resid = aData == EWpaMode ? R_WPA_MODE : R_WPA_TKIP_CIPHER; |
|
688 } |
651 |
689 |
652 HBufC* titlebuf = iEikonEnv->AllocReadResourceLC( attr_resid ); |
690 HBufC* titlebuf = iEikonEnv->AllocReadResourceLC( attr_resid ); |
653 CAknRadioButtonSettingPage* dlg = new ( ELeave )CAknRadioButtonSettingPage( |
691 CAknRadioButtonSettingPage* dlg = new ( ELeave )CAknRadioButtonSettingPage( |
654 R_RADIO_BUTTON_SETTING_PAGE, currvalue, items ); |
692 R_RADIO_BUTTON_SETTING_PAGE, currvalue, items ); |
655 CleanupStack::PushL( dlg ); |
693 CleanupStack::PushL( dlg ); |
779 |
817 |
780 items->AppendL( *iEikonEnv->AllocReadResourceLC( |
818 items->AppendL( *iEikonEnv->AllocReadResourceLC( |
781 R_WPA_MODE_PRESHARED_KEY ) ); |
819 R_WPA_MODE_PRESHARED_KEY ) ); |
782 CleanupStack::PopAndDestroy(); |
820 CleanupStack::PopAndDestroy(); |
783 } |
821 } |
784 else // EWpaWpa2Only: |
822 else if ( aData == EWpaWpa2Only ) |
785 { |
823 { |
786 items->AppendL( *iEikonEnv->AllocReadResourceLC( |
824 items->AppendL( *iEikonEnv->AllocReadResourceLC( |
787 R_WPA_CIPHER_ALLOWED ) ); |
825 R_WPA_CIPHER_ALLOWED ) ); |
788 CleanupStack::PopAndDestroy(); |
826 CleanupStack::PopAndDestroy(); |
789 items->AppendL( *iEikonEnv->AllocReadResourceLC( |
827 items->AppendL( *iEikonEnv->AllocReadResourceLC( |
790 R_WPA_CIPHER_NOT_ALLOWED ) ); |
828 R_WPA_CIPHER_NOT_ALLOWED ) ); |
791 CleanupStack::PopAndDestroy(); |
829 CleanupStack::PopAndDestroy(); |
792 |
830 |
793 aCurrvalue = iSecuritySettings->Wpa2Only(); |
831 aCurrvalue = iSecuritySettings->Wpa2Only(); |
794 } |
832 } |
795 |
833 else // EWpaUnencryptedConn |
|
834 { |
|
835 items->AppendL( *iEikonEnv->AllocReadResourceLC( |
|
836 R_WPA_UNENCRYPTED_CONN_NOT_ALLOW ) ); |
|
837 CleanupStack::PopAndDestroy(); |
|
838 items->AppendL( *iEikonEnv->AllocReadResourceLC( |
|
839 R_WPA_UNENCRYPTED_CONN_ALLOW ) ); |
|
840 CleanupStack::PopAndDestroy(); |
|
841 |
|
842 aCurrvalue = iSecuritySettings->WPAUnencryptedConn(); |
|
843 } |
|
844 |
796 return items; |
845 return items; |
797 } |
846 } |
798 |
847 |
799 |
848 |
800 // --------------------------------------------------------- |
849 // --------------------------------------------------------- |
817 { |
866 { |
818 iSecuritySettings->SetWPAMode( aCurrvalue ); |
867 iSecuritySettings->SetWPAMode( aCurrvalue ); |
819 retVal = ETrue; |
868 retVal = ETrue; |
820 } |
869 } |
821 } |
870 } |
822 else // EWpaWpa2Only: |
871 else if ( aData == EWpaWpa2Only ) |
823 { |
872 { |
824 if ( iSecuritySettings->Wpa2Only() != aCurrvalue ) |
873 if ( iSecuritySettings->Wpa2Only() != aCurrvalue ) |
825 { |
874 { |
826 iSecuritySettings->SetWpa2Only( aCurrvalue ); |
875 iSecuritySettings->SetWpa2Only( aCurrvalue ); |
827 retVal = ETrue; |
876 retVal = ETrue; |
828 } |
877 } |
829 } |
878 } |
|
879 else // EWpaUnencryptedConn |
|
880 { |
|
881 if ( iSecuritySettings->WPAUnencryptedConn() != aCurrvalue ) |
|
882 { |
|
883 iSecuritySettings->SetWPAUnencryptedConn( aCurrvalue ); |
|
884 retVal = ETrue; |
|
885 } |
|
886 } |
830 |
887 |
831 return retVal; |
888 return retVal; |
832 } |
889 } |
833 |
890 |
834 |
891 |
856 TInt itemIndex; |
913 TInt itemIndex; |
857 TInt shift; |
914 TInt shift; |
858 |
915 |
859 itemIndex = ( Max( iList->CurrentItemIndex(), 0 ) ); |
916 itemIndex = ( Max( iList->CurrentItemIndex(), 0 ) ); |
860 |
917 |
861 shift = ( itemIndex >= EWpaWpa2Only || |
918 //In 802.1x the first item is EapConfig and second item is UncryptedConn |
862 ( itemIndex == EWpaEapConfig && |
919 if (iSecuritySettings->SecurityMode() == ESecurityMode8021x) |
863 iSecuritySettings->WPAMode() ) ) ? 1 : 0; |
920 { |
864 |
921 shift = ( itemIndex == EWpaMode ) ? 1 : 3; |
|
922 } |
|
923 else |
|
924 { |
|
925 shift = ( itemIndex >= EWpaWpa2Only || |
|
926 ( itemIndex == EWpaEapConfig && |
|
927 iSecuritySettings->WPAMode() ) ) ? 1 : 0; |
|
928 } |
|
929 |
865 TWpaMember* ptr = iFieldsMain + itemIndex + shift; |
930 TWpaMember* ptr = iFieldsMain + itemIndex + shift; |
866 TInt* titPtr = iTitlesMain + itemIndex + shift; |
931 TInt* titPtr = iTitlesMain + itemIndex + shift; |
867 |
932 |
868 switch ( *ptr ) |
933 switch ( *ptr ) |
869 { |
934 { |
921 UpdateTextualListBoxItemL( *ptr, *titPtr, itemIndex ); |
986 UpdateTextualListBoxItemL( *ptr, *titPtr, itemIndex ); |
922 *iEventStore |= CWPASecuritySettings::EModified; |
987 *iEventStore |= CWPASecuritySettings::EModified; |
923 } |
988 } |
924 break; |
989 break; |
925 } |
990 } |
|
991 |
|
992 case EWpaUnencryptedConn: |
|
993 { // Setting item with two available values |
|
994 TBool changed( ETrue ); |
|
995 if ( aQuick ) |
|
996 { |
|
997 iSecuritySettings->SetWPAUnencryptedConn( |
|
998 !iSecuritySettings->WPAUnencryptedConn() ); |
|
999 } |
|
1000 else |
|
1001 { |
|
1002 changed = ShowPopupSettingPageL( EWpaUnencryptedConn ); |
|
1003 } |
|
1004 |
|
1005 if ( changed ) |
|
1006 { |
|
1007 UpdateTextualListBoxItemL( *ptr, *titPtr, itemIndex ); |
|
1008 *iEventStore |= CWPASecuritySettings::EModified; |
|
1009 } |
|
1010 break; |
|
1011 } |
926 |
1012 |
927 case EWpaPreSharedKey: |
1013 case EWpaPreSharedKey: |
928 { // Text setting item |
1014 { // Text setting item |
929 if ( ShowPopupTextSettingPageL() ) |
1015 if ( ShowPopupTextSettingPageL() ) |
930 { |
1016 { |