iaupdate/IAD/ui/src/iaupdatesettingdialog.cpp
changeset 53 ae54820ef82c
parent 42 d17dc5398051
child 69 b18a4bf55ddb
equal deleted inserted replaced
52:92f864ef0288 53:ae54820ef82c
    24 #include <xqconversions.h>
    24 #include <xqconversions.h>
    25 #include <hbaction.h> 
    25 #include <hbaction.h> 
    26 
    26 
    27 #include "iaupdatesettingdialog.h"
    27 #include "iaupdatesettingdialog.h"
    28 #include "iaupdateprivatecrkeys.h"
    28 #include "iaupdateprivatecrkeys.h"
    29 
    29 #include "iaupdate.hrh"
       
    30 
       
    31 
       
    32 const TInt KAutoUpdateOn( 0 );
       
    33 const TInt KAutoUpdateOff( 1 );
       
    34 const TInt KAutoUpdateOnInHomeNetwork( 2 );
    30 
    35 
    31 /*
    36 /*
    32 Constructor. It creates a formwidget on the view. 
    37 Constructor. It creates a formwidget on the view. 
    33 */
    38 */
    34 CIAUpdateSettingDialog::CIAUpdateSettingDialog(QGraphicsItem* parent):HbView(parent)
    39 CIAUpdateSettingDialog::CIAUpdateSettingDialog(QGraphicsItem* parent):HbView(parent)
   188     err = cenrep->Set( KIAUpdateAccessPoint, value ) ;
   193     err = cenrep->Set( KIAUpdateAccessPoint, value ) ;
   189     User::LeaveIfError( err );
   194     User::LeaveIfError( err );
   190     
   195     
   191     // Set auto update check
   196     // Set auto update check
   192     value = mAutoUpdateItem->contentWidgetData(QString("currentIndex")).toInt();
   197     value = mAutoUpdateItem->contentWidgetData(QString("currentIndex")).toInt();
       
   198     
       
   199     // Convert ist index index to setting value
       
   200     switch ( value )
       
   201          {
       
   202          case KAutoUpdateOn:
       
   203              value = EIAUpdateSettingValueDisableWhenRoaming;
       
   204              break;
       
   205          case KAutoUpdateOff:
       
   206              value = EIAUpdateSettingValueDisable;
       
   207              break;
       
   208          case KAutoUpdateOnInHomeNetwork:
       
   209              value = EIAUpdateSettingValueEnable;
       
   210              break;
       
   211          default: 
       
   212              break;
       
   213          }
   193     err = cenrep->Set( KIAUpdateAutoUpdateCheck, value ); 
   214     err = cenrep->Set( KIAUpdateAutoUpdateCheck, value ); 
       
   215     
   194     User::LeaveIfError( err );
   216     User::LeaveIfError( err );
   195     
   217     
   196     TUint32 ignore = KErrNone;
   218     TUint32 ignore = KErrNone;
   197     User::LeaveIfError( cenrep->CommitTransaction( ignore ) );
   219     User::LeaveIfError( cenrep->CommitTransaction( ignore ) );
   198     CleanupStack::PopAndDestroy(); // CleanupCancelTransactionPushL()
   220     CleanupStack::PopAndDestroy(); // CleanupCancelTransactionPushL()
   236     mDestinationItem->setContentWidgetData(QString("text"), mCurrentDest);
   258     mDestinationItem->setContentWidgetData(QString("text"), mCurrentDest);
   237     
   259     
   238     // set auto update value
   260     // set auto update value
   239     int value = 0;
   261     int value = 0;
   240     User::LeaveIfError( cenrep->Get( KIAUpdateAutoUpdateCheck, value ) );
   262     User::LeaveIfError( cenrep->Get( KIAUpdateAutoUpdateCheck, value ) );
       
   263     
       
   264     // map cenrep value to index
       
   265     switch ( value )
       
   266          {
       
   267          case EIAUpdateSettingValueEnable:
       
   268              value = KAutoUpdateOn; // On 
       
   269              break;
       
   270          case EIAUpdateSettingValueDisable:
       
   271              value = KAutoUpdateOff; // Off
       
   272              break;
       
   273          case EIAUpdateSettingValueDisableWhenRoaming:
       
   274              value = KAutoUpdateOnInHomeNetwork; // On in home network
       
   275              break;
       
   276          default: 
       
   277              break;
       
   278          }
       
   279     
   241     mAutoUpdateItem->setContentWidgetData("currentIndex", value);
   280     mAutoUpdateItem->setContentWidgetData("currentIndex", value);
   242     
   281     
   243    
   282    
   244     CleanupStack::PopAndDestroy( cenrep ); 
   283     CleanupStack::PopAndDestroy( cenrep ); 
   245 
   284