Revision: 201003 PDK_3.0.g
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 00:04:13 +0200
changeset 5 c743ef5928ba
parent 4 4d54b72983ae
child 9 f966699dea19
child 10 148c8716f7c0
child 13 6205fd287e8a
child 17 eb51821c0aca
child 35 f9ce957a272c
Revision: 201003 Kit: 201005
idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/desktopconfiguration.dtd
idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc
idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop_resources.iby
idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/profileconfiguration.dtd
idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profileconfiguration.loc
idlehomescreen/inc/xndepthfirsttreeiterator.h
idlehomescreen/loc/activeidle3.loc
idlehomescreen/widgetmanager/data/widgetmanagerview.rss
idlehomescreen/widgetmanager/group/widgetmanager.mmp
idlehomescreen/widgetmanager/inc/wmdetailsdlg.h
idlehomescreen/widgetmanager/inc/wminstaller.h
idlehomescreen/widgetmanager/inc/wmlistbox.h
idlehomescreen/widgetmanager/inc/wmplugin.h
idlehomescreen/widgetmanager/inc/wmresourceloader.h
idlehomescreen/widgetmanager/inc/wmwidgetdata.h
idlehomescreen/widgetmanager/inc/wmwidgetloaderao.h
idlehomescreen/widgetmanager/loc/widgetmanagerview.loc
idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp
idlehomescreen/widgetmanager/src/wmimageconverter.cpp
idlehomescreen/widgetmanager/src/wminstaller.cpp
idlehomescreen/widgetmanager/src/wmlistbox.cpp
idlehomescreen/widgetmanager/src/wmmaincontainer.cpp
idlehomescreen/widgetmanager/src/wmplugin.cpp
idlehomescreen/widgetmanager/src/wmportalbutton.cpp
idlehomescreen/widgetmanager/src/wmresourceloader.cpp
idlehomescreen/widgetmanager/src/wmwidgetdata.cpp
idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp
idlehomescreen/widgetmanager/tsrc/wmunittest/group/wmunittest.mmp
idlehomescreen/xmluicontroller/group/bld.inf
idlehomescreen/xmluicontroller/group/icons_aif_bitmaps.mk
idlehomescreen/xmluicontroller/group/icons_aif_scalable.mk
idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/inc/xnanimationadapter.h
idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp
idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp
idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp
idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h
idlehomescreen/xmluirendering/uiengine/inc/xnbgcontrol.h
idlehomescreen/xmluirendering/uiengine/inc/xneditor.h
idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h
idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h
idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp
idlehomescreen/xmluirendering/uiengine/src/xnbgcontrol.cpp
idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp
idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp
idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp
idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp
idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp
idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss
idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp
idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp
idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp
idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp
idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp
menufw/menufwui/matrixmenu/src/mmappui.cpp
menufw/menufwui/mmwidgets/inc/mmgridview.h
menufw/menufwui/mmwidgets/src/mmgrid.cpp
menufw/menufwui/mmwidgets/src/mmgridview.cpp
menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp
menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp
menufw/menusuites/foldersuite/data/items_nontouch.xml
menufw/menusuites/foldersuite/data/items_touch.xml
taskswitcher/taskswitcherui/inc/tsappuid.hrh
taskswitcher/taskswitcherui/inc/tsgraphicids.h
taskswitcher/taskswitcherui/inc/tsgraphictab.h
taskswitcher/taskswitcherui/inc/tsuid.hrh
taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h
taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h
taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp
taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp
taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp
--- a/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/desktopconfiguration.dtd	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/hsps/00/desktopconfiguration.dtd	Tue Feb 02 00:04:13 2010 +0200
@@ -29,7 +29,7 @@
 qtn_desktop_configuration_name.description "Shortcut widget name"
 qtn_desktop_configuration_name.parents ""
 -->
-<!ENTITY qtn_desktop_configuration_name  "Shortcut">
+<!ENTITY qtn_desktop_configuration_name  "Shortcuts">
 
 <!--
 qtn_desktop_configuration_desc.attributes
@@ -38,4 +38,4 @@
 qtn_desktop_configuration_desc.description "Shortcut widget description"
 qtn_desktop_configuration_desc.parents ""
 -->
-<!ENTITY qtn_desktop_configuration_desc  "Provides quick access to your favorite applications from Home Screen.">
+<!ENTITY qtn_desktop_configuration_desc  "Quick access to your favorite applications from Home Screen.">
--- a/idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/loc/desktopconfiguration.loc	Tue Feb 02 00:04:13 2010 +0200
@@ -19,10 +19,10 @@
 // l: listrow_wgtman_pane_t1
 // w:
 // r: TB9.2
-#define qtn_desktop_configuration_name  "Shortcut"
+#define qtn_desktop_configuration_name  "Shortcuts"
 
 // d: Shortcut widget description
 // l: listrow_wgtman_pane_t2
 // w:
 // r: TB9.2
-#define qtn_desktop_configuration_desc  "Provides quick access to your favorite applications from Home Screen."
+#define qtn_desktop_configuration_desc  "Quick access to your favorite applications from Home Screen."
--- a/idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop_resources.iby	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/data/qhd_tch/desktop_20026f4f/rom/desktop_resources.iby	Tue Feb 02 00:04:13 2010 +0200
@@ -23,16 +23,16 @@
 
 // Enabled by DTD-localization tools, language specific
 #if defined (__LOCALES_37_IBY__)
-data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\37\desktop_20026f4f.o0037 \private\200159c0\install\desktop_20026f4f\xuikon\37\desktop_20026f4f.o0037
+data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\37\desktop.o0037 \private\200159c0\install\desktop_20026f4f\xuikon\37\desktop.o0037
 #endif
 #if defined  (__LOCALES_50_IBY__)
-data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\50\desktop_20026f4f.o0050 \private\200159c0\install\desktop_20026f4f\xuikon\50\desktop_20026f4f.o0050
+data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\50\desktop.o0050 \private\200159c0\install\desktop_20026f4f\xuikon\50\desktop.o0050
 #endif
 #if defined  (__LOCALES_57_IBY__)
-data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\57\desktop_20026f4f.o0057 \private\200159c0\install\desktop_20026f4f\xuikon\57\desktop_20026f4f.o0057
+data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\57\desktop.o0057 \private\200159c0\install\desktop_20026f4f\xuikon\57\desktop.o0057
 #endif
 #if defined  (__LOCALES_94_IBY__)
-data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\94\desktop_20026f4f.o0094 \private\200159c0\install\desktop_20026f4f\xuikon\94\desktop_20026f4f.o0094
+data=ZPRIVATE\200159c0\install\desktop_20026f4f\xuikon\94\desktop.o0094 \private\200159c0\install\desktop_20026f4f\xuikon\94\desktop.o0094
 #endif
 
 data=ZPRIVATE\200159c0\install\desktop_20026f4f\hsps\00\icon.mif \private\200159c0\install\desktop_20026f4f\hsps\00\icon.mif
--- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/profileconfiguration.dtd	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/hsps/00/profileconfiguration.dtd	Tue Feb 02 00:04:13 2010 +0200
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 ============================================================================
-<FileName: "desktopconfiguration.dtd">
-<PartOf  : "desktopconfiguration">
+<FileName: "profileconfiguration.dtd">
+<PartOf  : "profileconfiguration">
 
 <FileDescription: "Localization strings for the configuration">
 <FileVersion    : >
 
 <Copyright:
-"Copyright © 2007 Nokia Corporation.
+"Copyright � 2007 Nokia Corporation.
 This material, including documentation and any related
 computer programs, is protected by copyright controlled by
 Nokia Corporation. All rights are reserved. Copying,
@@ -26,16 +26,16 @@
 qtn_desktop_configuration_name.attributes
 qtn_desktop_configuration_name.layout "listrow_wgtman_pane_t1"
 qtn_desktop_configuration_name.release "TB9.2"
-qtn_desktop_configuration_name.description "Shortcut"
+qtn_desktop_configuration_name.description "profile"
 qtn_desktop_configuration_name.parents ""
 -->
-<!ENTITY qtn_profile_configuration_name  "Profile">
+<!ENTITY qtn_profile_configuration_name  "Time & profile">
 
 <!--
 qtn_desktop_configuration_desc.attributes
 qtn_desktop_configuration_desc.layout "listrow_wgtman_pane_t2"
 qtn_desktop_configuration_desc.release "TB9.2"
-qtn_desktop_configuration_desc.description "Shortcut widget description"
+qtn_desktop_configuration_desc.description "profile widget description"
 qtn_desktop_configuration_desc.parents ""
 -->
-<!ENTITY qtn_profile_configuration_desc  "Provides quick access to calendar, time&date and change profile.">
+<!ENTITY qtn_profile_configuration_desc  "Quick access to time, date and change profile.">
--- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profileconfiguration.loc	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/loc/profileconfiguration.loc	Tue Feb 02 00:04:13 2010 +0200
@@ -20,10 +20,10 @@
 // l: listrow_wgtman_pane_t1
 // w:
 // r: TB9.2
-#define qtn_profile_configuration_name  "Profile"
+#define qtn_profile_configuration_name  "Time & profile"
 
 // d: profile widget description
 // l: listrow_wgtman_pane_t2
 // w:
 // r: TB9.2
-#define qtn_profile_configuration_desc  "Provides quick access to calendar, time&date and change profile."
\ No newline at end of file
+#define qtn_profile_configuration_desc  "Quick access to time, date and change profile."
\ No newline at end of file
--- a/idlehomescreen/inc/xndepthfirsttreeiterator.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/inc/xndepthfirsttreeiterator.h	Tue Feb 02 00:04:13 2010 +0200
@@ -111,9 +111,11 @@
 // -----------------------------------------------------------------------------
 //
 template< class T > CXnDepthFirstTreeIterator< T >::CXnDepthFirstTreeIterator(
-    T* aStartNode ) : iStart( aStartNode ), iStack( KMemoryAlocS )
+    T* aStartNode ):
+    iStart( aStartNode ),
+    iCurrent( aStartNode ),
+    iStack( KMemoryAlocS )
     {
-
     }
 
 // -----------------------------------------------------------------------------
@@ -207,4 +209,4 @@
 
 #endif    // CXNDEPTHFIRSTTREEITERATOR_H
 
-// End of File
\ No newline at end of file
+// End of File
--- a/idlehomescreen/loc/activeidle3.loc	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/loc/activeidle3.loc	Tue Feb 02 00:04:13 2010 +0200
@@ -290,3 +290,10 @@
 // r: TB9.2
 //
 #define qtn_hs_slideshow "Slideshow"
+
+// d: Shown when user select corrupted image file as a wallpaper 
+// l: popup_note_window
+// w:
+// r: TB9.2
+//
+#define qtn_hs_corrupted_image_note "Unable to select. Image corrupted or format not supported."
--- a/idlehomescreen/widgetmanager/data/widgetmanagerview.rss	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/data/widgetmanagerview.rss	Tue Feb 02 00:04:13 2010 +0200
@@ -179,6 +179,21 @@
     {
     buf = qtn_wm_uninst_not_allowed;
     }
+    
+RESOURCE TBUF r_qtn_wm_uninstall_widget_query
+    {
+    buf = qtn_wm_uninstall_widget_query;
+    }
+
+RESOURCE TBUF r_qtn_wm_uninst_process_busy
+    {
+    buf = qtn_wm_uninst_process_busy;
+    }
+
+RESOURCE TBUF r_qtn_wm_uninstall_text
+    {
+    buf = qtn_wm_uninstall_text;
+    }
 
 // ----------------------------------------------------
 // Wm Details dialog
--- a/idlehomescreen/widgetmanager/group/widgetmanager.mmp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/group/widgetmanager.mmp	Tue Feb 02 00:04:13 2010 +0200
@@ -51,6 +51,7 @@
 SOURCE	wmportalbutton.cpp
 SOURCE  wmwidgetloaderao.cpp
 SOURCE  wmconfiguration.cpp
+SOURCE  wminstaller.cpp
 
 SOURCEPATH		../data
 START RESOURCE  20026F53.rss
--- a/idlehomescreen/widgetmanager/inc/wmdetailsdlg.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmdetailsdlg.h	Tue Feb 02 00:04:13 2010 +0200
@@ -24,6 +24,7 @@
 #include <AknDialog.h>
 
 // FORWARD DECLARATIONS
+class CAknMarqueeControl;
 class CEikRichTextEditor;
 class CAknsBasicBackgroundControlContext;
 
@@ -43,8 +44,7 @@
 	        const TDesC& aDescription,
 	        TBool  aCanBeAdded,
             const CFbsBitmap* aLogoBmp,
-            const CFbsBitmap* aLogoMask,
-            CAknsBasicBackgroundControlContext* aBgContext );
+            const CFbsBitmap* aLogoMask );
 
     /** Destructor. */
     ~CWmDetailsDlg();
@@ -55,7 +55,6 @@
     TInt ExecuteLD();
 
 private: // Functions from base classes
-
 	
 	/** From CEikDialog Initializes dialog before layout*/
 	void PreLayoutDynInitL();
@@ -65,7 +64,8 @@
 	TBool OkToExitL(TInt aButtonId);
 	
 	/** From CCoeControl Handles key events */
-	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType );
+	TKeyResponse OfferKeyEventL( 
+	        const TKeyEvent& aKeyEvent,TEventCode aType );
 
 	/** From CEikDialog Called by framework when dialog is activated */
 	void ActivateL();
@@ -83,13 +83,22 @@
     TInt CountComponentControls() const;
     CCoeControl* ComponentControl(TInt aIndex) const;
     void Draw( const TRect& aRect ) const;
+    void FocusChanged( TDrawNow aDrawNow );
+
+private: // new functions
     
-    /** Desired rect for dialog */
-    TRect WmDetailsDialogRect();
-
     /** Insert and format content */
     void InsertAndFormatContentL();
     
+    /** Redraw call back for marque control */
+    static TInt RedrawCallback( TAny* aPtr );
+    
+    /** start marque control */
+    void StartMarquee();
+    
+    /** stop marque control */
+    void StopMarquee();
+
 private:
 
   	 /** Constructor for performing 1st stage construction */
@@ -100,8 +109,7 @@
 	        const TDesC& aName,
 	        const TDesC& aDescription,
             const CFbsBitmap* aLogoBmp,
-            const CFbsBitmap* aLogoMask,
-            CAknsBasicBackgroundControlContext* aBgContext );
+            const CFbsBitmap* aLogoMask );
 
 private:
 	
@@ -115,6 +123,11 @@
      */
 	CEikRichTextEditor* iRtEditor;
 
+    /**
+     * Marquee control
+     */
+	CAknMarqueeControl* iMarquee;
+
 	/** 
      * Name of widget 
      */
@@ -139,6 +152,11 @@
      * ETrue if widget can be added to HS 
      */
     TBool               iCanBeAdded;
+
+    /** 
+     * ETrue if widget name needs to be scrolled. 
+     */
+    TBool               iNeedToScroll;
 	};
 
 #endif ___WMDETAILSDLG_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idlehomescreen/widgetmanager/inc/wminstaller.h	Tue Feb 02 00:04:13 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2009 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Handles istalling for wm
+*
+*/
+
+#ifndef __WMINSTALLER_
+#define __WMINSTALLER_
+
+#include <SWInstApi.h> //installer
+
+class CIdle;
+class CWmWidgetData;
+class TUid;
+
+/**
+ * CWmInstaller 
+ */
+NONSHARABLE_CLASS( CWmInstaller ) : public CActive
+    {
+public:
+    /**
+     * Two-phased constructors.
+     */
+    static CWmInstaller* NewL();
+    static CWmInstaller* NewLC();
+    
+    /** Destructor */
+    ~CWmInstaller();
+    
+private:    
+    /** constructor */
+    CWmInstaller();
+    
+    /** 2nd phase constructor */
+    void ConstructL();
+    
+protected: // implementation of CActive
+    /**
+     * Implements cancellation of an outstanding request.
+     * 
+     * @see CActive::DoCancel
+     */
+    void DoCancel();
+    
+    /**
+     * Handles an active object's request completion event.
+     * 
+     * @see CActive::RunL
+     */
+    void RunL();
+    
+    /**
+     * RunError
+     * 
+     * @see CActive::RunError
+     */
+    TInt RunError(TInt aError);
+
+private:
+    
+    static TInt CloseSwiSession( TAny* aPtr );
+    
+public:
+    /**
+     *  Uninstall given widget
+     *  
+     *  @param aData widget to unistall
+     */
+    void UninstallL( CWmWidgetData* aData );
+    
+	/**
+	 * Returns wrt widget uid current been unistalled. 
+	 * If installer is not active returns KNullUid.
+	 */
+    TUid UninstallUid();
+    
+private:
+    
+    /** 
+     * instance of the CIdle class for async swinstaller delete
+     */
+    CIdle* iIdle;
+    
+    /**
+     * silent installer
+     */
+    SwiUI::RSWInstSilentLauncher iInstaller;
+
+    /**
+     * wrt widget that is currently been uninstalled
+     */    
+    TUid iUid;
+    };
+
+#endif // __WMPLUGIN_
--- a/idlehomescreen/widgetmanager/inc/wmlistbox.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmlistbox.h	Tue Feb 02 00:04:13 2010 +0200
@@ -379,11 +379,6 @@
     RWidgetDataValues   iWidgetDatas;
 
     /** 
-     * array of trashed widget data objects, not visible in list. 
-     */
-    RPointerArray<CWmWidgetData> iTrashedData;
-
-    /** 
      * the currently active item ADD button's rectangle, for push recognition 
      */
     TRect               iButtonRect;
--- a/idlehomescreen/widgetmanager/inc/wmplugin.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmplugin.h	Tue Feb 02 00:04:13 2010 +0200
@@ -31,6 +31,8 @@
 class CWmResourceLoader;
 class CWmMainContainer;
 class CWmEffectManager;
+class CWmWidgetData;
+class CWmInstaller;
 
 /**
  * CWmPlugin 
@@ -139,7 +141,12 @@
     
     /** prestored action to be executed. */
     void ExecuteCommandL();
-
+    
+    /**
+     * reference to iWmInstaller
+     */
+    CWmInstaller& WmInstaller();
+    
 private:
     /** constructor */
     CWmPlugin();
@@ -165,7 +172,6 @@
      */
     CWmMainContainer*  iWmMainContainer;
 
-
     /**
      * resource loader
      */
@@ -202,6 +208,11 @@
 	 * being activated upon deletion.
      */
     CActiveSchedulerWait* iWait;
+    
+    /*
+     * Handles installation
+     */
+    CWmInstaller* iWmInstaller;
     };
 
 #endif // __WMPLUGIN_
--- a/idlehomescreen/widgetmanager/inc/wmresourceloader.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmresourceloader.h	Tue Feb 02 00:04:13 2010 +0200
@@ -69,6 +69,12 @@
     /** wrt specific description text */
     const TDesC& WrtDescription();
     
+    /** uninstalling text to replace widget name */
+    const TDesC& Uninstalling();
+    
+    /** query popup*/
+    TBool QueryPopupL( TInt aResourceId, const TDesC& aString );
+	
 private: // internal methods
 
     /** constructor */
@@ -124,6 +130,10 @@
      */    
     HBufC*      iWrtDescription;
     
+    /**
+     * text to replace title
+     */    
+    HBufC*      iUninstalling;
     };
 
 #endif // WMRESOURCELOADER_H_
--- a/idlehomescreen/widgetmanager/inc/wmwidgetdata.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmwidgetdata.h	Tue Feb 02 00:04:13 2010 +0200
@@ -26,7 +26,6 @@
 #include <f32file.h>
 #include <bamdesca.h>
 #include <hscontentinfo.h>
-#include <SWInstApi.h> //installer
 
 #include "wmimageconverter.h"
 
@@ -46,7 +45,7 @@
  * handling the list item.
  */
 NONSHARABLE_CLASS( CWmWidgetData )
