iaupdate/IAD/ui/src/iaupdateengine.cpp
changeset 77 d1838696558c
parent 69 b18a4bf55ddb
child 80 9dcba1ee99f7
--- a/iaupdate/IAD/ui/src/iaupdateengine.cpp	Tue Sep 28 14:48:39 2010 +0300
+++ b/iaupdate/IAD/ui/src/iaupdateengine.cpp	Thu Oct 14 14:11:30 2010 +0300
@@ -74,6 +74,11 @@
     {
     IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::~IAUpdateEngine() begin");
     InformRequestObserver(KErrCancel);
+    if (iController)
+        {
+        delete iController;
+        }
+    
     if (iIdle)
         {
         delete iIdle;
@@ -90,10 +95,7 @@
         {
         delete iAutomaticCheck;
         }
-    if (iController)
-        {
-        delete iController;
-        }
+    
     if (iFwUpdateHandler)
         {
         delete iFwUpdateHandler;
@@ -255,11 +257,11 @@
         {
         if (!iFwUpdateHandler)
             {
-            TRAP_IGNORE( CIAUpdateFWUpdateHandler::NewL() );
+            TRAP_IGNORE(CIAUpdateFWUpdateHandler::NewL());
             }
         if (iFwUpdateHandler)
             {
-            iFwUpdateHandler->FirmWareUpdatewithFOTA();
+            iFwUpdateHandler->FirmWareUpdatewithFOTA(this);
             }
         }
     else
@@ -289,6 +291,7 @@
     IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartUpdate() end");
     }
 
+
 // -----------------------------------------------------------------------------
 // IAUpdateEngine::SetVisibleL
 // 
@@ -355,6 +358,20 @@
     }
 
 // -----------------------------------------------------------------------------
+// IAUpdateEngine::Controller()
+// 
+// -----------------------------------------------------------------------------
+//      
+CIAUpdateUiController* IAUpdateEngine::Controller() const
+    {
+    return iController;
+    }
+
+
+
+
+
+// -----------------------------------------------------------------------------
 // IAUpdateEngine::handleAllClientsClosed()
 // 
 // -----------------------------------------------------------------------------
@@ -556,6 +573,26 @@
     }
 
 // -----------------------------------------------------------------------------
+// IAUpdateEngine::RefreshUIProgress
+// 
+// -----------------------------------------------------------------------------
+//
+void IAUpdateEngine::RefreshUIProgress()
+    {
+    emit refreshProgress();
+    }
+
+// -----------------------------------------------------------------------------
+// IAUpdateEngine::SetUpdatesRefreshing
+// 
+// -----------------------------------------------------------------------------
+//
+void IAUpdateEngine::SetUpdatesRefreshing( TBool aRefreshing )
+    {
+    emit setUpdatesRefreshing(aRefreshing);
+    }
+
+// -----------------------------------------------------------------------------
 // IAUpdateEngine::RefreshCompleteL
 // 
 // -----------------------------------------------------------------------------
@@ -576,11 +613,6 @@
     else
         {
         emit refresh(iController->Nodes(), iController->FwNodes(), aError);
-        
-        // inform bgchecker to clear indicator menu
-        User::LeaveIfError( 
-                RProperty::Set(KPSUidBgc, KIAUpdateBGNotifyIndicatorRemove, 0) );
-        
         //if ( aWithViewActivation)
         //  {
         //  ActivateLocalViewL( TUid::Uid( EIAUpdateMainViewId ) );
@@ -623,12 +655,33 @@
         InformRequestObserver(aError);
         }
 
+    emit updateCompleted();
     ShowResultsDialogL();
 
     IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::UpdateCompleteL end");
     }
 
 // -----------------------------------------------------------------------------
+// IAUpdateEngine::PreparingStarted
+// 
+// -----------------------------------------------------------------------------
+//
+void IAUpdateEngine::PreparingStarted()
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// IAUpdateEngine::Prepared
+// 
+// -----------------------------------------------------------------------------
+//
+void IAUpdateEngine::Prepared()
+    {
+    emit updateCompleted();
+    }
+
+// -----------------------------------------------------------------------------
 // IAUpdateEngine::ShowResultsDialogL
 // 
 // -----------------------------------------------------------------------------
@@ -657,16 +710,17 @@
 
     HbMessageBox *messageBox = new HbMessageBox(
             HbMessageBox::MessageTypeQuestion);
-    messageBox->setText(QString("Phone restart needed. Restart now?"));
+    messageBox->setText
+        (hbTrId("txt_software_info_device_restart_is_needed_restar"));
     int actionCount = messageBox->actions().count();
     for (int i = actionCount - 1; i >= 0; i--)
         {
         messageBox->removeAction(messageBox->actions().at(i));
         }
     mPrimaryAction = NULL;
-    mPrimaryAction = new HbAction("Ok");
+    mPrimaryAction = new HbAction(hbTrId("txt_common_button_ok"));
     HbAction *secondaryAction = NULL;
-    secondaryAction = new HbAction("Cancel");
+    secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"));
 
     messageBox->addAction(mPrimaryAction);
     messageBox->addAction(secondaryAction);