Revision: 201021 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 09:49:41 +0300
branchRCL_3
changeset 40 f8cf9d484c15
parent 36 f9033e605ee2
child 47 3f419852be07
child 51 5bddc28da627
Revision: 201021 Kit: 2010123
iaupdate/IAD/ui/src/iaupdateappui.cpp
iaupdate/IAD/ui/src/iaupdatemainview.cpp
installationservices/swi/bwins/uissclient_legacyu.def
installationservices/swi/eabi/uissclient_legacyu.def
installationservices/swi/inc/progressbar.h
installationservices/swi/inc/swi/sisuihandler.h
installationservices/swi/source/swis/server/installmachine.cpp
installationservices/swi/source/swis/server/statemachine.cpp
installationservices/swi/source/swis/server/statemachine.h
installationservices/swi/source/swis/server/uninstallationplanner.cpp
installationservices/swi/source/swis/server/uninstallationplanner.h
installationservices/swi/source/swis/server/uninstallmachine.cpp
installationservices/swi/source/uiss/client/sisuihandler.cpp
--- a/iaupdate/IAD/ui/src/iaupdateappui.cpp	Tue May 25 12:50:16 2010 +0300
+++ b/iaupdate/IAD/ui/src/iaupdateappui.cpp	Wed Jun 09 09:49:41 2010 +0300
@@ -128,7 +128,7 @@
 CIAUpdateAppUi::~CIAUpdateAppUi()
     {    
     IAUPDATE_TRACE("[IAUPDATE] CIAUpdateAppUi::~CIAUpdateAppUi() begin");
-    
+    iShowStatusDialogAgain = EFalse;
     delete iGlobalLockHandler;
     iDestIdArray.Reset();
 	delete iController;
--- a/iaupdate/IAD/ui/src/iaupdatemainview.cpp	Tue May 25 12:50:16 2010 +0300
+++ b/iaupdate/IAD/ui/src/iaupdatemainview.cpp	Wed Jun 09 09:49:41 2010 +0300
@@ -353,6 +353,7 @@
                                       const TDesC8& /*aCustomMessage*/ )
     {
     UpdateStatusPaneL();
+    Toolbar()->SetToolbarVisibility( ETrue );
     if( !iContainer )
         {    
         iContainer = CIAUpdateMainContainer::NewL( ClientRect(), *this );
@@ -380,6 +381,7 @@
 void CIAUpdateMainView::DoDeactivate()
     {
     RemoveSelectionInfoInNaviPane();
+    Toolbar()->SetToolbarVisibility( EFalse );
     }
 
 // -----------------------------------------------------------------------------
--- a/installationservices/swi/bwins/uissclient_legacyu.def	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/bwins/uissclient_legacyu.def	Wed Jun 09 09:49:41 2010 +0300
@@ -97,8 +97,8 @@
 	?UpdateProgressBarL@RUiHandler@Swi@@QAEXABVTAppInfo@2@H@Z @ 96 NONAME ; void Swi::RUiHandler::UpdateProgressBarL(class Swi::TAppInfo const &, int)
 	?NewL@CDisplayText@Swi@@SAPAV12@ABVTAppInfo@2@W4TFileTextOption@2@ABVTDesC8@@@Z @ 97 NONAME ; class Swi::CDisplayText * Swi::CDisplayText::NewL(class Swi::TAppInfo const &, enum Swi::TFileTextOption, class TDesC8 const &)
 	?NewLC@CDisplayText@Swi@@SAPAV12@ABVTAppInfo@2@W4TFileTextOption@2@ABVTDesC8@@@Z @ 98 NONAME ; class Swi::CDisplayText * Swi::CDisplayText::NewLC(class Swi::TAppInfo const &, enum Swi::TFileTextOption, class TDesC8 const &)
-	?UpdateProgressBarValueL@CProgressBarValuePublisher@Swi@@QAEXH@Z @ 99 NONAME ABSENT ; void Swi::CProgressBarValuePublisher::UpdateProgressBarValueL(int)
-	?SetFinalProgressBarValue@CProgressBarValuePublisher@Swi@@QAEXH@Z @ 100 NONAME ABSENT ; void Swi::CProgressBarValuePublisher::SetFinalProgressBarValue(int)
-	?SetProgressBarValuePublisher@RUiHandler@Swi@@QAEXPAVCProgressBarValuePublisher@2@@Z @ 101 NONAME ABSENT ; void Swi::RUiHandler::SetProgressBarValuePublisher(class Swi::CProgressBarValuePublisher *)
-	?NewL@CProgressBarValuePublisher@Swi@@SAPAV12@XZ @ 102 NONAME ABSENT ; class Swi::CProgressBarValuePublisher * Swi::CProgressBarValuePublisher::NewL(void)
-
+	?CalculateProgressBarValue@CProgressBarValuePublisher@Swi@@QAEHH@Z @ 99 NONAME ; void Swi::CProgressBarValuePublisher::UpdateProgressBarValueL(int)
+	?SetFinalProgressBarValue@CProgressBarValuePublisher@Swi@@QAEXH@Z @ 100 NONAME ; void Swi::CProgressBarValuePublisher::SetFinalProgressBarValue(int)
+	?SetProgressBarValuePublisher@RUiHandler@Swi@@QAEXPAVCProgressBarValuePublisher@2@@Z @ 101 NONAME ; void Swi::RUiHandler::SetProgressBarValuePublisher(class Swi::CProgressBarValuePublisher *)
+	?NewL@CProgressBarValuePublisher@Swi@@SAPAV12@XZ @ 102 NONAME  ; class Swi::CProgressBarValuePublisher * Swi::CProgressBarValuePublisher::NewL(void)
+	
--- a/installationservices/swi/eabi/uissclient_legacyu.def	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/eabi/uissclient_legacyu.def	Wed Jun 09 09:49:41 2010 +0300
@@ -148,8 +148,8 @@
 	_ZN3Swi10RUiHandler18UpdateProgressBarLERKNS_8TAppInfoEi @ 147 NONAME
 	_ZN3Swi12CDisplayText4NewLERKNS_8TAppInfoENS_15TFileTextOptionERK6TDesC8 @ 148 NONAME
 	_ZN3Swi12CDisplayText5NewLCERKNS_8TAppInfoENS_15TFileTextOptionERK6TDesC8 @ 149 NONAME
-	_ZN3Swi10RUiHandler28SetProgressBarValuePublisherEPNS_26CProgressBarValuePublisherE @ 150 NONAME ABSENT
-	_ZN3Swi26CProgressBarValuePublisher23UpdateProgressBarValueLEi @ 151 NONAME ABSENT
-	_ZN3Swi26CProgressBarValuePublisher24SetFinalProgressBarValueEi @ 152 NONAME ABSENT
-	_ZN3Swi26CProgressBarValuePublisher4NewLEv @ 153 NONAME ABSENT
+	_ZN3Swi10RUiHandler28SetProgressBarValuePublisherEPNS_26CProgressBarValuePublisherE @ 150 NONAME 
+	_ZN3Swi26CProgressBarValuePublisher25CalculateProgressBarValueEi @ 151 NONAME 
+	_ZN3Swi26CProgressBarValuePublisher24SetFinalProgressBarValueEi @ 152 NONAME 
+	_ZN3Swi26CProgressBarValuePublisher4NewLEv @ 153 NONAME 
 
--- a/installationservices/swi/inc/progressbar.h	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/inc/progressbar.h	Wed Jun 09 09:49:41 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -30,12 +30,15 @@
 	/// How many increments to update the bar on the uninstall of a file
 	const static TInt KProgressBarUninstallAmount=1;
 	
-	/// How many bytes to copy before updating the progress bar by one increment
-	const static TInt KProgressBarInstallChunkSize=32767;
+	/// How many bytes to copy before updating the progress bar by one increment.
+	const static TInt KProgressBarInstallChunkSize=1048576;  //1MB
 
 	/// The extra increment we add onto the end to make there always be some progress.
 	const static TInt KProgressBarEndIncrement=1;
 	
+	/// Percentage of completion required before updating the progress bar.
+    const static TInt KProgressBarIncrement=1;
+
 	/**
 	 * Utility function to get how much to update the progress bar for a certain
 	 * size of file copied. The smallest increment is KProgressBarEndIncrement since we always want to show that 
--- a/installationservices/swi/inc/swi/sisuihandler.h	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/inc/swi/sisuihandler.h	Wed Jun 09 09:49:41 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -38,6 +38,7 @@
 class CWriteStream;
 class CProgressBarValuePublisher;
 
+
 /**
  * RClass which is used to make calls to the UI Support server using
  * the client-server framework. The ExecuteL() method is passed a
@@ -63,12 +64,10 @@
 	 */
 	IMPORT_C void UpdateProgressBarL(const TAppInfo& aAppInfo, TInt aAmount);
 	
-#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 	/** Sets a reference to the progress bar value publisher object. The ownership is NOT transferred. */
 	IMPORT_C void SetProgressBarValuePublisher(CProgressBarValuePublisher* aPublisher);
 private:
 	CProgressBarValuePublisher* iPublisher; // Owned by the state machine
-#endif
 	};
 
 /**
@@ -820,7 +819,6 @@
 	return iAppVersion;
 	}
 
-#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 	NONSHARABLE_CLASS(CProgressBarValuePublisher) : public CBase
 	/**
 	 * This class is used to publish the percentage value of the installation progress bar.
@@ -835,7 +833,7 @@
 		IMPORT_C void SetFinalProgressBarValue(TInt aValue);
 		
 		/** Updates the value of the progress bar value property by adding the given value to the current value. */
-		IMPORT_C void UpdateProgressBarValueL(TInt aValue);
+		IMPORT_C TInt CalculateProgressBarValue(TInt aValue);
 	
 	private:
 		CProgressBarValuePublisher();
@@ -844,8 +842,9 @@
 	private:
 		TInt iCurrentProgressValue;
 		TInt iFinalProgressValue;
+		TInt iLastPercentCompletion;
+		TInt iLastProgressValue;
 		};
