iaupdate/IAD/ui/src/iaupdatesettingdialog.cpp
changeset 44 329d304c1aa1
parent 42 d17dc5398051
child 69 b18a4bf55ddb
--- a/iaupdate/IAD/ui/src/iaupdatesettingdialog.cpp	Fri Jun 11 13:45:18 2010 +0300
+++ b/iaupdate/IAD/ui/src/iaupdatesettingdialog.cpp	Thu Jun 24 12:37:54 2010 +0300
@@ -26,8 +26,13 @@
 
 #include "iaupdatesettingdialog.h"
 #include "iaupdateprivatecrkeys.h"
+#include "iaupdate.hrh"
 
 
+const TInt KAutoUpdateOn( 0 );
+const TInt KAutoUpdateOff( 1 );
+const TInt KAutoUpdateOnInHomeNetwork( 2 );
+
 /*
 Constructor. It creates a formwidget on the view. 
 */
@@ -190,7 +195,24 @@
     
     // Set auto update check
     value = mAutoUpdateItem->contentWidgetData(QString("currentIndex")).toInt();
+    
+    // Convert ist index index to setting value
+    switch ( value )
+         {
+         case KAutoUpdateOn:
+             value = EIAUpdateSettingValueDisableWhenRoaming;
+             break;
+         case KAutoUpdateOff:
+             value = EIAUpdateSettingValueDisable;
+             break;
+         case KAutoUpdateOnInHomeNetwork:
+             value = EIAUpdateSettingValueEnable;
+             break;
+         default: 
+             break;
+         }
     err = cenrep->Set( KIAUpdateAutoUpdateCheck, value ); 
+    
     User::LeaveIfError( err );
     
     TUint32 ignore = KErrNone;
@@ -238,6 +260,23 @@
     // set auto update value
     int value = 0;
     User::LeaveIfError( cenrep->Get( KIAUpdateAutoUpdateCheck, value ) );
+    
+    // map cenrep value to index
+    switch ( value )
+         {
+         case EIAUpdateSettingValueEnable:
+             value = KAutoUpdateOn; // On 
+             break;
+         case EIAUpdateSettingValueDisable:
+             value = KAutoUpdateOff; // Off
+             break;
+         case EIAUpdateSettingValueDisableWhenRoaming:
+             value = KAutoUpdateOnInHomeNetwork; // On in home network
+             break;
+         default: 
+             break;
+         }
+    
     mAutoUpdateItem->setContentWidgetData("currentIndex", value);