-    : public CActive
+    : public CBase
     , public MConverterObserver
     {
 
@@ -88,28 +87,6 @@
     /** Destructor. */
     ~CWmWidgetData();
 
-protected: // implementation of CActive
-    /**
-     * Implements cancellation of an outstanding request.
-     * 
-     * @see CActive::DoCancel
-     */
-    void DoCancel();
-    
-    /**
-     * Handles an active object's request completion event.
-     * 
-     * @see CActive::RunL
-     */
-    void RunL();
-    
-    /**
-     * RunError
-     * 
-     * @see CActive::RunError
-     */
-    TInt RunError(TInt aError);
-
 private: // private construction
     /** Constructor for performing 1st stage construction */
     CWmWidgetData( const TSize& aLogoSize, 
@@ -130,11 +107,6 @@
 
 public: // external handles
 
-    /**
-     * Init uninstallation of widget.
-     */
-    void UnInstallL();
-
     /** current uninstall animation bitmap */
     const CFbsBitmap* AnimationBitmap( const TSize& aSize );
 
@@ -239,6 +211,9 @@
     /** sets the widget data validity */
     inline void SetValid( TBool aValid );
     
+	/** start animation for uninstallation*/
+    void VisualizeUninstallL();
+	
 protected: // from MConverterObserver
 
     /** image conversin completed */
@@ -247,11 +222,9 @@
 private: // new functions
     
     /** uninstall animation related*/
-    void VisualizeUninstall();
     void PrepairAnimL();
     void DestroyAnimData();
     static TInt Tick( TAny* aPtr );
-    static TInt CloseSwiSession( TAny* aPtr );
     
     /** fetches publisher uid from widget registry*/
     void FetchPublisherUidL( 
@@ -269,9 +242,6 @@
     /* reference to resource loader */
     CWmResourceLoader& iWmResourceLoader;
     
-    /* instance of the CIdle class for async iconStr handling*/
-    CIdle*              iIdle;
-
     /* the image converter utility */
     CWmImageConverter*    iImageConverter;
 
@@ -318,11 +288,6 @@
     TBool               iFireLogoChanged;
 
     /**
-     * silent install launcher.
-     */
-    SwiUI::RSWInstSilentLauncher iInstaller;
-
-    /**
      * ActiveSchedulerWait used to wait while logo image
      * is being prepaired.
      */
@@ -344,7 +309,6 @@
 
         /** returns the pointed widget name */
         inline TPtrC16 MdcaPoint(TInt aIndex) const;
-
     };
 
 #include "wmwidgetdata.inl"
--- a/idlehomescreen/widgetmanager/inc/wmwidgetloaderao.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmwidgetloaderao.h	Tue Feb 02 00:04:13 2010 +0200
@@ -121,6 +121,8 @@
     /** persistent widget order */
     CWmPersistentWidgetOrder* iWidgetOrder;
     
+	/** uid of currently unistalled widget */
+    TUid iUninstallUid;
     };
 
 #endif // WMWIDGETLOADERAO_H_
--- a/idlehomescreen/widgetmanager/loc/widgetmanagerview.loc	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/loc/widgetmanagerview.loc	Tue Feb 02 00:04:13 2010 +0200
@@ -38,7 +38,7 @@
 // w:
 // r: TB9.2
 //
-#define qtn_options_wm_add "Add To Homescreen"
+#define qtn_options_wm_add "Add To Home screen"
 
 // d: Launch-menuitem in Options-menu
 // d: 
@@ -92,8 +92,7 @@
 // w:
 // r: TB9.2
 //
-#define qtn_options_wm_show_details "Details"
-
+#define qtn_options_wm_details "Details"
 
 
 // MISC
@@ -105,7 +104,7 @@
 // w:
 // r: TB9.2
 //
-#define qtn_wm_ovi_store_title "Ovi Store"
+#define qtn_wm_ovi_store_title "Get more"
 
 // d: Info popup to indicate that an item can not be added to home screen
 // d: because current view is full
@@ -114,16 +113,16 @@
 // w:
 // r: TB9.2
 //
-#define qtn_hs_add_widget_no_space_note "Not enough space to add new widget to active page. Remove some content first"
+#define qtn_hs_add_widget_no_space_note "Not enough space to add new widget to active page. Remove some content first."
 
 // d: Info popup to indicate that an item can not be added to home screen
-// d: because maximum instance count of current widget would be exceeded
+// d: because maximum instance count of current widget would be exceeded in whole Home screen
 // d: 
 // l: popup_note_window
 // w:
 // r: TB9.2
 //
-#define qtn_hs_add_widget_max_count_note "Unable to add. Home screen does not allow more instances of this widget"
+#define qtn_hs_add_widget_max_count_note "Unable to add. Home screen does not allow more instances of this widget."
 
 // d: widget details dialog left softkey for adding widget to home screen
 // d: Note: widgets dialog is not necessarily full screen width, which may affect
@@ -150,7 +149,7 @@
 // w:
 // r: TB9.2
 //
-#define qtn_wm_uninst_not_allowed "%U can not be uninstalled "
+#define qtn_wm_uninst_not_allowed "%U can not be uninstalled"
 
 // d: widget details dialog default text for wrt widgets
 // d: 
@@ -159,5 +158,40 @@
 // w:
 // r: TB9.2
 //
-#define qtn_wm_widget_details_wrt "HomeScreen application that uses internet connection to show dynamic updates from web"
+#define qtn_wm_widget_details_wrt "Home Screen application that uses internet connection to show dynamic updates from web."
+
+// d: Query for unistallation
+// d: 
+// d: 
+// l: query
+// w:
+// r: TB9.2
+//
+#define qtn_wm_uninstall_widget_query "Uninstall %U?"
 
+// d: Note when installer allready inuse
+// d: 
+// d: 
+// l: popup_note_window
+// w:
+// r: TB9.2
+//
+#define qtn_wm_uninst_process_busy "Installation process already ongoing. Try again later."
+
+// d: Note when trying to add widget hs and max number of allowed instances 
+// d: of that widget is already reached in active page
+// d: 
+// l: popup_note_window
+// w:
+// r: TB9.2
+//
+#define qtn_hs_add_widget_max_reached "Unable to add. No more instances allowed of this item for active page."
+
+// d: Replace widget name when uninstalling
+// d: 
+// d: 
+// l: listrow_wgtman_pane_t1
+// w:
+// r: TB9.2
+//
+#define qtn_wm_uninstall_text "Uninstalling.."
--- a/idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -28,7 +28,7 @@
 #include <aknlayoutscalable_avkon.cdl.h>
 #include <aknlayoutscalable_apps.cdl.h>
 #include <AknsBasicBackgroundControlContext.h>
-
+#include <AknMarqueeControl.h>
 #include <widgetmanagerview.rsg>
 #include "widgetmanager.hrh"
 #include "wmdetailsdlg.h"
@@ -40,24 +40,6 @@
 // MEMBER FUNCTIONS
 
 // ---------------------------------------------------------
-// FullScreenRect
-// rectangle representing the screen
-// ---------------------------------------------------------
-//
-TRect FullScreenRect()
-    {
-    TRect screen;
-    CCoeEnv* env = CCoeEnv::Static();
-    if ( env )
-        {
-        CWsScreenDevice* screenDevice = env->ScreenDevice();
-        if ( screenDevice )
-            screen.SetRect( TPoint(0,0), screenDevice->SizeInPixels() );
-        }
-    return screen;
-    }
-
-// ---------------------------------------------------------
 // CWmDetailsDlg::NewL
 // ---------------------------------------------------------
 //
@@ -66,12 +48,11 @@
 	        const TDesC& aDescription,
 	        TBool  aCanBeAdded,
             const CFbsBitmap* aLogoBmp,
-            const CFbsBitmap* aLogoMask,
-            CAknsBasicBackgroundControlContext* aBgContext )
+            const CFbsBitmap* aLogoMask )
     {
     CWmDetailsDlg* self = new ( ELeave ) CWmDetailsDlg( aCanBeAdded );
     CleanupStack::PushL( self );
-    self->ConstructL( aName, aDescription, aLogoBmp, aLogoMask, aBgContext );
+    self->ConstructL( aName, aDescription, aLogoBmp, aLogoMask );
     CleanupStack::Pop( self );
     return self;
     }
@@ -82,9 +63,10 @@
 //
 CWmDetailsDlg::CWmDetailsDlg( TBool  aCanBeAdded )
     : CAknDialog(),
-    iCanBeAdded( aCanBeAdded )
+    iCanBeAdded( aCanBeAdded ),
+    iNeedToScroll( EFalse )
     {
-    iBorder = TGulBorder::ERaisedControl;
+    iBorder = TGulBorder::ERaisedControl;    
     }
 
 // ---------------------------------------------------------
@@ -93,13 +75,16 @@
 //
 CWmDetailsDlg::~CWmDetailsDlg()
     {
+    StopMarquee();
     iEikonEnv->RemoveFromStack( iRtEditor );
     iEikonEnv->RemoveFromStack( this );
     delete iRtEditor;
+    delete iMarquee;
     delete iName;
     delete iDescription;
     delete iLogoBmp;
-    delete iLogoMask;	
+    delete iLogoMask;
+    delete iBgContext;
     }
 
 // -----------------------------------------------------------------------------
@@ -126,8 +111,7 @@
 			const TDesC& aName,
 	        const TDesC& aDescription,
             const CFbsBitmap* aLogoBmp,
-            const CFbsBitmap* aLogoMask,
-            CAknsBasicBackgroundControlContext* aBgContext )
+            const CFbsBitmap* aLogoMask )
     {
     if ( !aLogoBmp )
         {
@@ -136,10 +120,12 @@
  
 	CAknDialog::ConstructL( R_AVKON_DIALOG_EMPTY_MENUBAR );
     
-	iBgContext = aBgContext;
+	iBgContext = CAknsBasicBackgroundControlContext::NewL( 
+	        KAknsIIDQsnFrPopupCenter, TRect(0,0,1,1), EFalse);
+
 	iName = aName.AllocL();
 	iDescription = aDescription.AllocL();
-	
+
 	// create bitmap and duplicate handle
 	iLogoBmp = new ( ELeave ) CFbsBitmap;
     TSize newSize = TSize( aLogoBmp->SizeInPixels().iWidth ,
@@ -155,7 +141,7 @@
         User::LeaveIfError( iLogoMask->Create( newSize, aLogoMask->DisplayMode() ) );    
         User::LeaveIfError( iLogoMask->Duplicate( aLogoMask->Handle() ) );
         }
-
+    
     iEikonEnv->AddWindowShadow( static_cast<CCoeControl*>(this) );
     }
 
@@ -195,11 +181,17 @@
                     EEikEdwinDisplayOnly |
                     EEikEdwinReadOnly );
 
-    iRtEditor->SetSkinBackgroundControlContextL( iBgContext );
-    
     CEikScrollBarFrame* scrollBarFrame = iRtEditor->CreateScrollBarFrameL();
     scrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
-                                             CEikScrollBarFrame::EOff );
+                                             CEikScrollBarFrame::EOff ); // set to EAuto 
+                                             // when layout fixed. ~wk04_2010
+                                             // currently scrollbar overlaps cba.
+    
+    iMarquee = CAknMarqueeControl::NewL();
+    TCallBack callback( RedrawCallback, this );
+    iMarquee->SetRedrawCallBack( callback );
+    iMarquee->SetLoops( 1 );
+    iMarquee->SetContainerWindowL( *this );
     
     InsertAndFormatContentL();
     iRtEditor->UpdateScrollBarsL();
@@ -212,14 +204,8 @@
 void CWmDetailsDlg::InsertAndFormatContentL()
     {
     CRichText* richText = iRtEditor->RichText();
-    const TInt KMinTxtLength = 100;
     
     richText->Reset();
-    if ( iDescription->Des().Length() <= KMinTxtLength )
-        {     
-        richText->InsertL( richText->DocumentLength(),
-                CEditableText::ELineBreak );
-        }
     richText->InsertL( richText->DocumentLength(), *iDescription );
 
     // change the color of the text according to the skin color
@@ -263,7 +249,12 @@
 //
 TInt CWmDetailsDlg::CountComponentControls() const
     {
-    return iRtEditor ? 1 : 0;
+    TInt count( 0 );
+    if ( iRtEditor )
+        count++;
+    if ( iMarquee )
+        count++;
+    return count;
     }
 
 //------------------------------------------------------------------------------
@@ -276,6 +267,8 @@
         {
         case 0:
             return iRtEditor;
+        case 1:
+            return iMarquee;
         default:
             return NULL;
         }
@@ -294,43 +287,17 @@
     }
 
 // -----------------------------------------------------------------------------
-// CWmDetailsDlg::WmDetailsDialogRect
-// -----------------------------------------------------------------------------
-//
-TRect CWmDetailsDlg::WmDetailsDialogRect()
-    {
-    TRect mainPane, dlgRect;    
-    TPoint topLeft;
-    TInt desiredW, desiredH;    
-    AknLayoutUtils::LayoutMetricsRect( 
-            AknLayoutUtils::EApplicationWindow, mainPane );
-
-    if ( Layout_Meta_Data::IsLandscapeOrientation() )
-        {
-        desiredW = ( mainPane.Width() - (mainPane.Width()/4) );
-        desiredH = ( mainPane.Height() - (mainPane.Height()/5) );        
-        topLeft.iX = ( ( mainPane.Width() - desiredW ) /2);
-        topLeft.iY = ( ( mainPane.Height() - desiredH ) /2);
-        dlgRect.SetRect( topLeft, TSize( desiredW, desiredH ) );
-        }
-    else
-        {
-        desiredH = ( mainPane.Height() - (mainPane.Height()/4) );
-        desiredW = ( mainPane.Width() - (mainPane.Width()/5) );
-        topLeft.iX = ( ( mainPane.Width() - desiredW ) /2);
-        topLeft.iY = ( ( mainPane.Height() - desiredH ) /2);
-        dlgRect.SetRect( topLeft, TSize( desiredW, desiredH ) );        
-        }
-    return dlgRect;
-    }
-
-// -----------------------------------------------------------------------------
 // CWmDetailsDlg::SetSizeAndPosition
 // -----------------------------------------------------------------------------
 //
 void CWmDetailsDlg::SetSizeAndPosition( const TSize& /*aSize*/ )
     {    
-    SetRect( WmDetailsDialogRect() );
+    TRect mainPane;
+    AknLayoutUtils::LayoutMetricsRect(
+            AknLayoutUtils::EApplicationWindow, mainPane );
+    TAknWindowLineLayout dlgWindow = AknLayoutScalable_Apps
+               ::popup_wgtman_window().LayoutLine();
+    AknLayoutUtils::LayoutControl( this, mainPane, dlgWindow );
     }
 
 // -----------------------------------------------------------------------------
@@ -341,32 +308,29 @@
     {
     CAknDialog::SizeChanged();
     TRect rect = Rect();
-    if ( iBgContext ) { iBgContext->SetRect( FullScreenRect() ); }
+    if ( iBgContext ) { iBgContext->SetRect( rect ); }
     if ( iRtEditor ) 
         {
-        const TInt offSet = 5;
-        TRect cbaRect;
-        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EControlPane, cbaRect );
-        
-        TInt logoH = iLogoBmp->SizeInPixels().iHeight;
-        
-        TInt height, width;
-        if ( Layout_Meta_Data::IsLandscapeOrientation() )
-            {        
-            height = ( (rect.Height() - logoH) - (cbaRect.Height() * 2) - offSet );
+        TAknLayoutRect layoutRect;
+        TAknWindowLineLayout contentPane = AknLayoutScalable_Apps
+                   ::wgtman_content_pane().LayoutLine();        
+        TAknWindowLineLayout rtePane = AknLayoutScalable_Apps
+                   ::wgtman_list_pane().LayoutLine();
+        layoutRect.LayoutRect( rect, contentPane );
+        AknLayoutUtils::LayoutControl( iRtEditor, layoutRect.Rect(), rtePane );
+        CEikScrollBarFrame* sbFrame = iRtEditor->ScrollBarFrame();
+        if ( sbFrame && sbFrame->VScrollBarVisibility() != CEikScrollBarFrame::EOff )
+            {
+            CEikScrollBar* scrollBar = sbFrame->VerticalScrollBar();
+            TAknWindowLineLayout scrollPane = AknLayoutScalable_Apps
+                           ::scroll_pane_cp036().LayoutLine();
+            AknLayoutUtils::LayoutControl( scrollBar, layoutRect.Rect(), scrollPane );
             }
-        else
-            {
-            height = ( (rect.Height() - logoH) - (cbaRect.Height() * 1.5) - offSet );
-            }
- 
-        width = ( rect.Width() - (CEikScrollBar::DefaultScrollBarBreadth() * 4 ) - offSet );
-        TPoint point = TPoint( rect.iTl.iX + offSet, rect.iTl.iY + logoH + offSet );
-        TSize size = TSize( width, height );
-        iRtEditor->SetRect( TRect( point, size ) );
         TRAP_IGNORE( 
             iRtEditor->SetSkinBackgroundControlContextL( iBgContext );
             InsertAndFormatContentL(); );
+
+        StartMarquee();
         }
     }
 
@@ -453,58 +417,62 @@
         gc.SetBrushStyle( CGraphicsContext::ENullBrush );
         }
 
-    // to fix scrollbar background issue in richtext editor
-    if ( iRtEditor ) 
-        {
-        MAknsControlContext* ccRte = AknsDrawUtils::ControlContext( iRtEditor );
-        AknsDrawUtils::Background( skin, ccRte, iRtEditor, gc, iRtEditor->Rect() );
-        }
-    
     // draw logo
-    TRect bmpRect( TPoint(0,0), TSize( iLogoBmp->SizeInPixels() ) );
-    TPoint point = TPoint( innerRect.iTl.iX + offSet,
-                           innerRect.iTl.iY + offSet );
+    TAknLayoutRect layoutRect;
+    TAknWindowLineLayout headingPane = AknLayoutScalable_Apps
+               ::wgtman_heading_pane().LayoutLine();        
+    layoutRect.LayoutRect( rect, headingPane );
 
-    if ( iLogoBmp && iLogoMask )
+    if( iLogoBmp && iLogoMask )
         {
-        gc.BitBltMasked( point, iLogoBmp, 
-                         bmpRect, iLogoMask, ETrue );
+        TAknLayoutRect logoLayout;
+        logoLayout.LayoutRect( layoutRect.Rect(),AknLayoutScalable_Apps
+                ::wgtman_heading_pane_g1().LayoutLine() );        
+        logoLayout.DrawImage( gc, iLogoBmp, iLogoMask );
         }
-    else
-        {
-        gc.BitBlt( point, iLogoBmp, bmpRect );
-        }
-
-    // draw name
-    point.iX += (bmpRect.Width() + offSet);
     
     AknsUtils::GetCachedColor( 
                     skin, color, 
                     KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 );
 
     // DRAW TEXT
-    const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont );
+    TAknTextLineLayout titleTextLayout = 
+              AknLayoutScalable_Apps::wgtman_heading_pane_t1().LayoutLine();
+    TAknLayoutText textLayoutTitle;
+    textLayoutTitle.LayoutText( layoutRect.Rect(), titleTextLayout );
+    
+    const CFont* font = textLayoutTitle.Font();
+    if ( !font ) 
+        {
+        font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont ); 
+        }
+
     gc.UseFont( font );
     gc.SetPenColor( color );
     gc.SetPenStyle( CGraphicsContext::ESolidPen );
-    point.iY += (bmpRect.Height() - (font->HeightInPixels() /2 ) );
-    CGraphicsContext::TDrawTextParam param;
     