-#endif
 
 } // namespace Swi
 
--- a/installationservices/swi/source/swis/server/installmachine.cpp	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/source/swis/server/installmachine.cpp	Wed Jun 09 09:49:41 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -1720,9 +1720,7 @@
 void CInstallMachine::SetProgressBarFinalValueL()
 	{
 	HandleInstallationEventL(iPlan, EEventSetProgressBarFinalValue, iPlan->FinalProgressBarValue());
-	#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK	
 	SetFinalProgressBarValue(iPlan->FinalProgressBarValue());
-	#endif
 	}
 
 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
--- a/installationservices/swi/source/swis/server/statemachine.cpp	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/source/swis/server/statemachine.cpp	Wed Jun 09 09:49:41 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -52,11 +52,11 @@
 	Cancel();
 	// close UISS session
 	iUiHandler.Close();
+	delete iProgressPublisher;
 	
 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 	iStsSession.Close();
 	delete iRegistryWrapper;
-	delete iProgressPublisher;
 #else
 	delete iIntegrityServices;
 #endif
@@ -69,12 +69,12 @@
 	{
 	// mark the installation/un-installation operation as unconfirmed to start with
 	iOperationConfirmed = EFalse;
-
+	iProgressPublisher = Swi::CProgressBarValuePublisher::NewL();
+	iUiHandler.SetProgressBarValuePublisher(iProgressPublisher);
+	
 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 	iStsSession.CreateTransactionL();	
 	iRegistryWrapper = CRegistryWrapper::NewL();
-	iProgressPublisher = CProgressBarValuePublisher::NewL();
-	iUiHandler.SetProgressBarValuePublisher(iProgressPublisher);
 #else
 	// Create integrity services, use the current time as transaction ID
 	TTime currentTime;
@@ -423,10 +423,10 @@
 	{
 	iIsInInfoMode = aOperationalMode;
 	}
+#endif
 
 void CSwisStateMachine::SetFinalProgressBarValue(TInt aValue)
 	{
 	iProgressPublisher->SetFinalProgressBarValue(aValue);
 	}
-#endif
 } // namespace Swi
