diff -r 77415202bfc8 -r 2e6c4614c58e cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugin.cpp --- a/cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugin.cpp Tue Feb 02 00:24:11 2010 +0200 +++ b/cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugin.cpp Fri Feb 19 23:12:51 2010 +0200 @@ -28,11 +28,11 @@ #include // Includes from GS framework: -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include // For HlpLauncher #include @@ -115,7 +115,7 @@ FeatureManager::InitializeLibL(); iIsWlanSupported = FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ); // Unload FeatureManager - FeatureManager::UnInitializeLib(); + FeatureManager::UnInitializeLib(); OpenLocalizedResourceFileL( KGSConnSettingsPluginResourceFileName, iResourceLoader ); @@ -456,35 +456,12 @@ // void CGSConnSettingsPlugin::ShowUsageOfWlanSettingPageL() { - - CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( - R_USAGE_OF_WLAN_SETTING_PAGE_LBX ); - CleanupStack::PushL( items ); - - TInt currentItem = iModel->UsageOfWlan(); - TInt oldItem = currentItem; - - CGSConnSettingsSelectionDlg* dlg = CGSConnSettingsSelectionDlg::NewL( - R_USAGE_OF_WLAN_SETTING_PAGE, - currentItem, - items, - R_USAGE_OF_WLAN_INFO_POPUP_TEXTS ); - - if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) - { - - if( currentItem != oldItem ) - { - iModel->SetUsageOfWlan( currentItem ); - UpdateListBoxL( EGSSettIdUsageOfWlan ); - //Save current settings when the setting is changed - //If function leaves it is trapped and ignored as there is nothing that we can do about it - TRAP_IGNORE(iModel->SaveSettingsL()); - } - } - - CleanupStack::PopAndDestroy( items ); - + TBool currentItem = (TBool)iModel->UsageOfWlan(); + iModel->SetUsageOfWlan( !currentItem ); + UpdateListBoxL( EGSSettIdUsageOfWlan ); + //Save current settings when the setting is changed + //If function leaves it is trapped and ignored as there is nothing that we can do about it + TRAP_IGNORE(iModel->SaveSettingsL()); } // --------------------------------------------------------------------------- @@ -511,6 +488,14 @@ CleanupStack::PushL( items ); TInt currentItem = iModel->DataUsageAbroad(); + + // We may have to do in this way because EDataUsageAbroadDisabled is equal to 3 + // and the actual index number should be 2 in this case + if( !iIsWlanSupported && currentItem == EDataUsageAbroadDisabled ) + { + currentItem --; + } + TInt oldItem = currentItem; CAknSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage( @@ -555,6 +540,14 @@ CleanupStack::PushL( items ); TInt currentItem = iModel->DataUsageInHomeNw(); + + // We may have to do in this way because EDataUsageAbroadDisabled is equal to 3 + // and the actual index number should be 2 in this case + if( !iIsWlanSupported && currentItem == EDataUsageAbroadDisabled ) + { + currentItem --; + } + TInt oldItem = currentItem; CAknSettingPage* dlg = new( ELeave ) CAknRadioButtonSettingPage(