-    HBufC* buf = iName->Des().Alloc();
-    if ( buf )
+    TBool truncate( ETrue );
+
+    // check if name needs scrolling
+    if ( textLayoutTitle.Font()->TextWidthInPixels( *iName ) > 
+        textLayoutTitle.TextRect().Width() && IsFocused() )
         {
-        TPtr bufPtr = buf->Des();
-        TextUtils::ClipToFit( bufPtr, *font, (innerRect.Width() - point.iX ) );
-        gc.DrawText( bufPtr ,point, param );
-        delete buf;
+        const_cast<CWmDetailsDlg&>(*this).iNeedToScroll = ETrue;
+        const_cast<CWmDetailsDlg&>(*this).StartMarquee();
+        truncate = iMarquee->DrawText(
+                        gc, textLayoutTitle.TextRect(), *iName,               
+                        (textLayoutTitle.TextRect().Height() - font->FontMaxDescent()),
+                        CGraphicsContext::ELeft, *font );
         }
-    else
+
+    if ( truncate )
         {
-        gc.DrawText( *iName ,point, param );
+        const_cast<CWmDetailsDlg&>(*this).StopMarquee();
+        textLayoutTitle.DrawText( gc, *iName, ETrue, color );
         }
-    
+
     gc.DiscardFont();
-    
+
     // draw the rounded rectangle as border
     const TInt KFrameRoundRadius = 3;
     const TInt KBorderWidth = 2;
@@ -528,5 +496,67 @@
     gc.SetPenStyle( CGraphicsContext::ENullPen );
     }
 
+// ---------------------------------------------------------
+// CWmDetailsDlg::RedrawCallback
+// ---------------------------------------------------------
+//
+TInt CWmDetailsDlg::RedrawCallback( TAny* aPtr )
+    {
+    CWmDetailsDlg* self = 
+        static_cast<CWmDetailsDlg*>( aPtr );
+    if ( !self->iNeedToScroll )
+        {
+        self->StopMarquee();    
+        }
+    self->DrawDeferred();
+    return static_cast<TBool>( ETrue );
+    }
+
+// ---------------------------------------------------------
+// CWmDetailsDlg::StartMarquee
+// ---------------------------------------------------------
+//
+void CWmDetailsDlg::StartMarquee()
+    {
+    if ( iMarquee && iNeedToScroll &&
+        !iMarquee->IsMarqueeOn() )
+        {
+        iMarquee->Reset();
+        iMarquee->EnableMarquee( iNeedToScroll );
+        iMarquee->Start();
+        }
+    }
+
+// ---------------------------------------------------------
+// CWmDetailsDlg::StopMarquee
+// ---------------------------------------------------------
+//
+void CWmDetailsDlg::StopMarquee()
+    {
+    if ( iMarquee && iMarquee->IsMarqueeOn() )
+        {
+        iMarquee->EnableMarquee( EFalse );
+        iMarquee->Stop();        
+        }
+    }
+
+// ---------------------------------------------------------
+// CWmDetailsDlg::FocusChanged
+// ---------------------------------------------------------
+//
+void CWmDetailsDlg::FocusChanged( TDrawNow aDrawNow )
+    {
+    CCoeControl::FocusChanged( aDrawNow );
+    if ( IsFocused() )
+        {
+        StartMarquee();
+        }
+    else
+        {
+        StopMarquee();
+        }
+    }
+
+
 // End of File
 
--- a/idlehomescreen/widgetmanager/src/wmimageconverter.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmimageconverter.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -862,7 +862,7 @@
     iMask = mask;
 
     TInt err = AknIconUtils::SetSize( iBitmap , iSize, EAspectRatioNotPreserved );