--- a/installationservices/swi/source/swis/server/statemachine.h	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/source/swis/server/statemachine.h	Wed Jun 09 09:49:41 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -44,7 +44,7 @@
 namespace Swi
 {
 class CPlan;
-
+class CProgressBarValuePublisher;
 /** Panic ID for panics raised in state machine */
 enum StateMachinePanic
 	{
@@ -108,10 +108,10 @@
 	void FinalizeJournalsL(TInt aError);
 	void CompleteClientL(TInt aError);
 	RUiHandler& UiHandler();
+	void SetFinalProgressBarValue(TInt aValue);
 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 	Usif::RStsSession& TransactionSession();
 	CRegistryWrapper& RegistryWrapper();
-	void SetFinalProgressBarValue(TInt aValue);
 	// Is the state machine runs in information extraction mode or normal installation/uninstallation mode?
 	TBool iIsInInfoMode;
 #else
@@ -151,11 +151,11 @@
 	TState*             iState;             ///< Curent state
 	const RMessage2     iMessage;           ///< Message to complete when done
 	RUiHandler          iUiHandler;         ///< UI handler server session
+	CProgressBarValuePublisher* iProgressPublisher; ///< Pointer to the progress bar value publisher object..
 
 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 	Usif::RStsSession	iStsSession;		///< Transaction service session handle
 	CRegistryWrapper* 	iRegistryWrapper;	///< Registry wrapper to access the registry
-	CProgressBarValuePublisher* iProgressPublisher;	///< Pointer to the progress bar value publisher object..
 #else
 	CIntegrityServices* iIntegrityServices; ///< Shared integrity services.
 #endif
--- a/installationservices/swi/source/swis/server/uninstallationplanner.cpp	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/source/swis/server/uninstallationplanner.cpp	Wed Jun 09 09:49:41 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -83,9 +83,7 @@
 	// coverity[memory_leak]
 	}
 
-#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 TInt32 CUninstallationPlanner::FinalProgressBarValue() const
 	{
 	return Plan().FinalProgressBarValue();
 	}
-#endif
--- a/installationservices/swi/source/swis/server/uninstallationplanner.h	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/source/swis/server/uninstallationplanner.h	Wed Jun 09 09:49:41 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -78,12 +78,10 @@
 	 */
 	void PlanUninstallationL(CSisRegistryPackage& aPackage);
 
-#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 	/**
 	 * @return The final progress bar value from the plan.
 	 */
 	TInt32 FinalProgressBarValue() const;
-#endif
 	
 	/**
 	 * Produces an uninstallation plan
--- a/installationservices/swi/source/swis/server/uninstallmachine.cpp	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/source/swis/server/uninstallmachine.cpp	Wed Jun 09 09:49:41 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -218,9 +218,8 @@
 	// the UI sothat we don't need to display anything (cancellation is not an
 	// error). See RunError() for more details.
 	iUninstallMachine.iPlanner->PlanUninstallationL(*iUninstallMachine.iPackage);
-#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK	
-	iUninstallMachine.SetFinalProgressBarValue(iUninstallMachine.iPlanner->FinalProgressBarValue());
-#endif	
+	TInt finalProgressBarValue = iUninstallMachine.iPlanner->FinalProgressBarValue();
+	iUninstallMachine.SetFinalProgressBarValue(finalProgressBarValue);
 	iUninstallMachine.iPlan=iUninstallMachine.iPlanner->TransferPlanOwnership();
 	iUninstallMachine.CompleteSelf();
 	iUninstallMachine.SetActive();
--- a/installationservices/swi/source/uiss/client/sisuihandler.cpp	Tue May 25 12:50:16 2010 +0300
+++ b/installationservices/swi/source/uiss/client/sisuihandler.cpp	Wed Jun 09 09:49:41 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -30,7 +30,7 @@
 #include "writestream.h"
 #include "swispubsubdefs.h"
 #include <e32property.h> 
-
+#include "progressbar.h"
 
 namespace Swi
 {
@@ -62,28 +62,29 @@
 		return;
 		}
 	
-#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 	_LIT(KProgressorPanicDescriptor, "UISSCLIENT:The progress bar value publisher has not been set!");
 	__ASSERT_ALWAYS(iPublisher, User::Panic(KProgressorPanicDescriptor,KErrAbort));
-	iPublisher->UpdateProgressBarValueL(aAmount);	
-#endif	
-	
-	CHandleInstallEvent* event=CHandleInstallEvent::NewLC(aAppInfo, EEventUpdateProgressBar, aAmount, KNullDesC);
-	ExecuteL(*event);
+	TInt progressAmount = iPublisher->CalculateProgressBarValue(aAmount);	
 	
-	if (!event->ReturnResult())
-		{
-		User::Leave(KErrCancel);
-		}
-	CleanupStack::PopAndDestroy(event);
+	if (progressAmount != 0)
+	    {
+	    CHandleInstallEvent* event=CHandleInstallEvent::NewLC(aAppInfo, EEventUpdateProgressBar, progressAmount, KNullDesC);
+	    ExecuteL(*event);
+	        
+	    if (!event->ReturnResult())
+	        {
+	        User::Leave(KErrCancel);
+	        }
+	    CleanupStack::PopAndDestroy(event);
+	    }
 	}
 
-#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+
 EXPORT_C void RUiHandler::SetProgressBarValuePublisher(CProgressBarValuePublisher* aPublisher)
 	{
 	iPublisher = aPublisher;
 	}
-#endif
+
 
 // CUissCmd
 
@@ -118,7 +119,6 @@
 	// default base class version which does not do any unmarshalling
 	}
 
-#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 // CProgressBarValuePublisher
 CProgressBarValuePublisher::CProgressBarValuePublisher()
 	{
@@ -142,8 +142,8 @@
 
 void CProgressBarValuePublisher::ConstructL()
 	{
-	// Initialize the value of the install progress bar property
-	User::LeaveIfError(RProperty::Set(KUidInstallServerCategory, KUidSwiProgressBarValueKey, 0));
+	iLastPercentCompletion = 0;
+	iLastProgressValue = 0;
 	}
 
 EXPORT_C void CProgressBarValuePublisher::SetFinalProgressBarValue(TInt aValue)
@@ -151,11 +151,16 @@
 	iFinalProgressValue = aValue;
 	}
 
-EXPORT_C void CProgressBarValuePublisher::UpdateProgressBarValueL(TInt aValue)
+EXPORT_C TInt CProgressBarValuePublisher::CalculateProgressBarValue(TInt aValue)
 	{
 	iCurrentProgressValue += aValue;
 	TUint percentage = (iFinalProgressValue <= 0) ? 100 : (iCurrentProgressValue * 100) / iFinalProgressValue;
-	User::LeaveIfError(RProperty::Set(KUidInstallServerCategory, KUidSwiProgressBarValueKey, percentage));
+	if ((percentage - iLastPercentCompletion) >= KProgressBarIncrement)
+	    {
+	    TInt amountCompleted = iCurrentProgressValue - iLastProgressValue; 
+	    iLastProgressValue = iCurrentProgressValue;
+	    return amountCompleted;
+	    }
+	return 0;
 	}	 
-#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 } // namespace Swi