diff -r 5cc91383ab1e -r 7333d7932ef7 iaupdate/IAD/ui/src/iaupdateautomaticcheck.cpp --- a/iaupdate/IAD/ui/src/iaupdateautomaticcheck.cpp Thu Aug 19 10:02:49 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdateautomaticcheck.cpp Tue Aug 31 15:21:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,16 +21,13 @@ //INCLUDES #include "iaupdateautomaticcheck.h" -#include "iaupdatedialogutil.h" #include "iaupdatefirsttimeinfo.h" #include "iaupdate.hrh" #include "iaupdateprivatecrkeys.h" -#include "iaupdateapplication.h" +#include "iaupdatedialogutil.h" -#include -#include -#include #include +#include // --------------------------------------------------------------------------- @@ -83,6 +80,10 @@ // CIAUpdateAutomaticCheck::~CIAUpdateAutomaticCheck() { + if ( mDialogUtil ) + { + delete mDialogUtil; + } } @@ -91,9 +92,8 @@ // // --------------------------------------------------------------------------- // -TBool CIAUpdateAutomaticCheck::AcceptAutomaticCheckL() +void CIAUpdateAutomaticCheck::AcceptAutomaticCheckL() { - TBool acceptChecks = ETrue; CIAUpdateFirstTimeInfo* firstTimeInfo = CIAUpdateFirstTimeInfo::NewLC(); if ( !firstTimeInfo->AutomaticUpdateChecksAskedL() ) { @@ -104,18 +104,21 @@ } else { - TInt ret = IAUpdateDialogUtil::ShowConfirmationQueryL( - R_IAUPDATE_TURN_ON_AUTOUPD_CHECKS, - R_AVKON_SOFTKEYS_YES_NO ); - firstTimeInfo->SetAutomaticUpdatesAskedL(); - if ( ret == EAknSoftkeyYes ) - { - EnableAutoUpdateCheckL( ETrue ); + if ( !mDialogUtil ) + { + mDialogUtil = new IAUpdateDialogUtil(NULL, this); } - } + if ( mDialogUtil ) + { + mPrimaryAction = NULL; + mPrimaryAction = new HbAction("Yes"); + HbAction *secondaryAction = NULL; + secondaryAction = new HbAction("No"); + mDialogUtil->showQuestion(QString("Turn on setting for Automatic update checks?"), mPrimaryAction, secondaryAction); + } + } } CleanupStack::PopAndDestroy( firstTimeInfo ); - return acceptChecks; } // --------------------------------------------------------------------------- @@ -169,5 +172,19 @@ CleanupStack::PopAndDestroy( cenrep ); } - +// --------------------------------------------------------------------------- +// CIAUpdateAutomaticCheck::dialogFinished +// +// --------------------------------------------------------------------------- +// +void CIAUpdateAutomaticCheck::dialogFinished(HbAction *action) + { + if ( action == mPrimaryAction ) + { + EnableAutoUpdateCheckL( ETrue ); + } + CIAUpdateFirstTimeInfo* firstTimeInfo = CIAUpdateFirstTimeInfo::NewLC(); + firstTimeInfo->SetAutomaticUpdatesAskedL(); + CleanupStack::PopAndDestroy( firstTimeInfo ); + } // End of File