-    if ( KErrNone == err )
+    if ( KErrNone == err && iMask )
         {
         err = AknIconUtils::SetSize( iMask , iSize, EAspectRatioNotPreserved );
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idlehomescreen/widgetmanager/src/wminstaller.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2009 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* widget manager plugin implementation
+*
+*/
+
+#include <e32base.h>
+
+#include "wminstaller.h"
+#include "wmwidgetdata.h"
+
+
+// CONSTANTS
+_LIT8( KWrtMime, "application/x-nokia-widget");
+
+// ---------------------------------------------------------
+// CWmInstaller::NewL
+// ---------------------------------------------------------
+//
+CWmInstaller* CWmInstaller::NewL()
+    {
+    CWmInstaller* self = CWmInstaller::NewLC();
+    CleanupStack::Pop(); // self;
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CWmInstaller::NewLC
+// ---------------------------------------------------------
+//
+CWmInstaller* CWmInstaller::NewLC()
+    {
+    CWmInstaller* self = new ( ELeave ) CWmInstaller();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CWmInstaller::CWmInstaller
+// ---------------------------------------------------------
+//
+CWmInstaller::CWmInstaller() : CActive( EPriorityStandard )
+    {
+    iUid = KNullUid;
+    iIdle = NULL;
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------
+// CWmInstaller::ConstructL
+// ---------------------------------------------------------
+//
+void CWmInstaller::ConstructL()
+    {
+    iIdle = CIdle::NewL( CActive::EPriorityStandard );
+    }
+
+// ---------------------------------------------------------
+// CWmInstaller::~CWmInstaller
+// ---------------------------------------------------------
+//
+CWmInstaller::~CWmInstaller()
+    {
+    Cancel();
+
+    if ( iIdle && iIdle->IsActive() )
+        {
+        iIdle->Cancel();
+        }
+    delete iIdle;
+    }
+
+// ---------------------------------------------------------
+// CWmInstaller::DoCancel
+// ---------------------------------------------------------
+//
+void CWmInstaller::DoCancel()
+    {
+    if ( IsActive() )
+        {
+        iInstaller.CancelAsyncRequest( 
+                SwiUI::ERequestSilentUninstall );
+
+        // close session
+        iInstaller.Close();
+        }
+    }
+
+// ---------------------------------------------------------
+// CWmInstaller::RunL
+// ---------------------------------------------------------
+//
+void CWmInstaller::RunL()
+    {
+    // close SWI session
+    if ( iIdle && iIdle->IsActive() )
+        {
+        iIdle->Cancel();
+        }
+    iIdle->Start( TCallBack( CloseSwiSession, this ) );
+    }
+
+// ---------------------------------------------------------
+// CWmInstaller::CloseSwiSession
+// ---------------------------------------------------------
+//
+TInt CWmInstaller::CloseSwiSession( TAny* aPtr )
+    {
+    CWmInstaller* self = static_cast< CWmInstaller* >( aPtr );
+    if ( self->iIdle->IsActive() )
+      {
+      self->iIdle->Cancel(); 
+      }
+    
+    self->iUid = KNullUid;
+    
+    self->iInstaller.Close();
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CWmInstaller::RunError
+// ---------------------------------------------------------
+//
+TInt CWmInstaller::RunError(TInt /*aError*/)
+    {   
+    // close SWI session
+    if ( iIdle && iIdle->IsActive() )
+        {
+        iIdle->Cancel();
+        }
+    iIdle->Start( TCallBack( CloseSwiSession, this ) );
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CWmInstaller::UninstallL
+// ---------------------------------------------------------
+//
+void CWmInstaller::UninstallL( CWmWidgetData* aData )
+    {
+    if ( IsActive() )
+        {
+        User::Leave( KErrInUse );
+        }
+    else
+        {
+        User::LeaveIfError( iInstaller.Connect() );
+        iUid = aData->PublisherUid();
+        SwiUI::TUninstallOptions optionsUninstall;
+        optionsUninstall.iBreakDependency = SwiUI::EPolicyAllowed;
+        optionsUninstall.iKillApp = SwiUI::EPolicyAllowed;
+        SwiUI::TUninstallOptionsPckg uninstallOptionsPkg( optionsUninstall );
+        iInstaller.SilentUninstall( iStatus, iUid, 
+                                uninstallOptionsPkg, KWrtMime );
+        
+        aData->VisualizeUninstallL();
+        SetActive();
+        }
+    }
+
+// ---------------------------------------------------------
+// CWmInstaller::Uid
+// ---------------------------------------------------------
+//
+TUid CWmInstaller::UninstallUid()
+    {
+    if ( IsActive() )
+        {
+        return iUid;
+        }
+    else
+        {
+        return KNullUid;
+        }
+    }
--- a/idlehomescreen/widgetmanager/src/wmlistbox.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmlistbox.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -444,7 +444,6 @@
 CWmListBox::~CWmListBox()
     {
     iWidgetDatas.ResetAndDestroy();
-    iTrashedData.ResetAndDestroy();
     }
 
 // ---------------------------------------------------------
@@ -517,19 +516,9 @@
         AknListBoxUtils::HandleItemRemovalAndPositionHighlightL(
             this, realIndex, current ) );
     
-    // widgetlist changed notification comes too early before even
-    // uninstall is completed. in wk04_2010 there is going to be fix 
-    // available for this issue. add data object to trashed array so
-    // that its not visible in list and is destroyed later.
-    if ( data->IsUninstalling() && data->IsActive() )
-        {
-        iTrashedData.Append( data );
-        }
-    else
-        {
-        // delete now
-        delete data;
-        }
+    // delete now
+    delete data;
+    data = NULL;
     }
 
 // ---------------------------------------------------------
--- a/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -65,6 +65,7 @@
 #include "wmportalbutton.h"
 #include "wmwidgetloaderao.h"
 #include "wmconfiguration.h"
+#include "wminstaller.h"
 
 // CONSTANTS
 const TInt KTextLimit = 40; // Text-limit for find-field
@@ -213,31 +214,13 @@
 	else
 	    {
 	    // two buttons
-        // **********************************
-        // we do not have layouts for two buttons yet - layout manually
-        TAknWindowLineLayout btnPane = AknLayoutScalable_Apps
-            ::wgtman_btn_pane( iLandscape ? 1 : 0 ).LayoutLine();
-	    TAknLayoutRect layoutrect;
-	    layoutrect.LayoutRect( rect, btnPane );
-	    TRect r( layoutrect.Rect() );
-	    TRect r1, r2;
-	    const TInt gap = 3;
-	    if ( iLandscape )
-	        {
-	        r1 = TRect( r.iTl, TSize( r.Width(), r.Height() / 2 - gap ) );
-	        r2 = r1;
-            r2.Move( 0, r.Height() / 2 + gap );
-	        }
-	    else
-	        {
-            r1 = TRect( r.iTl, TSize( r.Width() / 2 - gap, r.Height() ) );
-            r2 = r1;
-            if (iMirrored) r1.Move( r.Width() / 2 + gap, 0 );
-            else r2.Move( r.Width() / 2 + gap, 0 );
-            }
-        iPortalButtonOne->SetRect( r1 );
-        iPortalButtonTwo->SetRect( r2 );
-        // *************************************
+        TInt variety = (iLandscape ? 3 : 2);
+        TAknWindowLineLayout oviBtnLayout = AknLayoutScalable_Apps
+                ::wgtman_btn_pane( variety ).LayoutLine();
+        TAknWindowLineLayout operatorBtnLayout = AknLayoutScalable_Apps
+                ::wgtman_btn_pane_cp_01( variety ).LayoutLine();
+        AknLayoutUtils::LayoutControl( iPortalButtonOne, rect, oviBtnLayout );
+        AknLayoutUtils::LayoutControl( iPortalButtonTwo, rect, operatorBtnLayout );
 	    }
     
 	// layout iWidgetsList
@@ -927,7 +910,7 @@
     {
     TBool retVal = EFalse;
     CWmWidgetData* data = iWidgetsList->WidgetData();
-    if ( WidgetSelected() && data )
+    if ( WidgetSelected() && data && !data->IsUninstalling() )
         {
         if ( data->HsContentInfo().CanBeAdded() )
             retVal = ETrue;
@@ -943,7 +926,7 @@
     {
     TBool retVal( EFalse );
     CWmWidgetData* data = iWidgetsList->WidgetData();
-    if ( WidgetSelected() && data )
+    if ( WidgetSelected() && data && !data->IsUninstalling() )
         {
         if ( data->WidgetType() == CWmWidgetData::ECps &&
                 data->PublisherUid() != KNullUid )
@@ -961,13 +944,17 @@
 TBool CWmMainContainer::CanDoLaunch() 
     {
     TBool retVal(EFalse);
+    
     if ( WidgetSelected() )
         {
-        CWmWidgetData* data = iWidgetsList->WidgetData();        
-        if ( data && data->WidgetType() == CWmWidgetData::ECps &&
-            data->PublisherUid() != KNullUid )
+        CWmWidgetData* data = iWidgetsList->WidgetData();
+        if ( data && !data->IsUninstalling() )
             {
-            retVal = ETrue;
+            if ( data->WidgetType() == CWmWidgetData::ECps &&
+                data->PublisherUid() != KNullUid )
+                {
+                retVal = ETrue;
+                }
             }
         }
     return retVal;
@@ -1002,7 +989,8 @@
 //
 TBool CWmMainContainer::CanDoDetails()
     {
-    return ( WidgetSelected() && iWidgetsList->WidgetData() );
+    return ( WidgetSelected() && iWidgetsList->WidgetData() 
+            && !iWidgetsList->WidgetData()->IsUninstalling() );
     }
 
 // ---------------------------------------------------------
@@ -1021,7 +1009,7 @@
 void CWmMainContainer::AddWidgetToHomeScreenL()
     {
     CWmWidgetData* data = iWidgetsList->WidgetData();
-    if ( !iClosingDown && data )
+    if ( !iClosingDown && data && !data->IsUninstalling() )
         {
         if ( iFindbox && iFindPaneIsVisible )
             {
@@ -1200,7 +1188,21 @@
     {
     if ( CanDoUninstall() )
         {
-        iWidgetsList->WidgetData()->UnInstallL();
+        CWmWidgetData* data = iWidgetsList->WidgetData();
+        if ( data )
+            {
+            if ( iWmPlugin.ResourceLoader().QueryPopupL( 
+                    R_QTN_WM_UNINSTALL_WIDGET_QUERY, data->Name() ) )
+                {
+                
+                TRAPD( err, iWmPlugin.WmInstaller().UninstallL( data ) );
+                if ( err != KErrNone )
+                    {
+                    iWmPlugin.ResourceLoader().InfoPopupL( 
+                            R_QTN_WM_UNINST_PROCESS_BUSY, KNullDesC );
+                    }
+                }
+            }
         }
     }
 
@@ -1283,17 +1285,11 @@
 void CWmMainContainer::HandleListBoxEventL(
         CEikListBox* /*aListBox*/, TListBoxEvent aEventType )
     {
-    if ( aEventType == EEventEnterKeyPressed ||
-        aEventType == EEventItemSingleClicked )
+    if ( ( aEventType == EEventEnterKeyPressed ||
+           aEventType == EEventItemSingleClicked ) 
+           && !iClosingDown )    
         {
-        if ( iFindPaneIsVisible )
-            {
-            DeactivateFindPaneL();
-            }
-        else if ( !iClosingDown )
-            {
-            AddWidgetToHomeScreenL();
-            }
+        AddWidgetToHomeScreenL();
         }
     }
 
@@ -1314,7 +1310,7 @@
         CWmDetailsDlg* dlg = CWmDetailsDlg::NewL(
                 data->Name(), data->Description(), 
                 data->HsContentInfo().CanBeAdded(),
-                logo, mask, iBgContext );
+                logo, mask );
 
         if ( dlg && dlg->ExecuteLD() == ECbaAddToHs )
             {
--- a/idlehomescreen/widgetmanager/src/wmplugin.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmplugin.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -23,7 +23,9 @@
 #include <eikappui.h>
 #include <eikapp.h>
 #include <e32property.h>
+#include <e32base.h>
 #include <activeidle2domainpskeys.h>
+#include <widgetmanagerview.rsg>
 
 #include "wmcommon.h"
 #include "widgetmanager.hrh"
@@ -32,7 +34,9 @@
 #include "wmresourceloader.h"
 #include "wmplugin.h"
 #include "wmeffectmanager.h"
-#include <widgetmanagerview.rsg>
+#include "wmwidgetdata.h"
+#include "wminstaller.h"
+
 
 // ---------------------------------------------------------
 // CWmPlugin::NewL
@@ -40,8 +44,8 @@
 //
 CWmPlugin* CWmPlugin::NewL()
     {
-    CWmPlugin* self=new(ELeave) CWmPlugin();
-    CleanupStack::PushL(self);
+    CWmPlugin* self = new( ELeave ) CWmPlugin();
+    CleanupStack::PushL( self );
     self->ConstructL();
     CleanupStack::Pop(self);
     return self;
@@ -99,6 +103,7 @@
     delete iEffectManager;
     delete iPostponedContent;
     delete iWait;
+	delete iWmInstaller;
     }
 
 // ---------------------------------------------------------
@@ -117,7 +122,7 @@
 void CWmPlugin::ConstructL()
     {
     iWmMainContainer = NULL;
-
+	
     // store static view app ui
     CEikonEnv* eikonEnv = CEikonEnv::Static();
     if ( !eikonEnv ) User::Leave( KErrUnknown );
@@ -138,6 +143,8 @@
     CleanupStack::PushL( mainView );
 	iViewAppUi->AddViewL( mainView );	
 	CleanupStack::Pop( mainView );
+	
+    iWmInstaller = CWmInstaller::NewL();
     }
 
 // ---------------------------------------------------------
@@ -199,7 +206,7 @@
     
     // Don't forward numeric keys to phone
     ForwardNumericKeysToPhone( EFalse );
-    }
+    }    
 
 // ---------------------------------------------------------
 // CWmPlugin::MainViewDeactivated
@@ -276,7 +283,7 @@
             ResourceLoader().InfoPopupL(
                 R_QTN_HS_HS_MEMORY_FULL, KNullDesC );
             }
-        else if ( err != KErrNone )
+        else if ( ( err != KErrNone ) && ( err != KErrDiskFull ) )
             {
             ResourceLoader().ErrorPopup( err );
             }
@@ -334,4 +341,14 @@
         }
     }
 
+// ---------------------------------------------------------
+// CWmPlugin::WmInstaller
+// ---------------------------------------------------------
+//
+CWmInstaller& CWmPlugin::WmInstaller()
+    {
+    return *iWmInstaller;
+    }
+
 // End of file
+
--- a/idlehomescreen/widgetmanager/src/wmportalbutton.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmportalbutton.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -320,9 +320,18 @@
     {
     TBool landscape = Layout_Meta_Data::IsLandscapeOrientation();
     TAknLayoutRect imageLayout;
-    imageLayout.LayoutRect( Rect(),
-        AknLayoutScalable_Apps::wgtman_btn_pane_g1(
-            landscape ? 1 : 0).LayoutLine() );
+    if ( iWmMainContainer->Configuration().PortalButtonCount() == 1 )
+        {
+        imageLayout.LayoutRect( Rect(), AknLayoutScalable_Apps::
+                wgtman_btn_pane_g1( landscape ? 1 : 0).LayoutLine() );
+        }
+    else
+        {
+        TInt variety = (landscape ? 5 : 4);
+        imageLayout.LayoutRect( Rect(), AknLayoutScalable_Apps
+                ::wgtman_btn_pane_g1( variety ).LayoutLine() );
+        }
+    
     return imageLayout.Rect().Size();
     }
 
@@ -439,9 +448,17 @@
         if ( iButtonIcon && iButtonIconMask )
             {
             TAknLayoutRect imageLayout;
-            imageLayout.LayoutRect( rect,
-                    AknLayoutScalable_Apps::wgtman_btn_pane_g1(
-                            landscape ? 1 : 0).LayoutLine() );
+            if ( iWmMainContainer->Configuration().PortalButtonCount() == 1 )
+                {
+                imageLayout.LayoutRect( rect, AknLayoutScalable_Apps::
+                        wgtman_btn_pane_g1( landscape ? 3 : 0).LayoutLine() );
+                }
+            else
+                {
+                TInt variety = (landscape ? 7 : 4);
+                imageLayout.LayoutRect( rect, AknLayoutScalable_Apps
+                        ::wgtman_btn_pane_g1( variety ).LayoutLine() );
+                }
             imageLayout.DrawImage( gc, iButtonIcon, iButtonIconMask );
             }
         
@@ -449,8 +466,9 @@
         if ( !landscape )
             {
             TAknTextComponentLayout leftLayout;
-            leftLayout = AknLayoutScalable_Apps::wgtman_btn_pane_t1( 
-                                                landscape ? 1 : 0  );
+            TInt variety = 
+                ((iWmMainContainer->Configuration().PortalButtonCount()== 2)? 4:0 );
+            leftLayout = AknLayoutScalable_Apps::wgtman_btn_pane_t1( variety  );
             DrawText( gc, state->Text(), leftLayout, 1 );
             }
         }
--- a/idlehomescreen/widgetmanager/src/wmresourceloader.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmresourceloader.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -66,6 +66,7 @@
     delete iNote;
     delete iNoDescription;
     delete iWrtDescription;
+    delete iUninstalling;
     }
 
 // ---------------------------------------------------------
@@ -84,6 +85,9 @@
     
     iWrtDescription = StringLoader::LoadL( 
             R_QTN_WM_WIDGET_DETAILS_WRT, &iEnv  );
+    
+    iUninstalling = StringLoader::LoadL( 
+            R_QTN_WM_UNINSTALL_TEXT, &iEnv  );
     }
 
 // ---------------------------------------------------------
@@ -188,6 +192,18 @@
     }
 
 // ---------------------------------------------------------
+// CWmResourceLoader::QueryPopupL
+// ---------------------------------------------------------
+//
+TBool CWmResourceLoader::QueryPopupL( TInt aResourceId, const TDesC& aString )
+    {
+    HBufC* queryMsg = LoadStringLC( aResourceId, aString, &iEnv );
+    TBool resp = iEnv.QueryWinL( *queryMsg, KNullDesC );
+    CleanupStack::PopAndDestroy( queryMsg );
+    return resp;
+    }
+
+// ---------------------------------------------------------
 // CWmResourceLoader::ErrorPopup
 // ---------------------------------------------------------
 //
@@ -214,5 +230,14 @@
     return *iWrtDescription;
     }
 
+// ---------------------------------------------------------
+// CWmResourceLoader::Uninstalling
+// ---------------------------------------------------------
+//
+const TDesC& CWmResourceLoader::Uninstalling()
+    {
+    return *iUninstalling;
+    }
+
 // end of file
 
--- a/idlehomescreen/widgetmanager/src/wmwidgetdata.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmwidgetdata.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -29,6 +29,7 @@
 #include <AknsDrawUtils.h>
 #include <AknBitmapAnimation.h>
 #include <barsread.h>
+#include <widgetmanagerview.rsg>
 
 #include "wmwidgetdata.h"
 #include "wmwidgetdataobserver.h"
@@ -36,9 +37,6 @@
 #include "wmresourceloader.h"
 #include "wmcommon.h"
 
-// CONSTANTS
-_LIT8( KWrtMime, "application/x-nokia-widget");
-
 // ---------------------------------------------------------
 // CWmWidgetData::NewL
 // ---------------------------------------------------------
@@ -79,10 +77,8 @@
 //
 CWmWidgetData::CWmWidgetData( const TSize& aLogoSize, 
         CWmResourceLoader& aWmResourceLoader )
-    : CActive( EPriorityStandard ),
-    iWmResourceLoader( aWmResourceLoader )
+    : iWmResourceLoader( aWmResourceLoader )
     {
-    iIdle = NULL;
     iLogoImage = NULL;    
     iLogoImageMask = NULL;
     iHsContentInfo = NULL;
@@ -93,7 +89,6 @@
     iAnimationIndex = 0;
     iAsyncUninstalling = EFalse;
     iFireLogoChanged = EFalse;
-    CActiveScheduler::Add( this );
     }
 
 // ---------------------------------------------------------
@@ -108,7 +103,6 @@
 
     // start decoding the icon
     iImageConverter = CWmImageConverter::NewL( this );
-    iIdle = CIdle::NewL( CActive::EPriorityStandard );
     iWait = new (ELeave) CActiveSchedulerWait();
     iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
 
@@ -149,12 +143,6 @@
 //
 CWmWidgetData::~CWmWidgetData()
     {
-    Cancel();
-    if ( iIdle && iIdle->IsActive() )
-        {
-        iIdle->Cancel();
-        }
-    delete iIdle;
     if ( iWait && iWait->IsStarted() )
         {
         iWait->AsyncStop();
@@ -308,6 +296,7 @@
     else if ( KErrNone != err && iFireLogoChanged )
         {
         FireDataChanged(); // draw default icon
+        iFireLogoChanged = EFalse;
         }
     }
 
@@ -466,51 +455,15 @@
     }
 
 // ---------------------------------------------------------
-// CWmWidgetData::UnInstallL
-// ---------------------------------------------------------
-//
-void CWmWidgetData::UnInstallL()
-    {
-    if ( IsUninstalling() || IsActive() )
-        {
-        User::Leave( KErrInUse );
-        }
-
-    DestroyAnimData();
-    
-    TInt err = iInstaller.Connect();
-    if ( KErrNone == err )
-        {
-        CleanupClosePushL( iInstaller );
-        PrepairAnimL();
-        CleanupStack::Pop( &iInstaller );
-        SwiUI::TUninstallOptions optionsUninstall;
-        optionsUninstall.iBreakDependency = SwiUI::EPolicyAllowed;
-        optionsUninstall.iKillApp = SwiUI::EPolicyAllowed;
-        SwiUI::TUninstallOptionsPckg uninstallOptionsPkg( optionsUninstall );
-        iInstaller.SilentUninstall( iStatus, iPublisherUid, 
-                                uninstallOptionsPkg, KWrtMime );
-        VisualizeUninstall();
-        SetActive();
-        }
-    else
-        {
-        // do normal uninstall
-        iAsyncUninstalling = EFalse;
-        SwiUI::RSWInstLauncher installer;
-        User::LeaveIfError( installer.Connect() );
-        CleanupClosePushL( installer );
-        User::LeaveIfError( installer.Uninstall( iPublisherUid, KWrtMime ) );
-        CleanupStack::PopAndDestroy( &installer );
-        }
-    }
-
-// ---------------------------------------------------------
 // CWmWidgetData::VisualizeUninstall
 // ---------------------------------------------------------
 //
-void CWmWidgetData::VisualizeUninstall()
-    {
+void CWmWidgetData::VisualizeUninstallL()
+    {   
+    DestroyAnimData();
+    PrepairAnimL();
+    
+    iHsContentInfo->SetNameL( iWmResourceLoader.Uninstalling() );
     iAsyncUninstalling = ETrue;
     iAnimationIndex = 0;
     const TInt tickInterval = 400000;
@@ -588,22 +541,6 @@
     }
 
 // ---------------------------------------------------------
-// CWmWidgetData::CloseSwiSession
-// ---------------------------------------------------------
-//
-TInt CWmWidgetData::CloseSwiSession( TAny* aPtr )
-    {
-    CWmWidgetData* self = static_cast< CWmWidgetData* >( aPtr );
-    if ( self->iIdle->IsActive() )
-      {
-      self->iIdle->Cancel(); 
-      }
-
-    self->iInstaller.Close();
-    return KErrNone;
-    }
-
-// ---------------------------------------------------------
 // CWmWidgetData::AnimationBitmap
 // ---------------------------------------------------------
 //
@@ -660,64 +597,5 @@
     return iAsyncUninstalling;
     }
 
-// ---------------------------------------------------------
-// CWmWidgetData::DoCancel
-// ---------------------------------------------------------
-//
-void CWmWidgetData::DoCancel()
-    {
-    if ( IsActive() && iAsyncUninstalling )
-        {
-        iInstaller.CancelAsyncRequest( 
-                SwiUI::ERequestSilentUninstall );
-
-		// close session
-		iInstaller.Close();
-        }
-    iAsyncUninstalling = EFalse;
-    iAnimationIndex = 0;
-    }
-
-// ---------------------------------------------------------
-// CWmWidgetData::RunL
-// ---------------------------------------------------------
-//
-void CWmWidgetData::RunL()
-    {
-    iAsyncUninstalling = EFalse;
-    iAnimationIndex = 0;
-
-    DestroyAnimData();
-    FireDataChanged();
-
-    // close SWI session
-    if ( iIdle && iIdle->IsActive() )
-        {
-        iIdle->Cancel();
-        }
-    iIdle->Start( TCallBack( CloseSwiSession, this ) );
-    }
-
-// ---------------------------------------------------------
-// CWmWidgetData::RunError
-// ---------------------------------------------------------
-//
-TInt CWmWidgetData::RunError(TInt /*aError*/)
-    {
-    iAsyncUninstalling = EFalse;
-    iAnimationIndex = 0;
-    DestroyAnimData();
-    FireDataChanged();
-    
-    // close SWI session
-    if ( iIdle && iIdle->IsActive() )
-        {
-        iIdle->Cancel();
-        }
-    iIdle->Start( TCallBack( CloseSwiSession, this ) );
-
-    return KErrNone;
-    }
-
 // End of file
 
--- a/idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -23,6 +23,7 @@
 #include "wmpersistentwidgetorder.h"
 #include "wmlistbox.h"
 #include "wmwidgetloaderao.h"
+#include "wminstaller.h"
 
 #include <hscontentcontroller.h> // content control api
 #include <hscontentinfoarray.h> // content control api
@@ -123,6 +124,10 @@
 //
 void CWmWidgetLoaderAo::DoLoadWidgetsL()
     {
+    // Check if unistallation is ongoing for for some widget
+	// iUninstallUid is null no uninstallation is ongoing
+    iUninstallUid = iWmPlugin.WmInstaller().UninstallUid();
+    
     // 1. load the widgets array
     MHsContentController& controller = iWmPlugin.ContentController();    
     CHsContentInfoArray* contentInfoArray = CHsContentInfoArray::NewL();
@@ -257,6 +262,12 @@
     widgetData->SetPersistentWidgetOrder( iWidgetOrder );
     widgetData->SetValid( ETrue );
     iWidgetsList.AddWidgetDataL( widgetData, EFalse );
+    if ( iUninstallUid != KNullUid 
+            && iUninstallUid == widgetData->PublisherUid() )
+        {
+        widgetData->VisualizeUninstallL();
+        }
+    
     CleanupStack::Pop( widgetData );
     }
 
--- a/idlehomescreen/widgetmanager/tsrc/wmunittest/group/wmunittest.mmp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/widgetmanager/tsrc/wmunittest/group/wmunittest.mmp	Tue Feb 02 00:04:13 2010 +0200
@@ -51,6 +51,7 @@
 SOURCE          wmportalbutton.cpp
 SOURCE          wmwidgetloaderao.cpp
 SOURCE          wmconfiguration.cpp
+SOURCE          wminstaller.cpp
 
 SOURCEPATH      ../src
 SOURCE          wmunittest.cpp
--- a/idlehomescreen/xmluicontroller/group/bld.inf	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluicontroller/group/bld.inf	Tue Feb 02 00:04:13 2010 +0200
@@ -49,7 +49,7 @@
 END
 
 START EXTENSION s60/mifconv
-OPTION TARGETFILE ailaunch_aif.mif
+OPTION TARGETFILE homescreen_aif.mif
 OPTION SOURCES -c8,8 qgn_menu_idlestate
 END
 
--- a/idlehomescreen/xmluicontroller/group/icons_aif_bitmaps.mk	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluicontroller/group/icons_aif_bitmaps.mk	Tue Feb 02 00:04:13 2010 +0200
@@ -22,7 +22,7 @@
 
 TARGETDIR=$(ZDIR)\resource\apps
 HEADERDIR=$(EPOCROOT)epoc32\include
-ICONTARGETFILENAME=$(TARGETDIR)\ailaunch_aif.mbm
+ICONTARGETFILENAME=$(TARGETDIR)\homescreen_aif.mbm
 
 MAKMAKE : 
 	mifconv $(ICONTARGETFILENAME) \
--- a/idlehomescreen/xmluicontroller/group/icons_aif_scalable.mk	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluicontroller/group/icons_aif_scalable.mk	Tue Feb 02 00:04:13 2010 +0200
@@ -11,7 +11,7 @@
 #
 # Contributors:
 #
-# Description:  scalable icons makefile for project ailaunch
+# Description:  scalable icons makefile for project home screen
 #
 
 ifeq (WINS,$(findstring WINS,$(PLATFORM)))
@@ -22,7 +22,7 @@
 
 TARGETDIR=$(ZDIR)\resource\apps
 HEADERDIR=$(EPOCROOT)epoc32\include
-ICONTARGETFILENAME=$(TARGETDIR)\ailaunch_aif.mif
+ICONTARGETFILENAME=$(TARGETDIR)\homescreen_aif.mif
 
 MAKMAKE : ;
 
--- a/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/inc/xnanimationadapter.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/inc/xnanimationadapter.h	Tue Feb 02 00:04:13 2010 +0200
@@ -118,12 +118,6 @@
         
         // UI node, not owned
         CXnNodePluginIf& iNode;
-    
-        // display on(block) or off(none)
-        TBool iDisplay;
-        
-        // Whether the animation started or not
-        TBool iAnimationSarted;
        
         // Image Skind Id
         TAknsItemID iSkinId;
--- a/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -25,7 +25,6 @@
 
 #include "xnanimationadapter.h"
 
-const TInt KPeriodicTimerInterval5Sec(100000); // 0.1 sec
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
@@ -53,7 +52,6 @@
     {
     CXnControlAdapter::ConstructL( aNode );
     iSkinId = KAknsIIDNone;
-    iAnimationSarted = EFalse;
     }
     
 // -----------------------------------------------------------------------------
@@ -72,12 +70,7 @@
 //
 CXnAnimationAdapter::~CXnAnimationAdapter()
     {
-    if (iPeriodicTimer)
-        {
-        iPeriodicTimer->Cancel();
-        delete iPeriodicTimer;
-        iPeriodicTimer = NULL;
-        }
+    StopAnimation();
     }
 
 
@@ -108,12 +101,10 @@
  
            if( display == XnPropertyNames::style::common::display::KBlock )
                {
-               iDisplay = ETrue; 
                StartAnimation();
                }    
            else
                {
-               iDisplay = EFalse;
                StopAnimation();
                }
            }
@@ -126,7 +117,12 @@
 //
 void CXnAnimationAdapter::MakeVisible( TBool aVisible )
     {
-    if( aVisible )
+    TBool visible( IsVisible() ? ETrue : EFalse );
+    if ( visible == aVisible ) { return; }
+    
+    CCoeControl::MakeVisible( aVisible );
+    
+    if ( aVisible )
         {
         StartAnimation();
         }
@@ -134,7 +130,6 @@
         {
         StopAnimation();
         }
-    CCoeControl::MakeVisible( aVisible );
     }
 
 // -----------------------------------------------------------------------------
@@ -143,9 +138,9 @@
 //
 void CXnAnimationAdapter::Update()
     {
-    if (iAnimationSarted )
+    if ( iPeriodicTimer && iPeriodicTimer->IsActive() )
         {
-        switch(iSkinId.iMinor )
+        switch( iSkinId.iMinor )
             {
             case EAknsMinorGenericQgnHomeRefreshing1:
                 {
@@ -183,7 +178,7 @@
     {
     CXnAnimationAdapter* self = static_cast<CXnAnimationAdapter*> (aAny);
 
-    // Update widget every 5 seconds
+    // Update widget
     self->Update();
 
     return KErrNone; // Return value ignored by CPeriodic
@@ -195,15 +190,15 @@
 //
 void CXnAnimationAdapter::StartAnimation()
     {
-    if ( !iAnimationSarted && iDisplay )
+    if ( !iPeriodicTimer && IsVisible() )
         {
        TRAPD(err, iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle) );
        if ( err == KErrNone )
            {
-           iPeriodicTimer->Start( KPeriodicTimerInterval5Sec,
-                   KPeriodicTimerInterval5Sec, TCallBack( TimerCallBack, this ) );
+		   const TInt KPeriodicTimerInterval = 100000; // 0.1 sec
+           iPeriodicTimer->Start( KPeriodicTimerInterval,
+                   KPeriodicTimerInterval, TCallBack( TimerCallBack, this ) );
            iSkinId = KAknsIIDQgnHomeRefreshing1;
-           iAnimationSarted = ETrue;
            }
         }
     }
@@ -214,14 +209,13 @@
 //
 void CXnAnimationAdapter::StopAnimation()
     {
-    if ( iAnimationSarted )
+    if ( iPeriodicTimer && iPeriodicTimer->IsActive() )
         {
         iPeriodicTimer->Cancel();
-        delete iPeriodicTimer;
-        iPeriodicTimer = NULL;
-        iSkinId = KAknsIIDNone;
-        iAnimationSarted = EFalse;
         }
+    delete iPeriodicTimer;
+    iPeriodicTimer = NULL;
+    iSkinId = KAknsIIDNone;
     }
 
 // End of File
--- a/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -274,7 +274,7 @@
         {
         if( iForeground )
             {
-            iClockControl->StartTimer();
+            UpdateDisplay(); // starts timer after update
             }
         else
             {
--- a/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -1096,7 +1096,7 @@
 //
 void CXnMenuAdapter::SetSoftkeyAppearanceL( CXnSoftkeyItem& aItem )
     {
-    if( IsNodeVisibleL( *aItem.iNode) )
+    if( iContainer && IsNodeVisibleL( *aItem.iNode) )
         {
         if( aItem.iImageOn )
             {
@@ -1104,16 +1104,13 @@
             }
         else if( aItem.iLabel )// change label
             {
-            TBool left( EFalse );
             if ( aItem.iPosition == CEikButtonGroupContainer::ELeftSoftkeyPosition )
                 {
-                left = ETrue;
-                EikSoftkeyImage::SetLabel( iContainer,left );
+                EikSoftkeyImage::SetLabel( iContainer, ETrue );
                 }
             else if ( aItem.iPosition == CEikButtonGroupContainer::ERightSoftkeyPosition )
                 {
-                left = EFalse;
-                EikSoftkeyImage::SetLabel( iContainer,left );
+                EikSoftkeyImage::SetLabel( iContainer, EFalse );
                 }
 
             iContainer->SetCommandL( aItem.iPosition, aItem.iCommandId, *aItem.iLabel );
--- a/idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h	Tue Feb 02 00:04:13 2010 +0200
@@ -42,8 +42,7 @@
 *  @since S60 v5.0
 */
 NONSHARABLE_CLASS( CXnBackgroundManager ) : public CCoeControl,
-    public MAknsSkinChangeObserver, public MCoeViewActivationObserver,
-    public MDiskNotifyHandlerCallback
+    public MAknsSkinChangeObserver, public MDiskNotifyHandlerCallback
     {
 public:
 
@@ -64,6 +63,7 @@
      * 
      * @since S60 5.0
      * @param aFileName WallpaperImage image path and filename to be cached
+     * @param aViewData Page that owns the given wallpaper.
      * @return Error code.
      */            
     TInt CacheWallpaperL( const TDesC& aFileName, CXnViewData& aViewData );
@@ -73,8 +73,17 @@
      * 
      * @since S60 5.0
      * @param aFileName WallpaperImage image path and filename
+     * @return Error code.
      */            
-    void AddWallpaperL( const TDesC& aFileName );
+    TInt AddWallpaperL( const TDesC& aFileName );
+
+    /**
+     * Deletes wallpaper from the given page as well as from the cache.
+     * 
+     * @since S60 5.0
+     * @param aViewData Page where the wallpaper is to be destroyed.
+     */            
+    void DeleteWallpaper( CXnViewData& aViewData );
 
     /**
      * Checks whether page specific wallpaper feature is activated or not.
@@ -98,7 +107,14 @@
      * @param aNewView         New view 
      */
     void WallpaperChanged( CXnViewData& aOldView, CXnViewData& aNewView );
-   
+
+public: // Functions from base classes    
+
+    /**
+     * @see CCoeControl
+     */    
+    void MakeVisible( TBool aVisible );
+
 private: // Functions from base classes    
 
     /**
@@ -110,7 +126,7 @@
      * see CCoeControl 
      */
     void SizeChanged();
-
+    
     /**
      * see MAknsSkinChangeObserver 
      */
@@ -129,16 +145,10 @@
         const TAknsSkinStatusPackageChangeReason aReason );
 
     /**
-     * @see MCoeViewActivationObserver
-     */
-    void HandleViewActivation( const TVwsViewId& aNewlyActivatedViewId, 
-        const TVwsViewId& aViewIdToBeDeactivated );
-
-    /**
     * From MDiskNotifyHandlerCallback.
     */
     void HandleNotifyDisk( TInt aError, const TDiskEvent& aEvent );
-    
+
 private:
     
     /**
@@ -157,12 +167,13 @@
     void UpdateWallpapersL();
     void CleanCache();
     void RemoveWallpaperL( CXnViewData& aViewData );
-    void RemoveWallpaperFromCache( const TDesC& aFileName );
+    void RemoveWallpaperFromCache( const TDesC& aFileName, CXnViewData* aViewData = NULL );
     void RemovableDiskInsertedL();
     void CheckFeatureTypeL();
-    void AddPageSpecificWallpaperL( const TDesC& aFileName );
-    void AddCommonWallpaperL( const TDesC& aFileName, TBool aSave = ETrue );
+    TInt AddPageSpecificWallpaperL( const TDesC& aFileName );
+    TInt AddCommonWallpaperL( const TDesC& aFileName, TBool aSave = ETrue );
     void ReadWallpaperFromCenrepL();
+    void UpdateScreen();
 
 private: // data
 
@@ -215,12 +226,11 @@
      * Internal wallpaper update in progress
      */
     TInt iIntUpdate;
-        
+
     /** 
-     * States whether transparent CBA and status pane is used. 
-     * Homescreen uses transparency, but e.g. Widget catalog does not.
+     * True if screen needs to be drawn when view becomes visible.
      */
-    TBool iTransparencyEnabled;
+    TBool iScreenUpdateNeeded;
 
     /** 
      * Pointer to wallpaper image. This is used only if same wallpaper 
--- a/idlehomescreen/xmluirendering/uiengine/inc/xnbgcontrol.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnbgcontrol.h	Tue Feb 02 00:04:13 2010 +0200
@@ -24,9 +24,9 @@
 #include <coecntrl.h>
 
 // User includes
+#include "xnuistatelistener.h"
 
 // Forward declarations
-class CAknsLayeredBackgroundControlContext;
 
 /**
  * Background appearance drawer
@@ -35,7 +35,7 @@
  * @lib xn3layoutengine.lib
  * @since S60 5.0
  */
-NONSHARABLE_CLASS( CXnBgControl ) : public CCoeControl 
+NONSHARABLE_CLASS( CXnBgControl ) : public CCoeControl , public MXnUiStateObserver
     {
 public:    
     // Constructors and destructor
@@ -100,11 +100,51 @@
     // new functions
     void SetCompoundControl( CCoeControl* aControl );
     
+	/**
+     * Service for removing grabbing controls
+     */
+    void ResetGrabbingL();
+    
+    /**
+     * Prepares control for destroying
+     */
+    void PrepareDestroy();
+  
+private:  
+	// new functions
+    
+	/**
+     * Removes recursively grabbing controls
+     */
+    void RemoveGrabbingControL( const CCoeControl* aControl, const TPointerEvent& aEvent ) const;
+    
+private:
+    // from MXnUiStateObserver
+    
+    /**
+     * @see MXnUiStateObserver
+     */
+    void NotifyForegroundChanged( TForegroundStatus aStatus );
+    
+    /**
+     * @see MXnUiStateObserver
+     */
+    void NotifyLightStatusChanged( TBool aLightsOn );
+    
+    /**
+     * @see MXnUiStateObserver
+     */
+    void NotifyInCallStateChaged( TBool aInCall );   
+    
 private:
     // data
     
     /** Compound Control, Not owned */
     CCoeControl* iControl;
+    
+	/** stored point of EButton1Down */
+    TPoint iHitpoint;
+    
     };
 
 #endif // _XNBGCONTROL_H
--- a/idlehomescreen/xmluirendering/uiengine/inc/xneditor.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xneditor.h	Tue Feb 02 00:04:13 2010 +0200
@@ -195,14 +195,6 @@
      */    
     TInt IdFromCrep ( TDes8& aUid ) const;
 
-    /**
-     * Returns the Background manager object owned by this.
-     * 
-     * @since S60 5.0
-     * @return BgManager
-     */
-    CXnBackgroundManager& BgManager() const;
-
 private:
     // from MHsContentController
     
@@ -310,8 +302,6 @@
     CHspsWrapper* iHspsWrapper;  
     /** CPS wrapper, owned */
     CCpsWrapper* iCpsWrapper;
-    /** Provides background services, owned */    
-    CXnBackgroundManager* iBgManager;
     /** Publisher map, owned */
     CPublisherMap* iPublisherMap;
     /** Add widget listquery, not owned */
--- a/idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h	Tue Feb 02 00:04:13 2010 +0200
@@ -33,6 +33,7 @@
 class CXnControlAdapter;
 class CXnKeyEventDispatcher;
 class CXnBgControl;
+class CXnBackgroundManager;
 class CXnFocusControl;
 
 // Class declaration
@@ -93,7 +94,15 @@
      * return Bg control
      */        
     CCoeControl& BgControl() const;
-    
+
+    /**
+     * Gets background manager
+     * 
+     * @since S60 5.0
+     * return Background manager
+     */        
+    CXnBackgroundManager& BgManager() const;
+
     /**
      * Gets focus control
      * 
@@ -202,6 +211,8 @@
     CXnAppUiAdapter& iAppUiAdapter;
     /** Bg control, Owned */
     CXnBgControl* iBgControl;
+    /** Background manager, Owned */
+    CXnBackgroundManager* iBgManager;
     /** Focus control, Owned */
     CXnFocusControl* iFocusControl;
     /* Event dispatcher, Owned */
--- a/idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h	Tue Feb 02 00:04:13 2010 +0200
@@ -26,10 +26,25 @@
 
 class CXnWallpaperContainer;
 class CXnUiEngine;
+class TVwsViewId;
+class CPeriodic;
 
 // CONSTANTS
 const TUid KWallpaperViewUid = { 0x200286DB };
 
+/**
+*  Data structure to be used with timer callback.
+*
+*  @since S60 v5.0
+*/
+NONSHARABLE_STRUCT( TXnWallpaperViewData )
+    {
+    TBool iMultiple;
+    TUid iAppUid;
+    TUid iViewUid;
+    CPeriodic* iTimer; // Not own.
+    };
+
 // CLASS DECLARATION
 
 /**
@@ -81,6 +96,11 @@
      */
     void ConstructL();
 
+    /**
+     * Callback function to be used with CPeriodic.
+     */
+    static TInt TimerCallbackL( TAny *aPtr );
+
 private: // data
 
     /**
@@ -93,6 +113,18 @@
      * Reference to uiengine.
      */
     CXnUiEngine& iEngine;
+    
+    /**
+     * Data structure, that is transferred to TimerCallback.
+     */
+    TXnWallpaperViewData iData;
+    
+    /**
+     * Periodic timer.
+     * Own.
+     */
+    CPeriodic* iTimer;
+
     };
 
 #endif      // CXNWALLPAPERVIEW_H
--- a/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -55,8 +55,7 @@
 //
 CXnBackgroundManager::CXnBackgroundManager( CXnViewManager& aViewManager, CHspsWrapper& aWrapper )
     : iViewManager( aViewManager ), 
-      iHspsWrapper( aWrapper ),
-      iTransparencyEnabled( ETrue )
+      iHspsWrapper( aWrapper )
     {
     }
 
@@ -65,10 +64,7 @@
 // -----------------------------------------------------------------------------
 //
 void CXnBackgroundManager::ConstructL()
-    {
-    // Register for view activation & deactivation
-    iViewManager.AppUiAdapter().AddViewActivationObserverL( this );
-    
+    {    
     CreateWindowL();
 
     iBgContext = CAknsLayeredBackgroundControlContext::NewL(
@@ -133,27 +129,23 @@
 //    
 void CXnBackgroundManager::Draw(const TRect& aRect) const
     {
-    if( iTransparencyEnabled )
+    if( iFeatureSuppoted )
         {
-        if( iFeatureSuppoted )
+        CXnViewData& viewData( iViewManager.ActiveViewData() );
+        CFbsBitmap* wallpaper = viewData.WallpaperImage();
+        if( wallpaper )
             {
-            CXnViewData& viewData( iViewManager.ActiveViewData() );
-            CFbsBitmap* wallpaper = viewData.WallpaperImage();
-            if( wallpaper )
-                {
-                SystemGc().BitBlt( TPoint(0, 0), wallpaper ); 
-                return;
-                }
+            SystemGc().BitBlt( TPoint(0, 0), wallpaper ); 
+            return;
             }
-        else if( iBgImage )
-            {
-            SystemGc().BitBlt( TPoint(0, 0), iBgImage ); 
-            return;
-            }    
         }
+    else if( iBgImage )
+        {
+        SystemGc().BitBlt( TPoint(0, 0), iBgImage ); 
+        return;
+        }    
     MAknsSkinInstance* skin( AknsUtils::SkinInstance() );     
-    AknsDrawUtils::Background( skin, iBgContext, this, 
-        SystemGc(), aRect );
+    AknsDrawUtils::Background( skin, iBgContext, this, SystemGc(), aRect );
     }
 
 // -----------------------------------------------------------------------------
@@ -180,6 +172,21 @@
     }
 
 // -----------------------------------------------------------------------------
+// CXnBackgroundManager::MakeVisible
+// -----------------------------------------------------------------------------
+// 
+void CXnBackgroundManager::MakeVisible( TBool aVisible )
+    {    
+    CCoeControl::MakeVisible( aVisible );
+    if ( aVisible && iScreenUpdateNeeded )
+        {
+        iScreenUpdateNeeded = EFalse;
+        DrawNow();
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
 // Handle disk drive notifications.
 // -----------------------------------------------------------------------------
 //
@@ -243,18 +250,49 @@
 // CXnBackgroundManager::AddWallpaperL
 // ---------------------------------------------------------------------------
 //
-void CXnBackgroundManager::AddWallpaperL( const TDesC& aFileName )
+TInt CXnBackgroundManager::AddWallpaperL( const TDesC& aFileName )
+    {
+    TInt retVal = KErrNone;
+    if( iFeatureSuppoted )
+        {
+        retVal = AddPageSpecificWallpaperL( aFileName );
+        }
+    else
+        {
+        retVal = AddCommonWallpaperL( aFileName );
+        }
+    return retVal;
+    }
+
+// ---------------------------------------------------------------------------
+// CXnBackgroundManager::DeleteWallpaper
+// ---------------------------------------------------------------------------
+//
+void CXnBackgroundManager::DeleteWallpaper( CXnViewData& aViewData )
     {
     if( iFeatureSuppoted )
         {
-        AddPageSpecificWallpaperL( aFileName );
+        const TDesC& path = aViewData.WallpaperImagePath();
+        if( path != KNullDesC )
+            {
+            RemoveWallpaperFromCache( path, &aViewData );
+            TRAP_IGNORE( aViewData.SetWallpaperImagePathL( KNullDesC ) );
+            aViewData.SetWallpaperImage( NULL );
+            }
         }
     else
         {
-        AddCommonWallpaperL( aFileName );
+        if( iBgImagePath )
+            {
+            iSkinSrv.RemoveWallpaper( *iBgImagePath );          
+            delete iBgImagePath;
+            iBgImagePath = NULL;
+            }
+        delete iBgImage;
+        iBgImage = NULL;
         }
     }
-
+    
 // ---------------------------------------------------------------------------
 // CXnBackgroundManager::ActivatedL
 // ---------------------------------------------------------------------------
@@ -273,7 +311,7 @@
     if( iFeatureSuppoted && 
         aOldView.WallpaperImagePath().Compare( aNewView.WallpaperImagePath() ) )
         {
-        DrawNow();
+        UpdateScreen();
         TInt err = AknsWallpaperUtils::SetIdleWallpaper( aNewView.WallpaperImagePath(), NULL );
         if( err == KErrNone )
             {
@@ -446,7 +484,7 @@
         }
     else if ( aReason == EAknsSkinStatusConfigurationDeployed )
         {
-        DrawNow();
+        UpdateScreen();
         }
     }
     
@@ -459,27 +497,6 @@
     {
     }
 
-// ----------------------------------------------------------------------------
-// CXnBackgroundManager::HandleViewActivation()
-// ----------------------------------------------------------------------------
-//
-void CXnBackgroundManager::HandleViewActivation( 
-    const TVwsViewId& aNewlyActivatedViewId, 
-    const TVwsViewId& aViewIdToBeDeactivated )
-    {
-    TVwsViewId viewId( iViewManager.AppUiAdapter().View().ViewId() );
-    if ( viewId == aNewlyActivatedViewId && !iTransparencyEnabled )
-        {
-        iTransparencyEnabled = ETrue;
-        DrawNow();
-        }
-    else if ( viewId == aViewIdToBeDeactivated && iTransparencyEnabled )
-        {
-        iTransparencyEnabled = EFalse;
-        DrawNow();
-        }
-    }
-
 // -----------------------------------------------------------------------------
 // CXnBackgroundManager::CleanCache
 // -----------------------------------------------------------------------------
@@ -493,16 +510,21 @@
 // CXnBackgroundManager::RemoveWallpaper
 // -----------------------------------------------------------------------------
 //
-void CXnBackgroundManager::RemoveWallpaperFromCache( const TDesC& aFileName )
+void CXnBackgroundManager::RemoveWallpaperFromCache( const TDesC& aFileName,
+    CXnViewData* aViewData )
     {
-    CXnViewData& activeViewData( iViewManager.ActiveViewData() );
+    CXnViewData* currentViewData( aViewData );
+    if( !currentViewData )
+        {
+        currentViewData = &iViewManager.ActiveViewData();
+        }
     CXnRootData& rootData = iViewManager.ActiveAppData();
     RPointerArray<CXnPluginData>& rootDataArr = rootData.PluginData();
 
     for( TInt i = 0; i < rootDataArr.Count(); i++ )
         {
         CXnViewData* viewData = static_cast<CXnViewData*>( rootDataArr[i] );
-        if( viewData == &activeViewData )
+        if( currentViewData == viewData )
             {
             continue;
             }
@@ -587,7 +609,7 @@
             }
         if( drawingNeeded )
             {
-            DrawNow();
+            UpdateScreen();
             }    
         }
     else
@@ -634,8 +656,9 @@
 // CXnBackgroundManager::AddPageSpecificWallpaperL
 // ---------------------------------------------------------------------------
 //
-void CXnBackgroundManager::AddPageSpecificWallpaperL( const TDesC& aFileName )
+TInt CXnBackgroundManager::AddPageSpecificWallpaperL( const TDesC& aFileName )
     {
+    TInt err = KErrNone;
     CXnViewData& viewData( iViewManager.ActiveViewData() );
     const TDesC& old = viewData.WallpaperImagePath();
 
@@ -656,10 +679,10 @@
                 }
             else
                 {
-                return;
+                // image is corrupted or format is not supported
+                return KErrCACorruptContent;
                 }
             }
-        
         // WallpaperImage changed back to default. Update view data.
         else
             {
@@ -668,27 +691,29 @@
             }
 
         // Update screen
-        DrawNow();        
-
-        TInt err = AknsWallpaperUtils::SetIdleWallpaper( aFileName, NULL );
+        UpdateScreen();
+        
+        err = AknsWallpaperUtils::SetIdleWallpaper( aFileName, NULL );
         if( err == KErrNone )
             {
-            iIntUpdate++;        
-            }                
+            iIntUpdate++;
+            }
         }
+    return err;
     }
-
+        
 // ---------------------------------------------------------------------------
 // CXnBackgroundManager::AddCommonWallpaperL
 // ---------------------------------------------------------------------------
 //
-void CXnBackgroundManager::AddCommonWallpaperL( const TDesC& aFileName, 
+TInt CXnBackgroundManager::AddCommonWallpaperL( const TDesC& aFileName, 
     TBool aSave )
     {
+    TInt err = KErrNone;      
     // Remove old from the cache
     if( iBgImagePath )
         {
-        iSkinSrv.RemoveWallpaper( aFileName );          
+        iSkinSrv.RemoveWallpaper( *iBgImagePath );          
         delete iBgImagePath;
         iBgImagePath = NULL;
         }
@@ -703,7 +728,8 @@
         TRAP( err, iSkinSrv.AddWallpaperL( aFileName, iRect.Size() ) );
         if( err )
             {
-            return;
+            // image is corrupted or format is not supported
+            return KErrCACorruptContent;
             }
         TRAP( err, iBgImage = iSkinSrv.WallpaperImageL( aFileName ) );
         if( err )
@@ -711,12 +737,13 @@
             iSkinSrv.RemoveWallpaper( aFileName );
             delete iBgImage;
             iBgImage = NULL;
-            return;
+            // image is corrupted or format is not supported
+            return KErrCACorruptContent;
             }
         }
     
     // Update screen
-    DrawNow();        
+    UpdateScreen();        
 
     // Save path to cenrep
     if( aSave )
@@ -724,11 +751,13 @@
         SaveWallpaperL();
         }
 
-    TInt err = AknsWallpaperUtils::SetIdleWallpaper( aFileName, NULL );
-    if( !err )
+    err = AknsWallpaperUtils::SetIdleWallpaper( aFileName, NULL );
+    if( err == KErrNone )
         {
-        iIntUpdate++;        
-        }                
+        iIntUpdate++;
+        }
+
+    return err;
     }
 
 // ---------------------------------------------------------------------------
@@ -784,11 +813,27 @@
                         }
                     }                
                 }
-            DrawNow();
+            UpdateScreen();
             }
 
         CleanupStack::PopAndDestroy( repository );
         }    
     }
 
