480 } |
480 } |
481 // Inform the controller that we are now starting updates. This way the |
481 // Inform the controller that we are now starting updates. This way the |
482 // controller can handle situations as a whole and not as one item at the |
482 // controller can handle situations as a whole and not as one item at the |
483 // time. |
483 // time. |
484 iController->StartingUpdatesL(); |
484 iController->StartingUpdatesL(); |
485 |
485 |
|
486 //Store current node list before update |
|
487 iFilter->StoreNodeListL( iNodes ); |
|
488 |
|
489 iFilter->SortSelectedNodesFirstL( iSelectedNodesArray, iNodes ); |
|
490 |
486 iFileInUseError = EFalse; |
491 iFileInUseError = EFalse; |
487 // Set the node index to -1 because ContinueUpdateL increases it by one |
492 // Set the node index to -1 because ContinueUpdateL increases it by one |
488 // in the beginning of the function. So, we can use the ContinueUpdateL |
493 // in the beginning of the function. So, we can use the ContinueUpdateL |
489 // also in here. |
494 // also in here. |
490 iNodeIndex = -1; |
495 iNodeIndex = -1; |
544 MIAUpdateNode* selectedNode = iSelectedNodesArray[ iNodeIndex ]; |
549 MIAUpdateNode* selectedNode = iSelectedNodesArray[ iNodeIndex ]; |
545 |
550 |
546 // Only update items that have not been installed yet. |
551 // Only update items that have not been installed yet. |
547 if ( !selectedNode->IsInstalled() ) |
552 if ( !selectedNode->IsInstalled() ) |
548 { |
553 { |
549 IAUPDATE_TRACE("[IAUPDATE] Item not installed yet"); |
554 IAUPDATE_TRACE("[IAUPDATE] Item not installed yet"); |
|
555 iFilter->SortThisNodeFirstL( selectedNode, iNodes ); |
550 if ( !selectedNode->IsDownloaded() ) |
556 if ( !selectedNode->IsDownloaded() ) |
551 { |
557 { |
552 // Because content has not been downloaded or installed yet, |
558 // Because content has not been downloaded or installed yet, |
553 // it needs to be downloaded before it can be installed. |
559 // it needs to be downloaded before it can be installed. |
554 IAUPDATE_TRACE("[IAUPDATE] Download"); |
560 IAUPDATE_TRACE("[IAUPDATE] Download"); |
555 selectedNode->DownloadL( *this ); |
561 selectedNode->DownloadL( *this ); |
556 iState = EDownloading; |
562 iState = EDownloading; |
557 iClosingAllowedByClient = ETrue; |
563 iClosingAllowedByClient = ETrue; |
558 selectedNode->SetDownloading( ETrue); |
564 selectedNode->SetUiState( MIAUpdateNode::EDownloading ); |
559 /*ShowUpdatingDialogL( R_IAUPDATE_DOWNLOADING_NOTE, |
565 iObserver.RefreshUI(); |
560 selectedNode->Base().Name(), |
|
561 iNodeIndex + 1, |
|
562 iSelectedNodesArray.Count() );*/ |
|
563 nextUpdate = EFalse; |
566 nextUpdate = EFalse; |
564 } |
567 } |
565 else |
568 else |
566 { |
569 { |
567 // Because content has been downloaded but not installed yet, |
570 // Because content has been downloaded but not installed yet, |
568 // it needs to be installed now. |
571 // it needs to be installed now. |
569 IAUPDATE_TRACE("[IAUPDATE] Install"); |
572 IAUPDATE_TRACE("[IAUPDATE] Install"); |
570 selectedNode->InstallL( *this ); |
573 selectedNode->InstallL( *this ); |
571 iState = EInstalling; |
574 iState = EInstalling; |
572 iClosingAllowedByClient = EFalse; |
575 iClosingAllowedByClient = EFalse; |
573 /*CIAUpdateAppUi* appUi = |
576 selectedNode->SetUiState( MIAUpdateNode::EInstalling ); |
574 static_cast< CIAUpdateAppUi* >( iEikEnv->EikAppUi() ); |
577 iObserver.RefreshUI(); |
575 appUi->StartWGListChangeMonitoring(); |
|
576 ShowUpdatingDialogL( R_IAUPDATE_INSTALLING_NOTE, |
|
577 selectedNode->Base().Name(), |
|
578 iNodeIndex + 1, |
|
579 iSelectedNodesArray.Count() ); */ |
|
580 nextUpdate = EFalse; |
578 nextUpdate = EFalse; |
581 } |
579 } |
582 } |
580 } |
583 } |
581 } |
584 else |
582 else |
608 aNode.GetDependenciesL( iServicePackNodes, ETrue ); |
606 aNode.GetDependenciesL( iServicePackNodes, ETrue ); |
609 } |
607 } |
610 |
608 |
611 aNode.InstallL( *this ); |
609 aNode.InstallL( *this ); |
612 iState = EInstalling; |
610 iState = EInstalling; |
613 /*CIAUpdateAppUi* appUi = static_cast<CIAUpdateAppUi*>( iEikEnv->EikAppUi() ); |
611 aNode.SetUiState( MIAUpdateNode::EInstalling ); |
614 appUi->StartWGListChangeMonitoring(); |
612 iObserver.RefreshUI(); |
615 iClosingAllowedByClient = EFalse; |
613 |
616 ShowUpdatingDialogL( R_IAUPDATE_INSTALLING_NOTE, |
|
617 aNode.Base().Name(), |
|
618 iNodeIndex + 1, |
|
619 iSelectedNodesArray.Count() ); */ |
|
620 |
|
621 IAUPDATE_TRACE("[IAUPDATE] CIAUpdateUiController::StartInstallL() end"); |
614 IAUPDATE_TRACE("[IAUPDATE] CIAUpdateUiController::StartInstallL() end"); |
622 } |
615 } |
623 |
616 |
624 |
617 |
625 // --------------------------------------------------------------------------- |
618 // --------------------------------------------------------------------------- |
1649 nodeId->SetSelected( node->Base().IsSelected() ); |
1642 nodeId->SetSelected( node->Base().IsSelected() ); |
1650 iPreviousSelections.AppendL( nodeId ); |
1643 iPreviousSelections.AppendL( nodeId ); |
1651 CleanupStack::Pop( nodeId ); |
1644 CleanupStack::Pop( nodeId ); |
1652 |
1645 |
1653 } |
1646 } |
1654 |
1647 |
1655 if ( iFwNodes.Count() > 0 ) |
1648 for ( TInt j = 0; j < iFwNodes.Count(); ++j ) |
1656 { |
1649 { |
1657 MIAUpdateFwNode* fwNode( iFwNodes[ 0 ] ); |
1650 MIAUpdateFwNode* fwNode( iFwNodes[ j ] ); |
1658 CIAUpdateNodeId* nodeId = CIAUpdateNodeId::NewLC(); |
1651 CIAUpdateNodeId* nodeId = CIAUpdateNodeId::NewLC(); |
1659 nodeId->SetIdL( fwNode->Base().MetaId() ); |
1652 nodeId->SetIdL( fwNode->Base().MetaId() ); |
1660 nodeId->SetNamespaceL( fwNode->Base().MetaNamespace() ); |
1653 nodeId->SetNamespaceL( fwNode->Base().MetaNamespace() ); |
1661 nodeId->SetNodeType( MIAUpdateAnyNode::ENodeTypeFw ); |
1654 nodeId->SetNodeType( MIAUpdateAnyNode::ENodeTypeFw ); |
1662 nodeId->SetSelected( fwNode->Base().IsSelected() ); |
1655 nodeId->SetSelected( fwNode->Base().IsSelected() ); |
1935 TInt aError ) |
1928 TInt aError ) |
1936 { |
1929 { |
1937 IAUPDATE_TRACE("[IAUPDATE] CIAUpdateUiController::InstallCompleteL() begin"); |
1930 IAUPDATE_TRACE("[IAUPDATE] CIAUpdateUiController::InstallCompleteL() begin"); |
1938 IAUPDATE_TRACE_1("[IAUPDATE] error code: %d", aError ); |
1931 IAUPDATE_TRACE_1("[IAUPDATE] error code: %d", aError ); |
1939 |
1932 |
1940 // In release mode, we do not need the aError info, because |
1933 if ( aError == KErrNone ) |
1941 // success counters are counted by using the last operation error info |
1934 { |
1942 // when counter info is asked. In debug mode the error code is logged above. |
1935 aNode.SetUiState( MIAUpdateNode::EUpdated ); |
1943 (void)aError; |
1936 iObserver.RefreshUI(); |
|
1937 } |
|
1938 else |
|
1939 { |
|
1940 aNode.SetUiState( MIAUpdateNode::EFailed ); |
|
1941 iObserver.RefreshUI(); |
|
1942 } |
1944 |
1943 |
1945 // pass UID of installed package to starter |
1944 // pass UID of installed package to starter |
1946 if ( iStarter ) |
1945 if ( iStarter ) |
1947 { |
1946 { |
1948 if ( aNode.Type() == MIAUpdateNode::EPackageTypeServicePack ) |
1947 if ( aNode.Type() == MIAUpdateNode::EPackageTypeServicePack ) |
1983 { |
1982 { |
1984 IAUPDATE_TRACE("[IAUPDATE] CIAUpdateUiController::UpdateCompleteL() begin"); |
1983 IAUPDATE_TRACE("[IAUPDATE] CIAUpdateUiController::UpdateCompleteL() begin"); |
1985 |
1984 |
1986 iState = EIdle; |
1985 iState = EIdle; |
1987 iClosingAllowedByClient = EFalse; |
1986 iClosingAllowedByClient = EFalse; |
1988 |
1987 |
1989 // Remove installed nodes from the node array. |
|
1990 for ( TInt i = iNodes.Count() - 1; i >= 0; --i ) |
|
1991 { |
|
1992 MIAUpdateNode* node = iNodes[ i ]; |
|
1993 if ( node->IsInstalled() ) |
|
1994 { |
|
1995 iNodes.Remove( i ); |
|
1996 } |
|
1997 } |
|
1998 |
|
1999 TInt error( aError ); |
1988 TInt error( aError ); |
2000 TBool selfUpdaterStarted( EFalse ); |
1989 TBool selfUpdaterStarted( EFalse ); |
2001 |
1990 |
2002 if ( error == KErrNone ) |
1991 if ( error == KErrNone ) |
2003 { |
1992 { |
2052 // Notice, that in case of cancellations there would not be any need |
2041 // Notice, that in case of cancellations there would not be any need |
2053 // for timer. But just use it as in normal cases. Then, server report |
2042 // for timer. But just use it as in normal cases. Then, server report |
2054 // completion or timer will call the callback later. But, that callback |
2043 // completion or timer will call the callback later. But, that callback |
2055 // will be ignored in CIAUpdateUiController::ServerReportSent because |
2044 // will be ignored in CIAUpdateUiController::ServerReportSent because |
2056 // iState is already then changed from ESendingReport to something else. |
2045 // iState is already then changed from ESendingReport to something else. |
2057 const TInt KServerReportMaxWaitTime( 10000000 ); |
2046 |
2058 iController->FinishedUpdatesL( ETrue, KServerReportMaxWaitTime ); |
2047 //const TInt KServerReportMaxWaitTime( 10000000 ); //Commented TEMP |
2059 iState = ESendingReport; |
2048 //iController->FinishedUpdatesL( ETrue, KServerReportMaxWaitTime ); //Commented TEMP |
|
2049 //iState = ESendingReport; //Commented temporarily |
|
2050 EndUpdateFlowL( KErrNone ); //TEMP |
|
2051 return; //TEMP |
2060 } |
2052 } |
2061 |
2053 |
2062 // When reports are sent, EndUpdateFlowL is called via the callback functions |
2054 // When reports are sent, EndUpdateFlowL is called via the callback functions |
2063 // and the update flow will be finished there. But, if we come here when cancel |
2055 // and the update flow will be finished there. But, if we come here when cancel |
2064 // is pressed, then call EndUpdateFlowL directly because then we do not wait |
2056 // is pressed, then call EndUpdateFlowL directly because then we do not wait |
2725 { |
2717 { |
2726 iForcedRefresh = aForcedRefresh; |
2718 iForcedRefresh = aForcedRefresh; |
2727 } |
2719 } |
2728 |
2720 |
2729 // --------------------------------------------------------------------------- |
2721 // --------------------------------------------------------------------------- |
|
2722 // CIAUpdateUiController::RefreshNodeList |
|
2723 // |
|
2724 // --------------------------------------------------------------------------- |
|
2725 // |
|
2726 void CIAUpdateUiController::RefreshNodeList() |
|
2727 { |
|
2728 // Restore list after update, that nodes are shown in original sequence |
|
2729 iFilter->RestoreNodeListL( iNodes ); |
|
2730 // Remove installed nodes from the node array. |
|
2731 // Set temp UI state to normal for remaining nodes |
|
2732 for ( TInt i = iNodes.Count() - 1; i >= 0; --i ) |
|
2733 { |
|
2734 MIAUpdateNode* node = iNodes[ i ]; |
|
2735 if ( node->IsInstalled() ) |
|
2736 { |
|
2737 iNodes.Remove( i ); |
|
2738 } |
|
2739 else |
|
2740 { |
|
2741 node->SetUiState( MIAUpdateNode::ENormal ); |
|
2742 } |
|
2743 } |
|
2744 } |
|
2745 |
|
2746 |
|
2747 // --------------------------------------------------------------------------- |
2730 // CIAUpdateUiController::ParamsWriteFileL |
2748 // CIAUpdateUiController::ParamsWriteFileL |
2731 // |
2749 // |
2732 // --------------------------------------------------------------------------- |
2750 // --------------------------------------------------------------------------- |
2733 // |
2751 // |
2734 void CIAUpdateUiController::ParamsWriteFileL() |
2752 void CIAUpdateUiController::ParamsWriteFileL() |