diff -r f7816ffc66ed -r 77415202bfc8 cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugin.cpp --- a/cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugin.cpp Tue Jan 26 12:12:48 2010 +0200 +++ b/cmmanager/gsconnsettingsplugin/src/gsconnsettingsplugin.cpp Tue Feb 02 00:24:11 2010 +0200 @@ -194,13 +194,24 @@ // void CGSConnSettingsPlugin::DoDeactivate() { - //Save current settings when we leave the view + CGSBaseView::DoDeactivate(); + } + +// --------------------------------------------------------------------------- +// CGSConnSettingsPlugin:: HandleForegroundEventL +// +// +// --------------------------------------------------------------------------- +// +void CGSConnSettingsPlugin::HandleForegroundEventL( TBool aForeground ) + { + //Load saved settings from Connection Settings API //If function leaves it is trapped and ignored as there is nothing that we can do about it - if ( iModel ) + if ( iModel && aForeground ) { - TRAP_IGNORE(iModel->SaveSettingsL()); - } - CGSBaseView::DoDeactivate(); + TRAP_IGNORE( iModel->LoadSettingsL() ); + UpdateListBoxL( EGSSettIdDataUsageHomeNw ); + } } // ---------------------------------------------------------------------------- @@ -373,7 +384,7 @@ void CGSConnSettingsPlugin::GetHelpContext( TCoeHelpContext& aContext ) { aContext.iMajor = KUidGS; - aContext.iContext = KCP_HLP_ADMINISTRATIVE_SETTINGS; + aContext.iContext = KHLP_OCC_CONN_SETTINGS; } // --------------------------------------------------------------------------- @@ -466,6 +477,9 @@ { 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()); } } @@ -509,6 +523,9 @@ { iModel->SetDataUsageAbroad( currentItem ); UpdateListBoxL( EGSSettIdDataUsageAbroad ); + //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 ); @@ -550,6 +567,9 @@ { iModel->SetDataUsageInHomeNw( currentItem ); UpdateListBoxL( EGSSettIdDataUsageHomeNw ); + //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 );