+// ---------------------------------------------------------------------------
+// CXnBackgroundManager::UpdateScreen
+// ---------------------------------------------------------------------------
+//
+void CXnBackgroundManager::UpdateScreen()
+    {
+    if( !IsVisible() )
+        {
+        iScreenUpdateNeeded = ETrue;
+        }
+    else
+        {
+        DrawNow();  
+        }
+    }
+
 //  End of File
--- a/idlehomescreen/xmluirendering/uiengine/src/xnbgcontrol.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnbgcontrol.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -17,18 +17,11 @@
 
 // System includes
 #include <aknappui.h>
-#include <AknUtils.h>
-#include <AknsUtils.h>
-#include <AknsDrawUtils.h>
-#include <AknsLayeredBackgroundControlContext.h>
-#include <gdi.h>
 
 // User includes
 #include "xnappuiadapter.h"
 #include "xnuiengine.h"
 #include "xneditmode.h"
-#include "xnviewadapter.h"
-#include "xnfocuscontrol.h"
 
 #include "xnbgcontrol.h"
 
@@ -77,6 +70,7 @@
 // -----------------------------------------------------------------------------
 //
 CXnBgControl::CXnBgControl()
+    :   iHitpoint( TPoint( -1,-1 ) )
     {  
     }
 
@@ -106,6 +100,10 @@
     MakeVisible( ETrue );
     
     SetComponentsToInheritVisibility( ETrue );
+    
+    static_cast< CXnAppUiAdapter* >( iAvkonAppUi )
+            ->UiStateListener().AddObserver( *this );
+    
     }
 
 // -----------------------------------------------------------------------------
@@ -178,6 +176,19 @@
 //
 void CXnBgControl::HandlePointerEventL( const TPointerEvent& aPointerEvent )
     {
+    switch( aPointerEvent.iType )
+        {
+        case TPointerEvent::EButton1Down:
+            iHitpoint = aPointerEvent.iPosition;
+            break;
+            
+        case TPointerEvent::EButton1Up:
+            break;
+            
+        default:
+            break;
+        }
+    
     CXnAppUiAdapter* appui( static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) );
     
     appui->UiEngine().DisableRenderUiLC();
