iaupdate/IAD/ui/src/iaupdateautomaticcheck.cpp
branchRCL_3
changeset 65 7333d7932ef7
parent 0 ba25891c3a9e
child 66 8b7f4e561641
--- 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 <avkon.rsg>
-#include <avkon.hrh>
-#include <iaupdate.rsg>
 #include <centralrepository.h> 
+#include <hbaction.h>
 
 
 // ---------------------------------------------------------------------------
@@ -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