@@ -222,5 +233,94 @@
     iControl = aControl;        
     }
 
+// -----------------------------------------------------------------------------
+// CXnBgControl::ResetGrabbingL()
+// Service for removing grabbing controls
+// -----------------------------------------------------------------------------
+//
+void CXnBgControl::ResetGrabbingL()
+    {
+    TPointerEvent event;
+    event.iType = TPointerEvent::EButton1Up;
+    
+    RemoveGrabbingControL( this, event );
+    
+    iHitpoint.SetXY( -1, -1 );
+    }
+
+// -----------------------------------------------------------------------------
+// CXnBgControl::PrepareDestroy()
+// Prepares control for destroying
+// -----------------------------------------------------------------------------
+//
+void CXnBgControl::PrepareDestroy()
+    {
+    static_cast< CXnAppUiAdapter* >( iAvkonAppUi )
+            ->UiStateListener().RemoveObserver( *this );
+    }
+
+// -----------------------------------------------------------------------------
+// CXnBgControl::RemoveGrabbingControL()
+// Removes recursively grabbing controls
+// -----------------------------------------------------------------------------
+//
+void CXnBgControl::RemoveGrabbingControL( const CCoeControl* aControl,
+        const TPointerEvent& aEvent ) const
+    {
+    TInt count = aControl->CountComponentControls();
+    
+    for( TInt i = 0; i < count; i++ )
+        {
+        CCoeControl* child = aControl->ComponentControl( i );
+        
+        if( child && child->Rect().Contains( iHitpoint ) )
+            {
+            child->CCoeControl::HandlePointerEventL( aEvent ); 
+            RemoveGrabbingControL( child, aEvent );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CXnBgControl::NotifyForegroundChanged()
+// Notifies foreground changes.
+// -----------------------------------------------------------------------------
+//
+void CXnBgControl::NotifyForegroundChanged( TForegroundStatus aStatus )
+    {
+    switch( aStatus )
+        {
+        case EForeground:
+            break;
+            
+        case EUnknown:
+        case EBackground:
+        case EPartialForeground:  
+        default:
+            TRAP_IGNORE( ResetGrabbingL(); )
+            break;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CXnBgControl::NotifyLightStatusChanged()
+// Notifies primary display light status is changed.
+// -----------------------------------------------------------------------------
+//
+void CXnBgControl::NotifyLightStatusChanged( TBool /*aLightsOn*/ )
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CXnBgControl::NotifyInCallStateChaged()
+// Notifies in-call state is changed.
+// -----------------------------------------------------------------------------
+//
+void CXnBgControl::NotifyInCallStateChaged( TBool /*aInCall*/ )
+    {
+    
+    }
+
 // End of file
 
--- a/idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -33,7 +33,8 @@
 #include "xnpanic.h"
 #include "xnplugindefs.h"
 #include "xnviewmanager.h"
-#include "xneditor.h"
+#include "xnappuiadapter.h"
+#include "xnviewadapter.h"
 #include "xnbackgroundmanager.h"
 
 // Constants
@@ -608,8 +609,8 @@
         aViewData.SetUseEmptyWidget( UseEmptyWidget( *viewRoot )  );   
 
         // Read wallpaper image path from HSPS
-        CXnBackgroundManager& bgManager = aViewData.ViewManager().
-            Editor().BgManager();
+        CXnAppUiAdapter* appui = static_cast< CXnAppUiAdapter* >( iAvkonAppUi );
+        CXnBackgroundManager& bgManager = appui->ViewAdapter().BgManager();
         
         // if page specific wallpaper feature is enabled
         if( bgManager.ActivatedL() )
--- a/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -60,6 +60,7 @@
 #include "xnscrollablecontroladapter.h"
 #include "xnfocuscontrol.h"
 #include "xneditmode.h"
+#include "xnbgcontrol.h"
 
 _LIT8(KScrollableBoxNodeName, "scrollablebox");
         
@@ -3900,8 +3901,9 @@
             
             // Ignore events
             bg.IgnoreEventsUntilNextPointerUp();
-            
-            // Indicate long tap has taken plave
+            static_cast<CXnBgControl*>(&bg)->ResetGrabbingL();
+
+          // Indicate long tap has taken plave
             iLongtap = ETrue;
             
             CXnNode* hold = BuildTriggerNodeL( *engine,
@@ -3926,17 +3928,21 @@
     {
     const TPointerEvent& event( aPointerEvent );
     
+    CXnNode* node( &iNode.Node() );
+    CXnUiEngine* engine( node->UiEngine() );
+ 
+    
     // Forward event to gesture helper
     if( PassEventToGestureHelperL( aPointerEvent ) )
-        {
+        { 
+        CXnAppUiAdapter& appui( engine->AppUiAdapter() );
+        CCoeControl& bg( appui.ViewAdapter().BgControl() );
+        static_cast<CXnBgControl*>(&bg)->ResetGrabbingL();
+        
         // Swipe took place, consume this event
         return ETrue;
         }
 
-    CXnNode* node( &iNode.Node() );
-
-    CXnUiEngine* engine( node->UiEngine() );    
-
     TBool menuBar( node == engine->MenuBarNode() );
 
     if ( menuBar )
--- a/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -312,7 +312,6 @@
     iCpsWrapper = CCpsWrapper::NewL( *this );
     iHspsWrapper = CHspsWrapper::NewL( aUid, this );
     iRepository= CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) );
-    iBgManager = CXnBackgroundManager::NewL( iViewManager, *iHspsWrapper );
     }
 
 // ---------------------------------------------------------------------------
@@ -327,7 +326,6 @@
     delete iHspsWrapper;
     delete iPublisherMap;
     delete iRepository;
-    delete iBgManager;
     }
 
 // -----------------------------------------------------------------------------
@@ -1597,15 +1595,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// CXnEditor::BgManager
-// -----------------------------------------------------------------------------
-//
-CXnBackgroundManager& CXnEditor::BgManager() const
-    {
-    return *iBgManager;
-    }
-
-// -----------------------------------------------------------------------------
 // from MHsContentController
 // -----------------------------------------------------------------------------
 //
--- a/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -4477,7 +4477,7 @@
         }
     else if ( nameString == XnPropertyNames::action::event::KSetWallpaper )
         {
-        aEngine.Editor()->BgManager().SetWallpaperL();
+        aEngine.AppUiAdapter().ViewAdapter().BgManager().SetWallpaperL();
         return ETrue;
         }
            
--- a/idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -1094,29 +1094,37 @@
                 break;
                 }
             }
-
-        CXnExtRenderingPluginWrapper* wrapper = 
-        	CXnExtRenderingPluginWrapper::NewL( aNode.PluginIfL(), *adapter );
-        CleanupStack::PushL( wrapper );
-
-        parentAdapter->AppendChildL( *wrapper, aNode );
-        CleanupStack::Pop( wrapper );
         
-        component->SetControlAdapter( wrapper );
-
-        aNode.ComponentNodeImpl()->SetComponent( component );
-
-        component->SetNode( aNode.PluginIfL() );
-
-        wrapper->SetComponent( component );
-
-        wrapper->SetComponentsToInheritVisibility( ETrue );
-
-        wrapper->ActivateL();
-        
-        CleanupStack::Pop( component );
-
-        return ETrue;
+        if( parentAdapter )
+            {
+            CXnExtRenderingPluginWrapper* wrapper = 
+                CXnExtRenderingPluginWrapper::NewL( aNode.PluginIfL(), *adapter );
+            CleanupStack::PushL( wrapper );
+    
+            parentAdapter->AppendChildL( *wrapper, aNode );
+            CleanupStack::Pop( wrapper );
+            
+            component->SetControlAdapter( wrapper );
+    
+            aNode.ComponentNodeImpl()->SetComponent( component );
+    
+            component->SetNode( aNode.PluginIfL() );
+    
+            wrapper->SetComponent( component );
+    
+            wrapper->SetComponentsToInheritVisibility( ETrue );
+    
+            wrapper->ActivateL();
+            
+            CleanupStack::Pop( component );
+    
+            return ETrue;
+            }
+        else
+            {
+            CleanupStack::Pop( component );
+            return EFalse;
+            }
         }
     else
         {
--- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss	Tue Feb 02 00:04:13 2010 +0200
@@ -160,3 +160,8 @@
     { 
     buf = qtn_hs_operation_failed_no_disk; 
     }
+
+RESOURCE TBUF r_qtn_hs_corrupted_image_note 
+    {
+    buf = qtn_hs_corrupted_image_note; 
+    }
--- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -59,6 +59,11 @@
 #include "xntimemon.h"
 #endif
 
+#ifdef _XN3_DEBUG_
+#include "xndepthfirsttreeiterator.h" // for TraceTreeL
+#endif
+
+
 // CONSTANTS
 const TInt KXnBorderThin = 1;
 const TInt KXnBorderMedium = 3;
@@ -8940,7 +8945,7 @@
         // Bg rect is always screen size.
         TRect bgRect;
         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect );
-        Editor()->BgManager().SetRect( bgRect );
+        iAppUiAdapter.ViewAdapter().BgManager().SetRect( bgRect );
 
         iEditMode->HandleScreenDeviceChangedL();
         
--- a/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -38,6 +38,8 @@
 #include "xntype.h"
 #include "xnbgcontrol.h"
 #include "xnfocuscontrol.h"
+#include "xneditor.h"
+#include "xnbackgroundmanager.h"
 
 #include "xnviewadapter.h"
 #include "xnmenu.h"
@@ -158,6 +160,7 @@
     delete iDeactivate;
     delete iEditState;
     delete iBgControl;
+    delete iBgManager;
     delete iFocusControl;
     }
 
@@ -190,6 +193,9 @@
     iBgControl = CXnBgControl::NewL();
     iBgControl->SetMopParent( this );
 
+    iBgManager = CXnBackgroundManager::NewL( iAppUiAdapter.ViewManager(),
+        iAppUiAdapter.ViewManager().Editor().HspsWrapper() );
+
     iFocusControl = CXnFocusControl::NewL( iAppUiAdapter );   
     
     iEventDispatcher = 
@@ -241,6 +247,7 @@
 void CXnViewAdapter::PrepareDestroy()
     {
     iAppUiAdapter.UiStateListener().RemoveObserver( *this );
+    iBgControl->PrepareDestroy();
     
     TRAP_IGNORE( DeactivateContainerL() );
     
@@ -274,6 +281,16 @@
     }
 
 // -----------------------------------------------------------------------------
+// CXnViewAdapter::BgManager
+// Returns background manager.
+// -----------------------------------------------------------------------------
+//
+CXnBackgroundManager& CXnViewAdapter::BgManager() const
+    {
+    return *iBgManager;
+    }
+
+// -----------------------------------------------------------------------------
 // CXnViewAdapter::BgControl
 // Returns focus control.
 // -----------------------------------------------------------------------------
@@ -323,6 +340,7 @@
         }
     
     iBgControl->MakeVisible( ETrue );
+    iBgManager->MakeVisible( ETrue );
     
     // Set the active container
     ActivateContainerL( iAppUiAdapter.ViewManager().ActiveViewData() );             
@@ -345,6 +363,8 @@
     TRAP_IGNORE( DeactivateContainerL() );
     
     iBgControl->MakeVisible( EFalse );
+    iBgManager->MakeVisible( EFalse );
+    
     iFocusControl->MakeVisible( EFalse );
     
     iFlags.Clear( EIsActivated );
@@ -480,7 +500,7 @@
         CXnEditMode* editMode = iAppUiAdapter.UiEngine().EditMode();
         if( editMode )
             {
-            editMode->StopDraggingL();
+            TRAP_IGNORE( editMode->StopDraggingL() );
             }
 
         iFocusControl->MakeVisible( EFalse );
--- a/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -872,7 +872,6 @@
     if ( next.Occupied() && !next.Active() )
         {            
         iAppUiAdapter.ViewAdapter().ActivateContainerL( next );                
-        UpdateWallpaperL( current, next );
         }
     }
 
@@ -895,7 +894,6 @@
     if ( prev.Occupied() && !prev.Active() )
         {   
         iAppUiAdapter.ViewAdapter().ActivateContainerL( prev );
-        UpdateWallpaperL( current, prev );
         }
     }
 
@@ -1083,6 +1081,9 @@
                 iAppUiAdapter.ViewAdapter().ActivateContainerL( next );
                 }
 
+            // Remove wallpaper from cache
+            iAppUiAdapter.ViewAdapter().BgManager().DeleteWallpaper( *view );
+
             retval = iHspsWrapper->RemovePluginL( view->PluginId() );
             
             // Notify observers of view list change
@@ -1137,6 +1138,9 @@
                 
         CXnViewData* view( static_cast< CXnViewData* >( views[ index ] ) );
 
+        // Remove wallpaper from cache
+        iAppUiAdapter.ViewAdapter().BgManager().DeleteWallpaper( *view );
+
         // Remove plugin from HSPS
         iHspsWrapper->RemovePluginL( view->PluginId() );
         
@@ -1296,7 +1300,8 @@
         iHspsWrapper->SetActivePluginL( aViewToActivate.PluginId() );
 
         // Cache update is needed after view activation
-        UpdateCachesL();        
+        UpdateCachesL();       
+        UpdateWallpaperL( viewToDeactivate, aViewToActivate );
         }
     else
         {
@@ -1310,7 +1315,7 @@
     NotifyViewActivatedL( aViewToActivate );
     UpdatePageManagementInformationL();
     
-#ifdef _XN_PERFORMANCE_TEST_
+    #ifdef _XN_PERFORMANCE_TEST_
     RDebug::Print( _L( "CXnViewManager::NotifyContainerChangedL - end" ) );
 #endif //_XN_PERFORMANCE_TEST_
     }
@@ -1641,7 +1646,7 @@
 //
 void CXnViewManager::UpdateWallpaperL( CXnViewData& aCurrent, CXnViewData& aNew )
     {
-    iEditor->BgManager().WallpaperChanged( aCurrent, aNew );
+    iAppUiAdapter.ViewAdapter().BgManager().WallpaperChanged( aCurrent, aNew );
     }
 
 // -----------------------------------------------------------------------------
--- a/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -20,8 +20,10 @@
 #include "xnwallpaperview.h"
 #include "xnwallpapercontainer.h"
 #include "xnuiengine.h"
-#include "xneditor.h"
+#include "xnappuiadapter.h"
+#include "xnviewadapter.h"
 #include "xnbackgroundmanager.h"
+#include <xnuiengine.rsg>
 
 // SYSTEM INCLUDE FILES
 #include <aknappui.h>
@@ -29,6 +31,9 @@
 #include <avkon.rsg>
 #include <AknsWallpaperUtils.h>
 #include <MGFetch.h>
+#include <aknnotewrappers.h>
+#include <StringLoader.h> 
+#include <caf/caf.h>
 
 _LIT8( KMulti, "multi" );
 const TInt KFileArrayGranularity = 6;
@@ -51,6 +56,7 @@
 void CXnWallpaperView::ConstructL()
     {
     BaseConstructL();
+    iTimer = CPeriodic::NewL( CActive::EPriorityIdle );
     }
 
 // -----------------------------------------------------------------------------
@@ -77,6 +83,7 @@
         delete iContainer;
         iContainer = NULL;
         }
+    delete iTimer;
     }
 
 // -----------------------------------------------------------------------------
@@ -97,7 +104,8 @@
             TUid /*aCustomMessageId*/,
             const TDesC8& aCustomMessage )
     {
-    iAvkonAppUi->StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL );
+    iAvkonAppUi->StatusPane()->SwitchLayoutL(
+            R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT );
     iAvkonAppUi->StatusPane()->DrawNow();
     if ( !iContainer )
         {
@@ -107,31 +115,22 @@
         iContainer->DrawNow();
         }
     
-    CDesCArrayFlat* files = 
-        new (ELeave) CDesCArrayFlat( KFileArrayGranularity );
-    CleanupStack::PushL( files );
-    TBool selected = EFalse;
+    iData.iAppUid = aPrevViewId.iAppUid;
+    iData.iViewUid = aPrevViewId.iViewUid; 
+    iData.iMultiple = EFalse;
+    iData.iTimer = iTimer;
     
-    TBool multiple=EFalse;
     if( aCustomMessage == KMulti )
         {
-        multiple = ETrue;
+        iData.iMultiple = ETrue;
         }
-    TRAPD( err, selected = MGFetch::RunL( *files, EImageFile, multiple ) );
-    if ( err == KErrNone &&
-         selected &&
-         files->MdcaCount() > 0 )
+
+    // Run image selection dialog asynchronously
+    if ( iTimer->IsActive() )
         {
-        // set wallpaper.
-        if( files->MdcaCount() == 1 )
-            {
-            iEngine.Editor()->BgManager().AddWallpaperL( files->MdcaPoint( 0 ) );
-            }
+        iTimer->Cancel();
         }
-    CleanupStack::PopAndDestroy( files );
-    
-    iAvkonAppUi->ActivateViewL( aPrevViewId );
-    
+    iTimer->Start( 0, 1000, TCallBack( TimerCallbackL, &iData ) );
     }
 
 // -----------------------------------------------------------------------------
@@ -148,4 +147,54 @@
         }
     }
 
+// -----------------------------------------------------------------------------
+// CXnWallpaperView::TimerCallback
+// -----------------------------------------------------------------------------
+//
+TInt CXnWallpaperView::TimerCallbackL(TAny *aPtr)
+    {
+    TInt errAddWallpaper = KErrNone;
+    
+    TXnWallpaperViewData* data = reinterpret_cast<TXnWallpaperViewData*>( aPtr );
+    data->iTimer->Cancel();
+    
+    CDesCArrayFlat* files = 
+        new (ELeave) CDesCArrayFlat( KFileArrayGranularity );
+    CleanupStack::PushL( files );
+    TBool selected = EFalse;
+
+    TRAPD( err, selected = MGFetch::RunL( *files, EImageFile, data->iMultiple ) );
+    if ( err == KErrNone &&
+         selected &&
+         files->MdcaCount() > 0 )
+        {
+        // set wallpaper.
+        if( files->MdcaCount() == 1 )
+            {
+            CXnAppUiAdapter* appui = static_cast< CXnAppUiAdapter* >( iAvkonAppUi );
+            CXnBackgroundManager& bgManager = appui->ViewAdapter().BgManager();
+            errAddWallpaper = bgManager.AddWallpaperL( files->MdcaPoint( 0 ) );
+            }
+        }
+    CleanupStack::PopAndDestroy( files );
+
+    if( errAddWallpaper == KErrCACorruptContent )
+        {
+        //load message text
+        HBufC* msg = StringLoader::LoadLC( R_QTN_HS_CORRUPTED_IMAGE_NOTE );
+        //ensure that dialog will not disappear immediatelly - by const. param
+        CAknErrorNote* dialog = new (ELeave) CAknErrorNote( true );
+        CleanupStack::PushL( dialog );
+        //show dialog to user and destroy it
+        dialog->ExecuteLD( *msg );
+        CleanupStack::Pop( dialog );
+        CleanupStack::PopAndDestroy( msg );
+        }
+    
+    iAvkonAppUi->ActivateViewL( TVwsViewId( data->iAppUid, data->iViewUid ) );
+
+    return EFalse;
+    }
+
+
 //  End of File
--- a/idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnwidgetextensionadapter.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -106,19 +106,10 @@
     CXnType* typeInfo = iNode.Node().Type();
     const TDesC8& type = typeInfo->Type();
 
-    if ( type == KPopUpText )
-        {
-        // popup element does not capture pointer events
-        SetPointerCapture( ETrue );      
-        }
-    else
+    if ( ( type != KPopUpText ) &&
+         ( Window().SetTransparencyAlphaChannel() == KErrNone ) )
         {
-        // widget extension node
-        SetPointerCapture( ETrue );
-        if ( Window().SetTransparencyAlphaChannel() == KErrNone )
-            {
-            Window().SetBackgroundColor( ~0 );
-            }     
+        Window().SetBackgroundColor( ~0 );     
         }
     iUiEngine = iNode.Node().UiEngine();
     CXnControlAdapter::ConstructL( iNode );
@@ -142,78 +133,77 @@
         return;
         }
 
+    SetPointerCapture( aVisible );
+    
     CXnPluginData& plugin( 
             iAppUiAdapter->ViewManager().ActiveViewData().Plugin( &iNode.Node() ) );
 
     plugin.SetIsDisplayingPopup( aVisible, &iNode.Node() );
     
-    if ( aVisible )
-        {
-        
-        CXnType* typeInfo = iNode.Node().Type();
-        const TDesC8& type = typeInfo->Type();
+    CXnType* typeInfo = iNode.Node().Type();
+    const TDesC8& type = typeInfo->Type();
 
-        if ( type == KPopUpText )
-            {            
-            // read position-hint property and set-up its variable
-            CXnProperty* positionHintProp = NULL;
-            TRAP_IGNORE( positionHintProp = iNode.Node().GetPropertyL( KPositionHint ) );
-                       
-            if ( positionHintProp )
+    if ( type != KPopUpText )
+        {
+        DrawableWindow()->FadeBehind( aVisible );
+        }
+    
+    if ( aVisible && type == KPopUpText )
+        {        
+        // read position-hint property and set-up its variable
+        CXnProperty* positionHintProp = NULL;
+        TRAP_IGNORE( positionHintProp = iNode.Node().GetPropertyL( KPositionHint ) );
+                   
+        if ( positionHintProp )
+            {
+            const TDesC8& displayHintVal = positionHintProp->StringValue();
+                    
+            if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KAboveLeft )
+                {
+                iPositionHint = EAboveLeft;
+                }
+            else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KAboveRight )
+                {
+                iPositionHint = EAboveRight;
+                }
+            else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KBelowLeft )
+                {
+                iPositionHint = EBelowLeft;
+                }
+            else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KBelowRight )
                 {
-                const TDesC8& displayHintVal = positionHintProp->StringValue();
-                        
-                if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KAboveLeft )
-                    {
-                    iPositionHint = EAboveLeft;
-                    }
-                else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KAboveRight )
-                    {
-                    iPositionHint = EAboveRight;
-                    }
-                else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KBelowLeft )
-                    {
-                    iPositionHint = EBelowLeft;
-                    }
-                else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KBelowRight )
-                    {
-                    iPositionHint = EBelowRight;
-                    }
-                else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KRight )
-                    {
-                    iPositionHint = ERight;
-                    }
-                else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KLeft )
-                    {
-                    iPositionHint = ELeft;
-                    }
-                else 
-                    {
-                     // if the value if of unknown type, use default one
-                     if ( AknLayoutUtils::LayoutMirrored() )
-                         {
-                         iPositionHint = EAboveRight;
-                         }
-                         else
-                         {
-                         iPositionHint = EAboveLeft; 
-                         }
+                iPositionHint = EBelowRight;
+                }
+            else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KRight )
+                {
+                iPositionHint = ERight;
+                }
+            else if ( displayHintVal == XnPropertyNames::tooltip::positionhint::KLeft )
+                {
+                iPositionHint = ELeft;
+                }
+            else 
+                {
+                 // if the value if of unknown type, use default one
+                 if ( AknLayoutUtils::LayoutMirrored() )
+                     {
+                     iPositionHint = EAboveRight;
                      }
-            
-                if ( iPositionHint != ENone )
-                    {    
-                    // the popup is going visible and position-hind is available
-                    // calculate its position
-                    CalculatePosition();
-                    }
+                     else
+                     {
+                     iPositionHint = EAboveLeft; 
+                     }
+                 }
+        
+            if ( iPositionHint != ENone )
+                {    
+                // the popup is going visible and position-hind is available
+                // calculate its position
+                CalculatePosition();
                 }
-            }       
-        DrawableWindow()->FadeBehind( ETrue );
+            }        
         }
-    else
-        {
-        DrawableWindow()->FadeBehind( EFalse );
-        }
+
     CCoeControl::MakeVisible( aVisible );            
     }
 
@@ -255,39 +245,42 @@
                 CXnNode* parentN(iUiEngine->FindNodeByIdL( parentIdVal,
                         iNode.Node().Namespace() ) );
                 
-                TRect clientRect =
-                        static_cast<CEikAppUi&> ( *iAppUiAdapter ).ClientRect();
-                TRect parentRect = parentN->Rect();
-                parentRect.Move( clientRect.iTl );
-                
-                if ( !parentRect.Contains( aPointerEvent.iParentPosition ) )
+                if ( parentN )
                     {
-                    // tap was neither in popup nor in its parent -
-                    // we can close it
-                    if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
+                    TRect clientRect =
+                            static_cast<CEikAppUi&> ( *iAppUiAdapter ).ClientRect();
+                    TRect parentRect = parentN->Rect();
+                    parentRect.Move( clientRect.iTl );
+                    
+                    if ( !parentRect.Contains( aPointerEvent.iParentPosition ) )
                         {
-                        CXnDomStringPool* sp =
-                            iNode.Node().DomNode()->StringPool();
-                        CXnProperty* prop = CXnProperty::NewL( KDisplay, KNone,
-                        CXnDomPropertyValue::EString, *sp );
-                        CleanupStack::PushL( prop );
-                        iNode.Node().SetPropertyL( prop );
-                        CleanupStack::Pop( prop );
+                        // tap was neither in popup nor in its parent -
+                        // we can close it
+                        if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
+                            {
+                            CXnDomStringPool* sp =
+                                iNode.Node().DomNode()->StringPool();
+                            CXnProperty* prop = CXnProperty::NewL( KDisplay, KNone,
+                            CXnDomPropertyValue::EString, *sp );
+                            CleanupStack::PushL( prop );
+                            iNode.Node().SetPropertyL( prop );
+                            CleanupStack::Pop( prop );
+                            return;
+                            }
+                        }
+                    else
+                        {
+                        // tap was made inside of popup parent
+                        // we pass the event to it after
+                        // recalculating the taping point
+                        TPointerEvent newPointerEvent;
+                        newPointerEvent.Copy( aPointerEvent );
+                        newPointerEvent.iPosition = TPoint(
+                                 aPointerEvent.iParentPosition - clientRect.iTl );
+                        parentN->Control()->HandlePointerEventL( newPointerEvent );
                         return;
                         }
                     }
-                else
-                    {
-                    // tap was made inside of popup parent
-                    // we pass the event to it after
-                    // recalculating the taping point
-                    TPointerEvent newPointerEvent;
-                    newPointerEvent.Copy( aPointerEvent );
-                    newPointerEvent.iPosition = TPoint(
-                             aPointerEvent.iParentPosition - clientRect.iTl );
-                    parentN->Control()->HandlePointerEventL( newPointerEvent );
-                    return;
-                    }
                 }
             }
         }
--- a/menufw/menufwui/matrixmenu/src/mmappui.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/menufw/menufwui/matrixmenu/src/mmappui.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -12,8 +12,8 @@
 * Contributors:
 *
 * Description:  Application UI class
-*  Version     : %version: MM_176.1.28.1.60 % << Don't touch! Updated by Synergy at check-out.
-*  Version     : %version: MM_176.1.28.1.60 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: MM_176.1.28.1.61 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: MM_176.1.28.1.61 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -1805,12 +1805,6 @@
 
     if( iCurrentContainer != aWidgetContainer )
         {
-        if( iCurrentContainer && aWidgetContainer &&
-                iCurrentContainer->WidgetType() != aWidgetContainer->WidgetType() )
-            {
-            StartLayoutSwitchFullScreen();
-            }
-
         TBool highlightVisibleBefore = iCurrentContainer != NULL &&
 			iCurrentContainer->IsHighlightVisible();
 
--- a/menufw/menufwui/mmwidgets/inc/mmgridview.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/menufw/menufwui/mmwidgets/inc/mmgridview.h	Tue Feb 02 00:04:13 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  CMmGridView declaration
-*  Version     : %version: MM_24.1.8 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: MM_24.1.9 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -133,6 +133,12 @@
 	* @param aItemHeight New height in pixels for this view’s items.
 	*/	
     void SetItemHeight(TInt aItemHeight);
+    
+    /**
+     * Updates various member variables in this grid view and related objects
+     * with item dimensions taken from the template library.
+     */
+    void UpdateItemHeightAndWidth();
 
 private:
 	
--- a/menufw/menufwui/mmwidgets/src/mmgrid.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/menufw/menufwui/mmwidgets/src/mmgrid.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:
-*  Version     : %version: MM_97 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: MM_98 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -96,7 +96,7 @@
             CListItemDrawer* itemDrawer = aListBox->View()->ItemDrawer();
             CWindowGc* originalGc = itemDrawer->Gc();
             if ( customGc == originalGc )
-            {
+                {
                 return NULL;
                 }
             else
@@ -867,7 +867,7 @@
 //
 void CMmGrid::UpdateScrollBarsL()
     {
-    TBool redrawNeeded = HandleScrollbarVisibilityChangeL();
+    TBool visibilityChanged = HandleScrollbarVisibilityChangeL();
     if (ScrollBarFrame()->VerticalScrollBar()->IsVisible())
         {
         CAknGrid::UpdateScrollBarsL();
@@ -876,6 +876,11 @@
     iMmDrawer->TemplateLibrary()->SetScrollbarWidthL(
             ScrollBarFrame()->VerticalScrollBar()->Rect().Width() + ScrollBarOffset() );
     FixViewForMirroredLayout();
+    if ( visibilityChanged )
+        {
+        CMmGridView* view = static_cast<CMmGridView*>( iView );
+        view->UpdateItemHeightAndWidth();
+        }
     }
 
 // -----------------------------------------------------------------------------
--- a/menufw/menufwui/mmwidgets/src/mmgridview.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/menufw/menufwui/mmwidgets/src/mmgridview.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -214,14 +214,7 @@
 //
 void CMmGridView::Draw(const TRect* aClipRect) const
     {
-    CMmListBoxItemDrawer* itemDrawer =
-            STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() );
-    TSize size = itemDrawer->GetItemSize( 0, EFalse );
-    if ( itemDrawer->ItemCellSize() != size  )
-        {
-        const_cast<CMmGridView*>( this )->SetItemHeight( size.iHeight );
-        const_cast<CMmGridView*>( this )->SetColumnWidth( size.iWidth );
-        }
+    const_cast<CMmGridView*>( this )->UpdateItemHeightAndWidth();
     DoDraw( aClipRect );
     }
 
@@ -299,4 +292,23 @@
 	CAknGridView::SetItemHeight(aItemHeight);
 	}
 
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CMmGridView::UpdateItemHeightAndWidth()
+    {
+    if ( iModel && iModel->NumberOfItems() )
+        {
+        CMmListBoxItemDrawer* itemDrawer =
+                STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() );
+        TSize size = itemDrawer->GetItemSize( 0, EFalse );
+        if ( itemDrawer->ItemCellSize() != size  )
+            {
+            const_cast<CMmGridView*>( this )->SetItemHeight( size.iHeight );
+            const_cast<CMmGridView*>( this )->SetColumnWidth( size.iWidth );
+            }
+        }
+    }
+
 //End of file
--- a/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -128,6 +128,7 @@
 void CMmListBoxItemDrawer::InvalidateCache()
     {
     iItemsDataCache->Invalidate();
+    // this is needed to get iColors initialized on first use:
     }
 
 // -----------------------------------------------------------------------------
@@ -300,7 +301,7 @@
             TInt drawnItemIndex = iFloatingItems[i].GetDrawnItemIndex();
             TSize size = iWidget->View()->ItemSize( drawnItemIndex );
             TRect rect( iFloatingItems[i].GetItemPosition(), iFloatingItems[i].GetItemPosition() + size);
-            
+
             if (rect.Intersects(currentlyDrawnRect))
 				{
 				TInt tempZoomIconIndex = iZoomIconIndex;
@@ -314,7 +315,7 @@
 					{
 					ClearFlags( CListItemDrawer::EPressedDownState );
 					}
-				
+
 				DrawActualItem( drawnItemIndex, rect, ETrue, EFalse, EFalse, EFalse );
 				iIconAnimationZoomRatio = tempZoomRatio;
 				iZoomIconIndex = tempZoomIconIndex;
@@ -444,13 +445,13 @@
         {
         DrawBackgroundAndSeparatorLines( aItemTextRect );
         }
-    
+
     if ( !iUseCache || !cache->IsValid() )
         {
         SetupSubCellsL( aItemIsCurrent, aItemIndex );
         }
     __ASSERT_DEBUG( cache->IsValid(), User::Invariant() );
-    
+
     FormattedCellData()->SetIconArray( cache->GetIconListL() );
 
 	TBool isFloating = !iUseCache && IsFloating( aItemIndex );
@@ -462,7 +463,7 @@
 
 	CFormattedCellListBoxData* data = static_cast<CFormattedCellListBoxData*>(iData);
 	data->EnableMarqueeL( EFalse );
-	
+
     TBool highlightShown = ETrue;
 	if (FormattedCellData()->RespectFocus() && !aViewIsEmphasized)
 		{
@@ -668,22 +669,22 @@
 	if ( !aDragged )
 	    {
         AknsUtils::GetCachedColor( skin, colors.iText, KAknsIIDQsnTextColors,
-                EAknsCIQsnTextColorsCG6 );
+                EAknsCIQsnTextColorsCG9 );
         AknsUtils::GetCachedColor( skin, colors.iBack , KAknsIIDQsnTextColors,
-                EAknsCIQsnOtherColorsCG9 );
+                EAknsCIQsnOtherColorsCG6 );
         AknsUtils::GetCachedColor( skin, colors.iHighlightedText,
-                KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 );
+                KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG11 );
         AknsUtils::GetCachedColor( skin, colors.iHighlightedBack,
                 KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 );
 	    }
 	else
 	    {
         AknsUtils::GetCachedColor( skin, colors.iText, KAknsIIDQsnTextColors,
-                EAknsCIQsnTextColorsCG10 );
+                EAknsCIQsnTextColorsCG11 );
         AknsUtils::GetCachedColor( skin, colors.iBack , KAknsIIDQsnTextColors,
                 EAknsCIQsnTextColorsCG6 );
         AknsUtils::GetCachedColor( skin, colors.iHighlightedText,
-                KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 );
+                KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG11 );
         AknsUtils::GetCachedColor( skin, colors.iHighlightedBack,
                 KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 );
 	    }
@@ -778,7 +779,7 @@
         {
         return TSize( 1, 1 );
         }
-    
+
 	TSize size;
 
 	CMmCacheForItem* cache = NULL;
@@ -787,19 +788,19 @@
 	    {
 	    cache = NULL;
 	    }
-	
+
 	if ( cache )
 	    {
 	    cache->InvalidateIfCacheMayNotBeUsed(
 	            aItemIsCurrent, iLastSubcellsSetupCode );
 	    }
-	
+
     if ( !iUseCache || !cache || !cache->IsValid() )
         {
         const TDesC8& mm_template = iMmModel->GetAttributeAsText (aItemIndex,
                 KMmTemplate8);
         TRect viewRect = iWidget->View()->ViewRect();
-        
+
         TBool landscapeOrientation = viewRect.Width() > viewRect.Height();
         // Layout_Meta_Data::IsLandscapeOrientation cannot be used here because it
         // might happen that GetSize (this method) gets called immediately after
@@ -810,7 +811,7 @@
         // cause the template library to fill the internal cache for landscape mode
         // with parameters calculated according to the outdated ViewRect.
 
-        
+
         if ( iTemplateLibrary->GetSize( size, iWidgetType, mm_template,
                 landscapeOrientation, aItemIsCurrent, viewRect )
                 != KErrNone )
@@ -973,7 +974,7 @@
 				MmEffects::KNoAnimationFramesCount, iWidget->View() );
 		floatingItem.SetManualDelete( ETrue );
 		AddFloatingItemL(floatingItem, 0);
-		
+
 	    ClearFlags( CListItemDrawer::EPressedDownState );
     	}
 
@@ -1044,7 +1045,7 @@
 		{
 		iIsIndicatorItem = ETrue;
 		SetRedrawItemBackground( EFalse );
-		
+
 		DrawActualItem( aItemIndex, AdjustItemRect( aItemIndex ) , EFalse, EFalse, EFalse, EFalse);
 
 		SetRedrawItemBackground( ETrue );
@@ -1340,19 +1341,19 @@
     {
     CMmCacheForItem* cache = iItemsDataCache->GetItemCacheL( aItemIndex );
     cache->SetValidL( EFalse );
-    
+
     const TDesC8& mmTemplate = iMmModel->GetAttributeAsText( aItemIndex, KMmTemplate8 );
     if ( !mmTemplate.Compare( KNullDesC8 ) || !mmTemplate.Compare( KEmpty8 ) )
         {
         User::Leave( KErrNotFound );
         }
     cache->SetTemplateL( mmTemplate );
-    
+
     cache->ClearIconArray();
     cache->SetCurrent( aItemIsCurrent );
-    
+
     TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation();
-    
+
     RBuf& itemText = cache->GetItemTextForModifications();
     itemText.Close();
     itemText.CreateL( MmTemplateContants::KItemSubCellsText );
@@ -1369,9 +1370,9 @@
 		iTemplateLibrary->GetMoveIndicatorChildrenL( iWidgetType, templateChildArray,
 	    		mmTemplate, landscapeOrientation, aItemIsCurrent );
 		}
-    
+
     iLastSubcellsSetupCode.Clear();
-    
+
     //Backdrop icon as first element to draw
     TInt subcellIncrement( 0 );
     if ( GetBackdropVisibility( aItemIndex, aItemIsCurrent ) )
@@ -1379,7 +1380,7 @@
         SetupBackdropSubcellL( templateChildArray, aItemIndex, itemText, subcellIncrement );
         iItemHasBackdrop = ETrue;
         }
-    else 
+    else
     	{
     	iItemHasBackdrop = EFalse;
     	}
@@ -1409,13 +1410,13 @@
 	    {
 	    SetupSubNoCellL( i, aItemIndex );
 	    }
-	
+
 	iLastSubcellsSetupCode.AddTemplateInfo(
 	        iItemsDataCache->GetTemplateIdentifierL( mmTemplate ) );
 	iLastSubcellsSetupCode.AddIsCurrentInfo( aItemIsCurrent );
 
 	CleanupStack::PopAndDestroy( &templateChildArray );
-	
+
 	cache->SetSubcellsSetupCode( iLastSubcellsSetupCode );
 	// the line below is here only to make the cached information complete
 	GetItemSize( aItemIndex, aItemIsCurrent );
@@ -1471,14 +1472,14 @@
 //
 // -----------------------------------------------------------------------------
 //
-void CMmListBoxItemDrawer::DrawActualItem(TInt aItemIndex, 
-		const TRect& aActualItemRect, TBool aItemIsCurrent, 
+void CMmListBoxItemDrawer::DrawActualItem(TInt aItemIndex,
+		const TRect& aActualItemRect, TBool aItemIsCurrent,
 		TBool aViewIsEmphasized, TBool /*aViewIsDimmed*/,
 		TBool aItemIsSelected) const
 		{
-		if (Properties(aItemIndex).IsSelectionHidden()) 
-			{ 
-			aItemIsSelected = EFalse; 
+		if (Properties(aItemIndex).IsSelectionHidden())
+			{
+			aItemIsSelected = EFalse;
 			}
 		DrawItemText(aItemIndex,aActualItemRect,aItemIsCurrent,
 				aViewIsEmphasized,aItemIsSelected);
@@ -1488,7 +1489,7 @@
 //
 // -----------------------------------------------------------------------------
 //
-TBool CMmListBoxItemDrawer::GetHighlightVisibility( TInt aItemIndex, 
+TBool CMmListBoxItemDrawer::GetHighlightVisibility( TInt aItemIndex,
 		TBool aItemIsCurrent, TBool aAllowHighlightForNonDraggedItem ) const
 	{
 	TBool highlightVisibility(EFalse);
@@ -1497,7 +1498,7 @@
 		TBool currentlyDraggedItem =
 			ItemHasFloatingType( aItemIndex, EDrag ) ||
 			ItemHasFloatingType( aItemIndex, EDragTransition );
-		
+
 		if ( ( STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsHighlightVisible()
 				&& aItemIsCurrent && aAllowHighlightForNonDraggedItem )
 				|| currentlyDraggedItem )
@@ -1512,18 +1513,18 @@
 //
 // -----------------------------------------------------------------------------
 //
-TBool CMmListBoxItemDrawer::GetBackdropVisibility( TInt aItemIndex, 
+TBool CMmListBoxItemDrawer::GetBackdropVisibility( TInt aItemIndex,
 		TBool aItemIsCurrent ) const
 	{
 	TBool currentlyDraggedItem =
 		ItemHasFloatingType( aItemIndex, EDrag ) ||
 		ItemHasFloatingType( aItemIndex, EDragTransition );
-	
+
     return 	IsEditMode() /* draw the backdrop only in edit mode */
     		&& !currentlyDraggedItem /* backdrop is disabled for dragged items */
     		&& !iIsIndicatorItem /* in non-touch backdrop is not drawn, just "move indicators" */
     		&& !iLeftOverAreaUnderAnimatedItem /* is the currently drawn item the area left over behind dragged item*/
-    		&& !( STATIC_CAST( CMmWidgetContainer*,Widget()->Parent() )->IsHighlightVisible() 
+    		&& !( STATIC_CAST( CMmWidgetContainer*,Widget()->Parent() )->IsHighlightVisible()
     				&& aItemIsCurrent );/*if the timer is active then we want to draw highlight (not backdrop) on the current index*/
 	}
 
@@ -1531,7 +1532,7 @@
 //
 // -----------------------------------------------------------------------------
 //
-TBool CMmListBoxItemDrawer::ItemHasFloatingType( TInt aItemIndex, 
+TBool CMmListBoxItemDrawer::ItemHasFloatingType( TInt aItemIndex,
 		TMmFloatingItemType aFloatingType) const
 	{
 	TBool hasFloatingType( EFalse );
--- a/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:
-*  Version     : %version: MM_71.1.17.1.49 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: MM_71.1.17.1.51 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -1948,11 +1948,10 @@
 			}
 		}
 
-    if ( iListBoxObserver && !iLongTapInProgress )
+    if ( iListBoxObserver && !iLongTapInProgress && !iDrawer->IsDraggable() )
         {
         iListBoxObserver->HandleListBoxEventL( aListBox, aEventType );
         }
-
     }
 
 //End of file
--- a/menufw/menusuites/foldersuite/data/items_nontouch.xml	Tue Jan 26 11:48:23 2010 +0200
+++ b/menufw/menusuites/foldersuite/data/items_nontouch.xml	Tue Feb 02 00:04:13 2010 +0200
@@ -105,7 +105,7 @@
         </mm:output>
 		
         <mm:output alias="mul_indicator_1" condition="folder_items:ReturnValue/[$index]/running = true">
-            <mm:image mif_file="gridroot.mif" bitmap_id="EMbmGridrootQgn_indi_app_open" mask_id="EMbmGridrootQgn_indi_app_open_mask" />
+		    <mm:image skinid_major="0x101F86E3" skinid_minor="0x1417" mif_file="gridroot.mif" bitmap_id="EMbmGridrootQgn_indi_app_open" mask_id="EMbmGridrootQgn_indi_app_open_mask" />
         </mm:output>
         
         <mm:output alias="mul_indicator_1" condition="folder_items:ReturnValue/[$index]/drm_protection = expired">
--- a/menufw/menusuites/foldersuite/data/items_touch.xml	Tue Jan 26 11:48:23 2010 +0200
+++ b/menufw/menusuites/foldersuite/data/items_touch.xml	Tue Feb 02 00:04:13 2010 +0200
@@ -175,7 +175,7 @@
         </mm:output>
 		
         <mm:output alias="mul_indicator_1" condition="folder_items:ReturnValue/[$index]/running = true">
-		    <mm:image mif_file="gridroot.mif" bitmap_id="EMbmGridrootQgn_indi_app_open" mask_id="EMbmGridrootQgn_indi_app_open_mask" />
+		    <mm:image skinid_major="0x101F86E3" skinid_minor="0x1417" mif_file="gridroot.mif" bitmap_id="EMbmGridrootQgn_indi_app_open" mask_id="EMbmGridrootQgn_indi_app_open_mask" />
         </mm:output>
 		
         <mm:output alias="mul_indicator_1" condition="folder_items:ReturnValue/[$index]/drm_protection = expired">
--- a/taskswitcher/taskswitcherui/inc/tsappuid.hrh	Tue Jan 26 11:48:23 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*
-* Copyright (c) 2009 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#ifndef TSAPPUID_HRH
-#define TSAPPUID_HRH
-
-#define KTsAppUidValue      0x20016BF0
-
-#endif
--- a/taskswitcher/taskswitcherui/inc/tsgraphicids.h	Tue Jan 26 11:48:23 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2009 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSGRAPHICIDS_H
-#define TSGRAPHICIDS_H
-
-#include <e32base.h>
-
-/**
- * Logical IDs for all icons used in Taskswitcher.
- */
-enum TTsGraphicId
-    {
-    ETsGraphicIdLAST
-    };
-
-#endif // TSGRAPHICIDS_H
--- a/taskswitcher/taskswitcherui/inc/tsgraphictab.h	Tue Jan 26 11:48:23 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2009 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSGRAPHICTAB_H
-#define TSGRAPHICTAB_H
-
-#include <e32base.h>
-
-#include <AknUtils.h>
-#include <AknsUtils.h>          // skinned icons
-#include <AknsConstants.h>      // skinned icon ids
-
-
-/**
- * Name of image file in case icon is not available from the skin.
- * Path should not be included.
- * Use _S( "" ) if skin id should be used instead.
- * Order and count must match TTsGraphicId. (except the last-marker)
- */
-static const TText* const KTsGraphicFiles[] =
-    {
-    _S( "" )
-    };
-
-/**
- * Skin related IDs. Not in use yet.
- * Use all zeros if image file should be used instead.
- * Order and count must match TTsGraphicId. (except the last-marker)
- */
-static const TAknsItemID KTsGraphicSkinIds[] =
-    {
-    KAknsIIDNone
-    };
-
-#endif // TSGRAPHICTAB_H
--- a/taskswitcher/taskswitcherui/inc/tsuid.hrh	Tue Jan 26 11:48:23 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/*
-* Copyright (c) 2008 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Taskswitcher application's UID3
- *
-*/
-
-
-#ifndef TSAPPUID_HRH
-#define TSAPPUID_HRH
-
-#define KTsAppUidValue      0x20016BF0
-
-#endif
--- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h	Tue Feb 02 00:04:13 2010 +0200
@@ -117,11 +117,6 @@
     void TryCloseAppL( TInt aIndex, TBool aSuppressRendering = EFalse );
     
     /**
-     * Sends close msg to given app if user confirms the query.
-     */
-    void TryCloseAppWithQueryL( TInt aIndex );
-    
-    /**
      * Tries to Close all applications that cn be closed
      */
     void TryCloseAllL();
@@ -284,13 +279,6 @@
      * @param   aPoint  position for the popup
      */
     TBool ShowPopupL( TInt aIndex, const TPoint& aPoint );
-    
-    /**
-     * Shows the app close confirmation query.
-     * @param   aIndex  index of item in the grid
-     * @return ETrue if accepted EFalse if canceled
-     */
-    TBool ConfirmCloseL( TInt aIndex );
 
     /**
      * Sends the data-changed notification.
@@ -380,6 +368,12 @@
      * Launches increasing pop-up feedback.
      */
     void LaunchPopupFeedback();
+    
+    /**
+     * Show highlight when disabled and 
+     * consume EEventKeyUp that follows after event that swiched on the highlight.
+     */
+    TKeyResponse ShowHighlightOnKeyEvent(const TKeyEvent& aKeyEvent, TEventCode aType);
 
 private: // Data
     
@@ -407,9 +401,6 @@
     // the aIndex argument of ShowPopupL is stored here
     TInt iAppIndexForPopup;
 
-    // query shown when pressing Clear key in fsw, own
-    CAknQueryDialog* iConfirmCloseQuery;
-
     // Timestamp of the last application close operation
     TTime iTimeOfLastClose;
     
--- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h	Tue Jan 26 11:48:23 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h	Tue Feb 02 00:04:13 2010 +0200
@@ -57,7 +57,8 @@
  */
 class CTsFastSwapGrid: 
     public CAknGrid,
-    public MTsDeviceStateObserver
+    public MTsDeviceStateObserver,
+    public MTsFastSwapTimerObserver
     {
 public: // enums
     enum TFastSwapGridBehaviour
@@ -200,6 +201,9 @@
 private: // From CAknGrid
     virtual void CreateItemDrawerL();
 
+private: // From MTsFastSwapTimerObserver
+    void TimerCompletedL( CTsFastSwapTimer* aSource );
+    
 private: // New functions
     
     /**
@@ -224,6 +228,7 @@
     RArray<TInt> iCloseItems;
     TInt iCloseIconHitIdx;
     MTsFastSwapGridObserver* iFastSwapGridObserver;
+    CTsFastSwapTimer* iCloseIconRedrawTimer;
 
     // Highlight handling
     TFastSwapGridBehaviour iBehaviour;
@@ -232,6 +237,7 @@
     // Visible view rectangle (horizontal scrolling support)
     TRect iVisibleViewRect;
     
+    // Feedback support
     TBool iTactileFeedbackSupport;
     
     mutable RArray<TInt> iFullyVisibleItems;
--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -385,7 +385,10 @@
         }
     // forward event
     iDeviceState->HandleResourceChange( aType );
-    iAppView->HandleResourceChange( aType );
+    if ( iAppView )
+        {
+        iAppView->HandleResourceChange( aType );
+        }
     }
 
 // -----------------------------------------------------------------------------
--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -124,7 +124,6 @@
     delete iGrid;
     delete iFSClient;
     delete iPopup;
-    delete iConfirmCloseQuery;
     delete iHighlightTimer;
     delete iRedrawTimer;
     delete iUpdateGridTimer;
@@ -212,10 +211,6 @@
             empty, empty );
 
     // Setup text layout
-    TRgb textColor;
-    AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor,
-            KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG9 );
-    
     TAknLayoutText textLayout;
     textLayout.LayoutText(
             Rect(),
@@ -226,12 +221,25 @@
     TInt baselineOffset = textLayout.TextRect().iBr.iY - textLayout.TextRect().iTl.iY;
     AknListBoxLayouts::SetupFormTextCell( *iGrid, iGrid->ItemDrawer(), 1 /*Column index*/,
                                           textLayout.Font() /*Font type*/,
-                                          textColor.Color16() /*color*/,
+                                          NULL /*color*/,
                                           textLayout.TextRect().iTl.iX /*Left margin*/, 0 /*unused*/,
                                           baselineOffset /*Baseline*/, 0 /*Text width*/,
                                           textLayout.Align() /*Text alignment*/,
                                           TPoint(0,0) /*Start pos*/,
                                           TPoint(0,0) /*End pos*/);
+    // Text colors
+    TRgb textColor;
+    AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor,
+            KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 );
+    TRgb highlightTextColor;
+    AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), highlightTextColor,
+            KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG11 );
+    CFormattedCellListBoxData::TColors colors;
+    colors.iText = textColor;
+    colors.iBack = iGrid->ItemDrawer()->BackColor();
+    colors.iHighlightedText = highlightTextColor;
+    colors.iHighlightedBack = iGrid->ItemDrawer()->HighlightedBackColor();
+    iGrid->ItemDrawer()->FormattedCellData()->SetSubCellColorsL(1, colors);
     
     // Setup grid observers
     if ( obs )
@@ -427,20 +435,6 @@
     }
 
 // --------------------------------------------------------------------------
-// CTsFastSwapArea::TryCloseAppWithQueryL
-// --------------------------------------------------------------------------
-//
-void CTsFastSwapArea::TryCloseAppWithQueryL( TInt aIndex )
-    {
-    if ( aIndex >= 0 && aIndex < iArray.Count()
-            && CanClose( aIndex )
-            && ConfirmCloseL( aIndex ) )
-        {
-        TryCloseAppL( aIndex );
-        }
-    }
-
-// --------------------------------------------------------------------------
 // CTsFastSwapArea::TryCloseAllL
 // --------------------------------------------------------------------------
 //
@@ -732,9 +726,6 @@
     {
     // stop listening for changes in fsw content
     iFSClient->CancelSubscribe();
-    // get rid of the close confirmation query if shown
-    delete iConfirmCloseQuery; // this will cause ExecuteLD to return with 0
-    iConfirmCloseQuery = 0;
     }
 
 // -----------------------------------------------------------------------------
@@ -812,33 +803,17 @@
         TInt idx = SelectedIndex();
         if ( idx >= 0 )
             {
-            TryCloseAppWithQueryL( idx );
+            TryCloseAppL( idx );
             }
         return EKeyWasConsumed;
         }
     
     //do not forward the event until item is higlighted
-    if( aKeyEvent.iScanCode == EStdKeyLeftArrow ||
-        aKeyEvent.iScanCode == EStdKeyRightArrow )
-        {
-        if ( !iGrid->IsHighlightVisible() )
-            {
-            if ( aType == EEventKey )
-                {
-                ShowHighlight();
-                iConsumeEvent = ETrue;
-                }
-            return EKeyWasConsumed;
-            }
-        else if(iConsumeEvent)
-            {
-            if (aType == EEventKeyUp)
-                {
-                return EKeyWasConsumed;
-                }
-            iConsumeEvent = EFalse;
-            }
-        }
+    TKeyResponse response = ShowHighlightOnKeyEvent(aKeyEvent, aType);
+    if( response == EKeyWasConsumed )
+    	{
+    	return EKeyWasConsumed;
+    	}
     
     // pass the event to grid
     // do not pass down and up arrow key events
@@ -875,6 +850,43 @@
     }
 
 // -----------------------------------------------------------------------------
+// CTsFastSwapArea::CatchKeyEvent
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CTsFastSwapArea::ShowHighlightOnKeyEvent(
+		const TKeyEvent& aKeyEvent, TEventCode aType)
+	{
+	TKeyResponse retVal(EKeyWasNotConsumed);
+	
+	if (aKeyEvent.iScanCode == EStdKeyLeftArrow ||
+		aKeyEvent.iScanCode == EStdKeyRightArrow)
+		{
+		if (!iGrid->IsHighlightVisible())
+			{
+			if (aType == EEventKey)
+				{
+				ShowHighlight();
+				iConsumeEvent = ETrue;
+				}
+			retVal = EKeyWasConsumed;
+			}
+		else if (iConsumeEvent)
+			{
+			if (aType == EEventKeyUp)
+				{
+				retVal = EKeyWasConsumed;
+				}
+			else
+				{
+				iConsumeEvent = EFalse;
+				}
+			}
+		}
+	return retVal;
+	}
+
+
+// -----------------------------------------------------------------------------
 // CTsFastSwapArea::HandlePointerEventL
 // -----------------------------------------------------------------------------
 //
@@ -889,24 +901,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// CTsFastSwapArea::ConfirmCloseL
-// -----------------------------------------------------------------------------
-//
-TBool CTsFastSwapArea::ConfirmCloseL( TInt aIndex )
-    {
-    HBufC* msg = StringLoader::LoadLC( R_TS_FSW_CONFIRM_CLOSE,
-        iArray[aIndex]->AppName() );
-    iConfirmCloseQuery = CAknQueryDialog::NewL(
-        CAknQueryDialog::EConfirmationTone );
-    iConfirmCloseQuery->SetPromptL( *msg );
-    CleanupStack::PopAndDestroy( msg );
-    TBool ok = iConfirmCloseQuery->ExecuteLD(
-        R_TS_FSW_CONFIRM_CLOSE_QUERY );
-    iConfirmCloseQuery = 0;
-    return ok;
-    }
-
-// -----------------------------------------------------------------------------
 // CTsFastSwapArea::SelectedIndex
 // -----------------------------------------------------------------------------
 //
@@ -978,7 +972,7 @@
 //
 void CTsFastSwapArea::HandleCloseEventL(TInt aItemIdx)
     {
-    TryCloseAppWithQueryL( aItemIdx );
+    TryCloseAppL( aItemIdx );
     }
 
 
--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -29,6 +29,8 @@
   * ================================================================================
   */
 
+const TInt KCloseIconRedrawTime = 300000; // 0.3 second
+
 // -----------------------------------------------------------------------------
 // CTsFastSwapGrid::CTsFastSwapGrid
 // -----------------------------------------------------------------------------
@@ -50,6 +52,7 @@
     {
     iCloseItems.Close();
     delete iBgContext;
+    delete iCloseIconRedrawTimer;
     iFullyVisibleItems.Close();
     iPartialVisibleItems.Close();
     }
@@ -71,6 +74,8 @@
                ETrue );
     iBgContext->SetCenter( KAknsIIDQsnFrPopupCenter );
     iVisibleViewRect = TRect( 0, 0, 0, 0 );
+    iCloseIconRedrawTimer = new (ELeave) CTsFastSwapTimer( *this );
+    iCloseIconRedrawTimer->ConstructL();
     }
 
 // -----------------------------------------------------------------------------
@@ -134,9 +139,9 @@
                                                   ETouchFeedbackBasicButton, 
                                                   ETouchFeedbackVibra, 
                                                   aPointerEvent);
-                        iFastSwapGridObserver->HandleCloseEventL( hitDataIdx );
+                        iCloseIconRedrawTimer->Cancel();
+                        iCloseIconRedrawTimer->After(KCloseIconRedrawTime);
                         }
-                    ResetCloseHit();
                     if ( GridBehaviour() == EHybrid )
                         {
                         ShowHighlight();
@@ -253,6 +258,18 @@
     LoadCloseIcon();
     }
 
+// -----------------------------------------------------------------------------
+// CTsFastSwapGrid::TimerCompletedL
+// -----------------------------------------------------------------------------
+//
+void CTsFastSwapGrid::TimerCompletedL( CTsFastSwapTimer* aSource )
+    {
+    if ( aSource == iCloseIconRedrawTimer )
+        {
+        iFastSwapGridObserver->HandleCloseEventL( iCloseIconHitIdx );
+        ResetCloseHit();
+        }
+    }
 
 // -----------------------------------------------------------------------------
 // CTsFastSwapGrid::SetCloseItemsL
@@ -410,13 +427,16 @@
     CFbsBitmap* icon = NULL;
     CFbsBitmap* mask = NULL;
 
-    TRAP_IGNORE(AknsUtils::CreateIconLC( AknsUtils::SkinInstance(),
+    TRAP_IGNORE(AknsUtils::CreateColorIconLC( AknsUtils::SkinInstance(),
                 KAknsIIDQgnIndiItutListCollapse,
+                KAknsIIDQsnTextColors,    // we use text color here, eventhough this is an icon
+                EAknsCIQsnTextColorsCG13, // softkey text color
                 icon,
                 mask,
                 KAvkonBitmapFile,
                 EMbmAvkonQgn_indi_button_preview_close,
-                EMbmAvkonQgn_indi_button_preview_close_mask
+                EMbmAvkonQgn_indi_button_preview_close_mask,
+                KRgbWhite
                 );
                 CleanupStack::Pop( 2 ); // codescanner::cleanup
                 );