Revision: 201021
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 13:30:16 +0300
changeset 55 03646e8da489
parent 51 4785f57bf3d4
child 56 29d7e0a3b7b2
child 60 30f14686fb04
Revision: 201021 Kit: 2010123
homescreenapp/hsapplication/conf/base/confml/homescreendb.confml
homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/create.sql
homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/fill.sql
homescreenapp/hsapplication/hsapplication_fallbacktheme.qrc
homescreenapp/hsapplication/resource_s60/d_landscape.png
homescreenapp/hsapplication/resource_s60/d_portrait.png
homescreenapp/hsapplication/resource_s60/homescreen.db
homescreenapp/hsapplication/resource_win/d_landscape.png
homescreenapp/hsapplication/resource_win/d_portrait.png
homescreenapp/hsapplication/resource_win/homescreen.db
homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_large_applications_download.svg
homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_large_applications_user.svg
homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_large_super_new.svg
homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_mono_applications_all.svg
homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_mono_applications_collections.svg
homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_mono_ovistore.svg
homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_mono_search.svg
homescreenapp/hsdomainmodel/inc/hsbackuprestoreobserver.h
homescreenapp/hsdomainmodel/inc/hsconfiguration.h
homescreenapp/hsdomainmodel/inc/hscontentservice.h
homescreenapp/hsdomainmodel/inc/hsdatabase.h
homescreenapp/hsdomainmodel/inc/hsdomainmodeldatastructures.h
homescreenapp/hsdomainmodel/inc/hsgui.h
homescreenapp/hsdomainmodel/inc/hspage.h
homescreenapp/hsdomainmodel/inc/hsscene.h
homescreenapp/hsdomainmodel/inc/hsshortcutservice.h
homescreenapp/hsdomainmodel/inc/hswidgetcomponent.h
homescreenapp/hsdomainmodel/inc/hswidgethost.h
homescreenapp/hsdomainmodel/src/hsbackuprestoreobserver.cpp
homescreenapp/hsdomainmodel/src/hsconfiguration.cpp
homescreenapp/hsdomainmodel/src/hscontentservice.cpp
homescreenapp/hsdomainmodel/src/hsdatabase.cpp
homescreenapp/hsdomainmodel/src/hsgui.cpp
homescreenapp/hsdomainmodel/src/hspage.cpp
homescreenapp/hsdomainmodel/src/hsscene.cpp
homescreenapp/hsdomainmodel/src/hsshortcutservice.cpp
homescreenapp/hsdomainmodel/src/hswidgetcomponent.cpp
homescreenapp/hsdomainmodel/src/hswidgetcomponentdescriptor.cpp
homescreenapp/hsdomainmodel/src/hswidgetcomponentregistry.cpp
homescreenapp/hsdomainmodel/src/hswidgethost.cpp
homescreenapp/hsutils/inc/hsmenuevent.h
homescreenapp/hsutils/inc/hsmenueventfactory.h
homescreenapp/hsutils/src/hsmenueventfactory.cpp
homescreenapp/inc/hsapp_defs.inl
homescreenapp/sis/homescreenapp_ut_hs.pkg
homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary.confml
homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary_20022F97.crml
homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h
homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsinstalledappsstate.h
homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuview.h
homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h
homescreenapp/stateplugins/hsapplibrarystateplugin/resource/applibrary.docml
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp
homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h
homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsloadscenestate.h
homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp
homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlewidget.cpp
homescreenapp/stateplugins/hshomescreenstateplugin/src/hsloadscenestate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddappstocollectionstate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsarrangestate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionnamestate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsarrangestate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionslistdialog.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenuworkerstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp
homescreenapp/widgetplugins/hsshortcutwidgetplugin/inc/hsshortcutwidget.h
homescreenapp/widgetplugins/hsshortcutwidgetplugin/resource/hsshortcutwidget.css
homescreenapp/widgetplugins/hsshortcutwidgetplugin/src/hsshortcutwidget.cpp
taskswitcherapp/rom/tsapplication_core.iby
taskswitcherapp/taskswitcherapp.pro
taskswitcherapp/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp
taskswitcherapp/tsdevicedialogplugin/src/tsentrymodelitem.cpp
--- a/homescreenapp/hsapplication/conf/base/confml/homescreendb.confml	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsapplication/conf/base/confml/homescreendb.confml	Fri Jun 11 13:30:16 2010 +0300
@@ -3,14 +3,6 @@
   <confml:feature ref="HomeScreenDbSettings" name="HomeScreen database settings">
     <confml:setting ref="portraitWallpaper" name="Portrait wallpaper" type="string"/>
     <confml:setting ref="landscapeWallpaper" name="Landscape wallpaper" type="string"/>
-    <confml:setting ref="maximumPageCount" name="Maximum number of pages" type="int"/>
-    <confml:setting ref="maximumWidgetHeight" name="Maximum height of widget" type="real"/>
-    <confml:setting ref="maximumWidgetWidth" name="Maximum width of widget" type="real"/>
-    <confml:setting ref="minimumWidgetHeight" name="Minimum height of widget" type="real"/>
-    <confml:setting ref="minimumWidgetWidth" name="Minimum width of widget" type="real"/>
-    <confml:setting ref="defaultPageId" name="Default page ID" type="selection">
-      <confml:option map="HomeScreenDbSettings/Pages"/>
-    </confml:setting>
     <confml:setting ref="Pages" mapKey="id" mapValue="id" name="Pages" type="sequence">
       <confml:setting ref="id" name="ID" type="int"/>
       <confml:setting ref="indexPosition" name="Index Position" type="int"/>
@@ -73,18 +65,22 @@
       <confml:setting ref="widgetDragEffectDuration" name="Widget drag effect duration" type="int"/>
       <confml:setting ref="widgetDropEffectDuration" name="Widget drop effect duration" type="int"/>
       <confml:setting ref="boundaryFeedbackEffectDistance" name="Boundary feedback effect distance" type="int"/>
+      <confml:setting ref="maximumPageCount" name="Maximum number of pages" type="int"/>
+      <confml:setting ref="maximumWidgetHeight" name="Maximum height of widget" type="real"/>
+      <confml:setting ref="maximumWidgetWidth" name="Maximum width of widget" type="real"/>
+      <confml:setting ref="minimumWidgetHeight" name="Minimum height of widget" type="real"/>
+      <confml:setting ref="minimumWidgetWidth" name="Minimum width of widget" type="real"/>
+      <confml:setting ref="defaultPageId" name="Default page ID" type="selection">
+        <confml:option map="HomeScreenDbSettings/Pages"/>
+      </confml:setting>
+      <confml:setting ref="shortcutLabelsVisible" name="Minimum width of widget" type="int"/>     
+      <confml:setting ref="pageChangePanDistance" name="Amount of pan needed to change page" type="real"/>     
     </confml:setting>
   </confml:feature>
   <confml:data>
     <confml:HomeScreenDbSettings>
       <confml:landscapeWallpaper/>
       <confml:portraitWallpaper/>
-      <confml:maximumPageCount>8</confml:maximumPageCount>
-      <confml:maximumWidgetHeight>39</confml:maximumWidgetHeight>
-      <confml:maximumWidgetWidth>48</confml:maximumWidgetWidth>
-      <confml:minimumWidgetHeight>8.75</confml:minimumWidgetHeight>
-      <confml:minimumWidgetWidth>8.75</confml:minimumWidgetWidth>
-      <confml:defaultPageId map="HomeScreenDbSettings/Pages[@key='1']"/>
       <confml:Widgets><confml:id>1</confml:id><confml:uri>hsclockwidgetplugin</confml:uri><confml:pageId  map="HomeScreenDbSettings/Pages[@key='1']"></confml:pageId></confml:Widgets>
       <confml:Widgets><confml:id>2</confml:id><confml:uri>hsdialerwidgetplugin</confml:uri><confml:pageId map="HomeScreenDbSettings/Pages[@key='1']"></confml:pageId></confml:Widgets>
       <confml:Widgets><confml:id>3</confml:id><confml:uri>ftuhswidget</confml:uri><confml:pageId map="HomeScreenDbSettings/Pages[@key='1']"></confml:pageId></confml:Widgets>
@@ -163,6 +159,14 @@
       	<confml:widgetDragEffectDuration>200</confml:widgetDragEffectDuration>
       	<confml:widgetDropEffectDuration>200</confml:widgetDropEffectDuration>
       	<confml:boundaryFeedbackEffectDistance>3</confml:boundaryFeedbackEffectDistance>
+        <confml:maximumPageCount>8</confml:maximumPageCount>
+        <confml:maximumWidgetHeight>39</confml:maximumWidgetHeight>
+        <confml:maximumWidgetWidth>48</confml:maximumWidgetWidth>
+        <confml:minimumWidgetHeight>8.75</confml:minimumWidgetHeight>
+        <confml:minimumWidgetWidth>8.75</confml:minimumWidgetWidth> 
+       	<confml:defaultPageId map="HomeScreenDbSettings/Pages[@key='1']"/>
+        <confml:shortcutLabelsVisible>1</confml:shortcutLabelsVisible>
+        <confml:pageChangePanDistance>17.91</confml:pageChangePanDistance>           	
       </confml:GeneralConfiguration>
     </confml:HomeScreenDbSettings>
   </confml:data>
--- a/homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/create.sql	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/create.sql	Fri Jun 11 13:30:16 2010 +0300
@@ -2,13 +2,7 @@
 CREATE TABLE Scene (
   id INTEGER PRIMARY KEY,
   portraitWallpaper TEXT,
-  landscapeWallpaper TEXT,
-  defaultPageId INTEGER,
-  maximumPageCount INTEGER,
-  maximumWidgetHeight REAL,
-  maximumWidgetWidth REAL,
-  minimumWidgetHeight REAL,
-  minimumWidgetWidth REAL);
+  landscapeWallpaper TEXT);
 
 DROP TABLE IF EXISTS Pages;
 CREATE TABLE Pages (
@@ -76,5 +70,13 @@
   newPageAddedAnimationDuration INTEGER, 
   widgetDragEffectDuration INTEGER, 
   widgetDropEffectDuration INTEGER,
-  boundaryFeedbackEffectDistance INTEGER);
+  boundaryFeedbackEffectDistance INTEGER,
+  defaultPageId INTEGER,
+  maximumPageCount INTEGER,
+  maximumWidgetHeight REAL,
+  maximumWidgetWidth REAL,
+  minimumWidgetHeight REAL,
+  minimumWidgetWidth REAL,
+  shortcutLabelsVisible INTEGER,
+  pageChangePanDistance REAL);
  
\ No newline at end of file
--- a/homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/fill.sql	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/fill.sql	Fri Jun 11 13:30:16 2010 +0300
@@ -1,12 +1,6 @@
 {%- set portraitWallpaper = feat_tree.HomeScreenDbSettings.portraitWallpaper._value or '' -%}
 {%- set landscapeWallpaper = feat_tree.HomeScreenDbSettings.landscapeWallpaper._value or '' -%}
-{%- set defaultPageId = feat_tree.HomeScreenDbSettings.defaultPageId._value -%}
-{%- set maximumPageCount = feat_tree.HomeScreenDbSettings.maximumPageCount._value -%}
-{%- set maximumWidgetHeight = feat_tree.HomeScreenDbSettings.maximumWidgetHeight._value -%}
-{%- set maximumWidgetWidth = feat_tree.HomeScreenDbSettings.maximumWidgetWidth._value -%}
-{%- set minimumWidgetHeight = feat_tree.HomeScreenDbSettings.minimumWidgetHeight._value -%}
-{%- set minimumWidgetWidth = feat_tree.HomeScreenDbSettings.minimumWidgetWidth._value -%}
-INSERT INTO Scene (portraitWallpaper, landscapeWallpaper, defaultPageId, maximumPageCount, maximumWidgetHeight, maximumWidgetWidth, minimumWidgetHeight, minimumWidgetWidth) VALUES ('{{portraitWallpaper}}', '{{landscapeWallpaper}}', {{defaultPageId}}, {{maximumPageCount}}, {{maximumWidgetHeight}}, {{maximumWidgetWidth}}, {{minimumWidgetHeight}}, {{minimumWidgetWidth}});
+INSERT INTO Scene (portraitWallpaper, landscapeWallpaper) VALUES ('{{portraitWallpaper}}', '{{landscapeWallpaper}}');
 
 {% for index in range(feat_tree.HomeScreenDbSettings.Pages._value|length) -%}
     {%- set id = feat_tree.HomeScreenDbSettings.Pages.id._value[index] -%}
@@ -62,7 +56,15 @@
 {%- set widgetDragEffectDuration = feat_tree.HomeScreenDbSettings.GeneralConfiguration.widgetDragEffectDuration._value -%}
 {%- set widgetDropEffectDuration = feat_tree.HomeScreenDbSettings.GeneralConfiguration.widgetDropEffectDuration._value -%}
 {%- set boundaryFeedbackEffectDistance = feat_tree.HomeScreenDbSettings.GeneralConfiguration.boundaryFeedbackEffectDistance._value -%}
-INSERT INTO GeneralConfiguration (bounceEffect, tapAndHoldDistance, widgetTapAndHoldTimeout, sceneTapAndHoldTimeout, pageChangeZoneWidth, pageIndicatorSpacing, pageChangeAnimationDuration, pageChangeZoneAnimationDuration, pageChangeZoneReverseAnimationDuration, pageRemovedAnimationDuration, newPageAddedAnimationDuration, widgetDragEffectDuration, widgetDropEffectDuration, boundaryFeedbackEffectDistance ) VALUES ({{bounceEffect}}, {{tapAndHoldDistance}}, {{widgetTapAndHoldTimeout}}, {{widgetTapAndHoldTimeout}}, {{pageChangeZoneWidth}}, {{pageIndicatorSpacing}}, {{pageChangeAnimationDuration}}, {{pageChangeZoneAnimationDuration}}, {{pageChangeZoneReverseAnimationDuration}}, {{pageRemovedAnimationDuration}}, {{newPageAddedAnimationDuration}}, {{widgetDragEffectDuration}}, {{widgetDropEffectDuration}}, {{boundaryFeedbackEffectDistance}});
+{%- set defaultPageId = feat_tree.HomeScreenDbSettings.GeneralConfiguration.defaultPageId._value -%}
+{%- set maximumPageCount = feat_tree.HomeScreenDbSettings.GeneralConfiguration.maximumPageCount._value -%}
+{%- set maximumWidgetHeight = feat_tree.HomeScreenDbSettings.GeneralConfiguration.maximumWidgetHeight._value -%}
+{%- set maximumWidgetWidth = feat_tree.HomeScreenDbSettings.GeneralConfiguration.maximumWidgetWidth._value -%}
+{%- set minimumWidgetHeight = feat_tree.HomeScreenDbSettings.GeneralConfiguration.minimumWidgetHeight._value -%}
+{%- set minimumWidgetWidth = feat_tree.HomeScreenDbSettings.GeneralConfiguration.minimumWidgetWidth._value -%}
+{%- set shortcutLabelsVisible = feat_tree.HomeScreenDbSettings.GeneralConfiguration.shortcutLabelsVisible._value -%}
+{%- set pageChangePanDistance = feat_tree.HomeScreenDbSettings.GeneralConfiguration.pageChangePanDistance._value -%}
+INSERT INTO GeneralConfiguration (bounceEffect, tapAndHoldDistance, widgetTapAndHoldTimeout, sceneTapAndHoldTimeout, pageChangeZoneWidth, pageIndicatorSpacing, pageChangeAnimationDuration, pageChangeZoneAnimationDuration, pageChangeZoneReverseAnimationDuration, pageRemovedAnimationDuration, newPageAddedAnimationDuration, widgetDragEffectDuration, widgetDropEffectDuration, boundaryFeedbackEffectDistance, defaultPageId, maximumPageCount, maximumWidgetHeight, maximumWidgetWidth, minimumWidgetHeight, minimumWidgetWidth, shortcutLabelsVisible, pageChangePanDistance) VALUES ({{bounceEffect}}, {{tapAndHoldDistance}}, {{widgetTapAndHoldTimeout}}, {{widgetTapAndHoldTimeout}}, {{pageChangeZoneWidth}}, {{pageIndicatorSpacing}}, {{pageChangeAnimationDuration}}, {{pageChangeZoneAnimationDuration}}, {{pageChangeZoneReverseAnimationDuration}}, {{pageRemovedAnimationDuration}}, {{newPageAddedAnimationDuration}}, {{widgetDragEffectDuration}}, {{widgetDropEffectDuration}}, {{boundaryFeedbackEffectDistance}}, {{defaultPageId}}, {{maximumPageCount}}, {{maximumWidgetHeight}}, {{maximumWidgetWidth}}, {{minimumWidgetHeight}}, {{minimumWidgetWidth}}, {{shortcutLabelsVisible}}, {{pageChangePanDistance}});
 
 {%- set pageChangeFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.pageChangeFeedbackType._value -%}
 {%- set widgetPickFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.widgetPickFeedbackType._value -%}
--- a/homescreenapp/hsapplication/hsapplication_fallbacktheme.qrc	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsapplication/hsapplication_fallbacktheme.qrc	Fri Jun 11 13:30:16 2010 +0300
@@ -1,13 +1,5 @@
 <RCC>
     <qresource prefix="/" >
-        <file>themes/icons/hbdefault/scalable/qtg_mono_applications_all.svg</file>
-        <file>themes/icons/hbdefault/scalable/qtg_mono_applications_collections.svg</file>
-        <file>themes/icons/hbdefault/scalable/qtg_mono_search.svg</file>
-        <file>themes/icons/hbdefault/scalable/qtg_mono_ovistore.svg</file>
-        <file>themes/icons/hbdefault/scalable/qtg_large_applications_download.svg</file>
-        <file>themes/icons/hbdefault/scalable/qtg_large_applications_user.svg</file>
-        <file>themes/icons/hbdefault/scalable/qtg_large_super_new.svg</file>
-
         <file>themes/icons/hbdefault/scalable/qtg_graf_hspage_normal.svg</file>
         <file>themes/icons/hbdefault/scalable/qtg_graf_hspage_highlight.svg</file>
         <file>themes/icons/hbdefault/scalable/hs_shortcut_bg.svg</file>
Binary file homescreenapp/hsapplication/resource_s60/d_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_s60/d_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_s60/homescreen.db has changed
Binary file homescreenapp/hsapplication/resource_win/d_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_win/d_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_win/homescreen.db has changed
--- a/homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_large_applications_download.svg	Thu May 27 12:46:08 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="98px" height="98px" viewBox="0 0 98 98">
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="50.9189" y1="46.7383" x2="50.9189" y2="77.3273" gradientTransform="matrix(1 1.000000e-004 -1.000000e-004 1 -2.362 -29.0813)">
-<stop offset="0" style="stop-color:#A6A8AB"/>
-<stop offset="1" style="stop-color:#231F20"/>
-</linearGradient>
-<polygon fill-opacity="0.2" stroke-opacity="0.2" fill="url(#SVGID_1_)" points="8.539,45.168 30.738,45.176 30.758,17.66 66.072,17.664 66.082,45.203   88.559,45.207 48.346,86.49 "/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="50.9102" y1="48.5117" x2="50.9102" y2="76.6895" gradientTransform="matrix(1 1.000000e-004 -1.000000e-004 1 -2.362 -29.0813)">
-<stop offset="0" style="stop-color:#7F8082"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<polygon fill-opacity="0.4" stroke-opacity="0.4" fill="url(#SVGID_2_)" points="12.131,46.691 32.27,46.697 32.283,19.184 64.553,19.188 64.563,46.727   84.949,46.73 48.352,84.305 "/>
-<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="50.9697" y1="48.3413" x2="50.9697" y2="107.9882" gradientTransform="matrix(1 1.000000e-004 -1.000000e-004 1 -2.362 -29.0813)">
-<stop offset="0" style="stop-color:#45E8FF"/>
-<stop offset="0.1455" style="stop-color:#45E8FF"/>
-<stop offset="0.5576" style="stop-color:#30A4D5"/>
-<stop offset="1" style="stop-color:#1347BA"/>
-</linearGradient>
-<polygon fill="url(#SVGID_3_)" points="16.996,46.771 48.355,79.5 80.203,46.732 63.039,46.727 63.027,19.936 33.807,19.934   33.807,46.77 "/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="48.4165" y1="19.9453" x2="48.4165" y2="19.9492">
-<stop offset="0" style="stop-color:#B3FCFF"/>
-<stop offset="0.4182" style="stop-color:#B3FCFF"/>
-<stop offset="1" style="stop-color:#5FBAD8"/>
-</linearGradient>
-<line fill="url(#SVGID_4_)" x1="63.027" y1="19.949" x2="33.807" y2="19.945"/>
-<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="48.4165" y1="8.1895" x2="48.4165" y2="81.0683">
-<stop offset="0" style="stop-color:#B3FCFF"/>
-<stop offset="0.4182" style="stop-color:#B3FCFF"/>
-<stop offset="1" style="stop-color:#5FBAD8"/>
-</linearGradient>
-<polygon fill="url(#SVGID_5_)" points="33.807,19.184 63.029,19.188 63.027,20.709 33.805,20.707 33.807,19.184 "/>
-<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="71.5557" y1="8.1895" x2="71.5557" y2="81.0683">
-<stop offset="0" style="stop-color:#B3FCFF"/>
-<stop offset="0.4182" style="stop-color:#B3FCFF"/>
-<stop offset="1" style="stop-color:#5FBAD8"/>
-</linearGradient>
-<polygon fill="url(#SVGID_6_)" points="62.58,46.789 80.531,46.793 79.17,48.316 62.58,48.316 62.58,46.789 "/>
-<linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="24.8906" y1="8.1895" x2="24.8906" y2="81.0684">
-<stop offset="0" style="stop-color:#B3FCFF"/>
-<stop offset="0.4182" style="stop-color:#B3FCFF"/>
-<stop offset="1" style="stop-color:#5FBAD8"/>
-</linearGradient>
-<polygon fill="url(#SVGID_7_)" points="16,46.77 33.781,46.77 33.777,48.291 17.605,48.291 16,46.77 "/>
-<polygon fill="#33AEDB" points="79.213,46.73 48.355,78.408 17.84,46.691 15.723,46.695 48.354,80.594 81.342,46.73 "/>
-<rect fill="none" width="98" height="98"/>
-<linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="65.5" y1="56.4053" x2="65.5" y2="92.0204">
-<stop offset="0" style="stop-color:#A6A8AB"/>
-<stop offset="1" style="stop-color:#231F20"/>
-</linearGradient>
-<path fill-opacity="0.2" stroke-opacity="0.2" fill="url(#SVGID_8_)" d="M59,91.5c-1.103,0-2-0.897-2-2v-13c0-1.103,0.897-2,2-2h13c1.103,0,2,0.897,2,2v13  c0,1.103-0.897,2-2,2H59z"/>
-<linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="65.5" y1="56.584" x2="65.5" y2="91.4017">
-<stop offset="0" style="stop-color:#A9AAAD"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<path fill-opacity="0.4" stroke-opacity="0.4" fill="url(#SVGID_9_)" d="M59,91c-0.827,0-1.5-0.673-1.5-1.5v-13c0-0.827,0.673-1.5,1.5-1.5h13  c0.827,0,1.5,0.673,1.5,1.5v13c0,0.827-0.673,1.5-1.5,1.5H59z"/>
-<linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="65.5" y1="75" x2="65.5" y2="90.3335">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.3152" style="stop-color:#BDC2C4"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-<path fill="url(#SVGID_10_)" d="M72,75H59c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V76  C73,75.447,72.553,75,72,75z"/>
-<path fill-opacity="0.2" stroke-opacity="0.2" fill="url(#SVGID_11_)" d="M76,91.5c-1.103,0-2-0.897-2-2v-13c0-1.103,0.897-2,2-2h13c1.103,0,2,0.897,2,2v13  c0,1.103-0.897,2-2,2H76z"/>
-<path fill-opacity="0.4" stroke-opacity="0.4" fill="url(#SVGID_12_)" d="M76,91c-0.827,0-1.5-0.673-1.5-1.5v-13c0-0.827,0.673-1.5,1.5-1.5h13  c0.827,0,1.5,0.673,1.5,1.5v13c0,0.827-0.673,1.5-1.5,1.5H76z"/>
-<linearGradient id="SVGID_13_" gradientUnits="userSpaceOnUse" x1="82.5" y1="75" x2="82.5" y2="90.3335">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.3152" style="stop-color:#BDC2C4"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-<path fill="url(#SVGID_13_)" d="M89,75H76c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V76  C90,75.447,89.553,75,89,75z"/>
-<linearGradient id="SVGID_14_" gradientUnits="userSpaceOnUse" x1="64.5" y1="56.4053" x2="64.5" y2="92.0204">
-<stop offset="0" style="stop-color:#A6A8AB"/>
-<stop offset="1" style="stop-color:#231F20"/>
-</linearGradient>
-<path fill-opacity="0.2" stroke-opacity="0.2" fill="url(#SVGID_14_)" d="M58,73.5c-1.103,0-2-0.898-2-2v-13c0-1.103,0.897-2,2-2h13.001  c1.102,0,1.999,0.897,1.999,2v13c0,1.102-0.897,2-1.999,2H58z"/>
-<linearGradient id="SVGID_15_" gradientUnits="userSpaceOnUse" x1="64.5" y1="56.584" x2="64.5" y2="91.4017">
-<stop offset="0" style="stop-color:#A9AAAD"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<path fill-opacity="0.4" stroke-opacity="0.4" fill="url(#SVGID_15_)" d="M58,73c-0.827,0-1.5-0.672-1.5-1.5v-13c0-0.827,0.673-1.5,1.5-1.5h13.001  c0.826,0,1.499,0.673,1.499,1.5v13c0,0.828-0.673,1.5-1.499,1.5H58z"/>
-<linearGradient id="SVGID_16_" gradientUnits="userSpaceOnUse" x1="64.5" y1="57" x2="64.5" y2="72.3335">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.3152" style="stop-color:#BDC2C4"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-<path fill="url(#SVGID_16_)" d="M71.001,72C71.553,72,72,71.553,72,71.001V58c0-0.552-0.447-1-0.999-1H58c-0.553,0-1,0.448-1,1  v13.001C57,71.553,57.447,72,58,72H71.001z"/>
-<path fill-opacity="0.2" stroke-opacity="0.2" fill="url(#SVGID_11_)" d="M76,74.5c-1.103,0-2-0.897-2-2v-13c0-1.103,0.897-2,2-2h13c1.103,0,2,0.897,2,2v13  c0,1.103-0.897,2-2,2H76z"/>
-<path fill-opacity="0.4" stroke-opacity="0.4" fill="url(#SVGID_12_)" d="M76,74c-0.827,0-1.5-0.672-1.5-1.5v-13c0-0.827,0.673-1.5,1.5-1.5h13  c0.827,0,1.5,0.673,1.5,1.5v13c0,0.828-0.673,1.5-1.5,1.5H76z"/>
-<path fill="url(#SVGID_19_)" d="M89,58H76c-0.553,0-1,0.448-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V59  C90,58.448,89.553,58,89,58z"/>
-<linearGradient id="SVGID_20_" gradientUnits="userSpaceOnUse" x1="65.5" y1="75" x2="65.5" y2="90">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.2606" style="stop-color:#BDC2C4"/>
-<stop offset="0.5394" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-<path fill="url(#SVGID_20_)" d="M73,89c0,0.553-0.447,1-1,1H59c-0.553,0-1-0.447-1-1V76c0-0.553,0.447-1,1-1h13c0.553,0,1,0.447,1,1  V89z"/>
-<linearGradient id="SVGID_21_" gradientUnits="userSpaceOnUse" x1="65.5" y1="75" x2="65.5" y2="90">
-<stop offset="0" style="stop-color:#F6FDFF"/>
-<stop offset="0.3152" style="stop-color:#D1D7D9"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#B7C3C7"/>
-</linearGradient>
-<path fill="url(#SVGID_21_)" d="M72,75H59c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V76  C73,75.447,72.553,75,72,75z M72.5,89c0,0.275-0.225,0.5-0.5,0.5H59c-0.275,0-0.5-0.225-0.5-0.5V76c0-0.275,0.225-0.5,0.5-0.5h13  c0.275,0,0.5,0.225,0.5,0.5V89z"/>
-<linearGradient id="SVGID_22_" gradientUnits="userSpaceOnUse" x1="82.5" y1="75" x2="82.5" y2="90.6667">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.2606" style="stop-color:#BDC2C4"/>
-<stop offset="0.5394" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-<path fill="url(#SVGID_22_)" d="M90,89c0,0.553-0.447,1-1,1H76c-0.553,0-1-0.447-1-1V76c0-0.553,0.447-1,1-1h13c0.553,0,1,0.447,1,1  V89z"/>
-<linearGradient id="SVGID_23_" gradientUnits="userSpaceOnUse" x1="82.5" y1="75" x2="82.5" y2="90.6667">
-<stop offset="0" style="stop-color:#F6FDFF"/>
-<stop offset="0.3152" style="stop-color:#D1D7D9"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#B7C3C7"/>
-</linearGradient>
-<path fill="url(#SVGID_23_)" d="M89,75H76c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V76  C90,75.447,89.553,75,89,75z M89.5,89c0,0.275-0.225,0.5-0.5,0.5H76c-0.275,0-0.5-0.225-0.5-0.5V76c0-0.275,0.225-0.5,0.5-0.5h13  c0.275,0,0.5,0.225,0.5,0.5V89z"/>
-<linearGradient id="SVGID_24_" gradientUnits="userSpaceOnUse" x1="64.5" y1="56.333" x2="64.5" y2="72.3331">
-<stop offset="0" style="stop-color:#AFED23"/>
-<stop offset="0.7394" style="stop-color:#358C0C"/>
-<stop offset="1" style="stop-color:#67AD1A"/>
-</linearGradient>
-<path fill="url(#SVGID_24_)" d="M72,71.001C72,71.553,71.553,72,71.001,72H58c-0.553,0-1-0.447-1-0.999V58c0-0.552,0.447-1,1-1  h13.001C71.553,57,72,57.448,72,58V71.001z"/>
-<linearGradient id="SVGID_25_" gradientUnits="userSpaceOnUse" x1="64.5" y1="56.333" x2="64.5" y2="72.3331">
-<stop offset="0" style="stop-color:#E5FFB2"/>
-<stop offset="0.3879" style="stop-color:#6AAB18"/>
-<stop offset="0.7879" style="stop-color:#247307"/>
-<stop offset="1" style="stop-color:#7ABF2B"/>
-</linearGradient>
-<path fill="url(#SVGID_25_)" d="M71.001,57H58c-0.553,0-1,0.448-1,1v13.001C57,71.553,57.447,72,58,72h13.001  C71.553,72,72,71.553,72,71.001V58C72,57.448,71.553,57,71.001,57z M71.5,71.001c0,0.274-0.225,0.499-0.499,0.499H58  c-0.275,0-0.5-0.225-0.5-0.499V58c0-0.275,0.225-0.5,0.5-0.5h13.001c0.274,0,0.499,0.225,0.499,0.5V71.001z"/>
-<path fill="url(#SVGID_19_)" d="M90,72c0,0.553-0.447,1-1,1H76c-0.553,0-1-0.447-1-1V59c0-0.552,0.447-1,1-1h13c0.553,0,1,0.448,1,1  V72z"/>
-<linearGradient id="SVGID_27_" gradientUnits="userSpaceOnUse" x1="82.5" y1="58" x2="82.5" y2="73.3335">
-<stop offset="0" style="stop-color:#F6FDFF"/>
-<stop offset="0.3152" style="stop-color:#D1D7D9"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#B7C3C7"/>
-</linearGradient>
-<path fill="url(#SVGID_27_)" d="M89,58H76c-0.553,0-1,0.448-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V59  C90,58.448,89.553,58,89,58z M89.5,72c0,0.275-0.225,0.5-0.5,0.5H76c-0.275,0-0.5-0.225-0.5-0.5V59c0-0.275,0.225-0.5,0.5-0.5h13  c0.275,0,0.5,0.225,0.5,0.5V72z"/>
-<rect x="49" y="49" fill="none" width="49" height="49"/>
-<defs>
-<linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="82.5" y1="56.4053" x2="82.5" y2="92.0204">
-<stop offset="0" style="stop-color:#A6A8AB"/>
-<stop offset="1" style="stop-color:#231F20"/>
-</linearGradient>
-</defs>
-<defs>
-<linearGradient id="SVGID_12_" gradientUnits="userSpaceOnUse" x1="82.5" y1="56.584" x2="82.5" y2="91.4017">
-<stop offset="0" style="stop-color:#A9AAAD"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-</defs>
-<defs>
-<linearGradient id="SVGID_19_" gradientUnits="userSpaceOnUse" x1="82.5" y1="58" x2="82.5" y2="73.3335">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.3152" style="stop-color:#BDC2C4"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-</defs>
-</svg>
--- a/homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_large_applications_user.svg	Thu May 27 12:46:08 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="98px" height="98px" viewBox="0 0 98 98">
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="48.9995" y1="11" x2="48.9995" y2="87.1677">
-<stop offset="0" style="stop-color:#A6A8AB"/>
-<stop offset="1" style="stop-color:#231F20"/>
-</linearGradient>
-<path fill-opacity="0.2" stroke-opacity="0.2" fill="url(#SVGID_1_)" d="M10.5,87v-1.949c0-7.928,3.57-14.014,10.324-17.6  c1.77-0.939,6.408-2.703,10.498-4.26c1.463-0.559,2.809-1.068,3.891-1.49l1.854-0.813c0.68-1.561,0.375-4.135,0.012-4.703  c-0.094-0.143-1.463-2.387-1.463-2.387l-0.904-1.482h0.125c-0.404-0.758-0.799-1.533-1.17-2.32c-0.018,0-0.027,0-0.041,0  c-2.383,0-4.756-2.02-5.906-5.027c-1.229-3.209-0.715-6.434,1.189-8.025c-1.721-6.977-1.436-12.307,0.85-15.846  c1.693-2.625,4.082-3.686,5.904-4.105C38.129,13.984,41.596,11,48.33,11c7.727,0.254,13.732,2.893,17.398,7.627  c3.629,4.682,4.742,11.238,3.135,18.467c1.777,1.664,2.188,4.885,0.926,7.988c-1.104,2.727-3.24,4.617-5.422,4.863  c-0.877,1.838-1.848,3.629-2.893,5.338l-0.141,0.227c-0.141,0.238-0.273,0.457-0.412,0.68L60,55.861l0.852,0.479  c-0.477,1.115-0.438,3.623,0.209,4.807l1.398,0.563l0.525,0.199l0.438,0.178l2.471,0.916c4.264,1.586,9.564,3.555,11.27,4.441  c1.725,0.9,10.338,5.973,10.338,17.607V87H10.5z"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="48.9995" y1="11.9746" x2="48.9995" y2="86.1888">
-<stop offset="0" style="stop-color:#A9AAAD"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<path fill-opacity="0.4" stroke-opacity="0.4" fill="url(#SVGID_2_)" d="M11.473,86.025v-0.975c0-7.545,3.391-13.334,9.809-16.74  c1.721-0.914,6.338-2.67,10.41-4.219c1.441-0.547,2.789-1.063,3.877-1.486l2.213-0.965c1.004-1.787,0.719-5.037,0.117-5.98  c-0.088-0.137-0.268-0.438-0.268-0.438l-1.182-1.932h0.035c-0.795-1.393-1.539-2.844-2.234-4.332  c-0.201,0.043-0.414,0.063-0.625,0.063c-1.98,0-3.99-1.77-4.996-4.398c-1.176-3.072-0.559-6.164,1.389-7.266  c-1.832-7.027-1.643-12.316,0.559-15.729c1.596-2.473,3.871-3.416,5.627-3.758c2.482-3.1,5.723-5.896,12.127-5.896  c7.404,0.246,13.145,2.752,16.631,7.248c3.447,4.449,4.494,10.727,2.947,17.676c0,0-0.043,0.207-0.129,0.578  c1.816,1.203,2.318,4.252,1.107,7.238c-1.039,2.563-3.049,4.285-5,4.285c-0.051,0-0.1,0-0.148-0.002  c-0.93,1.998-1.971,3.938-3.096,5.777L60.5,55.004c-0.127,0.219-0.264,0.438-0.398,0.656c-0.039,0.061-0.07,0.127-0.102,0.201  l-0.037,0.072c-0.594,1.406-0.611,4.551,0.445,6.002l1.688,0.68l0.541,0.205l0.418,0.168l2.5,0.93  c4.232,1.572,9.506,3.531,11.156,4.389c1.641,0.854,9.816,5.672,9.816,16.744v0.975H11.473z"/>
-<radialGradient id="SVGID_3_" cx="-71.7129" cy="-127.9443" r="81.158" gradientTransform="matrix(0.3386 0 0 0.3374 73.7966 117.8436)" gradientUnits="userSpaceOnUse">
-<stop offset="0" style="stop-color:#FFA98E"/>
-<stop offset="0.2" style="stop-color:#FFA98E"/>
-<stop offset="0.9628" style="stop-color:#D45D36"/>
-<stop offset="1" style="stop-color:#D45D36"/>
-</radialGradient>
-<path fill="url(#SVGID_3_)" d="M60.715,62.455c-2.584-1.121-2.5-6.627-1.436-8.293c0.186-0.289,0.355-0.58,0.533-0.871H38.188  c0.176,0.291,0.346,0.582,0.531,0.871c1.066,1.666,1.148,7.172-1.436,8.293c-2.584,1.125,12.02,10.906,12.02,10.906  S63.303,63.58,60.715,62.455z"/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="48.9995" y1="61.4395" x2="48.9995" y2="84.0762">
-<stop offset="0" style="stop-color:#FF7236"/>
-<stop offset="1" style="stop-color:#BA1212"/>
-</linearGradient>
-<path fill="url(#SVGID_4_)" d="M76.262,68.197c-2.721-1.416-16.199-6.135-16.453-6.428l-10.295,8.557l-11.063-8.887  c-0.307,0.451-13.629,5.121-16.713,6.758c-3.527,1.873-9.289,6.178-9.289,15.879h73.102C85.551,74.375,78.977,69.611,76.262,68.197z  "/>
-<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="49.0981" y1="59.9551" x2="49.0981" y2="73.1974">
-<stop offset="0" style="stop-color:#BC1C24"/>
-<stop offset="1" style="stop-color:#6B1C24"/>
-</linearGradient>
-<polygon fill="url(#SVGID_5_)" points="35.93,62.537 49.514,73.361 62.268,62.76 59.809,61.77 49.514,70.326 38.451,61.439 "/>
-<path fill="#FF7B56" d="M36.57,64.252c0,0-19.377,5.059-19.377,18.633c0,0-2.77,0.002-2.791,0  C14.402,74.537,20.918,68.045,36.57,64.252z"/>
-<path fill="#FF7B56" d="M61.176,63.936c0,0,19.377,5.061,19.377,18.637c0,0,2.77,0,2.791,0  C83.344,74.223,76.828,67.73,61.176,63.936z"/>
-<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="49.1011" y1="74.334" x2="49.1011" y2="61.8274">
-<stop offset="0" style="stop-color:#FFA98E"/>
-<stop offset="0.9628" style="stop-color:#D45D36"/>
-<stop offset="1" style="stop-color:#D45D36"/>
-</linearGradient>
-<polygon fill="url(#SVGID_6_)" points="49.514,73.361 35.93,62.537 35.139,62.883 49.514,74.334 63.063,63.068 62.273,62.752 "/>
-<radialGradient id="SVGID_7_" cx="-98.501" cy="-259.397" r="108.9636" gradientTransform="matrix(0.3386 0 0 0.3374 73.7966 117.8436)" gradientUnits="userSpaceOnUse">
-<stop offset="0" style="stop-color:#FFE2D9"/>
-<stop offset="0.5091" style="stop-color:#FFC6B3"/>
-<stop offset="0.7636" style="stop-color:#FFA98E"/>
-<stop offset="1" style="stop-color:#E88160"/>
-</radialGradient>
-<path fill="url(#SVGID_7_)" d="M66.932,37.145c-0.092-0.045-0.197-0.053-0.289-0.08c0-0.002,0-0.002,0-0.002  c-0.02-0.006-0.035-0.01-0.055-0.012c-0.143-0.039-0.285-0.07-0.432-0.08C48.1,33.83,39.818,23.83,39.195,26.48  c-0.498,2.105-5.561,6.662-8.209,8.936c0.021,0.102,0.033,0.191,0.057,0.295c0,0,0.096,0.467,0.293,1.26  c-0.207,0.023-0.416,0.066-0.615,0.15c-1.688,0.711-2.217,3.477-1.182,6.178c1.031,2.701,3.238,4.318,4.926,3.607  c0.104-0.045,0.191-0.119,0.287-0.182c0.98,2.205,2.184,4.566,3.658,6.936c2.469,2.934,6.254,6.375,10.428,6.375  c5.055,0,8.145-2.764,10.271-5.551c0.051-0.117,0.105-0.227,0.17-0.322c1.574-2.461,2.852-4.93,3.885-7.229  c1.652,0.57,3.768-0.963,4.818-3.559C69.072,40.688,68.604,37.896,66.932,37.145z"/>
-<linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="42.4819" y1="61.7285" x2="58.0754" y2="46.2569">
-<stop offset="0" style="stop-color:#FFDED3"/>
-<stop offset="0.2121" style="stop-color:#FFC6B3"/>
-<stop offset="1" style="stop-color:#FFA98E"/>
-</linearGradient>
-<path fill="url(#SVGID_8_)" d="M48.096,58.623c-3.076,0-6.178-1.434-8.459-3.594c2.416,2.537,5.664,5.006,9.201,5.006  c5.055,0,8.145-2.764,10.271-5.551c0.051-0.117,0.105-0.227,0.17-0.322c1.574-2.461,2.852-4.93,3.885-7.229  C57.416,56.979,53.148,58.623,48.096,58.623z"/>
-<linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="48.6909" y1="12.3115" x2="48.6909" y2="35.2794">
-<stop offset="0" style="stop-color:#8A5D3B"/>
-<stop offset="0.3758" style="stop-color:#632F00"/>
-<stop offset="1" style="stop-color:#361700"/>
-</linearGradient>
-<path fill="url(#SVGID_9_)" d="M48.33,11.975c-6.26,0-9.27,2.846-11.594,5.82c-3.779,0.582-9.77,4.047-5.537,19.223  c2.65-2.271,7.498-8.432,7.996-10.537c0.629-2.676,9.051,7.537,27.447,10.582c0.213-0.852,0.311-1.352,0.311-1.352  C69.844,22.752,63.561,12.482,48.33,11.975z"/>
-<linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="56.5469" y1="34.2852" x2="35.739" y2="21.9324">
-<stop offset="0" style="stop-color:#8A5D3B"/>
-<stop offset="0.3636" style="stop-color:#632F00"/>
-<stop offset="1" style="stop-color:#361700"/>
-</linearGradient>
-<path fill="url(#SVGID_10_)" d="M39.217,25.238c0,0,9.004,11.826,27.297,11.807C66.514,37.045,57.898,35.691,39.217,25.238z"/>
-<linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="33.8599" y1="19.5259" x2="34.0425" y2="32.7395">
-<stop offset="0" style="stop-color:#8A5D3B"/>
-<stop offset="0.3758" style="stop-color:#632F00"/>
-<stop offset="1" style="stop-color:#361700"/>
-</linearGradient>
-<path fill="url(#SVGID_11_)" d="M37.051,18.674c0,0-8.816,0.527-5.545,15.467C31.506,34.141,30.428,23.91,37.051,18.674z"/>
-<linearGradient id="SVGID_12_" gradientUnits="userSpaceOnUse" x1="51.6084" y1="14.2803" x2="50.9608" y2="20.2678">
-<stop offset="0" style="stop-color:#A87C4F"/>
-<stop offset="1" style="stop-color:#632F00"/>
-</linearGradient>
-<path fill="url(#SVGID_12_)" d="M52.604,20.742c-4.104-0.584-11.047-4.221-13.768-2.922c0,0,8.906-10.162,24.627,1.408  C63.463,19.229,59.715,21.758,52.604,20.742z"/>
-<rect fill="none" width="98" height="98"/>
-<linearGradient id="SVGID_13_" gradientUnits="userSpaceOnUse" x1="65.5" y1="56.4053" x2="65.5" y2="92.0204">
-<stop offset="0" style="stop-color:#A6A8AB"/>
-<stop offset="1" style="stop-color:#231F20"/>
-</linearGradient>
-<path fill-opacity="0.2" stroke-opacity="0.2" fill="url(#SVGID_13_)" d="M59,91.5c-1.103,0-2-0.897-2-2v-13c0-1.103,0.897-2,2-2h13c1.103,0,2,0.897,2,2v13  c0,1.103-0.897,2-2,2H59z"/>
-<linearGradient id="SVGID_14_" gradientUnits="userSpaceOnUse" x1="65.5" y1="56.584" x2="65.5" y2="91.4017">
-<stop offset="0" style="stop-color:#A9AAAD"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<path fill-opacity="0.4" stroke-opacity="0.4" fill="url(#SVGID_14_)" d="M59,91c-0.827,0-1.5-0.673-1.5-1.5v-13c0-0.827,0.673-1.5,1.5-1.5h13  c0.827,0,1.5,0.673,1.5,1.5v13c0,0.827-0.673,1.5-1.5,1.5H59z"/>
-<linearGradient id="SVGID_15_" gradientUnits="userSpaceOnUse" x1="65.5" y1="75" x2="65.5" y2="90.3335">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.3152" style="stop-color:#BDC2C4"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-<path fill="url(#SVGID_15_)" d="M72,75H59c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V76  C73,75.447,72.553,75,72,75z"/>
-<path fill-opacity="0.2" stroke-opacity="0.2" fill="url(#SVGID_16_)" d="M76,91.5c-1.103,0-2-0.897-2-2v-13c0-1.103,0.897-2,2-2h13c1.103,0,2,0.897,2,2v13  c0,1.103-0.897,2-2,2H76z"/>
-<path fill-opacity="0.4" stroke-opacity="0.4" fill="url(#SVGID_17_)" d="M76,91c-0.827,0-1.5-0.673-1.5-1.5v-13c0-0.827,0.673-1.5,1.5-1.5h13  c0.827,0,1.5,0.673,1.5,1.5v13c0,0.827-0.673,1.5-1.5,1.5H76z"/>
-<linearGradient id="SVGID_18_" gradientUnits="userSpaceOnUse" x1="82.5" y1="75" x2="82.5" y2="90.3335">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.3152" style="stop-color:#BDC2C4"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-<path fill="url(#SVGID_18_)" d="M89,75H76c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V76  C90,75.447,89.553,75,89,75z"/>
-<linearGradient id="SVGID_19_" gradientUnits="userSpaceOnUse" x1="64.5" y1="56.4053" x2="64.5" y2="92.0204">
-<stop offset="0" style="stop-color:#A6A8AB"/>
-<stop offset="1" style="stop-color:#231F20"/>
-</linearGradient>
-<path fill-opacity="0.2" stroke-opacity="0.2" fill="url(#SVGID_19_)" d="M58,73.5c-1.103,0-2-0.897-2-2v-13c0-1.103,0.897-2,2-2h13c1.103,0,2,0.897,2,2v13  c0,1.103-0.897,2-2,2H58z"/>
-<linearGradient id="SVGID_20_" gradientUnits="userSpaceOnUse" x1="64.5" y1="56.584" x2="64.5" y2="91.4017">
-<stop offset="0" style="stop-color:#A9AAAD"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<path fill-opacity="0.4" stroke-opacity="0.4" fill="url(#SVGID_20_)" d="M58,73c-0.827,0-1.5-0.673-1.5-1.5v-13c0-0.827,0.673-1.5,1.5-1.5h13  c0.827,0,1.5,0.673,1.5,1.5v13c0,0.827-0.673,1.5-1.5,1.5H58z"/>
-<linearGradient id="SVGID_21_" gradientUnits="userSpaceOnUse" x1="64.5" y1="57" x2="64.5" y2="72.3335">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.3152" style="stop-color:#BDC2C4"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-<path fill="url(#SVGID_21_)" d="M71,72c0.553,0,1-0.447,1-1V58c0-0.553-0.447-1-1-1H58c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1  H71z"/>
-<path fill-opacity="0.2" stroke-opacity="0.2" fill="url(#SVGID_16_)" d="M76,74.5c-1.103,0-2-0.897-2-2v-13c0-1.103,0.897-2,2-2h13c1.103,0,2,0.897,2,2v13  c0,1.103-0.897,2-2,2H76z"/>
-<path fill-opacity="0.4" stroke-opacity="0.4" fill="url(#SVGID_17_)" d="M76,74c-0.827,0-1.5-0.673-1.5-1.5v-13c0-0.827,0.673-1.5,1.5-1.5h13  c0.827,0,1.5,0.673,1.5,1.5v13c0,0.827-0.673,1.5-1.5,1.5H76z"/>
-<path fill="url(#SVGID_24_)" d="M89,58H76c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V59  C90,58.447,89.553,58,89,58z"/>
-<linearGradient id="SVGID_25_" gradientUnits="userSpaceOnUse" x1="65.5" y1="75" x2="65.5" y2="90">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.2606" style="stop-color:#BDC2C4"/>
-<stop offset="0.5394" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-<path fill="url(#SVGID_25_)" d="M73,89c0,0.553-0.447,1-1,1H59c-0.553,0-1-0.447-1-1V76c0-0.553,0.447-1,1-1h13c0.553,0,1,0.447,1,1  V89z"/>
-<linearGradient id="SVGID_26_" gradientUnits="userSpaceOnUse" x1="65.5" y1="75" x2="65.5" y2="90">
-<stop offset="0" style="stop-color:#F6FDFF"/>
-<stop offset="0.3152" style="stop-color:#D1D7D9"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#B7C3C7"/>
-</linearGradient>
-<path fill="url(#SVGID_26_)" d="M72,75H59c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V76  C73,75.447,72.553,75,72,75z M72.5,89c0,0.275-0.225,0.5-0.5,0.5H59c-0.275,0-0.5-0.225-0.5-0.5V76c0-0.275,0.225-0.5,0.5-0.5h13  c0.275,0,0.5,0.225,0.5,0.5V89z"/>
-<linearGradient id="SVGID_27_" gradientUnits="userSpaceOnUse" x1="82.5" y1="75" x2="82.5" y2="90.6667">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.2606" style="stop-color:#BDC2C4"/>
-<stop offset="0.5394" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-<path fill="url(#SVGID_27_)" d="M90,89c0,0.553-0.447,1-1,1H76c-0.553,0-1-0.447-1-1V76c0-0.553,0.447-1,1-1h13c0.553,0,1,0.447,1,1  V89z"/>
-<linearGradient id="SVGID_28_" gradientUnits="userSpaceOnUse" x1="82.5" y1="75" x2="82.5" y2="90.6667">
-<stop offset="0" style="stop-color:#F6FDFF"/>
-<stop offset="0.3152" style="stop-color:#D1D7D9"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#B7C3C7"/>
-</linearGradient>
-<path fill="url(#SVGID_28_)" d="M89,75H76c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V76  C90,75.447,89.553,75,89,75z M89.5,89c0,0.275-0.225,0.5-0.5,0.5H76c-0.275,0-0.5-0.225-0.5-0.5V76c0-0.275,0.225-0.5,0.5-0.5h13  c0.275,0,0.5,0.225,0.5,0.5V89z"/>
-<linearGradient id="SVGID_29_" gradientUnits="userSpaceOnUse" x1="64.5" y1="56.333" x2="64.5" y2="72.3331">
-<stop offset="0" style="stop-color:#AFED23"/>
-<stop offset="0.7394" style="stop-color:#358C0C"/>
-<stop offset="1" style="stop-color:#67AD1A"/>
-</linearGradient>
-<path fill="url(#SVGID_29_)" d="M72,71c0,0.553-0.447,1-1,1H58c-0.553,0-1-0.447-1-1V58c0-0.553,0.447-1,1-1h13c0.553,0,1,0.447,1,1  V71z"/>
-<linearGradient id="SVGID_30_" gradientUnits="userSpaceOnUse" x1="64.5" y1="56.333" x2="64.5" y2="72.3331">
-<stop offset="0" style="stop-color:#E5FFB2"/>
-<stop offset="0.3879" style="stop-color:#6AAB18"/>
-<stop offset="0.7879" style="stop-color:#247307"/>
-<stop offset="1" style="stop-color:#7ABF2B"/>
-</linearGradient>
-<path fill="url(#SVGID_30_)" d="M71,57H58c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V58  C72,57.447,71.553,57,71,57z M71.5,71c0,0.275-0.225,0.5-0.5,0.5H58c-0.275,0-0.5-0.225-0.5-0.5V58c0-0.275,0.225-0.5,0.5-0.5h13  c0.275,0,0.5,0.225,0.5,0.5V71z"/>
-<path fill="url(#SVGID_24_)" d="M90,72c0,0.553-0.447,1-1,1H76c-0.553,0-1-0.447-1-1V59c0-0.553,0.447-1,1-1h13c0.553,0,1,0.447,1,1  V72z"/>
-<linearGradient id="SVGID_32_" gradientUnits="userSpaceOnUse" x1="82.5" y1="58" x2="82.5" y2="73.3335">
-<stop offset="0" style="stop-color:#F6FDFF"/>
-<stop offset="0.3152" style="stop-color:#D1D7D9"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#B7C3C7"/>
-</linearGradient>
-<path fill="url(#SVGID_32_)" d="M89,58H76c-0.553,0-1,0.447-1,1v13c0,0.553,0.447,1,1,1h13c0.553,0,1-0.447,1-1V59  C90,58.447,89.553,58,89,58z M89.5,72c0,0.275-0.225,0.5-0.5,0.5H76c-0.275,0-0.5-0.225-0.5-0.5V59c0-0.275,0.225-0.5,0.5-0.5h13  c0.275,0,0.5,0.225,0.5,0.5V72z"/>
-<rect x="49" y="49" fill="none" width="49" height="49"/>
-<rect fill="none" width="98" height="98"/>
-<defs>
-<linearGradient id="SVGID_16_" gradientUnits="userSpaceOnUse" x1="82.5" y1="56.4053" x2="82.5" y2="92.0204">
-<stop offset="0" style="stop-color:#A6A8AB"/>
-<stop offset="1" style="stop-color:#231F20"/>
-</linearGradient>
-</defs>
-<defs>
-<linearGradient id="SVGID_17_" gradientUnits="userSpaceOnUse" x1="82.5" y1="56.584" x2="82.5" y2="91.4017">
-<stop offset="0" style="stop-color:#A9AAAD"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-</defs>
-<defs>
-<linearGradient id="SVGID_24_" gradientUnits="userSpaceOnUse" x1="82.5" y1="58" x2="82.5" y2="73.3335">
-<stop offset="0" style="stop-color:#E9F0F2"/>
-<stop offset="0.0424" style="stop-color:#E9F0F2"/>
-<stop offset="0.3152" style="stop-color:#BDC2C4"/>
-<stop offset="0.6727" style="stop-color:#949DA1"/>
-<stop offset="1" style="stop-color:#98A1A4"/>
-</linearGradient>
-</defs>
-</svg>
--- a/homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_large_super_new.svg	Thu May 27 12:46:08 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="60px" height="60px" viewBox="0 0 60 60">
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="21.0146" y1="7.1299" x2="21.0146" y2="39.4316" gradientTransform="matrix(0.9948 0.1014 -0.1014 0.9948 3.0857 -3.0766)">
-<stop offset="0" style="stop-color:#FFA300"/>
-<stop offset="0.0051" style="stop-color:#FFA300"/>
-<stop offset="1" style="stop-color:#F41C00"/>
-</linearGradient>
-<polygon fill="url(#SVGID_1_)" points="26.187,38.914 24.965,38.619 11.196,35.301 9.975,35.006 10.27,33.785 16.785,6.739   17.079,5.517 18.302,5.812 32.069,9.125 33.291,9.419 32.997,10.642 26.482,37.69 26.187,38.914 "/>
-<path fill="#292929" d="M18.007,7.033l13.767,3.315l-6.516,27.046l-13.767-3.317L18.007,7.033 M16.154,4.002l-7.693,31.93  l18.652,4.494l7.69-31.933L16.154,4.002L16.154,4.002z"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="39.3506" y1="15.6035" x2="39.3506" y2="49.9902" gradientTransform="matrix(0.9948 0.1014 -0.1014 0.9948 3.0857 -3.0766)">
-<stop offset="0" style="stop-color:#FFA300"/>
-<stop offset="0.0051" style="stop-color:#FFA300"/>
-<stop offset="1" style="stop-color:#F41C00"/>
-</linearGradient>
-<polygon fill="url(#SVGID_2_)" points="35.683,50.495 34.709,49.698 23.911,40.865 22.935,40.07 23.733,39.097 41.346,17.563   42.139,16.587 43.111,17.385 53.909,26.216 54.884,27.009 54.086,27.982 36.477,49.52 35.683,50.495 "/>
-<path fill="#292929" d="M42.315,18.357l10.8,8.831l-17.61,21.536l-10.799-8.831L42.315,18.357 M41.962,14.822L21.171,40.248  L35.859,52.26l20.789-25.426L41.962,14.822L41.962,14.822z"/>
-<rect fill="none" width="60" height="60"/>
-</svg>
--- a/homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_mono_applications_all.svg	Thu May 27 12:46:08 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30">
-<rect fill="none" width="30" height="30"/>
-<path d="M25.121,4.314c0.725,0,1.313,0.588,1.313,1.313v7.624c0,0.724-0.588,1.311-1.313,1.311h-7.623  c-0.725,0-1.313-0.587-1.313-1.311V5.627c0-0.725,0.588-1.313,1.313-1.313H25.121 M24.875,5.872h-7.131v7.132h7.131V5.872  L24.875,5.872z"/>
-<path d="M25.121,16.753c0.725,0,1.313,0.587,1.313,1.311v7.625c0,0.724-0.588,1.312-1.313,1.312h-7.623  c-0.725,0-1.313-0.588-1.313-1.312v-7.625c0-0.724,0.588-1.311,1.313-1.311H25.121 M24.875,18.311h-7.131v7.132h7.131V18.311  L24.875,18.311z"/>
-<path d="M12.503,16.753c0.724,0,1.311,0.587,1.311,1.311v7.625c0,0.724-0.587,1.312-1.311,1.312H4.878  c-0.723,0-1.312-0.588-1.312-1.312v-7.625c0-0.724,0.589-1.311,1.312-1.311H12.503 M12.256,18.311H5.125v7.132h7.132V18.311  L12.256,18.311z"/>
-<path d="M13.814,13.251c0,0.724-0.587,1.311-1.311,1.311H4.878c-0.723,0-1.312-0.587-1.312-1.311V5.626  c0-0.724,0.589-1.312,1.312-1.312h7.625c0.724,0,1.311,0.587,1.311,1.312V13.251z"/>
-</svg>
--- a/homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_mono_applications_collections.svg	Thu May 27 12:46:08 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30">
-<rect fill="none" width="30" height="30"/>
-<path d="M24.899,2.301H9.288c-1.438,0-2.603,1.164-2.603,2.602v2.709l1.3,0.077V4.903c0.001-0.719,0.582-1.298,1.302-1.299h15.611  c0.718,0.001,1.3,0.58,1.3,1.299v15.611c0,0.719-0.582,1.302-1.3,1.304h-2.643v1.298h2.643c1.436,0,2.601-1.163,2.601-2.602V4.903  C27.5,3.465,26.335,2.301,24.899,2.301z"/>
-<path d="M2.5,25.096V9.486c0-1.438,1.164-2.602,2.6-2.602l0,0h15.614c1.436,0,2.601,1.164,2.601,2.602l0,0v15.61  c0,1.439-1.165,2.603-2.601,2.603l0,0L5.1,27.699C3.664,27.698,2.5,26.535,2.5,25.096L2.5,25.096z M3.8,9.486v15.61  c0.002,0.722,0.583,1.3,1.3,1.302l0,0l15.614-0.002c0.719,0,1.299-0.578,1.299-1.3l0,0V9.486c0-0.718-0.583-1.301-1.299-1.303l0,0  H5.1C4.383,8.185,3.802,8.768,3.8,9.486L3.8,9.486z"/>
-<path d="M18.874,11.491c0.428,0,0.775,0.345,0.775,0.771v4.487c0,0.427-0.348,0.772-0.775,0.772h-4.488  c-0.425,0-0.771-0.346-0.771-0.772v-4.487c0-0.426,0.347-0.771,0.771-0.771H18.874 M18.732,12.408h-4.202v4.198h4.202V12.408  L18.732,12.408z"/>
-<path d="M18.874,18.814c0.428,0,0.775,0.344,0.775,0.77v4.49c0,0.427-0.348,0.771-0.775,0.771h-4.488  c-0.425,0-0.771-0.344-0.771-0.771v-4.49c0-0.426,0.347-0.77,0.771-0.77H18.874 M18.732,19.73h-4.202v4.197h4.202V19.73  L18.732,19.73z"/>
-<path d="M11.447,18.814c0.426,0,0.772,0.344,0.772,0.77v4.49c0,0.427-0.346,0.771-0.772,0.771H6.958  c-0.427,0-0.771-0.344-0.771-0.771v-4.49c0-0.426,0.344-0.77,0.771-0.77H11.447 M11.302,19.73H7.104v4.197h4.198V19.73L11.302,19.73  z"/>
-<path d="M12.219,14.799c0,0.426-0.346,0.771-0.772,0.771H6.958c-0.427,0-0.771-0.345-0.771-0.771v-4.488  c0-0.429,0.344-0.771,0.771-0.771h4.488c0.426,0,0.772,0.343,0.772,0.771V14.799z"/>
-</svg>
--- a/homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_mono_ovistore.svg	Thu May 27 12:46:08 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30">
-<rect fill="none" width="30" height="30"/>
-<path d="M7.144,18.48c-4.202,0-5.644-2.886-5.644-6.549c0-3.618,1.96-6.159,5.687-6.159c3.857,0,5.623,2.563,5.623,6.247  C12.809,15.875,11.021,18.48,7.144,18.48z M7.144,7.753c-1.917,0-2.068,2.327-2.068,4.114c0,1.831,0.086,4.632,2.068,4.632  c1.981,0,2.09-2.5,2.09-4.632C9.234,10.209,8.975,7.753,7.144,7.753z M12.06,5.944h3.599l2.199,9.246l2.327-9.246h3.04  l-3.254,10.684c-0.36,1.1-0.896,1.853-2.409,1.853c-1.512,0-2.071-0.753-2.407-1.853L12.06,5.944z M26.363,4.648  c-1.099,0-1.896-0.56-1.896-1.595c0-1.035,0.775-1.595,1.896-1.595c1.056,0,1.896,0.582,1.896,1.595  C28.259,4.088,27.462,4.648,26.363,4.648z M24.622,16.899c0,0.313,0,0.894,0.486,1.236c0.253,0.179,0.655,0.345,1.224,0.345  c0.59,0,0.978-0.164,1.232-0.345c0.488-0.343,0.488-0.923,0.488-1.236V5.944h-3.396c0,0-0.121,0-0.231,0  c-0.332,0-0.604,0.008-0.795,0.267c-0.089,0.12-0.213,0.338-0.213,0.725c0,0.405,0.124,0.606,0.213,0.726  c0.191,0.259,0.463,0.261,0.795,0.261c0.11,0,0.197,0,0.197,0V16.899z"/>
-<path d="M3.578,28.539c-0.491,0-0.895-0.032-1.209-0.097c-0.313-0.065-0.571-0.145-0.774-0.234v-1.139  c0.219,0.123,0.491,0.231,0.82,0.323c0.327,0.093,0.679,0.139,1.055,0.139c0.336,0,0.592-0.075,0.767-0.229  c0.173-0.151,0.26-0.379,0.26-0.686c0-0.141-0.026-0.272-0.079-0.395c-0.054-0.12-0.145-0.234-0.27-0.344  c-0.127-0.107-0.378-0.257-0.754-0.447c-0.553-0.272-0.931-0.507-1.133-0.704c-0.202-0.195-0.34-0.402-0.413-0.618  c-0.073-0.218-0.11-0.477-0.11-0.777c0-0.606,0.213-1.077,0.639-1.414c0.425-0.34,0.974-0.509,1.646-0.509  c0.423,0,0.785,0.034,1.085,0.098c0.301,0.066,0.558,0.147,0.772,0.241v1.134c-0.226-0.124-0.497-0.233-0.814-0.327  c-0.316-0.096-0.602-0.143-0.86-0.143c-0.289,0-0.513,0.075-0.673,0.225c-0.16,0.151-0.241,0.349-0.241,0.594  c0,0.146,0.032,0.27,0.096,0.365s0.145,0.185,0.243,0.264c0.1,0.079,0.328,0.209,0.688,0.392c0.51,0.255,0.882,0.472,1.113,0.655  c0.231,0.185,0.399,0.399,0.507,0.644c0.108,0.246,0.16,0.561,0.16,0.944c0,0.691-0.206,1.206-0.62,1.542  C5.065,28.372,4.431,28.539,3.578,28.539z"/>
-<path d="M10.826,28.32c-0.134,0.052-0.307,0.102-0.519,0.148c-0.212,0.049-0.483,0.07-0.81,0.07c-0.662,0-1.15-0.189-1.469-0.571  s-0.478-0.931-0.478-1.652v-3.713H6.626v-1.092h0.925v-0.925l1.607-0.838v1.763h1.566v1.092H9.159v3.564  c0,0.479,0.056,0.815,0.167,1.009c0.111,0.194,0.312,0.291,0.604,0.291c0.163,0,0.324-0.023,0.483-0.069  c0.16-0.044,0.298-0.097,0.413-0.155V28.32z"/>
-<path d="M14.44,21.409c0.929,0,1.657,0.31,2.185,0.926c0.529,0.616,0.793,1.498,0.793,2.641c0,1.174-0.269,2.062-0.804,2.663  c-0.536,0.601-1.261,0.9-2.174,0.9c-0.914,0-1.641-0.3-2.181-0.9c-0.539-0.602-0.809-1.489-0.809-2.663  c0-1.163,0.263-2.049,0.792-2.655C12.771,21.712,13.503,21.409,14.44,21.409z M14.44,27.473c0.43,0,0.762-0.215,0.994-0.645  c0.231-0.428,0.346-1.046,0.346-1.853c0-0.809-0.115-1.424-0.346-1.852c-0.232-0.427-0.563-0.641-0.994-0.641  c-0.427,0-0.76,0.214-0.998,0.641c-0.237,0.428-0.355,1.043-0.355,1.852C13.087,26.641,13.538,27.473,14.44,27.473z"/>
-<path d="M22.324,22.643c-0.169-0.043-0.336-0.063-0.499-0.063c-0.556,0-0.934,0.158-1.132,0.476  c-0.197,0.318-0.298,0.844-0.298,1.577v3.813h-1.607V22.82c0-0.312-0.012-0.749-0.034-1.31h1.542c0.055,0.396,0.088,0.712,0.1,0.948  c0.107-0.33,0.279-0.59,0.517-0.773c0.237-0.185,0.508-0.276,0.813-0.276c0.206,0,0.406,0.027,0.6,0.083V22.643z"/>
-<path d="M25.926,28.541c-0.949,0-1.667-0.298-2.155-0.894c-0.485-0.596-0.729-1.47-0.729-2.625c0-1.143,0.235-2.031,0.708-2.664  s1.164-0.949,2.074-0.949c0.93,0,1.607,0.294,2.034,0.882c0.429,0.586,0.642,1.473,0.642,2.654v0.492h-3.813  c0,0.646,0.132,1.142,0.397,1.489s0.647,0.521,1.15,0.521c0.441,0,0.823-0.031,1.142-0.094c0.318-0.064,0.6-0.151,0.846-0.263v1.116  c-0.241,0.111-0.528,0.194-0.865,0.249C27.023,28.512,26.546,28.541,25.926,28.541z M26.88,24.351c0-0.535-0.1-0.982-0.302-1.337  c-0.201-0.354-0.453-0.53-0.754-0.53c-0.313,0-0.577,0.177-0.795,0.53c-0.217,0.354-0.326,0.802-0.326,1.337H26.88z"/>
-</svg>
--- a/homescreenapp/hsapplication/themes/icons/hbdefault/scalable/qtg_mono_search.svg	Thu May 27 12:46:08 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30">
-<rect fill="none" width="30" height="30"/>
-<path d="M19.235,5.717c-3.733-3.733-9.785-3.733-13.518,0s-3.733,9.785,0,13.52c3.23,3.229,8.195,3.656,11.894,1.297l5.943,5.945  c0.808,0.807,2.115,0.807,2.923,0c0.807-0.807,0.807-2.115,0-2.924l-5.944-5.943C22.895,13.914,22.465,8.947,19.235,5.717z   M17.592,17.59c-2.825,2.824-7.407,2.824-10.231,0c-2.823-2.822-2.823-7.405,0-10.229c2.824-2.824,7.406-2.824,10.231,0  C20.415,10.185,20.415,14.768,17.592,17.59z"/>
-</svg>
--- a/homescreenapp/hsdomainmodel/inc/hsbackuprestoreobserver.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsbackuprestoreobserver.h	Fri Jun 11 13:30:16 2010 +0300
@@ -63,7 +63,7 @@
     
     bool mBUROngoing;
 
-    static QScopedPointer<HsBackupRestoreObserver> mInstance;
+    static HsBackupRestoreObserver *mInstance;
 #ifdef Q_OS_SYMBIAN
     friend class HsBackupRestoreObserverPrivate;
 #endif //Q_OS_SYMBIAN
--- a/homescreenapp/hsdomainmodel/inc/hsconfiguration.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsconfiguration.h	Fri Jun 11 13:30:16 2010 +0300
@@ -20,8 +20,10 @@
 
 #include <QObject>
 
+#include <HbFeedback>
+#include <HbDeviceProfile>
+
 #include "hsdomainmodel_global.h"
-#include <HbFeedback>
 
 class HsGeneralConfiguration;
 class HsFeedbackConfiguration;
@@ -36,11 +38,11 @@
     static void loadConfiguration();
 
     static inline int bounceEffect() { return mBounceEffect; };
-    static inline int tapAndHoldDistance() { return mTapAndHoldDistance; };
+    static inline qreal tapAndHoldDistance() { return mTapAndHoldDistance; };
     static inline int widgetTapAndHoldTimeout() { return mWidgetTapAndHoldTimeout; };
     static inline int sceneTapAndHoldTimeout() { return mSceneTapAndHoldTimeout; };
-    static inline int pageChangeZoneWidth() { return mPageChangeZoneWidth; };
-    static inline int pageIndicatorSpacing() { return mPageIndicatorSpacing; };
+    static inline qreal pageChangeZoneWidth() { return mPageChangeZoneWidth; };
+    static inline qreal pageIndicatorSpacing() { return mPageIndicatorSpacing; };
     static inline int pageChangeAnimationDuration() { return mPageChangeAnimationDuration; };
     static inline int pageChangeZoneAnimationDuration() { return mPageChangeZoneAnimationDuration; };
     static inline int pageChangeZoneReverseAnimationDuration() { return mPageChangeZoneReverseAnimationDuration; };
@@ -49,6 +51,15 @@
     static inline int widgetDragEffectDuration() { return mWidgetDragEffectDuration; };
     static inline int widgetDropEffectDuration() { return mWidgetDropEffectDuration; };
     static inline int bounceFeedbackEffectDistance() { return mBounceFeedbackEffectDistance; };
+    static inline int defaultPageId() { return mDefaultPageId; };
+    static inline int maximumPageCount() { return mMaximumPageCount; };
+    static inline qreal maximumWidgetHeight() { return mMaximumWidgetHeight; };
+    static inline qreal maximumWidgetWidth() { return mMaximumWidgetWidth; };
+    static inline qreal minimumWidgetHeight() { return mMinimumWidgetHeight; };
+    static inline qreal minimumWidgetWidth() { return mMinimumWidgetWidth; };
+    static inline bool shortcutLabelsVisible() { return mShortcutLabelsVisible; };
+    static inline qreal pageChangePanDistance() { return mPageChangePanDistance; };
+    static inline int pageChangePanDistanceInPixels() { return mPageChangePanDistanceInPixels; };
 
     static inline HbFeedback::InstantEffect pageChangeFeedbackType() { return mPageChangeFeedbackType; };
     static inline HbFeedback::InstantEffect widgetPickFeedbackType() { return mWidgetPickFeedbackType; };
@@ -69,11 +80,11 @@
 
     // setters should be removed before code is released to SF
     static void setBounceEffect(int bounceEffect) { mBounceEffect = bounceEffect; };
-    static void setTapAndHoldDistance(int tapAndHoldDistance) { mTapAndHoldDistance = tapAndHoldDistance; };
+    static void setTapAndHoldDistance(qreal tapAndHoldDistance) { mTapAndHoldDistance = tapAndHoldDistance; };
     static void setWidgetTapAndHoldTimeout(int tapAndHoldTimeout) { mWidgetTapAndHoldTimeout = tapAndHoldTimeout; };
     static void setSceneTapAndHoldTimeout(int tapAndHoldTimeout) { mSceneTapAndHoldTimeout = tapAndHoldTimeout; };
-    static void setPageChangeZoneWidth(int pageChangeZoneWidth) { mPageChangeZoneWidth = pageChangeZoneWidth; };
-    static void setPageIndicatorSpacing(int pageIndicatorSpacing) { mPageIndicatorSpacing = pageIndicatorSpacing; };
+    static void setPageChangeZoneWidth(qreal pageChangeZoneWidth) { mPageChangeZoneWidth = pageChangeZoneWidth; };
+    static void setPageIndicatorSpacing(qreal pageIndicatorSpacing) { mPageIndicatorSpacing = pageIndicatorSpacing; };
     static void setPageChangeAnimationDuration(int pageChangeAnimationDuration) { mPageChangeAnimationDuration = pageChangeAnimationDuration; };
     static void setPageChangeZoneAnimationDuration(int pageChangeZoneAnimationDuration) { mPageChangeZoneAnimationDuration = pageChangeZoneAnimationDuration; };
     static void setPageChangeZoneReverseAnimationDuration(int pageChangeZoneReverseAnimationDuration) { mPageChangeZoneReverseAnimationDuration = pageChangeZoneReverseAnimationDuration; };
@@ -82,6 +93,15 @@
     static void setWidgetDragEffectDuration(int widgetDragEffectDuration) { mWidgetDragEffectDuration = widgetDragEffectDuration; };
     static void setWidgetDropEffectDuration(int widgetDropEffectDuration) { mWidgetDropEffectDuration = widgetDropEffectDuration; };
     static void setBounceFeedbackEffectDistance(int bounceFeedbackEffectDistance) { mBounceFeedbackEffectDistance = bounceFeedbackEffectDistance; };
+    static void setDefaultPageId(int defaultPageId) { mDefaultPageId = defaultPageId;  };
+    static void setMaximumPageCount(int maximumPageCount) { mMaximumPageCount = maximumPageCount; };
+    static void setMaximumWidgetHeight(qreal maximumWidgetHeight) { mMaximumWidgetHeight = maximumWidgetHeight; };
+    static void setMaximumWidgetWidth(qreal maximumWidgetWidth) { mMaximumWidgetWidth = maximumWidgetWidth; };
+    static void setMinimumWidgetHeight(qreal minimumWidgetHeight) { mMinimumWidgetHeight = minimumWidgetHeight; };
+    static void setMinimumWidgetWidth(qreal minimumWidgetWidth) { mMinimumWidgetWidth = minimumWidgetWidth; };
+    static void setShortcutLabelsVisible(bool shortcutLabelsVisible) { mShortcutLabelsVisible = shortcutLabelsVisible; };
+    static void setPageChangePanDistance(qreal pageChangePanDistance) { mPageChangePanDistance = pageChangePanDistance; 
+                                                                        mPageChangePanDistanceInPixels = pageChangePanDistance * HbDeviceProfile::current().unitValue(); };
 
     static void setPageChangeFeedbackType(HbFeedback::InstantEffect pageChangeFeedbackType ) { mPageChangeFeedbackType = pageChangeFeedbackType; };
     static void setWidgetPickFeedbackType(HbFeedback::InstantEffect widgetPickFeedbackType ) { mWidgetPickFeedbackType = widgetPickFeedbackType; };
@@ -102,11 +122,11 @@
 
 private:
     static int mBounceEffect;		
-	static int mTapAndHoldDistance;
+	static qreal mTapAndHoldDistance;
 	static int mWidgetTapAndHoldTimeout;
 	static int mSceneTapAndHoldTimeout;
-    static int mPageChangeZoneWidth;
-	static int mPageIndicatorSpacing;
+    static qreal mPageChangeZoneWidth;
+	static qreal mPageIndicatorSpacing;
     static int mPageChangeAnimationDuration;
 	static int mPageChangeZoneAnimationDuration;
     static int mPageChangeZoneReverseAnimationDuration;
@@ -114,7 +134,16 @@
 	static int mNewPageAddedAnimationDuration;
 	static int mWidgetDragEffectDuration;
 	static int mWidgetDropEffectDuration;
-	static int mBounceFeedbackEffectDistance; 
+	static int mBounceFeedbackEffectDistance;
+    static int mDefaultPageId;
+    static int mMaximumPageCount;
+    static qreal mMaximumWidgetHeight;
+    static qreal mMaximumWidgetWidth;
+    static qreal mMinimumWidgetHeight;
+    static qreal mMinimumWidgetWidth;
+    static bool mShortcutLabelsVisible;
+    static qreal mPageChangePanDistance;
+    static int mPageChangePanDistanceInPixels;
 
     static HbFeedback::InstantEffect mPageChangeFeedbackType;
 	static HbFeedback::InstantEffect mWidgetPickFeedbackType;
--- a/homescreenapp/hsdomainmodel/inc/hscontentservice.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hscontentservice.h	Fri Jun 11 13:30:16 2010 +0300
@@ -42,7 +42,7 @@
     static HsContentService *instance();
 
 private:
-    static QScopedPointer<HsContentService> mInstance;
+    static HsContentService *mInstance;
 
     Q_DISABLE_COPY(HsContentService)
 };
--- a/homescreenapp/hsdomainmodel/inc/hsdatabase.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsdatabase.h	Fri Jun 11 13:30:16 2010 +0300
@@ -75,7 +75,7 @@
 
     bool widgetPresentation(HsWidgetPresentationData &data);
     bool setWidgetPresentation(const HsWidgetPresentationData &data);
-    bool deleteWidgetPresentation(int widgetId, const QString &key);
+    bool deleteWidgetPresentation(int widgetId, Qt::Orientation orientation);
 
     bool widgetPreferences(int widgetId, QVariantHash &data);
     bool widgetPreference(int widgetId, const QString &key, QVariant &value);
@@ -98,7 +98,7 @@
     QString mConnectionName;
     QString mDatabaseName;
 
-    static QScopedPointer<HsDatabase> mInstance;
+    static HsDatabase *mInstance;
 };
 
 #endif // HSDATABASE_H
--- a/homescreenapp/hsdomainmodel/inc/hsdomainmodeldatastructures.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsdomainmodeldatastructures.h	Fri Jun 11 13:30:16 2010 +0300
@@ -21,25 +21,19 @@
 #include <QRectF>
 #include "hsdomainmodel_global.h"
 #include <HbFeedback>
+#include <QMetaEnum>
 
 class HSDOMAINMODEL_EXPORT HsSceneData
 {
 public:
     HsSceneData() 
-      : id(-1), defaultPageId(-1), maximumPageCount(-1),
-        maximumWidgetHeight(-1.0), maximumWidgetWidth(-1.0),
-        minimumWidgetHeight(-1.0), minimumWidgetWidth(-1.0)
+      : id(-1)
     {}
     
     int     id;
     QString portraitWallpaper;
     QString landscapeWallpaper;
-    int     defaultPageId;
-    int     maximumPageCount;
-    qreal   maximumWidgetHeight;
-    qreal   maximumWidgetWidth;
-    qreal   minimumWidgetHeight;
-    qreal   minimumWidgetWidth;
+
 };
 
 class HSDOMAINMODEL_EXPORT HsPageData
@@ -70,7 +64,7 @@
 {
 public:
     HsWidgetPresentationData()
-        : x(0), y(0), zValue(0), 
+        : orientation(Qt::Vertical), x(0), y(0), zValue(0), 
           widgetId(-1)
     {}
 
@@ -80,7 +74,12 @@
         y = pos.y();
     }
 
-    QString key;
+    QPointF pos() const
+    {
+        return QPointF(x, y);
+    }
+
+    Qt::Orientation orientation;
     qreal   x;
     qreal   y;
     qreal   zValue;
@@ -91,11 +90,11 @@
 {	
 public:
 	int bounceEffect; // pixels, bounce effect reservation, half in left side and half in right side of wallpaper 		
-	int tapAndHoldDistance; // pixels
+	qreal tapAndHoldDistance; // pixels
     int widgetTapAndHoldTimeout; // ms, duration of long press before action is triggered on widget
 	int sceneTapAndHoldTimeout; // ms, duration of long press before action is triggered on background
-	int pageChangeZoneWidth; // pixels
-	int pageIndicatorSpacing; // pixels
+	qreal pageChangeZoneWidth; // pixels
+	qreal pageIndicatorSpacing; // pixels
     int pageChangeAnimationDuration; // ms, this is how long page change animation takes
 	int pageChangeZoneAnimationDuration; // ms, this is how long crawling is done before page is actually changed
     int pageChangeZoneReverseAnimationDuration; // ms, animation duration back to starting position when crawling ends before page is changed
@@ -105,128 +104,31 @@
 	int widgetDropEffectDuration; // ms
 	int boundaryFeedbackEffectDistance; // pixels, when widget is moved within n pixels from first page right border or 
                                         // n pixels from last page's left border, feedback effect is played
+    int defaultPageId; // id of default page (which cannot be removed)
+    int maximumPageCount; // maximum number of pages
+    qreal maximumWidgetHeight; // px
+    qreal maximumWidgetWidth; // px
+    qreal minimumWidgetHeight; // px
+    qreal minimumWidgetWidth; // px
+    bool shortcutLabelsVisible; // display labels under shortcut widgets
+    qreal pageChangePanDistance; // un, amount of pan needed to change page
 };
 
 class HSDOMAINMODEL_EXPORT HsFeedbackConfiguration
 {
 public: 
-    HbFeedback::InstantEffect feedbackFromString(QString feedback)
+    HbFeedback::InstantEffect feedbackFromString(const QString &feedback)
     {
-        if (feedback == "Basic") {
-            return HbFeedback::Basic;
-        }
-        else if (feedback == "Sensitive") {
-            return HbFeedback::Sensitive;
-        }
-        else if (feedback == "BasicButton") {
-            return HbFeedback::BasicButton;
-        }
-        else if (feedback == "SensitiveButton") {
-            return HbFeedback::SensitiveButton;
-        }
-        else if (feedback == "BasicKeypad") {
-            return HbFeedback::BasicKeypad;
-        }
-        else if (feedback == "SensitiveKeypad") {
-            return HbFeedback::SensitiveKeypad;
-        }
-        else if (feedback == "BasicSlider") {
-            return HbFeedback::BasicSlider;
-        }
-        else if (feedback == "SensitiveSlider") {
-            return HbFeedback::SensitiveSlider;
-        }
-        else if (feedback == "BasicKeypad") {
-            return HbFeedback::BasicKeypad;
-        }
-        else if (feedback == "BasicSlider") {
-            return HbFeedback::BasicSlider;
-        }
-        else if (feedback == "SensitiveSlider") {
-            return HbFeedback::SensitiveSlider;
-        }
-        else if (feedback == "BasicItem") {
-            return HbFeedback::BasicItem;
-        }
-        else if (feedback == "SensitiveItem") {
-            return HbFeedback::SensitiveItem;
-        }
-        else if (feedback == " ItemScroll") {
-            return HbFeedback::ItemScroll;
-        }
-        else if (feedback == "ItemPick") {
-            return HbFeedback::ItemPick;
-        }
-        else if (feedback == "ItemDrop") {
-            return HbFeedback::ItemDrop;
-        }
-        else if (feedback == "ItemMoveOver") {
-            return HbFeedback::ItemMoveOver;
-        }
-        else if (feedback == "BounceEffect") {
-            return HbFeedback::BounceEffect;
-        }
-        else if (feedback == "Checkbox") {
-            return HbFeedback::Checkbox;
-        }
-        else if (feedback == "MultipleCheckbox") {
-            return HbFeedback::MultipleCheckbox;
-        }
-        else if (feedback == "Editor") {
-            return HbFeedback::Editor;
-        }
-        else if (feedback == "TextSelection") {
-            return HbFeedback::TextSelection;
-        }
-        else if (feedback == "BlankSelection") {
-            return HbFeedback::BlankSelection;
-        }
-        else if (feedback == "LineSelection") {
-            return HbFeedback::LineSelection;
-        }
-        else if (feedback == "EmptyLineSelection") {
-            return HbFeedback::EmptyLineSelection;
-        }
-        else if (feedback == "PopUp") {
-            return HbFeedback::PopUp;
-        }
-        else if (feedback == "PopupOpen") {
-            return HbFeedback::PopupOpen;
-        }
-        else if (feedback == "PopupClose") {
-            return HbFeedback::PopupClose;
-        }
-        else if (feedback == "Flick") {
-            return HbFeedback::Flick;
-        }
-        else if (feedback == "StopFlick") {
-            return HbFeedback::StopFlick;
-        }
-        else if (feedback == "MultitouchActivate") {
-            return HbFeedback::MultitouchActivate;
-        }
-        else if (feedback == "RotateStep") {
-            return HbFeedback::RotateStep;
-        }
-        else if (feedback == "PositiveTacticon") {
-            return HbFeedback::PositiveTacticon;
-        }
-        else if (feedback == "NeutralTacticon") {
-            return HbFeedback::NeutralTacticon;
-        }
-        else if (feedback == "NegativeTacticon") {
-            return HbFeedback::NegativeTacticon;
-        }
-        else if (feedback == "NumberOfInstantFeedbacks") {
-            return HbFeedback::NumberOfInstantFeedbacks;
-        }
-        else if (feedback == "InstantUser") {
-            return HbFeedback::InstantUser;
-        }
-        else if (feedback == "InstantMaxUser") {
-            return HbFeedback::InstantMaxUser;
-        }
+    int index = HbFeedback::staticMetaObject.indexOfEnumerator("InstantEffect");
+    QMetaEnum metaEnum = HbFeedback::staticMetaObject.enumerator(index);
+
+    int intFeedback = metaEnum.keysToValue(feedback.toAscii());
+
+    if (intFeedback < HbFeedback::None || intFeedback > HbFeedback::InstantMaxUser) {
         return HbFeedback::None;
+    } 
+
+    return static_cast<HbFeedback::InstantEffect>(intFeedback);
     }
 
 public:
--- a/homescreenapp/hsdomainmodel/inc/hsgui.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsgui.h	Fri Jun 11 13:30:16 2010 +0300
@@ -15,8 +15,8 @@
 *
 */
 
-#ifndef HSVIEW_H
-#define HSVIEW_H
+#ifndef HSGUI_H
+#define HSGUI_H
 
 #include <QPointer>
 
@@ -31,17 +31,21 @@
 class HSDOMAINMODEL_EXPORT HsGui
 {
 public:
-	HsGui();
-	~HsGui();
 	static HbView *idleView();	
 	static HbView *takeIdleView();
 	static void setIdleView(HbView *idleView);	
-	static HbMainWindow *mainWindow();
+	
+    static HbMainWindow *mainWindow();
+
+private:
+    HsGui() {}
 
 private:
 	static QPointer<HbView> mIdleView;
-	HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest)
+	
+    HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest)
 };
 
 Q_DECLARE_METATYPE(HsGui*)
-#endif //HSVIEW_H
+
+#endif // HSGUI_H
--- a/homescreenapp/hsdomainmodel/inc/hspage.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hspage.h	Fri Jun 11 13:30:16 2010 +0300
@@ -55,6 +55,8 @@
     bool isRemovable() const;
     void setRemovable(bool removable);
 
+    bool isActivePage() const;
+    
     static HsPage *createInstance(const HsPageData &pageData);
 
 public slots:
@@ -67,18 +69,25 @@
     int pageIndex();
 
 private:
+    Q_DISABLE_COPY(HsPage)
     void connectWidget(HsWidgetHost *widget);
     void disconnectWidget(HsWidgetHost *widget);
 
 private slots:
-    void onWidgetFinished(HsWidgetHost *widget);
-    void onWidgetResized(HsWidgetHost *widget);
+    void onWidgetFinished();
+    void onWidgetFaulted();
+    void onWidgetResized();
+    void onWidgetAvailable();
+    void onWidgetUnavailable();
+
+    void onOrientationChanged(Qt::Orientation orientation);
 
 private:
     int mDatabaseId;
     bool mRemovable;
     QList<HsWidgetHost*> mWidgets;
     QList<HsWidgetHost*> mNewWidgets;
+    QList<HsWidgetHost*> mUnavailableWidgets;
 
     HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
 };
--- a/homescreenapp/hsdomainmodel/inc/hsscene.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsscene.h	Fri Jun 11 13:30:16 2010 +0300
@@ -76,7 +76,7 @@
 
 private:
     HsScene(QObject *parent = 0);
-    void calculateWidgetSizeLimitations(HsSceneData &sceneData);
+    void calculateWidgetSizeLimitations();
     Q_DISABLE_COPY(HsScene)
 
 private:
--- a/homescreenapp/hsdomainmodel/inc/hsshortcutservice.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsshortcutservice.h	Fri Jun 11 13:30:16 2010 +0300
@@ -48,7 +48,7 @@
 
 private:
 	QScopedPointer<HsShortcutServicePrivate> mD; 	
-    static QScopedPointer<HsShortcutService> mInstance;    
+    static HsShortcutService *mInstance;    
     
     HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
 };
--- a/homescreenapp/hsdomainmodel/inc/hswidgetcomponent.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hswidgetcomponent.h	Fri Jun 11 13:30:16 2010 +0300
@@ -26,11 +26,6 @@
 #include "hstest_global.h"
 HOMESCREEN_TEST_CLASS(TestRuntimeServices)
 
-#include "cadefs.h"
-
-class CaEntry;
-class HsWidgetComponentDescriptor;
-
 class HSDOMAINMODEL_EXPORT HsWidgetComponent : public QObject
 {
     Q_OBJECT
--- a/homescreenapp/hsdomainmodel/inc/hswidgethost.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hswidgethost.h	Fri Jun 11 13:30:16 2010 +0300
@@ -18,118 +18,125 @@
 #ifndef HSWIDGETHOST_H
 #define HSWIDGETHOST_H
 
-#include <QVariantMap>
+#include <HbWidget>
 #include <QMetaMethod>
 #include <QMetaProperty>
 
-#include <HbWidget>
+#include "hsdomainmodel_global.h"
+#include "hsdomainmodeldatastructures.h"
 
-#include "hsdomainmodeldatastructures.h"
-#include "hsdomainmodel_global.h"
 #include "hstest_global.h"
+HOMESCREEN_TEST_CLASS(TestRuntimeServices)
 
+class QStateMachine;
+
+class HsWidgetComponent;
 class HsPage;
 
-HOMESCREEN_TEST_CLASS(TestRuntimeServices)
-
 class HSDOMAINMODEL_EXPORT HsWidgetHost : public HbWidget
 {
     Q_OBJECT
 
 public:
-    enum State {
-        Unloaded,
-        Loaded,
-        Initialized,
-        Visible,
-        Hidden,
-        Uninitialized,
-        Finished,
-        Faulted,
-        UninstallingOrUpdating
-    };
+    HsWidgetHost(int databaseId, QGraphicsItem *parent = 0);
+    ~HsWidgetHost();
 
-public:
-    static HsWidgetHost *createInstance(HsWidgetData &widgetData, 
-                                        const QVariantHash &preferences = QVariantHash());
-
-    HsWidgetHost(int databaseId, QGraphicsItem *parent = 0);
-    
-    ~HsWidgetHost();
-    
-    bool load();
-    void unload();
-    
-    bool setPage(HsPage *page);
-    HsPage *page() const;
-
-    bool isValid() const;
+    static HsWidgetHost *createInstance(
+        HsWidgetData &widgetData, 
+        const QVariantHash &preferences = QVariantHash());
 
     int databaseId() const;
 
-    State state() const { return mState; }
+    bool setPage(HsPage *page);
+    HsPage *page() const; 
 
-    bool deleteFromDatabase();
+    bool isPannable(QGraphicsSceneMouseEvent *event);
     
-    bool setWidgetPresentation();
-    bool setWidgetPresentationData(HsWidgetPresentationData &presentationData);
-    bool widgetPresentationData(const QString &key, HsWidgetPresentationData &presentationData);
+    bool loadPresentation();
+    bool loadPresentation(Qt::Orientation orientation);
+    bool savePresentation();
+    bool savePresentation(Qt::Orientation orientation);    
+    bool savePresentation(HsWidgetPresentationData &presentation);
+    bool getPresentation(HsWidgetPresentationData &presentation);
+    bool removePresentation(Qt::Orientation orientation);
 
-    HsWidgetPresentationData widgetPresentation(Qt::Orientation orientation);
-    bool loadWidgetPresentation();
-    bool deleteWidgetPresentation(Qt::Orientation orientation);
-    bool isPannable(QGraphicsSceneMouseEvent *event);
 signals:
-    void widgetFinished(HsWidgetHost *widget);
-    void widgetError(HsWidgetHost *widget);
-    void widgetResized(HsWidgetHost *widget);
-   
+    void event_startAndShow();
+    void event_startAndHide();
+    void event_unload();
+    void event_show();
+    void event_hide();
+    void event_remove();
+    void event_close();
+    void event_finished();
+    void event_faulted();
+    
+    void finished();
+    void faulted();
+    void resized();
+    void available();
+    void unavailable();
+
 public slots:
-    void initializeWidget();
+    void startWidget(bool show = true);
     void showWidget();
     void hideWidget();
-    void uninitializeWidget();
     void setOnline(bool online = true);
+    
+    void remove();
+    void close();
 
     void startDragEffect();
     void startDropEffect();
-  
-protected:    
-    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
-    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
-    void mousePressEvent(QGraphicsSceneMouseEvent *event);
-    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-    bool eventFilter(QObject *obj, QEvent *event);
-    
+
+protected:
+    bool eventFilter(QObject *watched, QEvent *event);    
+    void mousePressEvent(QGraphicsSceneMouseEvent *) {}
+
 private:
+    Q_DISABLE_COPY(HsWidgetHost)    
+    void setupEffects();
+    void setupStates();
+
     bool setProperty(const char *name, QMetaProperty &property); 
     bool setMethod(const char *signature, QMetaMethod &method);    
     bool hasSignal(const char *signature);
+
+    void setNewSize(const QSizeF &size);
+
     bool setPreferencesToWidget();
-    void setNewSize(const QSizeF &newSize);
 
 private slots:
-    void onSetPreferences(const QStringList &names);
+    void action_connectComponent();
+    void action_disconnectComponent();
+    void action_load();
+    void action_unload();
+    void action_initialize();
+    void action_uninitialize();
+    void action_show();
+    void action_hide();
+    void action_finished();
+    void action_faulted();
+    void action_remove();
+    
     void onFinished();
     void onError();
-    void onAboutToUninstall();
-    void onUpdated();
-    void onUnavailable();
-    void onAvailable();
+    void onSetPreferences(const QStringList &names);
+
 private:
-    Q_DISABLE_COPY(HsWidgetHost)
+    int mDatabaseId;        
+    QStateMachine *mStateMachine;
     QGraphicsWidget *mWidget;
-    HsPage *mPage;
+    HsPage *mPage;    
+    HsWidgetComponent *mComponent;    
     QMetaMethod mOnInitializeMethod;
     QMetaMethod mOnShowMethod;
     QMetaMethod mOnHideMethod;
     QMetaMethod mOnUninitializeMethod;
+    QMetaMethod mIsPannableMethod;
     QMetaProperty mIsOnlineProperty;
-	QMetaProperty mRootPathProperty;
-    QMetaMethod mIsPannable;
-    State mState;
-    QString mUri;
-    int mDatabaseId;
+	QMetaProperty mRootPathProperty;        
+    bool mIsFinishing;
 
     HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
 };
--- a/homescreenapp/hsdomainmodel/src/hsbackuprestoreobserver.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsbackuprestoreobserver.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -48,9 +48,7 @@
     Destructor.
 */
 HsBackupRestoreObserverPrivate::~HsBackupRestoreObserverPrivate()
-{   
-    disconnect(sender(), SIGNAL(valueChanged(XQSettingsKey, const QVariant &)),
-			   this, SLOT(handleKeyChange(XQSettingsKey, const QVariant&)));
+{
     delete mCallBack;
     delete mActiveBackupClient;
 }
@@ -130,9 +128,9 @@
 HsBackupRestoreObserver *HsBackupRestoreObserver::instance()
 {
     if (!mInstance) {
-        mInstance.reset(new HsBackupRestoreObserver);
+        mInstance = new HsBackupRestoreObserver();
     }
-    return mInstance.data();
+    return mInstance;
 }
 
 /*!
@@ -195,6 +193,6 @@
 /*!
     Points to the observer instance.
 */
-QScopedPointer<HsBackupRestoreObserver> HsBackupRestoreObserver::mInstance(0);
+HsBackupRestoreObserver *HsBackupRestoreObserver::mInstance(0);
 
 // End of File
--- a/homescreenapp/hsdomainmodel/src/hsconfiguration.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsconfiguration.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -43,13 +43,21 @@
         mWidgetDragEffectDuration = generalConfiguration.widgetDragEffectDuration;
         mWidgetDropEffectDuration = generalConfiguration.widgetDropEffectDuration;
         mBounceFeedbackEffectDistance = generalConfiguration.boundaryFeedbackEffectDistance;
+        mDefaultPageId = generalConfiguration.defaultPageId;
+        mMaximumPageCount = generalConfiguration.maximumPageCount;
+        mMaximumWidgetHeight = generalConfiguration.maximumWidgetHeight;
+        mMaximumWidgetWidth = generalConfiguration.maximumWidgetWidth;
+        mMinimumWidgetHeight = generalConfiguration.minimumWidgetHeight;
+        mMinimumWidgetWidth = generalConfiguration.minimumWidgetWidth;
+        mShortcutLabelsVisible = generalConfiguration.shortcutLabelsVisible;
+        mPageChangePanDistance = generalConfiguration.pageChangePanDistance;
+        mPageChangePanDistanceInPixels = mPageChangePanDistance * HbDeviceProfile::current().unitValue();
     } else {
         Q_ASSERT_X(1, "Configuration", "Homescreen configuration could not be loaded from database");
     }
 
     HsFeedbackConfiguration feedbackConfiguration;
     if (db->feedbackConfiguration(feedbackConfiguration)) {
-	    mBounceFeedbackEffectDistance = 3;
         mPageChangeFeedbackType = feedbackConfiguration.pageChangeFeedbackType;
 	    mWidgetPickFeedbackType = feedbackConfiguration.widgetPickFeedbackType;
 	    mWidgetDropFeedbackType = feedbackConfiguration.widgetDropFeedbackType;
@@ -78,11 +86,11 @@
 
 // static member variables initilized here, these values will be used if fetching from database fails
 int HsConfiguration::mBounceEffect = 20;
-int HsConfiguration::mTapAndHoldDistance = 16;
+qreal HsConfiguration::mTapAndHoldDistance = 16.0;
 int HsConfiguration::mWidgetTapAndHoldTimeout = 500;
 int HsConfiguration::mSceneTapAndHoldTimeout = 500;
-int HsConfiguration::mPageChangeZoneWidth = 60;
-int HsConfiguration::mPageIndicatorSpacing = 8;
+qreal HsConfiguration::mPageChangeZoneWidth = 60.0;
+qreal HsConfiguration::mPageIndicatorSpacing = 8.0;
 int HsConfiguration::mPageChangeAnimationDuration = 200;
 int HsConfiguration::mPageChangeZoneAnimationDuration = 800;
 int HsConfiguration::mPageChangeZoneReverseAnimationDuration = 200;
@@ -91,6 +99,15 @@
 int HsConfiguration::mWidgetDragEffectDuration = 200;
 int HsConfiguration::mWidgetDropEffectDuration = 200;
 int HsConfiguration::mBounceFeedbackEffectDistance = 3;
+int HsConfiguration::mDefaultPageId = 1;
+int HsConfiguration::mMaximumPageCount = 8;
+qreal HsConfiguration::mMaximumWidgetHeight = 39;
+qreal HsConfiguration::mMaximumWidgetWidth = 48;
+qreal HsConfiguration::mMinimumWidgetHeight = 8.75;
+qreal HsConfiguration::mMinimumWidgetWidth = 8.75;
+bool HsConfiguration::mShortcutLabelsVisible = false;
+qreal HsConfiguration::mPageChangePanDistance = 17.91;
+int HsConfiguration::mPageChangePanDistanceInPixels = 120;
 
 HbFeedback::InstantEffect HsConfiguration::mPageChangeFeedbackType = HbFeedback::None;
 HbFeedback::InstantEffect HsConfiguration::mWidgetPickFeedbackType = HbFeedback::None;
--- a/homescreenapp/hsdomainmodel/src/hscontentservice.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hscontentservice.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -39,8 +39,7 @@
     HsWidgetHost *widget = createWidgetForPreview(params);
     if (!widget) {
         return false;
-    }
-     
+    }     
     return HsScene::instance()->activePage()->addNewWidget(widget);
 }
 
@@ -49,20 +48,8 @@
     HsWidgetData widgetData;
     widgetData.uri = params.value("uri").toString();
 
-
-    HsWidgetHost *widget = HsWidgetHost::createInstance(widgetData,
-                                                        params.value("preferences").toHash());
-
-    if (!widget) {
-        return NULL;
-    }
-    if (!widget->load()) {
-        widget->deleteFromDatabase();
-        delete widget;
-        return NULL;
-    }
-
-    return widget;
+    return HsWidgetHost::createInstance(
+        widgetData, params.value("preferences").toHash());
 }
 
 /*!
@@ -70,24 +57,22 @@
 */
 bool HsContentService::addWidget(const QString &uri, const QVariantHash &preferences)
 {
-    HsWidgetData widgetData;
-    widgetData.uri = uri;
+    HsWidgetData data;
+    data.uri = uri;
 
-    QScopedPointer<HsWidgetHost> widget(HsWidgetHost::createInstance(widgetData, preferences));
-    if (!widget.data()) {
+    HsWidgetHost *widget = HsWidgetHost::createInstance(data, preferences);    
+    if (!widget) {
         return false;
     }
 
-    HsPage *activePage = HsScene::instance()->activePage();
-    if (!widget->load() || !activePage->addNewWidget(widget.data())) {
-        widget->deleteFromDatabase();
+    HsPage *page = HsScene::instance()->activePage();
+    if (!page->addNewWidget(widget)) {
+        widget->remove();
         return false;
     }
 
-    HsWidgetHost *taken = widget.take();
-    taken->initializeWidget();
-    taken->showWidget();
-    activePage->layoutNewWidgets();
+    widget->startWidget();
+    page->layoutNewWidgets();
     return true;
 }
 
@@ -97,12 +82,12 @@
 HsContentService *HsContentService::instance()
 {
     if (!mInstance) {
-        mInstance.reset(new HsContentService);
+        mInstance = new HsContentService();
     }
-    return mInstance.data();
+    return mInstance;
 }
 
 /*!
     Points to the content service instance.
 */
-QScopedPointer<HsContentService> HsContentService::mInstance(0);
+HsContentService *HsContentService::mInstance(0);
--- a/homescreenapp/hsdomainmodel/src/hsdatabase.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsdatabase.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -185,21 +185,13 @@
     QSqlQuery query(QSqlDatabase::database(mConnectionName));
 
     QString statement =
-        "SELECT id, portraitWallpaper, landscapeWallpaper, defaultPageId, "
-        "maximumPageCount, maximumWidgetHeight, maximumWidgetWidth, "
-        "minimumWidgetHeight, minimumWidgetWidth "
+        "SELECT id, portraitWallpaper, landscapeWallpaper "
         "FROM Scene";
     
     if (query.prepare(statement) && query.exec() && query.next()) {        
         data.id                  = query.value(0).toInt();
         data.portraitWallpaper   = query.value(1).toString();
         data.landscapeWallpaper  = query.value(2).toString();
-        data.defaultPageId       = query.value(3).toInt();
-        data.maximumPageCount    = query.value(4).toInt();
-        data.maximumWidgetHeight = query.value(5).toReal();
-        data.maximumWidgetWidth  = query.value(6).toReal();
-        data.minimumWidgetHeight = query.value(7).toReal();
-        data.minimumWidgetWidth  = query.value(8).toReal();
         return true;
     }
     
@@ -573,6 +565,9 @@
         return false;
     }
 
+    QString key = data.orientation == Qt::Vertical ?
+        QLatin1String("portrait") : QLatin1String("landscape");
+
     QSqlQuery query(QSqlDatabase::database(mConnectionName));
 
     QString statement =
@@ -581,7 +576,7 @@
         "WHERE key = ? AND widgetId = ?";
 
     if (query.prepare(statement)) {
-        query.addBindValue(data.key);
+        query.addBindValue(key);
         query.addBindValue(data.widgetId);
         if (query.exec() && query.next()) {
             data.x      = query.value(0).toReal();
@@ -603,6 +598,9 @@
         return false;
     }
 
+    QString key = data.orientation == Qt::Vertical ?
+        QLatin1String("portrait") : QLatin1String("landscape");
+
     QSqlQuery query(QSqlDatabase::database(mConnectionName));
 
     QString statement =
@@ -611,7 +609,7 @@
         "VALUES (?, ?, ?, ?, ?)";
 
     if (query.prepare(statement)) {
-        query.addBindValue(data.key);
+        query.addBindValue(key);
         query.addBindValue(data.x);
         query.addBindValue(data.y);
         query.addBindValue(data.zValue);
@@ -625,12 +623,15 @@
 /*!
 
 */
-bool HsDatabase::deleteWidgetPresentation(int widgetId, const QString &key)
+bool HsDatabase::deleteWidgetPresentation(int widgetId, Qt::Orientation orientation)
 {
     if (!checkConnection()) {
         return false;
     }
 
+    QString key = orientation == Qt::Vertical ?
+        QLatin1String("portrait") : QLatin1String("landscape");
+
     QSqlQuery query(QSqlDatabase::database(mConnectionName));
 
     QString statement =
@@ -776,16 +777,19 @@
         "pageIndicatorSpacing, pageChangeAnimationDuration, pageChangeZoneAnimationDuration, "
         "pageChangeZoneReverseAnimationDuration, "
         "pageRemovedAnimationDuration, newPageAddedAnimationDuration, widgetDragEffectDuration, "
-        "widgetDropEffectDuration, boundaryFeedbackEffectDistance "
+        "widgetDropEffectDuration, boundaryFeedbackEffectDistance, "
+        "defaultPageId, maximumPageCount, maximumWidgetHeight, maximumWidgetWidth, "
+        "minimumWidgetHeight, minimumWidgetWidth, shortcutLabelsVisible,  "
+        "pageChangePanDistance "
         "FROM GeneralConfiguration";
 
     if (query.prepare(statement) && query.exec() && query.next()) {        
         data.bounceEffect                           = query.value(0).toInt();
-        data.tapAndHoldDistance                     = query.value(1).toInt();
+        data.tapAndHoldDistance                     = query.value(1).toReal();
         data.widgetTapAndHoldTimeout                = query.value(2).toInt();
         data.sceneTapAndHoldTimeout                 = query.value(3).toInt();
-        data.pageChangeZoneWidth                    = query.value(4).toInt();
-        data.pageIndicatorSpacing                   = query.value(5).toInt();
+        data.pageChangeZoneWidth                    = query.value(4).toReal();
+        data.pageIndicatorSpacing                   = query.value(5).toReal();
         data.pageChangeAnimationDuration            = query.value(6).toInt();
         data.pageChangeZoneAnimationDuration        = query.value(7).toInt();
         data.pageChangeZoneReverseAnimationDuration = query.value(8).toInt();
@@ -794,6 +798,14 @@
         data.widgetDragEffectDuration               = query.value(11).toInt();
         data.widgetDropEffectDuration               = query.value(12).toInt();
         data.boundaryFeedbackEffectDistance         = query.value(13).toInt();
+        data.defaultPageId                          = query.value(14).toInt();
+        data.maximumPageCount                       = query.value(15).toInt();
+        data.maximumWidgetHeight                    = query.value(16).toReal();
+        data.maximumWidgetWidth                     = query.value(17).toReal();
+        data.minimumWidgetHeight                    = query.value(18).toReal();
+        data.minimumWidgetWidth                     = query.value(19).toReal();
+        data.shortcutLabelsVisible                  = query.value(20).toBool();
+        data.pageChangePanDistance                  = query.value(21).toReal();
         return true;
     }
     
@@ -848,10 +860,7 @@
         "FROM SnapConfiguration";
 
     if (query.prepare(statement) && query.exec() && query.next()) {
-        data.snappingEnabled = false;
-        if (query.value(0).toInt() == 1) {
-            data.snappingEnabled = true;
-        }
+        data.snappingEnabled = query.value(0).toBool();
         data.snapForce = query.value(1).toReal();
         data.snapGap   = query.value(2).toReal();
         data.borderGap = query.value(3).toReal();
@@ -867,7 +876,11 @@
 */
 void HsDatabase::setInstance(HsDatabase *instance)
 {
-    mInstance.reset(instance);
+    if (mInstance != instance) {
+        HsDatabase *oldInstance = mInstance;
+        mInstance = instance;
+        delete oldInstance;
+    }
 }
 
 /*!
@@ -875,7 +888,7 @@
 */
 HsDatabase *HsDatabase::instance()
 {
-    return mInstance.data();
+    return mInstance;
 }
 
 /*!
@@ -885,7 +898,9 @@
 */
 HsDatabase *HsDatabase::takeInstance()
 {
-    return mInstance.take();
+    HsDatabase *instance = mInstance;
+    mInstance = 0;
+    return instance;
 }
   
 /*!
@@ -900,4 +915,4 @@
 /*!
     Points to the database instance.
 */
-QScopedPointer<HsDatabase> HsDatabase::mInstance(0);
+HsDatabase *HsDatabase::mInstance(0);
--- a/homescreenapp/hsdomainmodel/src/hsgui.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsgui.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -17,6 +17,7 @@
 
 #include <HbInstance>
 #include <HbView>
+
 #include "hsgui.h"
 
 /*!
@@ -27,25 +28,11 @@
 */
 
 /*!
-    Constructor
-*/
-HsGui::HsGui()	
-{    
-}
-
-/*!
-    Destructor.
-*/
-HsGui::~HsGui()
-{
-}
-
-/*!
-    Returns idle view. 
+    Returns the idle view. 
 */
 HbView *HsGui::idleView()
 {
-	return mIdleView.data();    
+    return mIdleView;    
 }
 
 /*!
@@ -55,9 +42,9 @@
 */
 HbView *HsGui::takeIdleView()
 {	
-    HbView *view = mIdleView;
+    HbView *idleView = mIdleView;
     mIdleView = 0;
-    return view;
+    return idleView;
 }
 
 /*!
@@ -67,14 +54,13 @@
 void HsGui::setIdleView(HbView *idleView)
 {
     if (mIdleView != idleView) {
-        HbView *oldView = mIdleView;
+        delete mIdleView;
         mIdleView = idleView;
-        delete oldView;
     }
 }
 
 /*!
-    Return main window.
+    Returns the main window.
 */
 HbMainWindow *HsGui::mainWindow()
 {
@@ -82,6 +68,6 @@
 }
 
 /*!
-    Points to the view instance.
+    Points to the idle view instance.
 */
 QPointer<HbView> HsGui::mIdleView(0);
--- a/homescreenapp/hsdomainmodel/src/hspage.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hspage.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -27,6 +27,7 @@
 #include "hswidgethost.h"
 #include "hswallpaper.h"
 #include "hswidgetpositioningonwidgetadd.h"
+#include "hswidgetpositioningonorientationchange.h"
 
 
 /*!
@@ -92,22 +93,18 @@
     }
 
     foreach (HsWidgetData data, datas) {
-        QScopedPointer<HsWidgetHost> widget(new HsWidgetHost(data.id));
-        if(!widget->load() || !widget->isValid()) {
-            continue;
-		}
-        connectWidget(widget.data());
+        HsWidgetHost *widget = new HsWidgetHost(data.id);
+        mWidgets.append(widget);
+        connectWidget(widget);
         widget->setPage(this);
-        widget->initializeWidget();
-        if (widget->state() != HsWidgetHost::Initialized) {
-            continue;
-        }
-        widget->showWidget();
-        mWidgets.append(widget.data());
         widget->setParentItem(this);
-        widget.take(); // now this page owns widget
+        widget->startWidget();
     }
 
+    connect(HsScene::mainWindow(),
+        SIGNAL(orientationChanged(Qt::Orientation)),
+        SLOT(onOrientationChanged(Qt::Orientation)));
+
     return true;
 }
 
@@ -163,16 +160,13 @@
         return true;
     }
 
-    // Set presentation.
-    QString key = HsScene::orientation() == Qt::Horizontal ?
-        "landscape" : "portrait";
-
     HsWidgetPresentationData presentation;
-    if (!widgetHost->widgetPresentationData(key, presentation)) {
-        presentation.key = key;
+    presentation.orientation = HsScene::orientation();
+    if (!widgetHost->getPresentation(presentation)) {
+        presentation.orientation = HsScene::orientation();
         presentation.setPos(QPointF());
         presentation.zValue = 0;
-        widgetHost->setWidgetPresentationData(presentation);
+        widgetHost->savePresentation(presentation);
     }
 
     widgetHost->hide();
@@ -215,9 +209,10 @@
     for (int i = 0; i < mNewWidgets.count(); ++i) {
         widget = mNewWidgets.at(i);
         widget->setGeometry(calculatedRects.at(i));
-        widget->setWidgetPresentation();
+        widget->savePresentation();
         widget->setPage(this);
         widget->setParentItem(this);
+        widget->showWidget();
         widget->show();
     }
     mWidgets << mNewWidgets;
@@ -227,19 +222,22 @@
 
 bool HsPage::deleteFromDatabase()
 {
-    HsDatabase *db = HsDatabase::instance();
-
     foreach (HsWidgetHost *widget, mWidgets) {
-        if (!widget->deleteFromDatabase()) {
-            return false;
-        }
+        widget->remove();
+    }
+    mWidgets.clear();
+    
+    foreach (HsWidgetHost *widget, mNewWidgets) {
+        widget->remove();
     }
+    mNewWidgets.clear();
 
-    if (!db->deletePage(mDatabaseId))  {
-        return false;
+    foreach (HsWidgetHost *widget, mUnavailableWidgets) {
+        widget->remove();
     }
+    mUnavailableWidgets.clear();
 
-    return true;
+    return HsDatabase::instance()->deletePage(mDatabaseId);
 }
 
 QList<HsWidgetHost *> HsPage::widgets() const
@@ -264,6 +262,11 @@
     mRemovable = removable;
 }
 
+bool HsPage::isActivePage() const
+{
+    return this == HsScene::instance()->activePage();
+}
+
 HsPage *HsPage::createInstance(const HsPageData &pageData)
 {
     HsDatabase *db = HsDatabase::instance();
@@ -336,14 +339,14 @@
 
         foreach (HsWidgetHost *widget, sortedWidgets) {
             widget->setZValue(z++);
-            widget->setWidgetPresentation();
+            widget->savePresentation();
         }
     }
 
     if (!mNewWidgets.isEmpty()) {
         foreach (HsWidgetHost *widget, mNewWidgets) {
             widget->setZValue(z++);
-            widget->setWidgetPresentation();
+            widget->savePresentation();
         }
     }
 }
@@ -355,10 +358,11 @@
 
 void HsPage::connectWidget(HsWidgetHost *widget)
 {
-    connect(widget, SIGNAL(widgetFinished(HsWidgetHost*)),
-            SLOT(onWidgetFinished(HsWidgetHost*)));
-    connect(widget, SIGNAL(widgetResized(HsWidgetHost*)),
-            SLOT(onWidgetResized(HsWidgetHost*)));
+    connect(widget, SIGNAL(finished()), SLOT(onWidgetFinished()));
+    connect(widget, SIGNAL(faulted()), SLOT(onWidgetFaulted()));
+    connect(widget, SIGNAL(resized()), SLOT(onWidgetResized()));
+    connect(widget, SIGNAL(available()), SLOT(onWidgetAvailable()));
+    connect(widget, SIGNAL(unavailable()), SLOT(onWidgetUnavailable()));
 }
 
 void HsPage::disconnectWidget(HsWidgetHost *widget)
@@ -366,9 +370,10 @@
     widget->disconnect(this);
 }
 
-void HsPage::onWidgetFinished(HsWidgetHost *widget)
+void HsPage::onWidgetFinished()
 {
-    Q_ASSERT(widget);
+    HsWidgetHost *widget = qobject_cast<HsWidgetHost *>(sender());
+
     // It can be in new widget list if we haven't layouted it yet
     // or layouted new widget and widget list
     if (!mNewWidgets.removeOne(widget)) {
@@ -376,16 +381,21 @@
     }
 
     disconnectWidget(widget);
-    widget->uninitializeWidget();
-    widget->deleteFromDatabase();
-    widget->deleteLater();
+    widget->remove();
+}
+
+void HsPage::onWidgetFaulted()
+{
+    onWidgetFinished();
 }
 
 /*!
     Calculates new widget position on page when widget size changes
 */
-void HsPage::onWidgetResized(HsWidgetHost *widget)
+void HsPage::onWidgetResized()
 {
+    HsWidgetHost *widget = qobject_cast<HsWidgetHost *>(sender());
+
     QRectF widgetRect = widget->geometry();
 
     QRectF pageRect = HsScene::mainWindow()->layoutRect();
@@ -401,3 +411,59 @@
     widget->setPos(widgetX, widgetY);
 }
 
+void HsPage::onWidgetAvailable()
+{
+    HsWidgetHost *widget = qobject_cast<HsWidgetHost *>(sender());
+    
+    mUnavailableWidgets.removeOne(widget);
+    mWidgets.append(widget);
+
+    widget->setParentItem(this);
+    widget->startWidget(isActivePage());
+    widget->show();
+}
+ 
+void HsPage::onWidgetUnavailable()
+{
+    HsWidgetHost *widget = qobject_cast<HsWidgetHost *>(sender());
+
+    if (mWidgets.contains(widget)) {
+        mWidgets.removeOne(widget);
+    } else if (mNewWidgets.contains(widget)) {
+        mNewWidgets.removeOne(widget);
+    } else {
+        return;
+    }
+
+    mUnavailableWidgets.append(widget);
+
+    widget->hide();
+    widget->setParentItem(0);
+}
+
+void HsPage::onOrientationChanged(Qt::Orientation orientation)
+{
+    QRectF rect = HsScene::mainWindow()->layoutRect();    
+    
+    HsWidgetPositioningOnOrientationChange *converter =
+        HsWidgetPositioningOnOrientationChange::instance();
+
+    qreal chrome = 64;
+    QRectF from(0, chrome, rect.height(), rect.width() - chrome);
+    QRectF to(0, chrome, rect.width(), rect.height() - chrome);
+
+    HsWidgetPresentationData presentation;
+    presentation.orientation = orientation;
+
+    foreach (HsWidgetHost *widget, mWidgets) {
+        if (!widget->getPresentation(presentation)) {
+            QList<QRectF> geometries = converter->convert(
+                from, QList<QRectF>() << widget->geometry(), to);
+            widget->setGeometry(geometries.first());
+            widget->savePresentation();
+        } else {
+            widget->setPos(presentation.pos());
+            widget->setZValue(presentation.zValue);
+        }
+    }   
+}
--- a/homescreenapp/hsdomainmodel/src/hsscene.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsscene.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -27,6 +27,7 @@
 #include "hswidgethost.h"
 #include "hsdatabase.h"
 #include "hswallpaper.h"
+#include "hsconfiguration.h"
 
 /*!
     Destructor.
@@ -57,9 +58,9 @@
         return false;
     }
 
-    mMaximumPageCount = sceneData.maximumPageCount;
+    mMaximumPageCount = HsConfiguration::maximumPageCount();
 
-    calculateWidgetSizeLimitations(sceneData);
+    calculateWidgetSizeLimitations();
 
     if (sceneData.portraitWallpaper.isEmpty()) {
         mWallpaper->setImagesById();
@@ -83,7 +84,7 @@
             delete page;
             continue;
         }
-        if (pageData.id == sceneData.defaultPageId) {
+        if (pageData.id == HsConfiguration::defaultPageId()) {
             mActivePage = page;
             mActivePage->setRemovable(false);
         }
@@ -97,19 +98,17 @@
 /*!
     Calculate maximum and minimum widget sizes 
 */
-void HsScene::calculateWidgetSizeLimitations(HsSceneData &sceneData)
+void HsScene::calculateWidgetSizeLimitations()
 {
     // 1un = 6.7px = 2mm
-    mMaximumWidgetSizeInUnits = QSizeF(sceneData.maximumWidgetWidth,
-                                       sceneData.maximumWidgetHeight);
-    mMinimumWidgetSizeInUnits = QSizeF(sceneData.minimumWidgetWidth,
-                                       sceneData.minimumWidgetHeight);
+    mMaximumWidgetSizeInUnits = QSizeF(HsConfiguration::maximumWidgetWidth(),
+                                       HsConfiguration::maximumWidgetHeight());
+    mMinimumWidgetSizeInUnits = QSizeF(HsConfiguration::minimumWidgetWidth(),
+                                       HsConfiguration::minimumWidgetHeight());
     HbDeviceProfile profile;
     qreal unitToPixelFactor = profile.unitValue();
-    mMaximumWidgetSizeInPixels = QSizeF(sceneData.maximumWidgetWidth * unitToPixelFactor,
-                                        sceneData.maximumWidgetHeight * unitToPixelFactor);
-    mMinimumWidgetSizeInPixels = QSizeF(sceneData.minimumWidgetWidth * unitToPixelFactor,
-                                        sceneData.minimumWidgetHeight * unitToPixelFactor);
+    mMaximumWidgetSizeInPixels = unitToPixelFactor * mMaximumWidgetSizeInUnits;
+    mMinimumWidgetSizeInPixels = unitToPixelFactor * mMinimumWidgetSizeInUnits;
 }
 
 /*!
@@ -149,6 +148,8 @@
         return false;
     }
 
+    int addPosition = data.indexPosition;
+
     db->transaction();
 
     for (int i = data.indexPosition; i < mPages.count(); ++i) {
@@ -162,7 +163,7 @@
     
     db->commit();
     
-    mPages.insert(data.indexPosition, page);
+    mPages.insert(addPosition, page);
     return true;
 }
     
--- a/homescreenapp/hsdomainmodel/src/hsshortcutservice.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsshortcutservice.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -68,9 +68,9 @@
 HsShortcutService *HsShortcutService::instance(QStateMachine *stateMachine)
 {
     if (!mInstance && stateMachine) {
-        mInstance.reset(new HsShortcutService(stateMachine));
+        mInstance = new HsShortcutService(stateMachine);
     }
-    return mInstance.data();
+    return mInstance;
 }
 
 HsShortcutService::~HsShortcutService()
@@ -94,4 +94,4 @@
     mD.reset(new HsShortcutServicePrivate(stateMachine));
 }
 
-QScopedPointer<HsShortcutService> HsShortcutService::mInstance(0);
+HsShortcutService *HsShortcutService::mInstance(0);
--- a/homescreenapp/hsdomainmodel/src/hswidgetcomponent.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hswidgetcomponent.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -19,8 +19,6 @@
 #include <QDir>
 
 #include "hswidgetcomponent.h"
-#include "hswidgetcomponentdescriptor.h"
-#include "hswidgetcomponentregistry.h"
 #include "hsapp_defs.h"
 #include "caservice.h"
 #include "caquery.h"
@@ -171,9 +169,3 @@
         emit available();
     }
 }
-
-
-
-
-    
-
--- a/homescreenapp/hsdomainmodel/src/hswidgetcomponentdescriptor.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hswidgetcomponentdescriptor.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -23,6 +23,10 @@
     \class HsWidgetComponentDescriptor
     \ingroup group_hsdomainmodel
     \brief Homescreen widget component descriptor class.
+    
+    Homescreen widget component descriptor class hosts meta data of
+    widget component. Meta data is delivered in manifest file.
+    \see page_widgetsispackage
 */
 
 
--- a/homescreenapp/hsdomainmodel/src/hswidgetcomponentregistry.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hswidgetcomponentregistry.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -37,6 +37,15 @@
     \class HsWidgetComponentRegistry
     \ingroup group_hsdomainmodel
     \brief Homescreen widget component registry.
+
+    Homescreen widget component registry keeps track of packages from which is(are) 
+    created widget(s) to homescreen page(s). Registry updates its content
+    when the installation package is uninstalled/updated or installation location is( or is not)
+	available (media attached/detached). Registry takes care of package registration/unregistration
+	to Qt service framework.
+    
+    Events for all above cases are get from Content Storage. Component registry listens
+    changes of Content Storages' entries (CaEntry) via its service class (CaService).
 */
 
 HsWidgetComponentRegistry *HsWidgetComponentRegistry::mInstance = 0;
@@ -64,6 +73,7 @@
 
 /*!
     Returns component object of the given \a uri.
+    Uri is defined in widget manifest file. \see page_widgetsispackage
 */
 HsWidgetComponent *HsWidgetComponentRegistry::component(const QString &uri)
 {
@@ -77,15 +87,15 @@
 }
 
 /*!
-    Requests widget component to emit 'aboutToInstall' signal to free widget resources when uninstalling the widget.
+    Requests widget component to emit 'aboutToUninstall' signal to free widget resources when
+    uninstalling the widget's installation package.
 */
 void HsWidgetComponentRegistry::uninstallComponent(const HsWidgetComponentDescriptor &componentDescriptor)
 {
     HsWidgetComponent *component = mRegistry.value(componentDescriptor.uri);
     if (component) {
         component->emitAboutToUninstall();
-        }
-        
+    }
 }
 
 /*!
@@ -119,7 +129,6 @@
     if (component) {
         component->emitAvailable();
     }
-
 }
 
 /*!
@@ -139,7 +148,7 @@
         mServiceManager.removeService(uri);
         QCoreApplication::removeLibraryPath(rootPath);
         if (component) {
-            // for now support versions without uinstaller
+            // for now support versions without uninstaller
             component->emitAboutToUninstall();
             component->emitUninstalled();
             mRegistry.take(uri)->deleteLater();
@@ -203,4 +212,3 @@
         default: break;     
     }
 }
-
--- a/homescreenapp/hsdomainmodel/src/hswidgethost.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hswidgethost.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -15,190 +15,90 @@
 *
 */
 
-#include <QMetaObject>
+#include <QApplication>
+#include <QStateMachine>
+#include <QState>
+#include <QFinalState>
 #include <QGraphicsLinearLayout>
 #include <QParallelAnimationGroup>
 #include <QPropertyAnimation>
 #include <QGraphicsDropShadowEffect>
 #include <QGraphicsSceneResizeEvent>
+#include <QGesture>
+#include <QGraphicsScene>
 
 #include <qservicemanager.h>
 #include <qservicefilter.h>
 #include <qserviceinterfacedescriptor.h>
 
-#include <HbInstance>
 #include <HbInstantFeedback>
 
-#include "hswidgethost.h"
 #include "hsdatabase.h"
 #include "hsdomainmodeldatastructures.h"
+#include "hsscene.h"
 #include "hspage.h"
-#include "hsapp_defs.h"
-#include "hsscene.h"
+#include "hswidgethost.h"
 #include "hswidgetcomponentregistry.h"
 #include "hswidgetcomponent.h"
+#include "hsconfiguration.h"
+
+// Helper macros for connecting state entry and exit actions.
+#define ENTRY_ACTION(state, action) \
+    connect(state, SIGNAL(entered()), SLOT(action()));
+#define EXIT_ACTION(state, action) \
+    connect(state, SIGNAL(exited()), SLOT(action()));
 
 QTM_USE_NAMESPACE
 
-/*!
-    \class HsWidgetHost
-    \ingroup group_hsutils
-    \brief Homescreen widget runner.
-    Is responsible of running a homescreen widget. Each
-    homescreen widget has its own host.
-*/
-
-HsWidgetHost* HsWidgetHost::createInstance(HsWidgetData &widgetData,
-                                           const QVariantHash &preferences)
+HsWidgetHost::HsWidgetHost(int databaseId, QGraphicsItem *parent)
+  : HbWidget(parent),
+    mDatabaseId(databaseId),
+    mStateMachine(0),
+    mWidget(0),
+    mPage(0),
+    mComponent(0),
+    mIsFinishing(false)
 {
-    HsDatabase* db = HsDatabase::instance();
-    Q_ASSERT(db);
-
-    if (db->insertWidget(widgetData)) {
-        db->setWidgetPreferences(widgetData.id, preferences);
-        return new HsWidgetHost(widgetData.id);
-    }
+    setFlag(QGraphicsItem::ItemClipsChildrenToShape);
+    setFlag(QGraphicsItem::ItemHasNoContents);
 
-    return 0;
-}
-/*!
-    Construct a widget host for the given \a databaseId.
-    \a parent becomes the parent item for the host.
-*/
-HsWidgetHost::HsWidgetHost(int databaseId, QGraphicsItem *parent)
-    : HbWidget(parent),
-      mWidget(0),
-      mPage(0),
-      mState(Unloaded),
-      mDatabaseId(databaseId)
-{
-    setFlags(QGraphicsItem::ItemClipsChildrenToShape);
-
-    HsDatabase *db = HsDatabase::instance();
+    grabGesture(Qt::TapGesture);
+    grabGesture(Qt::TapAndHoldGesture);
+    grabGesture(Qt::PanGesture);
+    grabGesture(Qt::PinchGesture);
+    grabGesture(Qt::SwipeGesture);
+    grabGesture(Qt::CustomGesture);
 
-    // Find the widget data.
-    HsWidgetData data;
-    data.id = mDatabaseId;
-    if (!db->widget(data)) {
-       return;
-    }
-
-    mUri = data.uri;
-
-    // bind host to component
-    HsWidgetComponent *component = HsWidgetComponentRegistry::instance()->component(mUri);
-    connect(component, SIGNAL(uninstalled()), SLOT(onFinished()));
-    connect(component, SIGNAL(aboutToUninstall()), SLOT(onAboutToUninstall()));
-    connect(component, SIGNAL(updated()), SLOT(onUpdated()));
-    connect(component, SIGNAL(unavailable()), SLOT(onUnavailable()));
-    connect(component, SIGNAL(available()), SLOT(onAvailable()));
-
-    /* TODO: Uncomment after the Qt bug has been fixed.
-    QGraphicsDropShadowEffect *effect =
-        new QGraphicsDropShadowEffect(this);
-    effect->setColor(QColor(0, 0, 0, 150));
-    effect->setBlurRadius(5);
-    effect->setOffset(3);
-    setGraphicsEffect(effect);
-    */
+    setupEffects();
+    setupStates();
 }
 
-/*!
-    Destructor.
-*/
 HsWidgetHost::~HsWidgetHost()
 {
 }
 
-/*!
-    Load hosted widget from plugin and validate it.
-    Returns true if widget construction is successfull.
-*/
-bool HsWidgetHost::load()
+HsWidgetHost *HsWidgetHost::createInstance(HsWidgetData &widgetData, 
+                                           const QVariantHash &preferences)
 {
-    if (mState != Unloaded) {
-        return false;
-    }
-    if (mWidget) {
-        return false;
-    }
-
-
-    // Create the hosted widget.
-    QServiceManager manager;
-    QServiceFilter filter("com.nokia.symbian.IHomeScreenWidget");
-    filter.setServiceName(mUri);
-    QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(filter);
-    if (interfaces.isEmpty()) {
-        return false;
-    }
-
-    QObject *widgetObject = manager.loadInterface(interfaces.first());
-    mWidget = qobject_cast<QGraphicsWidget *>(widgetObject);
-
-    if (!mWidget ||
-        !setMethod("onShow()", mOnShowMethod) ||
-        !setMethod("onHide()", mOnHideMethod)) {
-        mWidget = 0;
-        delete widgetObject;
-        return false;
-    }
+    HsDatabase *db = HsDatabase::instance();
 
-    setProperty("isOnline", mIsOnlineProperty);
-	setProperty("rootPath", mRootPathProperty);
-    
-    setMethod("isPannable(QGraphicsSceneMouseEvent*)", mIsPannable);
-    setMethod("onInitialize()", mOnInitializeMethod);
-    setMethod("onUninitialize()", mOnUninitializeMethod);
-
-    if (hasSignal("setPreferences(const QStringList&)")) {
-        connect(mWidget, SIGNAL(setPreferences(QStringList)),
-                SLOT(onSetPreferences(QStringList)));
-    }
-    if (hasSignal("finished()")) {
-        connect(mWidget, SIGNAL(finished()),
-                SLOT(onFinished()));
+    if (db->insertWidget(widgetData)) {
+        db->setWidgetPreferences(widgetData.id, preferences);
+        return new HsWidgetHost(widgetData.id);
+    } else {
+        return 0;
     }
-    if (hasSignal("error()")) {
-        connect(mWidget, SIGNAL(error()),
-                SLOT(onError()));
-    }
-
-    mWidget->installEventFilter(this);
-
-	loadWidgetPresentation();
-
-    HsScene *scene = HsScene::instance();
-    setMaximumSize(scene->maximumWidgetSizeInPixels());
-    setMinimumSize(scene->minimumWidgetSizeInPixels());
-
-    mWidget->setParentItem(this);
-
-    setNewSize(mWidget->size());
-    mState = Loaded;
-
-    return true;
 }
 
-void HsWidgetHost::unload()
+int HsWidgetHost::databaseId() const
 {
-    if (mState != Uninitialized) {
-        return;
-    }
-    if (mWidget) {
-        mWidget->setParentItem(0);
-    }
-    delete mWidget;
-    QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
-    mWidget = 0;
-    mState = Unloaded;
+    return mDatabaseId;
 }
 
 bool HsWidgetHost::setPage(HsPage *page)
 {
-    HsDatabase* db = HsDatabase::instance();
-    Q_ASSERT(db);
-
+    HsDatabase *db = HsDatabase::instance();
+    
     HsWidgetData data;
     data.id = mDatabaseId;
     if (db->widget(data)) {
@@ -217,266 +117,129 @@
     mPage = page;
     return true;
 }
-
+ 
 HsPage *HsWidgetHost::page() const
 {
     return mPage;
 }
 
-/*!
-    Returns true if this host has a valid widget set.
-    Otherwise, return false.
-*/
-bool HsWidgetHost::isValid() const
-{
-    return mWidget;
-}
-
-/*!
-    Returns database id
-*/
-int HsWidgetHost::databaseId() const
-{
-    return mDatabaseId;
-}
-
-/*!
-    Returns true if this the database operation succeeds,
-    false otherwise
-*/
-bool HsWidgetHost::deleteFromDatabase()
+bool HsWidgetHost::isPannable(QGraphicsSceneMouseEvent *event)
 {
-    HsDatabase *db = HsDatabase::instance();
-
-    if (!db->deleteWidget(mDatabaseId)) {
-        return false;
-    }
-
-    mDatabaseId = -1;
-    return true;
-}
-
-/*!
-    Set widget presentation by using current values.
-    Return true if successfull.
-*/
-bool HsWidgetHost::setWidgetPresentation()
-{
-    HsDatabase *db = HsDatabase::instance();
-    Q_ASSERT(db);
-
-    QString key = HsScene::orientation() == Qt::Vertical ?
-        "portrait" : "landscape";
-
-    HsWidgetPresentationData data;
-    data.key      = key;
-    data.setPos(pos());
-    data.zValue   = zValue();
-    data.widgetId = databaseId();
-
-    return db->setWidgetPresentation(data);
+    bool result = false;
+    mIsPannableMethod.invoke(mWidget, Q_RETURN_ARG(bool, result), Q_ARG(QGraphicsSceneMouseEvent *,event));
+    return result;
 }
 
-/*!
-    Set widget presentation data. Return true if successfull.
-*/
-bool HsWidgetHost::setWidgetPresentationData(HsWidgetPresentationData &presentationData)
+bool HsWidgetHost::loadPresentation()
 {
-    HsDatabase *db = HsDatabase::instance();
-    Q_ASSERT(db);
-
-    presentationData.widgetId = mDatabaseId;
-    return db->setWidgetPresentation(presentationData);
-}
-
-/*!
-    Get widget presentation data matching given \a key.
-    Data is returned on given empty \a presentationData. Return true if successfull
-*/
-bool HsWidgetHost::widgetPresentationData(const QString &key,
-                                          HsWidgetPresentationData &presentationData)
-{
-    HsDatabase *db = HsDatabase::instance();
-    Q_ASSERT(db);
-
-    presentationData.key = key;
-    presentationData.widgetId = mDatabaseId;
-    return db->widgetPresentation(presentationData);
+    return loadPresentation(HsScene::orientation());
 }
 
-/*!
-    Return HsWidgetPresentationData for given \a orientation
-*/
-HsWidgetPresentationData HsWidgetHost::widgetPresentation(Qt::Orientation orientation)
+bool HsWidgetHost::loadPresentation(Qt::Orientation orientation)
 {
     HsDatabase *db = HsDatabase::instance();
-    Q_ASSERT(db);
-
-    QString key = orientation == Qt::Vertical ?
-        "portrait" : "landscape";
-
+        
     HsWidgetPresentationData data;
-    data.key = key;
-    data.widgetId = mDatabaseId;
-    if (db->widgetPresentation(data)) {
-        return data;
-    } else {
-        return HsWidgetPresentationData();
-    }
-}
-
-/*!
-    Load HsWidgetPresentationData for current orientation
-*/
-bool HsWidgetHost::loadWidgetPresentation()
-{
-    HsDatabase *db = HsDatabase::instance();
-
-    QString key = HsScene::orientation() == Qt::Vertical ?
-        "portrait" : "landscape";
-
-    HsWidgetPresentationData data;
-    data.key = key;
+    data.orientation = orientation;
     data.widgetId = mDatabaseId;
     if (!db->widgetPresentation(data)) {
         return false;
     }
-
     setPos(data.x, data.y);
     setZValue(data.zValue);
-
     return true;
 }
 
-/*!
-    Delete HsWidgetPresentationData for given \a orientation.
-    Return true if successfull.
-*/
-bool HsWidgetHost::deleteWidgetPresentation(Qt::Orientation orientation)
+bool HsWidgetHost::savePresentation()
+{
+    return savePresentation(HsScene::orientation());
+}
+
+bool HsWidgetHost::savePresentation(Qt::Orientation orientation)
+{
+    HsDatabase *db = HsDatabase::instance();
+        
+    HsWidgetPresentationData data;
+    data.orientation = orientation;
+    data.setPos(pos());
+    data.zValue = zValue();
+    data.widgetId = mDatabaseId;
+    return db->setWidgetPresentation(data);
+}
+
+bool HsWidgetHost::savePresentation(HsWidgetPresentationData &presentation)
+{
+    HsDatabase *db = HsDatabase::instance();
+    
+    presentation.widgetId = mDatabaseId;
+    return db->setWidgetPresentation(presentation);
+}
+
+bool HsWidgetHost::getPresentation(HsWidgetPresentationData &presentation)
 {
     HsDatabase *db = HsDatabase::instance();
-    Q_ASSERT(db);
-
-    QString key = orientation == Qt::Vertical ?
-        "portrait" : "landscape";
+        
+    presentation.widgetId = mDatabaseId;
+    return db->widgetPresentation(presentation);
+}
 
-    return db->deleteWidgetPresentation(mDatabaseId, key);
-}
-/*!
-    Check wheter widget uses pan gestures
-    Return true if successfull.
-*/
-bool HsWidgetHost::isPannable(QGraphicsSceneMouseEvent *event)
+bool HsWidgetHost::removePresentation(Qt::Orientation orientation)
 {
-    bool ret(false);
-    mIsPannable.invoke(mWidget,Q_RETURN_ARG(bool,ret),Q_ARG(QGraphicsSceneMouseEvent *,event));
-    return ret;
+    HsDatabase *db = HsDatabase::instance();
+    return db->deleteWidgetPresentation(mDatabaseId, orientation);
 }
-/*!
-    \fn void HsWidgetHost::widgetFinished()
-    This signal is emitted after the contained widget
-    reported is completion.
-*/
-
-/*!
-    \fn void HsWidgetHost::widgetError()
-    This signal is emitted after the contained widget
-    reported an error.
-*/
 
-/*!
-    \fn void HsWidgetHost::widgetResized()
-    This signal is emitted after the contained widget
-    sends a resize event.
-*/
-/*!
-    \fn void HsWidgetHost::mousePressEventIgnored()
-    This signal is emitted if managed widget ignores mouse press event
-
-*/
+void HsWidgetHost::startWidget(bool show)
+{
+    if (!mStateMachine->isRunning()) {
+        mStateMachine->start();
+        // This is needed because QStateMachine::start() starts
+        // the state machine asynchronously via the eventloop. 
+        // Here we want the machine to start synchronously.
+        QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+    }
 
-/*!
-    Calls the widget's onInitialize() slot if the
-    widget defines it.
-*/
-void HsWidgetHost::initializeWidget()
-{
-    if (mState != Loaded) {
-        return;
-    }
-    HsWidgetComponent *component = HsWidgetComponentRegistry::instance()->component(mUri);
-    Q_ASSERT(component);
-    mRootPathProperty.write(mWidget, component->rootPath());
-    setPreferencesToWidget();
-    setOnline(HsScene::instance()->isOnline());
-    mOnInitializeMethod.invoke(mWidget);
-
-    if (mState != Finished &&
-        mState != Faulted) {
-        mState = Initialized;
+    if (show) {
+        emit event_startAndShow();
+    } else {
+        emit event_startAndHide();
     }
 }
-
-/*!
-    Calls the widget's onShow() slot if the
-    widget defines it.
-*/
+ 
 void HsWidgetHost::showWidget()
 {
-    if (mState != Initialized &&
-        mState != Hidden ) {
-        return;
-    }
-
-    mOnShowMethod.invoke(mWidget);
-
-    mState = Visible;
+    emit event_show();
 }
-
-/*!
-    Calls the widget's onHide() slot if the
-    widget defines it.
-*/
+    
 void HsWidgetHost::hideWidget()
 {
-    if (mState != Initialized &&
-        mState != Visible) {
-        return;
-    }
-
-    mOnHideMethod.invoke(mWidget);
-
-    mState = Hidden;
+    emit event_hide();
 }
 
-/*!
-    Calls the widget's onUninitialize() slot if the
-    widget defines it.
-*/
-void HsWidgetHost::uninitializeWidget()
-{
-    if (mState != Visible &&
-        mState != Hidden) {
-        return;
-    }
-
-    mOnUninitializeMethod.invoke(mWidget);
-
-    mState = Uninitialized;
-}
-
-/*!
-    Calls the widget's widgetOnlineState property if the
-    widget defines it.
-*/
 void HsWidgetHost::setOnline(bool online)
 {
     mIsOnlineProperty.write(mWidget, online);
 }
 
-/*!
-    Starts the widget drag animation.
-*/
+void HsWidgetHost::remove()
+{
+    if (mStateMachine->isRunning()) {
+        emit event_remove();
+    } else {
+        action_remove();
+        deleteLater();
+    }
+}
+ 
+void HsWidgetHost::close()
+{
+    if (mStateMachine->isRunning()) {
+        emit event_close();
+    } else {
+        deleteLater();
+    }
+}
+
 void HsWidgetHost::startDragEffect()
 {
     /* TODO: Uncomment after the Qt bug has been fixed.
@@ -490,7 +253,7 @@
     QParallelAnimationGroup *animationGroup = new QParallelAnimationGroup();
 
     QPropertyAnimation *animation = new QPropertyAnimation(this, "scale");
-    animation->setDuration(200);
+    animation->setDuration(HsConfiguration::widgetDragEffectDuration());
     animation->setEndValue(1.1);
     animationGroup->addAnimation(animation);
 
@@ -504,9 +267,6 @@
     animationGroup->start(QAbstractAnimation::DeleteWhenStopped);
 }
 
-/*!
-    Starts the widget drop animation.
-*/
 void HsWidgetHost::startDropEffect()
 {
     /* TODO: Uncomment after the Qt bug has been fixed.
@@ -518,7 +278,7 @@
     QParallelAnimationGroup *animationGroup = new QParallelAnimationGroup;
 
     QPropertyAnimation *animation = new QPropertyAnimation(this, "scale");
-    animation->setDuration(200);
+    animation->setDuration(HsConfiguration::widgetDropEffectDuration());
     animation->setEndValue(1);
     animationGroup->addAnimation(animation);
 
@@ -531,56 +291,122 @@
 
     animationGroup->start(QAbstractAnimation::DeleteWhenStopped);
 }
-/*!
-    Overwritten to stop event propogation
-*/
-void HsWidgetHost::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) 
-{ 
-    Q_UNUSED(event) 
-}
-/*!
-    Overwritten to stop event propogation
-*/
-void HsWidgetHost::mouseMoveEvent(QGraphicsSceneMouseEvent *event) 
-{ 
-    Q_UNUSED(event)  
-}
-/*!
-    Overwritten to stop event propogation
-*/
-void HsWidgetHost::mousePressEvent(QGraphicsSceneMouseEvent *event) 
-{ 
-    Q_UNUSED(event)  
-    
-}
-/*!
-    Overwritten to stop event propogation
-*/
-void HsWidgetHost::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { 
-    Q_UNUSED(event)
-}    
-/*!
-    Filters resize events from widgets and resizes inside max/min size boundaries if needed.
-*/
-bool HsWidgetHost::eventFilter(QObject *obj, QEvent *event)
+
+bool HsWidgetHost::eventFilter(QObject *watched, QEvent *event)
 {
     if (event->type() == QEvent::GraphicsSceneResize ) {
-        QGraphicsSceneResizeEvent *resizeEvent = static_cast<QGraphicsSceneResizeEvent*>(event);
+        QGraphicsSceneResizeEvent *resizeEvent = 
+            static_cast<QGraphicsSceneResizeEvent *>(event);
         setNewSize(resizeEvent->newSize());
-        emit widgetResized(this);
-        return true;
-    } else {
-         // standard event processing
-         return HbWidget::eventFilter(obj, event);
+        emit resized();
     }
+    return HbWidget::eventFilter(watched, event);
+}
+
+void HsWidgetHost::setupEffects()
+{
+    /* TODO: Uncomment after the Qt bug has been fixed.
+    QGraphicsDropShadowEffect *effect =
+        new QGraphicsDropShadowEffect(this);
+    effect->setColor(QColor(0, 0, 0, 150));
+    effect->setBlurRadius(5);
+    effect->setOffset(3);
+    setGraphicsEffect(effect);
+    */
 }
 
-/*!
-    Checks if a property with the given \a name
-    in the contained widget. If the property exists the \a
-    metaProperty is made to reference to it. Returns true if
-    the property was found. Otherwise, returns false.
-*/
+void HsWidgetHost::setupStates()
+{
+    // State machine
+
+    mStateMachine = new QStateMachine(this);
+    mStateMachine->setAnimated(false);
+    
+    // States
+
+    QState *state_component = new QState;
+    QState *state_unloaded = new QState(state_component);
+    QState *state_running = new QState(state_component);
+    QState *state_show = new QState(state_running);
+    QState *state_hide = new QState(state_running);
+    QState *state_finished = new QState;
+    QState *state_faulted = new QState;
+    QState *state_remove = new QState;
+    QFinalState *state_final = new QFinalState;
+
+    mStateMachine->addState(state_component);
+    mStateMachine->addState(state_finished);
+    mStateMachine->addState(state_faulted);
+    mStateMachine->addState(state_remove);
+    mStateMachine->addState(state_final);
+
+    mStateMachine->setInitialState(state_component);
+    state_component->setInitialState(state_unloaded);
+    state_running->setInitialState(state_hide);
+
+    // Transitions
+
+    state_component->addTransition(
+        this, SIGNAL(event_close()), state_final);
+    state_component->addTransition(
+        this, SIGNAL(event_remove()), state_remove);
+    state_component->addTransition(
+        this, SIGNAL(event_finished()), state_finished);
+    state_component->addTransition(
+        this, SIGNAL(event_faulted()), state_faulted);
+
+    state_unloaded->addTransition(
+        this, SIGNAL(event_startAndShow()), state_show);
+    state_unloaded->addTransition(
+        this, SIGNAL(event_startAndHide()), state_hide);
+
+    state_running->addTransition(
+        this, SIGNAL(event_unload()), state_unloaded);
+    
+    state_show->addTransition(
+        this, SIGNAL(event_hide()), state_hide);
+
+    state_hide->addTransition(
+        this, SIGNAL(event_show()), state_show);
+
+    state_finished->addTransition(
+        this, SIGNAL(event_remove()), state_remove);
+    state_finished->addTransition(
+        this, SIGNAL(event_close()), state_final);
+
+    state_faulted->addTransition(
+        this, SIGNAL(event_remove()), state_remove);
+    state_faulted->addTransition(
+        this, SIGNAL(event_close()), state_final);
+
+    state_remove->addTransition(state_final);
+
+    // Actions
+
+    ENTRY_ACTION(state_component, action_connectComponent)
+    EXIT_ACTION(state_component, action_disconnectComponent)
+
+    ENTRY_ACTION(state_running, action_load)
+    ENTRY_ACTION(state_running, action_initialize)
+    EXIT_ACTION(state_running, action_uninitialize)
+    EXIT_ACTION(state_running, action_unload)
+
+    ENTRY_ACTION(state_show, action_show)
+
+    ENTRY_ACTION(state_hide, action_hide)
+
+    ENTRY_ACTION(state_finished, action_finished)
+
+    ENTRY_ACTION(state_faulted, action_faulted)
+
+    ENTRY_ACTION(state_remove, action_remove)
+
+    // Delete on finish.
+
+    connect(mStateMachine, SIGNAL(finished()), SLOT(deleteLater()), 
+            Qt::QueuedConnection);
+}
+
 bool HsWidgetHost::setProperty(const char *name, QMetaProperty &property)
 {
     const QMetaObject *object = mWidget->metaObject();
@@ -589,12 +415,6 @@
     return index >= 0;
 }
 
-/*!
-    Checks if a slot with the given \a signature exists
-    in the contained widget. If the slot exists the \a
-    method is made to reference to it. Returns true if
-    the slot was found. Otherwise, returns false.
-*/
 bool HsWidgetHost::setMethod(const char *signature, QMetaMethod &method)
 {
     const QMetaObject *object = mWidget->metaObject();
@@ -604,11 +424,6 @@
     return index >= 0;
 }
 
-/*!
-    Returns true if a signal with the given \a signature
-    exists in the contained widget. Otherwise, returns
-    false.
-*/
 bool HsWidgetHost::hasSignal(const char *signature)
 {
     const QMetaObject *object = mWidget->metaObject();
@@ -616,22 +431,24 @@
         QMetaObject::normalizedSignature(signature));
     return index >= 0;
 }
-/*!
-    Returns true if fetching widget preferences from db and setting those
-    to widget is successfull
-*/
+
+void HsWidgetHost::setNewSize(const QSizeF &size)
+{
+    resize(size);
+    setPreferredSize(size);
+}
+
 bool HsWidgetHost::setPreferencesToWidget()
 {
     HsDatabase *db = HsDatabase::instance();
-    Q_ASSERT(db);
-
+    
     QVariantHash preferences;
     if (!db->widgetPreferences(mDatabaseId, preferences)) {
         return false;
     }
 
     QStringList names = preferences.keys();
-    foreach(QString name, names) {
+    foreach (QString name, names) {
         mWidget->setProperty(name.toLatin1(),
                              preferences.value(name));
     }
@@ -639,23 +456,159 @@
     return true;
 }
 
-/*!
-    Resizes and sets preferred size for widget layouts
-*/
-void HsWidgetHost::setNewSize(const QSizeF &newSize)
+void HsWidgetHost::action_connectComponent()
 {
-    resize(newSize);
-    setPreferredSize(newSize);
+    HsDatabase *db = HsDatabase::instance();
+    
+    HsWidgetData data;
+    data.id = mDatabaseId;
+    if (!db->widget(data)) {
+        emit event_faulted();
+        return;
+    }
+    
+    mComponent = HsWidgetComponentRegistry::instance()->component(data.uri);
+    
+    connect(mComponent, SIGNAL(aboutToUninstall()), SIGNAL(event_unload()));
+    connect(mComponent, SIGNAL(uninstalled()), SIGNAL(event_finished()));
+    connect(mComponent, SIGNAL(unavailable()), SIGNAL(event_unload()));
+    connect(mComponent, SIGNAL(unavailable()), SIGNAL(unavailable()));
+    connect(mComponent, SIGNAL(available()), SIGNAL(available()));
+    connect(mComponent, SIGNAL(updated()), SIGNAL(available()));
+}
+
+void HsWidgetHost::action_disconnectComponent()
+{
+    mComponent->disconnect(this);
 }
 
-/*!
-    This slot is connected to the contained widget's
-    setPreferences() signal, if it was defined for
-    the widget. The widget emits the signal for persisting
-    its preferences named with \a names. The given
-    preferences are read, validated, and written to
-    the database.
-*/
+void HsWidgetHost::action_load()
+{
+    QServiceManager manager;
+    QServiceFilter filter("com.nokia.symbian.IHomeScreenWidget");
+    filter.setServiceName(mComponent->uri());
+    QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(filter);
+    if (interfaces.isEmpty()) {
+        emit event_faulted();
+        return;
+    }
+
+    QObject *widgetObject = manager.loadInterface(interfaces.first());
+    mWidget = qobject_cast<QGraphicsWidget *>(widgetObject);
+
+    if (!mWidget ||
+        !setMethod("onShow()", mOnShowMethod) ||
+        !setMethod("onHide()", mOnHideMethod)) {
+        mWidget = 0;
+        delete widgetObject;
+        emit event_faulted();
+        return;
+    }
+
+    setMethod("onInitialize()", mOnInitializeMethod);
+    setMethod("onUninitialize()", mOnUninitializeMethod);
+    setMethod("isPannable(QGraphicsSceneMouseEvent*)", mIsPannableMethod);
+
+    setProperty("isOnline", mIsOnlineProperty);
+	setProperty("rootPath", mRootPathProperty);
+    
+    if (hasSignal("setPreferences(const QStringList&)")) {
+        connect(mWidget, SIGNAL(setPreferences(QStringList)),
+                SLOT(onSetPreferences(QStringList)));
+    }
+    if (hasSignal("finished()")) {
+        connect(mWidget, SIGNAL(finished()),
+                SLOT(onFinished()));
+    }
+    if (hasSignal("error()")) {
+        connect(mWidget, SIGNAL(error()),
+                SLOT(onError()));
+    }
+
+    mWidget->installEventFilter(this);
+
+    HsScene *scene = HsScene::instance();
+    setMaximumSize(scene->maximumWidgetSizeInPixels());
+    setMinimumSize(scene->minimumWidgetSizeInPixels());
+
+    loadPresentation();
+
+    mWidget->setParentItem(this);
+
+    setNewSize(mWidget->size());
+}
+
+void HsWidgetHost::action_unload()
+{
+    delete mWidget;
+    mWidget = 0;
+
+    mOnInitializeMethod = QMetaMethod();
+    mOnShowMethod = QMetaMethod();
+    mOnHideMethod = QMetaMethod();
+    mOnUninitializeMethod = QMetaMethod();
+    mIsPannableMethod = QMetaMethod();
+    mIsOnlineProperty = QMetaProperty();
+	mRootPathProperty = QMetaProperty();    
+}
+
+void HsWidgetHost::action_initialize()
+{    
+    mRootPathProperty.write(mWidget, mComponent->rootPath());
+    setPreferencesToWidget();
+    setOnline(HsScene::instance()->isOnline());
+    mOnInitializeMethod.invoke(mWidget);
+}
+
+void HsWidgetHost::action_uninitialize()
+{
+    mOnUninitializeMethod.invoke(mWidget);
+}
+
+void HsWidgetHost::action_show()
+{
+    if (!mIsFinishing) {
+        mOnShowMethod.invoke(mWidget);
+    }
+}
+
+void HsWidgetHost::action_hide()
+{
+    if (!mIsFinishing) {
+        mOnHideMethod.invoke(mWidget);
+    }
+}
+
+void HsWidgetHost::action_finished()
+{
+    emit finished();
+}
+
+void HsWidgetHost::action_faulted()
+{
+    emit faulted();
+}
+
+void HsWidgetHost::action_remove()
+{
+    HsDatabase *db = HsDatabase::instance();
+    
+    db->deleteWidget(mDatabaseId);
+    mDatabaseId = -1;
+}
+
+void HsWidgetHost::onFinished()
+{
+    mIsFinishing = true;
+    emit event_finished();
+}
+ 
+void HsWidgetHost::onError()
+{
+    mIsFinishing = true;
+    emit event_faulted();
+}
+
 void HsWidgetHost::onSetPreferences(const QStringList &names)
 {
     if (names.isEmpty()) {
@@ -669,85 +622,8 @@
         preferences.insert(name, value);
     }
 
-    HsDatabase *db = HsDatabase::instance();
-    Q_ASSERT(db);
-
+    HsDatabase *db = HsDatabase::instance();    
     if (!db->setWidgetPreferences(mDatabaseId, preferences)) {
         onError();
     }
 }
-
-/*!
-    This slot reacts to the widgets finished() signal, if
-    it was defined for the widget. The widget emits the signal
-    when it has finished its execution and is ready for
-    removal from the homescreen.
-*/
-void HsWidgetHost::onFinished()
-{
-    mState = Finished;
-    emit widgetFinished(this);
-}
-
-/*!
-    This slot reacts to the widgets error() signal, if it was
-    defined for the widget. The widget emits the signal in
-    failure cases.
-*/
-void HsWidgetHost::onError()
-{
-    mState = Faulted;
-    emit widgetError(this);
-}
-/*!
-    This slot is called when component is about to uninstall or
-    update. Widget need to release all handles to resources installing
-    to succeed.
-*/
-void HsWidgetHost::onAboutToUninstall()
-{
-    uninitializeWidget();
-    unload();
-}
-
-void HsWidgetHost::onUpdated()
-{
-    if(mState != Unloaded) {
-        return;
-    }
-    load();
-    initializeWidget();
-    if (HsScene::instance()->activePage() == mPage) {
-       showWidget();
-    } else {
-        hideWidget();
-    }
-
-}
-void HsWidgetHost::onUnavailable()
-{
-    if (mState != Visible && mState != Hidden) {
-        return;
-    }
-    uninitializeWidget();
-    unload();
-}
-
-void HsWidgetHost::onAvailable()
-{
-    if (mState != Unloaded) {
-        return;
-    }
-    load();
-    initializeWidget();
-    if (HsScene::instance()->activePage() == mPage) {
-        showWidget();
-    } else {
-        hideWidget();
-    }
-}
-
-
-
-
-
--- a/homescreenapp/hsutils/inc/hsmenuevent.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsutils/inc/hsmenuevent.h	Fri Jun 11 13:30:16 2010 +0300
@@ -40,6 +40,7 @@
         CollectionDeleted,
         AddAppsToCollection,
         RemoveAppFromCollection,
+        UninstallApplication,
         OpenApplicationLibrary,
         OpenInstalledView,
         OpenHomeScreen,
--- a/homescreenapp/hsutils/inc/hsmenueventfactory.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsutils/inc/hsmenueventfactory.h	Fri Jun 11 13:30:16 2010 +0300
@@ -70,6 +70,8 @@
 
     static QEvent *createRemoveAppFromCollectionEvent(int aItemId, int aCollectionId);
 
+    static QEvent *createUninstallApplicationEvent(int aItemId);
+
     static QEvent *createArrangeCollectionEvent(int aTopItemId);
 
     static QEvent *createPreviewHSWidgetEvent(
--- a/homescreenapp/hsutils/src/hsmenueventfactory.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/hsutils/src/hsmenueventfactory.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -207,6 +207,20 @@
 }
 
 /*!
+    Creates an HsMenuEvent::UninstallApplication event.
+
+    \param aItemId Item id of the application to be removed from a collection.
+    \param aCollectionId Item id of the collection the application is to be removed from.
+    \return UninstallApplication event.
+ */
+QEvent *HsMenuEventFactory::createUninstallApplicationEvent(int aItemId)
+{
+    QVariantMap params;
+    params.insert(itemIdKey(), aItemId);
+    return new HsMenuEvent(HsMenuEvent::UninstallApplication, params);
+}
+
+/*!
     Creates an HsMenuEvent::ArrangeCollection event.
 
     \param aTopItemId Item id to be scrolled.
--- a/homescreenapp/inc/hsapp_defs.inl	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/inc/hsapp_defs.inl	Fri Jun 11 13:30:16 2010 +0300
@@ -212,7 +212,7 @@
 */
 inline const QString newIconId()
 {
-    static const QString name("qtg_large_super_new");
+    static const QString name("qtg_small_new_event");
     return name;
 }
 
--- a/homescreenapp/sis/homescreenapp_ut_hs.pkg	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/sis/homescreenapp_ut_hs.pkg	Fri Jun 11 13:30:16 2010 +0300
@@ -33,62 +33,59 @@
 "/epoc32/release/armv5/urel/t_hsapplicationexe.exe"                         - "c:/sys/bin/t_hsapplicationexe.exe"
 "/epoc32/data/z/private/10003a3f/import/apps/t_hsapplicationexe_reg.rsc"    - "c:/private/10003a3f/import/apps/t_hsapplicationexe_reg.rsc"
 "/epoc32/data/z/resource/apps/t_hsapplicationexe.rsc"                       - "c:/resource/apps/t_hsapplicationexe.rsc"
-"/epoc32/release/armv5/urel/mockruntimeplugin.dll"     - "c:/sys/bin/mockruntimeplugin.dll"
+"/epoc32/release/armv5/urel/mockruntimeplugin.dll"                                                  - "c:/sys/bin/mockruntimeplugin.dll"
 "/epoc32/data/z/private/20022f5f/hsresources/plugins/runtimeplugins/mockruntimeplugin.qtplugin"     - "c:/private/20022f5f/hsresources/plugins/runtimeplugins/mockruntimeplugin.qtplugin"
-"/epoc32/data/z/private/20022f5f/hsresources/plugins/runtimeplugins/mockruntimeplugin.xml"  - "c:/private/20022f5f/hsresources/plugins/runtimeplugins/mockruntimeplugin.xml"
+"/epoc32/data/z/private/20022f5f/hsresources/plugins/runtimeplugins/mockruntimeplugin.xml"          - "c:/private/20022f5f/hsresources/plugins/runtimeplugins/mockruntimeplugin.xml"
 
 ;--------------- hsutils ---------------
 "/epoc32/release/armv5/urel/t_hsutils.exe"                         - "c:/sys/bin/t_hsutils.exe"
 "/epoc32/data/z/private/10003a3f/import/apps/t_hsutils_reg.rsc"    - "c:/private/10003a3f/import/apps/t_hsutils_reg.rsc"
 "/epoc32/data/z/resource/apps/t_hsutils.rsc"                       - "c:/resource/apps/t_hsutils.rsc"
-"../hsutils/tsrc/t_hsutils/nokia.png"       - "C:/hsresources/testresources/nokia.png"
-"../hsutils/tsrc/t_hsutils/large.jpg"       - "C:/hsresources/testresources/large.jpg"
+"../hsutils/tsrc/t_hsutils/nokia.png"                              - "c:/hsresources/testresources/nokia.png"
+"../hsutils/tsrc/t_hsutils/large.jpg"                              - "c:/hsresources/testresources/large.jpg"
 
 ;--------------- hsdomainmodel ---------------
-
 "/epoc32/release/armv5/urel/t_hsdomainmodel.exe"                         - "c:/sys/bin/t_hsdomainmodel.exe"
 "/epoc32/data/z/private/10003a3f/import/apps/t_hsdomainmodel_reg.rsc"    - "c:/private/10003a3f/import/apps/t_hsdomainmodel_reg.rsc"
 "/epoc32/data/z/resource/apps/t_hsdomainmodel.rsc"                       - "c:/resource/apps/t_hsdomainmodel.rsc"
 
 
-"../hsdomainmodel/tsrc/t_hsdomainmodel/hsdomainmodeltest.db" - "c:/private/20022F59/hsdomainmodeltest.db"
-"../hsdomainmodel/tsrc/t_hsdomainmodel/d_landscape.png" - "c:/private/20022F59/d_landscape.png"
-"../hsdomainmodel/tsrc/t_hsdomainmodel/d_portrait.png" - "c:/private/20022F59/d_portrait.png"
+"../hsdomainmodel/tsrc/t_hsdomainmodel/hsdomainmodeltest.db"    - "c:/private/20022F59/hsdomainmodeltest.db"
+"../hsdomainmodel/tsrc/t_hsdomainmodel/d_landscape.png"         - "c:/private/20022F59/d_landscape.png"
+"../hsdomainmodel/tsrc/t_hsdomainmodel/d_portrait.png"           - "c:/private/20022F59/d_portrait.png"
 
-"/epoc32/release/armv5/urel/mockwidgetplugin.dll" - "c:/sys/bin/mockwidgetplugin.dll"
-"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.qtplugin" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.qtplugin"
-"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.xml" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.xml"
-"/epoc32/data/z/resource/qt/translations/mockwidgetplugin.qm" - "c:/resource/qt/translations/mockwidgetplugin.qm"
+"/epoc32/release/armv5/urel/mockwidgetplugin.dll"                                               - "c:/sys/bin/mockwidgetplugin.dll"
+"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.qtplugin"   - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.qtplugin"
+"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.xml"        - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.xml"
+"/epoc32/data/z/resource/qt/translations/mockwidgetplugin.qm"                                   - "c:/resource/qt/translations/mockwidgetplugin.qm"
 
-"/epoc32/release/armv5/urel/mockwidgetplugintoosmall.dll" - "c:/sys/bin/mockwidgetplugintoosmall.dll"
-"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.qtplugin" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.qtplugin"
-"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.xml" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.xml"
+"/epoc32/release/armv5/urel/mockwidgetplugintoosmall.dll"                                               - "c:/sys/bin/mockwidgetplugintoosmall.dll"
+"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.qtplugin"   - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.qtplugin"
+"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.xml"        - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoosmall.xml"
 
-"/epoc32/release/armv5/urel/mockwidgetplugintoobig.dll" - "c:/sys/bin/mockwidgetplugintoobig.dll"
+"/epoc32/release/armv5/urel/mockwidgetplugintoobig.dll"                                             - "c:/sys/bin/mockwidgetplugintoobig.dll"
 "/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoobig.qtplugin" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoobig.qtplugin"
-"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoobig.xml" - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoobig.xml"
+"/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoobig.xml"      - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugintoobig.xml"
 
 
 ;--------------- runtimeplugins ---------------
 ;hsdefaultruntimeplugin
-"/epoc32/release/armv5/urel/t_hsdefaultruntimeplugin.exe"                  - "c:/sys/bin/t_hsdefaultruntimeplugin.exe"
-"/epoc32/data/z/private/10003a3f/import/apps/t_hsdefaultruntimeplugin_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsdefaultruntimeplugin_reg.rsc"
-"/epoc32/data/z/resource/apps/t_hsdefaultruntimeplugin.rsc"                - "c:/resource/apps/t_hsdefaultruntimeplugin.rsc"
-"/epoc32/release/armv5/urel/mockstateplugins.dll"     - "c:/sys/bin/mockstateplugins.dll"
-"/epoc32/data/z/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.qtplugin"     - "c:/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.qtplugin"
-"/epoc32/data/z/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.xml"  - "c:/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.xml"
+"/epoc32/release/armv5/urel/t_hsdefaultruntimeplugin.exe"                                       - "c:/sys/bin/t_hsdefaultruntimeplugin.exe"
+"/epoc32/data/z/private/10003a3f/import/apps/t_hsdefaultruntimeplugin_reg.rsc"                  - "c:/private/10003a3f/import/apps/t_hsdefaultruntimeplugin_reg.rsc"
+"/epoc32/data/z/resource/apps/t_hsdefaultruntimeplugin.rsc"                                     - "c:/resource/apps/t_hsdefaultruntimeplugin.rsc"
+"/epoc32/release/armv5/urel/mockstateplugins.dll"                                               - "c:/sys/bin/mockstateplugins.dll"
+"/epoc32/data/z/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.qtplugin"    - "c:/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.qtplugin"
+"/epoc32/data/z/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.xml"         - "c:/private/20022f63/hsresources/plugins/stateplugins/mockstateplugins.xml"
 
 ;--------------- serviceproviders ---------------
 
 ;--------------- stateplugins ---------------
-
 ;hshomescreenstateplugin
 "/epoc32/release/armv5/urel/t_hshomescreenstateplugin.exe"                         - "c:/sys/bin/t_hshomescreenstateplugin.exe"
 "/epoc32/data/z/private/10003a3f/import/apps/t_hshomescreenstateplugin_reg.rsc"    - "c:/private/10003a3f/import/apps/t_hshomescreenstateplugin_reg.rsc"
 "/epoc32/data/z/resource/apps/t_hshomescreenstateplugin.rsc"                       - "c:/resource/apps/t_hshomescreenstateplugin.rsc"
 
 ;--------------- widgetplugins ---------------
-
 ;hsshortcutwidgetlugin
 ;t_hsshortcutwidget:
 "/epoc32/release/armv5/urel/t_hsshortcutwidget.exe"                         - "c:/sys/bin/t_hsshortcutwidget.exe"
@@ -100,3 +97,21 @@
 "/epoc32/release/armv5/urel/t_hsclockwidgetplugin.exe"                      - "c:/sys/bin/t_hsclockwidgetplugin.exe"
 "/epoc32/data/z/private/10003a3f/import/apps/t_hsclockwidgetplugin_reg.rsc" - "c:/private/10003a3f/import/apps/t_hsclockwidgetprovider_reg.rsc"
 "/epoc32/data/z/resource/apps/t_hsclockwidgetplugin.rsc"                    - "c:/resource/apps/t_hsclockwidgetprovider.rsc"
+
+;--------------- hshomescreenclientplugin -----------------------
+;hshomescreenclientplugin
+;"/epoc32/release/armv5/urel/t_hshomescreenclientplugin.exe"                       - "c:/sys/bin/t_hshomescreenclientplugin.exe"
+;"/epoc32/data/z/private/10003a3f/import/apps/t_hshomescreenclientplugin_reg.rsc"  - "c:/private/10003a3f/import/apps/t_hshomescreenclientplugin_reg.rsc"
+;"/epoc32/data/z/resource/apps/t_hshomescreenclientplugin.rsc"                     - "c:/resource/apps/t_hshomescreenclientplugin.rsc"
+
+;--------------- hswidgetuninstaller -----------------------
+;hswidgetuninstaller
+"/epoc32/release/armv5/urel/t_hswidgetuninstaller.exe"                      - "c:/sys/bin/t_hswidgetuninstaller.exe"
+"/epoc32/data/z/private/10003a3f/import/apps/t_hswidgetuninstaller_reg.rsc" - "c:/private/10003a3f/import/apps/t_hswidgetuninstaller_reg.rsc"
+"/epoc32/data/z/resource/apps/t_hswidgetuninstaller.rsc"                    - "c:/resource/apps/t_hswidgetuninstaller.rsc"
+"../hswidgetuninstaller/tsrc/t_hswidgetuninstaller/empty.manifest"          - "c:/private/20022F42/empty.manifest"
+"../hswidgetuninstaller/tsrc/t_hswidgetuninstaller/fail_new.manifest"       - "c:/private/20022F42/fail_new.manifest"
+"../hswidgetuninstaller/tsrc/t_hswidgetuninstaller/ok_new.manifest"         - "c:/private/20022F42/ok_new.manifest"
+"../hswidgetuninstaller/tsrc/t_hswidgetuninstaller/ok_old.manifest"         - "c:/private/20022F42/ok_old.manifest"
+"../hswidgetuninstaller/tsrc/t_hswidgetuninstaller/version10.manifest"      - "c:/private/20022F42/version10.manifest"
+"../hswidgetuninstaller/tsrc/t_hswidgetuninstaller/version12.manifest"      - "c:/private/20022F42/version12.manifest"
\ No newline at end of file
Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary.confml has changed
Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary_20022F97.crml has changed
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h	Fri Jun 11 13:30:16 2010 +0300
@@ -69,6 +69,9 @@
     void latestOnTopMenuAction();
     void oldestOnTopMenuAction();
     void contextMenuAction(HbAction *action);
+    void handleEmptyChange(bool empty);
+    void lockSearchButton(bool lock);
+
 private:
     void construct();
     void constructMenu(bool isDynamic);
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsinstalledappsstate.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsinstalledappsstate.h	Fri Jun 11 13:30:16 2010 +0300
@@ -66,6 +66,8 @@
 
     void stateExited();
 
+    void setEmptyLabelVisibility(bool visibility);
+
     void contextMenuAction(HbAction *action);
 
 private:
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuview.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuview.h	Fri Jun 11 13:30:16 2010 +0300
@@ -51,10 +51,13 @@
     ~HsMenuView();
 
     void setSearchPanelVisible(bool visible);
+    void setContext(HsViewContext viewContext,
+                    HsOperationalContext context);
 
     HbView *view() const;
 
     HbListView *listView() const;
+    HbPushButton *collectionButton() const;
 
     void activate();
     void inactivate();
@@ -77,6 +80,8 @@
     void showSearchPanel();
     void hideSearchPanel();
 
+    void disableSearch(bool disable);
+
 
 private slots:
     void scrollToRow(int row,
@@ -120,6 +125,8 @@
     HbSearchPanel *mSearchPanel;
     HbStaticVkbHost* mVkbHost;
 
+    HbPushButton *mCollectionButton;
+
     HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
 };
 
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h	Fri Jun 11 13:30:16 2010 +0300
@@ -24,6 +24,7 @@
 #include <QString>
 #include <qnamespace.h>
 #include <HbDocumentLoader>
+#include "hsmenustates_global.h"
 
 class QActionGroup;
 class HbAction;
@@ -35,6 +36,7 @@
 class HbView;
 class HbWidget;
 class HbToolBarExtension;
+class HbPushButton;
 
 enum HsViewContext {
     HsAllAppsContext,
@@ -45,9 +47,12 @@
 
 enum HsOperationalContext {
     HsItemViewContext,
-    HsSearchContext
+    HsSearchContext,
+    HsButtonContext,
+    HsEmptyLabelContext
 };
 
+HS_STATES_TEST_CLASS(MenuStatesTest)
 
 class HsMenuViewBuilder
 {
@@ -73,6 +78,7 @@
     // optional widgets accessors
     HbGroupBox *currentViewLabel() const;
     HbSearchPanel *currentSearchPanel() const;
+    HbPushButton *collectionButton() const;
 
 
     void setViewContext(HsViewContext viewContext);
@@ -99,13 +105,13 @@
     QSet<QObject *> mLoadedObjects;
 
     const QString DOCUMENT_FILE_NAME;
-    const QString COMMON_SECTION_NAME;
     const QString ALL_APPS_ACTION_NAME;
     const QString ALL_COLLECTIONS_ACTION_NAME;
     const QString SEARCH_ACTION_NAME;
     const QString OVI_STORE_ACTION_NAME;
     const QString OPERATOR_ACTION_NAME;
     const QString SEARCH_PANEL_NAME;
+    const QString BUTTON_NAME;
     const QString TOOL_BAR_NAME;
 
     QActionGroup *mToolBarActionGroup;
@@ -115,6 +121,8 @@
 
     HsViewContext mViewContext;
     HsOperationalContext mOperationalContext;
+
+    HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
 };
 
 #endif // HSMENUVIEWBUILDER_H
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/applibrary.docml	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/applibrary.docml	Fri Jun 11 13:30:16 2010 +0300
@@ -1,71 +1,56 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
-
-    <section name="commonDefinitions">
-        <object name="allAppsAction" type="HbAction">
+<hbdocument version="1.0">
+    <object name="allAppsAction" type="HbAction">
         <bool name="checkable" value="TRUE"/>
         <icon iconName="qtg_mono_applications_all" name="icon"/>
-        </object>
-        <object name="allCollectionsAction" type="HbAction">
-            <bool name="checkable" value="TRUE"/>
-            <icon iconName="qtg_mono_applications_collections" name="icon"/>
-        </object>
-        <object name="searchAction" type="HbAction">
-            <icon iconName="qtg_mono_search" name="icon"/>
-        </object>
-        <object name="oviStoreAction" type="HbAction">
-            <icon iconName="qtg_mono_ovistore" name="icon"/>
-        </object>
-        <object name="operatorAction" type="HbAction"/>
-
-        <widget name="view" type="HbView">
-            <widget name="container" role="HbView:widget" type="HbWidget">
-                <widget name="collectionLabel" type="HbGroupBox">
-                    <sizehint height="6un" type="MAXIMUM" width="100un"/>
-                    <string name="heading" value="."/>
-                    <enums name="groupBoxType" value="GroupBoxSimpleLabel"/>
-                    <bool name="marqueeHeading" value="TRUE"/>
-                    <fontspec name="fontSpec" role="Title" textheight="0"/>
-                    <bool name="visible" value="FALSE"/>
-                </widget>
-                <widget name="searchPanel" type="HbSearchPanel">
-                    <bool name="progressive" value="TRUE"/>
-                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
-                    <bool name="visible" value="FALSE"/>
-                </widget>
+    </object>
+    <object name="allCollectionsAction" type="HbAction">
+        <bool name="checkable" value="TRUE"/>
+        <icon iconName="qtg_mono_applications_collections" name="icon"/>
+    </object>
+    <object name="searchAction" type="HbAction">
+        <icon iconName="qtg_mono_search" name="icon"/>
+    </object>
+    <object name="oviStoreAction" type="HbAction">
+        <icon iconName="qtg_mono_ovistore" name="icon"/>
+    </object>
+    <object name="operatorAction" type="HbAction"/>
+    <widget name="view" type="HbView">
+        <widget name="container" role="HbView:widget" type="HbWidget">
+            <widget name="collectionLabel" type="HbGroupBox">
+                <sizehint height="6un" type="MAXIMUM" width="100un"/>
+                <bool name="visible" value="FALSE"/>
+                <string name="heading" value="."/>
+                <bool name="marqueeHeading" value="TRUE"/>
+                <fontspec name="fontSpec" role="Title" textheight="0"/>
+                <integer name="groupBoxType" value="1"/>
             </widget>
-            <!--  no support for toolbar extensions, not defined in docml for now -->
-            <!--widget name="toolBar" role="HbView:toolBar" type="HbToolBar">
-                <enums name="orientation" value="Horizontal"/>
-                <ref object="allAppsAction" role="HbToolBar:addAction"/>
-                <ref object="allCollectionsAction" role="HbToolBar:addAction"/>
-                <ref object="searchAction" role="HbToolBar:addAction"/>
-                <ref object="oviStoreAction" role="HbToolBar:addAction"/>
-                <ref object="operatorAction" role="HbToolBar:addAction"/>
+            <widget name="searchPanel" type="HbSearchPanel">
+                <bool name="progressive" value="TRUE"/>
+                <sizehint height="0un" type="MAXIMUM" width="0un"/>
                 <bool name="visible" value="FALSE"/>
-            </widget-->
-            <bool name="contentFullScreen" value="FALSE"/>
-            <bool name="visible" value="FALSE"/>
+            </widget>
         </widget>
-    </section>
+        <bool name="contentFullScreen" value="FALSE"/>
+        <bool name="visible" value="FALSE"/>
+    </widget>
     <section name="allAppsViewDefinition">
         <widget name="allAppsView" type="HbView">
             <widget name="allAppsContainer" role="HbView:widget" type="HbWidget">
                 <widget name="allAppsListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbListView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="Thumbnail"/>
+                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
+                        <enums name="graphicsSize" value="LargeIcon"/>
                     </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
                     <sizehint height="100un" type="MAXIMUM" width="100un"/>
                     <bool name="frictionEnabled" value="TRUE"/>
                     <bool name="visible" value="TRUE"/>
-	        </widget>
+                </widget>
                 <widget name="searchPanel" type="HbSearchPanel">
                     <sizehint height="0un" type="MAXIMUM" width="0un"/>
                     <bool name="visible" value="FALSE"/>
                 </widget>
-
                 <widget name="allAppsSearchListView" type="HbListView">
                     <bool name="visible" value="FALSE"/>
                 </widget>
@@ -90,8 +75,8 @@
                     <bool name="visible" value="FALSE"/>
                 </widget>
                 <widget name="allAppsSearchListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbListView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="Thumbnail"/>
+                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
+                        <enums name="graphicsSize" value="LargeIcon"/>
                     </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
@@ -113,8 +98,8 @@
         <widget name="allCollectionsView" type="HbView">
             <widget name="allCollectionsContainer" role="HbView:widget" type="HbWidget">
                 <widget name="allCollectionsListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbListView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="Thumbnail"/>
+                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
+                        <enums name="graphicsSize" value="LargeIcon"/>
                     </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
@@ -151,8 +136,8 @@
                     <bool name="visible" value="FALSE"/>
                 </widget>
                 <widget name="allCollectionsSearchListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbListView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="Thumbnail"/>
+                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
+                        <enums name="graphicsSize" value="LargeIcon"/>
                     </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
@@ -176,13 +161,13 @@
                 <widget name="installedAppsLabel" type="HbGroupBox">
                     <sizehint height="6un" type="MAXIMUM" width="100un"/>
                     <string name="heading" value="."/>
-                    <enums name="groupBoxType" value="GroupBoxSimpleLabel"/>
                     <bool name="marqueeHeading" value="TRUE"/>
                     <fontspec name="fontSpec" role="Title" textheight="0"/>
+                    <integer name="groupBoxType" value="1"/>
                 </widget>
                 <widget name="installedAppsListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbListView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="Thumbnail"/>
+                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
+                        <enums name="graphicsSize" value="LargeIcon"/>
                     </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
@@ -198,6 +183,11 @@
                     <sizehint height="0un" type="MAXIMUM" width="0un"/>
                     <bool name="visible" value="FALSE"/>
                 </widget>
+                <widget name="installedAppsEmptyLabel" type="HbLabel">
+                    <sizehint height="0un" type="MINIMUM" width="0un"/>
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
                 <layout orientation="Vertical" type="linear">
                     <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
                     <linearitem itemname="installedAppsLabel"/>
@@ -216,6 +206,7 @@
                     <string name="heading" value="."/>
                     <bool name="marqueeHeading" value="TRUE"/>
                     <fontspec name="fontSpec" role="Title" textheight="0"/>
+                    <integer name="groupBoxType" value="1"/>
                 </widget>
                 <widget name="searchPanel" type="HbSearchPanel">
                     <sizehint height="10un" type="MAXIMUM" width="100un"/>
@@ -226,8 +217,8 @@
                     <bool name="visible" value="FALSE"/>
                 </widget>
                 <widget name="installedAppsSearchListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbListView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="Thumbnail"/>
+                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
+                        <enums name="graphicsSize" value="LargeIcon"/>
                     </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
@@ -235,6 +226,11 @@
                     <bool name="frictionEnabled" value="TRUE"/>
                     <bool name="visible" value="TRUE"/>
                 </widget>
+                <widget name="installedAppsEmptyLabel" type="HbLabel">
+                    <sizehint height="0un" type="MINIMUM" width="0un"/>
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
                 <layout orientation="Vertical" type="linear">
                     <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
                     <linearitem itemname="installedAppsLabel"/>
@@ -246,16 +242,69 @@
             <bool name="contentFullScreen" value="TRUE"/>
         </widget>
     </section>
+    <section name="installedAppsEmptyLabelViewDefinition">
+        <widget name="installedAppsView" type="HbView">
+            <widget name="installedAppsContainer" role="HbView:widget" type="HbWidget">
+                <widget name="installedAppsLabel" type="HbGroupBox">
+                    <sizehint height="6un" type="MAXIMUM" width="100un"/>
+                    <string name="heading" value="."/>
+                    <bool name="marqueeHeading" value="TRUE"/>
+                    <fontspec name="fontSpec" role="Title" textheight="0"/>
+                    <integer name="groupBoxType" value="1"/>
+                </widget>
+                <widget name="installedAppsListView" type="HbListView">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="installedAppsSearchListView" type="HbListView">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="searchPanel" type="HbSearchPanel">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="installedAppsEmpytLabelContainer" type="HbWidget">
+                    <widget name="installedAppsEmptyLabel" type="HbLabel">
+                        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
+                        <sizehint height="10un" type="MINIMUM" width="50un"/>
+                        <sizehint height="10un" type="MAXIMUM" width="50un"/>
+                        <string locid="txt_applib_formlabel_empty" name="plainText"/>
+                        <fontspec name="fontSpec" role="Title" textheight="4un" />
+                        <enums name="elideMode" value="ElideMiddle"/>
+                        <enums name="alignment" value="AlignHCenter"/>
+                        <bool name="visible" value="TRUE"/>
+                    </widget>
+                    <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
+                    <layout orientation="Horizontal" type="linear">
+                        <stretchitem stretchfactor="1"/>
+                        <linearitem itemname="installedAppsEmptyLabel"/>
+                        <stretchitem stretchfactor="1"/>
+                    </layout>
+                </widget>
+                <layout orientation="Vertical" type="linear">
+                    <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                    <linearitem itemname="installedAppsLabel"/>
+                    <stretchitem stretchfactor="1"/>
+                    <linearitem itemname="installedAppsEmpytLabelContainer"/>
+                    <stretchitem stretchfactor="5"/>
+                </layout>
+            </widget>
+            <string locid="txt_applib_title_applications" name="title"/>
+            <bool name="contentFullScreen" value="FALSE"/>
+        </widget>
+    </section>
     <section name="collectionViewDefinition">
         <widget name="collectionView" type="HbView">
             <widget name="collectionContainer" role="HbView:widget" type="HbWidget">
                 <widget name="collectionLabel" type="HbGroupBox">
                     <sizehint height="6un" type="MAXIMUM" width="100un"/>
                     <bool name="visible" value="TRUE"/>
+                    <integer name="groupBoxType" value="1"/>
                 </widget>
                 <widget name="collectionListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbListView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="Thumbnail"/>
+                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
+                        <enums name="graphicsSize" value="LargeIcon"/>
                     </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
@@ -271,6 +320,16 @@
                     <sizehint height="0un" type="MAXIMUM" width="0un"/>
                     <bool name="visible" value="FALSE"/>
                 </widget>
+                <widget name="collectionButton" type="HbPushButton">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <string locid="txt_applib_button_add_to_collection" name="text"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="collectionAppsEmptyLabel" type="HbLabel">
+                    <sizehint height="0un" type="MINIMUM" width="0un"/>
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>                
                 <layout orientation="Vertical" type="linear">
                     <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
                     <linearitem itemname="collectionLabel"/>
@@ -287,18 +346,19 @@
                 <widget name="collectionLabel" type="HbGroupBox">
                     <sizehint height="6un" type="MAXIMUM" width="100un"/>
                     <bool name="visible" value="TRUE"/>
+                    <integer name="groupBoxType" value="1"/>
                 </widget>
                 <widget name="searchPanel" type="HbSearchPanel">
+                    <sizehint height="10un" type="MAXIMUM" width="100un"/>
                     <bool name="visible" value="TRUE"/>
-                    <sizehint height="10un" type="MAXIMUM" width="100un"/>
                 </widget>
                 <widget name="collectionListView" type="HbListView">
                     <sizehint height="0un" type="MAXIMUM" width="0un"/>
                     <bool name="visible" value="FALSE"/>
                 </widget>
                 <widget name="collectionSearchListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbListView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="Thumbnail"/>
+                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
+                        <enums name="graphicsSize" value="LargeIcon"/>
                     </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
@@ -306,6 +366,15 @@
                     <bool name="frictionEnabled" value="TRUE"/>
                     <bool name="visible" value="TRUE"/>
                 </widget>
+                <widget name="collectionButton" type="HbPushButton">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="collectionAppsEmptyLabel" type="HbLabel">
+                    <sizehint height="0un" type="MINIMUM" width="0un"/>
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
                 <layout orientation="Vertical" type="linear">
                     <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
                     <linearitem itemname="collectionLabel"/>
@@ -317,16 +386,147 @@
             <bool name="contentFullScreen" value="TRUE"/>
         </widget>
     </section>
-    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
-        <uistate name="Common ui state" sections="#common commonDefinition"/>
+    <section name="collectionButtonViewDefinition">
+        <widget name="collectionView" type="HbView">
+            <widget name="collectionContainer" role="HbView:widget" type="HbWidget">
+                <widget name="collectionLabel" type="HbGroupBox">
+                    <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                    <sizehint height="6un" type="MAXIMUM" width="100un"/>
+                    <bool name="visible" value="TRUE"/>
+                    <integer name="groupBoxType" value="1"/>
+                </widget>
+                <widget name="collectionListView" type="HbListView">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="collectionSearchListView" type="HbListView">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="searchPanel" type="HbSearchPanel">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="collectionButtonContainer" type="HbWidget">
+                    <widget name="collectionButton" type="HbPushButton">
+                        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                        <sizehint type="FIXED" width="50un"/>
+                        <sizehint height="10un" type="MINIMUM" width="50un"/>
+                        <sizehint height="10un" type="MAXIMUM" width="50un"/>
+                        <bool name="visible" value="TRUE"/>
+                    </widget>
+                    <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
+                    <layout orientation="Horizontal" type="linear">
+                        <stretchitem stretchfactor="1"/>
+                        <linearitem itemname="collectionButton"/>
+                        <stretchitem stretchfactor="1"/>
+                    </layout>
+                </widget>
+                <widget name="collectionAppsEmptyLabel" type="HbLabel">
+                    <sizehint height="0un" type="MINIMUM" width="0un"/>
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <layout orientation="Vertical" type="linear">
+                    <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                    <linearitem itemname="collectionLabel"/>
+                    <stretchitem stretchfactor="1"/>
+                    <linearitem itemname="collectionButtonContainer"/>
+                    <stretchitem stretchfactor="5"/>
+                </layout>
+            </widget>
+            <string locid="txt_applib_title_applications" name="title"/>
+            <bool name="contentFullScreen" value="FALSE"/>
+        </widget>
+    </section>
+    <section name="collectionEmptyLabelViewDefinition">
+        <widget name="collectionView" type="HbView">
+            <widget name="collectionContainer" role="HbView:widget" type="HbWidget">
+                <widget name="collectionLabel" type="HbGroupBox">
+                    <sizehint height="6un" type="MAXIMUM" width="100un"/>
+                    <bool name="visible" value="TRUE"/>
+                    <integer name="groupBoxType" value="1"/>
+                </widget>
+                <widget name="collectionListView" type="HbListView">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="collectionSearchListView" type="HbListView">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="searchPanel" type="HbSearchPanel">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="collectionButton" type="HbPushButton">
+                    <sizehint height="0un" type="MAXIMUM" width="0un"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="collectionEmpytLabelContainer" type="HbWidget">
+                    <widget name="collectionAppsEmptyLabel" type="HbLabel">
+                        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
+                        <sizehint height="10un" type="MINIMUM" width="50un"/>
+                        <sizehint height="10un" type="MAXIMUM" width="50un"/>
+                        <string locid="txt_applib_formlabel_empty" name="plainText"/>
+                        <fontspec name="fontSpec" role="Title" textheight="4un"/>
+                        <enums name="elideMode" value="ElideMiddle"/>
+                        <enums name="alignment" value="AlignHCenter"/>                        
+                        <bool name="visible" value="TRUE"/>
+                    </widget>
+                    <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
+                    <layout orientation="Horizontal" type="linear">
+                        <stretchitem stretchfactor="1"/>
+                        <linearitem itemname="collectionAppsEmptyLabel"/>
+                        <stretchitem stretchfactor="1"/>
+                    </layout>
+                </widget>
+                <layout orientation="Vertical" type="linear">
+                    <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                    <linearitem itemname="collectionLabel"/>
+                    <stretchitem stretchfactor="1"/>
+                    <linearitem itemname="collectionEmpytLabelContainer"/>
+                    <stretchitem stretchfactor="5"/>
+                </layout>
+            </widget>
+            <string locid="txt_applib_title_applications" name="title"/>
+            <bool name="contentFullScreen" value="FALSE"/>
+        </widget>
+    </section>
+    <metadata activeUIState="collection view with empty label state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
         <uistate name="all apps view state" sections="#common commonDefinition allAppsViewDefinition"/>
         <uistate name="all apps search view state" sections="#common commonDefinition allAppsSearchViewDefinition"/>
         <uistate name="all collections view state" sections="#common commonDefinition allCollectionsViewDefinition"/>
         <uistate name="all collections search view state" sections="#common commonDefinition allCollectionsSearchViewDefinition"/>
         <uistate name="installed apps view state" sections="#common commonDefinition installedAppsViewDefinition"/>
         <uistate name="installed apps search view state" sections="#common commonDefinition installedAppsSearchViewDefinition"/>
+        <uistate name="installed apps empty view state" sections="#common commonDefinition installedAppsEmptyLabelViewDefinition"/>
         <uistate name="collection view state" sections="#common commonDefinition collectionViewDefinition"/>
         <uistate name="collection search view state" sections="#common commonDefinition collectionSearchViewDefinition"/>
-        <dummydata objectName="allAppsSearchListView" section="allAppsSearchViewDefinition" value="app_list_template4"/>
+        <uistate name="collection view with button state" sections="#common commonDefinition collectionButtonViewDefinition"/>
+        <uistate name="collection view with empty label state" sections="#common commonDefinition collectionEmptyLabelViewDefinition"/>
+        <dummydata objectName="allAppsListView" section="allAppsViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="allAppsSearchListView" section="allAppsViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="allAppsListView" section="allAppsSearchViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="allAppsSearchListView" section="allAppsSearchViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="allCollectionsSearchListView" section="allCollectionsViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="allCollectionsListView" section="allCollectionsViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="allCollectionsSearchListView" section="allCollectionsSearchViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="allCollectionsListView" section="allCollectionsSearchViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="installedAppsListView" section="installedAppsViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="installedAppsSearchListView" section="installedAppsViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="installedAppsListView" section="installedAppsSearchViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="installedAppsSearchListView" section="installedAppsSearchViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="installedAppsListView" section="installedAppsEmptyLabelViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="installedAppsSearchListView" section="installedAppsEmptyLabelViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="collectionListView" section="collectionViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="collectionSearchListView" section="collectionViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="collectionListView" section="collectionSearchViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="collectionSearchListView" section="collectionSearchViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="collectionListView" section="collectionButtonViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="collectionSearchListView" section="collectionButtonViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="collectionListView" section="collectionEmptyLabelViewDefinition" value="app_list_template5"/>
+        <dummydata objectName="collectionSearchListView" section="collectionEmptyLabelViewDefinition" value="app_list_template5"/>
     </metadata>
 </hbdocument>
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -355,6 +355,8 @@
     // check conditions and hide irrelevant menu items
 
     QSharedPointer<const CaEntry> entry = mAllAppsModel->entry(item->modelIndex());
+    EntryFlags flags = item->modelIndex().data(
+                           CaItemModel::FlagsRole).value<EntryFlags> ();
 
     if (!(entry->attribute(appSettingsPlugin()).isEmpty())) {
         appSettingsAction = mContextMenu->addAction(hbTrId(
@@ -362,14 +364,11 @@
         appSettingsAction->setData(AppSettingContextAction);
     }
     if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && 
-                entry->entryTypeName() == applicationTypeName() ) {
+            (flags & RemovableEntryFlag) ) {
         appDetailsAction = mContextMenu->addAction(hbTrId(
                                                 "txt_common_menu_details"));
         appDetailsAction->setData(AppDetailsContextAction);
-    }    
-    
-    EntryFlags flags = item->modelIndex().data(
-                           CaItemModel::FlagsRole).value<EntryFlags> ();
+    }        
 
     if (!(flags & RemovableEntryFlag)) {
         uninstallAction->setVisible(false);
@@ -406,7 +405,9 @@
                     mSortAttribute, mCollectionsSortAttribute, itemId));
             break;
         case UninstallContextAction:
-            HsMenuService::executeAction(itemId, removeActionIdentifier());
+            machine()->postEvent(
+                HsMenuEventFactory::createUninstallApplicationEvent(
+                    itemId));
             break;
         case AppSettingContextAction: 
             machine()->postEvent(
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -349,9 +349,6 @@
 {
     HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::listItemLongPressed");
 
-
-    const int itemId = item->modelIndex().data(CaItemModel::IdRole).toInt();
-
     mContextMenu = new HbMenu;
 
     // create context menu
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -19,6 +19,7 @@
 
 #include <HbGroupBox>
 #include <HbListView>
+#include <HbPushButton>
 #include <hbview.h>
 #include <hbaction.h>
 #include <hbabstractviewitem.h>
@@ -140,17 +141,16 @@
 void HsCollectionState::construct()
 {
     HSMENUTEST_FUNC_ENTRY("HsCollectionState::construct");
+
     const QString parentName =
         parent() != 0 ? parent()->objectName() : QString("");
     setObjectName(parentName + "/collectionstate");
 
-
     connect(this, SIGNAL(entered()),SLOT(stateEntered()));
     connect(this, SIGNAL(exited()),SLOT(stateExited()));
 
     makeConnect();
-    mMenuView.view()->
-    setNavigationAction(mSecondarySoftkeyAction);
+    mMenuView.view()->setNavigationAction(mSecondarySoftkeyAction);
 
     HSMENUTEST_FUNC_EXIT("HsCollectionState::construct");
 }
@@ -207,7 +207,27 @@
                 mCollectionId, mSortAttribute, mCollectionType);
     }
     
+    EntryFlags flags =
+        mCollectionModel->root().data(CaItemModel::FlagsRole).value<
+        EntryFlags> ();
+
+    if (mCollectionModel->rowCount() == 0){
+        if (flags & RemovableEntryFlag){
+            mMenuView.setContext(HsCollectionContext,HsButtonContext);
+        } else {
+            mMenuView.setContext(HsCollectionContext,HsEmptyLabelContext);
+        }
+        mMenuView.disableSearch(true);
+    } else {
+        mMenuView.setContext(HsCollectionContext,HsItemViewContext);
+        mMenuView.disableSearch(false);
+    }
+
     connect(mCollectionModel, SIGNAL(modelReset()), SLOT(updateLabel()));
+    connect(mCollectionModel, SIGNAL(empty(bool)),this,
+            SLOT(handleEmptyChange(bool)));
+    connect(mCollectionModel, SIGNAL(empty(bool)),this,
+            SLOT(lockSearchButton(bool)));
 
     mMenuView.setModel(mCollectionModel);
 
@@ -223,10 +243,6 @@
                             this,
                             SLOT(openTaskSwitcher()));
 
-        EntryFlags flags =
-            mCollectionModel->root().data(CaItemModel::FlagsRole).value<
-            EntryFlags> ();
-
         if (flags & RemovableEntryFlag) {
             mOptions->addAction(hbTrId("txt_applib_opt_add_content"), this,
                                 SLOT(addAppsAction()));
@@ -280,8 +296,15 @@
 {
     HSMENUTEST_FUNC_ENTRY("HsCollectionState::stateExited");
 
+    mMenuView.inactivate();
     mMenuView.setSearchPanelVisible(false);
-    mMenuView.inactivate();
+    mMenuView.disableSearch(false);
+    disconnect(mCollectionModel, SIGNAL(empty(bool)),this,
+               SLOT(handleEmptyChange(bool)));
+
+    disconnect(mCollectionModel, SIGNAL(empty(bool)),this,
+               SLOT(lockSearchButton(bool)));
+
     disconnect(mCollectionModel, SIGNAL(modelReset()),
                    this, SLOT(updateLabel()));
     delete mCollectionModel;
@@ -308,6 +331,9 @@
     connect(&mMenuView,
             SIGNAL(longPressed(HbAbstractViewItem *, QPointF)),
             SLOT(listItemLongPressed(HbAbstractViewItem *, QPointF)));
+    connect(mMenuView.collectionButton(),
+            SIGNAL(released()), this, SLOT(addAppsAction()));
+
 }
 
 /*!
@@ -315,6 +341,9 @@
  */
 void HsCollectionState::makeDisconnect()
 {
+    disconnect(mMenuView.collectionButton(),
+            SIGNAL(pressed()), this, SLOT(addAppsAction()));
+
     disconnect(mSecondarySoftkeyAction, SIGNAL(triggered()),
                this, SLOT(backSteppingAction()));
 
@@ -416,7 +445,7 @@
     }
     
     if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && 
-                entry->entryTypeName() == applicationTypeName() ) {
+            (flags & RemovableEntryFlag) ) {
         appDetailsAction = mContextMenu->addAction(hbTrId(
                                                 "txt_common_menu_details"));
         appDetailsAction->setData(AppDetailsContextAction);
@@ -450,7 +479,9 @@
                     mCollectionId, itemId, mCollectionsSortAttribute));
             break;
         case UninstallContextAction:
-            HsMenuService::executeAction(itemId, removeActionIdentifier());
+            machine()->postEvent(
+                HsMenuEventFactory::createUninstallApplicationEvent(
+                    itemId));
             break;
         case RemoveFromCollectionContextAction:
             machine()->postEvent(
@@ -473,6 +504,36 @@
 }
 
 /*!
+ Handles button visibility
+ */
+void HsCollectionState::handleEmptyChange(bool empty)
+{
+    EntryFlags flags =
+        mCollectionModel->root().data(CaItemModel::FlagsRole).value<
+        EntryFlags> ();
+
+    if (empty){
+        if (flags & RemovableEntryFlag){
+            mMenuView.setContext(HsCollectionContext,HsButtonContext);
+        } else {
+            mMenuView.setContext(HsCollectionContext,HsEmptyLabelContext);
+        }
+    } else {
+        mMenuView.setContext(HsCollectionContext,HsItemViewContext);
+    }
+}
+
+
+/*!
+ Handles lock serch button
+ */
+void HsCollectionState::lockSearchButton(bool lock)
+{
+    mMenuView.disableSearch(lock);
+}
+
+
+/*!
  Menu add applications action slot
  */
 void HsCollectionState::addAppsAction()
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -158,6 +158,10 @@
         mMenuView.setModel(mInstalledAppsModel);
     }
 
+    if (mInstalledAppsModel->rowCount() == 0){
+        mMenuView.setContext(HsInstalledAppsContext,HsEmptyLabelContext);
+        }
+
     mMenuView.listView()->scrollTo(
         mInstalledAppsModel->index(0));
 
@@ -168,6 +172,9 @@
             SIGNAL(longPressed(HbAbstractViewItem *, QPointF)),
             SLOT(listItemLongPressed(HbAbstractViewItem *, QPointF)));
 
+    connect(mInstalledAppsModel, SIGNAL(empty(bool)),this,
+            SLOT(setEmptyLabelVisibility(bool)));
+
     mMenuView.viewLabel()->setHeading(
         hbTrId("txt_applib_subtitle_installed"));
 
@@ -181,6 +188,9 @@
 {
     HSMENUTEST_FUNC_ENTRY("HsInstalledAppsState::stateExited");
 
+    disconnect(mInstalledAppsModel, SIGNAL(empty(bool)),this,
+               SLOT(setEmptyLabelVisibility(bool)));
+
     mMenuView.setSearchPanelVisible(false);
     mMenuView.inactivate();
 
@@ -192,6 +202,18 @@
 }
 
 /*!
+ Handles button visibility
+ */
+void HsInstalledAppsState::setEmptyLabelVisibility(bool visibility)
+{
+    if(visibility){
+        mMenuView.setContext(HsInstalledAppsContext,HsEmptyLabelContext);
+    } else {
+        mMenuView.setContext(HsInstalledAppsContext,HsItemViewContext);
+    }
+}
+
+/*!
  Open task switcher.
  \retval true if operation is successful.
  */
@@ -233,7 +255,19 @@
 
     HbAction *uninstallAction = mContextMenu->addAction(
                                     hbTrId("txt_common_menu_delete"));
+    HbAction *appDetailsAction(NULL);
     uninstallAction->setData(UninstallContextAction);
+    
+    QSharedPointer<const CaEntry> entry = mInstalledAppsModel->entry(item->modelIndex());
+    EntryFlags flags = item->modelIndex().data(
+                           CaItemModel::FlagsRole).value<EntryFlags> ();
+    
+    if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && 
+            (flags & RemovableEntryFlag) ) {
+        appDetailsAction = mContextMenu->addAction(hbTrId(
+                                                "txt_common_menu_details"));
+        appDetailsAction->setData(AppDetailsContextAction);
+    }      
 
     mContextModelIndex = item->modelIndex();
     mContextMenu->setPreferredPos(coords);
@@ -251,13 +285,25 @@
  Handles context menu actions
  */
 void HsInstalledAppsState::contextMenuAction(HbAction *action)
-{
-    HsContextAction command = static_cast<HsContextAction>(action->data().toInt());
-    if (command == UninstallContextAction) {
-        const int itemId = mContextModelIndex.data(
-                                   CaItemModel::IdRole).toInt();
-        HsMenuService::executeAction(itemId, removeActionIdentifier());
-    }   
+{    
+    HsContextAction command = 
+            static_cast<HsContextAction>(action->data().toInt());
+    
+    const int itemId = mContextModelIndex.data(CaItemModel::IdRole).toInt();
+    
+    switch (command) {
+        case UninstallContextAction:
+            machine()->postEvent(
+                HsMenuEventFactory::createUninstallApplicationEvent(
+                    itemId));
+            break;
+        case AppDetailsContextAction: 
+            machine()->postEvent(
+                HsMenuEventFactory::createAppDetailsViewEvent(itemId));
+            break;            
+        default:
+            break;            
+    }
     mMenuView.setSearchPanelVisible(false);
 }
 
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -24,6 +24,7 @@
 #include <HbMainWindow>
 #include <HbInstance>
 #include <HbSearchPanel>
+#include <HbPushButton>
 #include <HbToolBar>
 #include <HbView>
 #include <HbToolBarExtension>
@@ -74,6 +75,8 @@
     mListView = mBuilder.currentListView();
     mViewLabel= mBuilder.currentViewLabel();
 
+    mCollectionButton = mBuilder.collectionButton();
+
     mProxyModel->setFilterRole(CaItemModel::TextRole);
     mProxyModel->setFilterKeyColumn(1);
     mProxyModel->setSortRole(CaItemModel::TextRole);
@@ -186,6 +189,20 @@
 }
 
 /*!
+    Makes the UI to show or hide view add collection button
+    \param visibility When true button will be shown,
+     otherwise it will be hidden.
+ */
+void HsMenuView::setContext(HsViewContext viewContext,
+                            HsOperationalContext context)
+{
+    mBuilder.setViewContext(viewContext);
+    mBuilder.setOperationalContext(context);
+    mBuilder.build();
+}
+
+
+/*!
 \return View widget of the menu view.
  */
 HbView *HsMenuView::view() const
@@ -202,6 +219,14 @@
 }
 
 /*!
+\return Collection button
+ */
+HbPushButton *HsMenuView::collectionButton() const
+{
+    return mCollectionButton;
+}
+
+/*!
  Makes search panel visible.
  Equivalent to \a setSearchPanelVisible(true)
  */
@@ -232,6 +257,15 @@
 #endif //COVERAGE_MEASUREMENT
 
 /*!
+ Disable or enable search action button.
+ \param disable If true action is disabled.
+ */
+void HsMenuView::disableSearch(bool disable)
+{
+    mBuilder.searchAction()->setDisabled(disable);
+}
+
+/*!
  Scrolls item view to requested row.
  \param row The row which is to get at the position pointed by \a hint.
  \param hint Position in the view the row should be scrolled to.
@@ -336,6 +370,8 @@
     HSMENUTEST_FUNC_ENTRY("hsmenuview::findItem");
 
     if ("" != criteriaStr) {
+        mProxyModel->invalidate();
+        mProxyModel->setSourceModel(mListView->model());
         mProxyModel->setFilterRegExp(QRegExp(criteriaStr,
                                              Qt::CaseInsensitive, QRegExp::FixedString));
         mSearchListView->scrollTo(mProxyModel->index(0,0),
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -23,6 +23,7 @@
 #include <HbListView>
 #include <HbLineEdit>
 #include <HbSearchPanel>
+#include <HbPushButton>
 #include <HbToolBar>
 #include <HbView>
 #include <HbWidget>
@@ -83,7 +84,6 @@
     if (view != NULL && mViewContext != HsInstalledAppsContext) {
         view->setToolBar(mToolBar);
     }
-
     return view;
 }
 
@@ -95,9 +95,11 @@
  */
 HbListView *HsMenuViewBuilder::currentListView() const
 {
-    const QString LIST_VIEW_NAME = mViewContextToStringMap[mViewContext]
-                                   + mOperationalContextToStringMap[mOperationalContext]
-                                   + "ListView";
+    QString LIST_VIEW_NAME = mViewContextToStringMap[mViewContext];
+    if (mOperationalContext == HsSearchContext) {
+        LIST_VIEW_NAME.append(mOperationalContextToStringMap[mOperationalContext]);
+    }
+    LIST_VIEW_NAME.append("ListView");
 
     return qobject_cast<HbListView *>(
                mDocumentLoader.findWidget(LIST_VIEW_NAME));
@@ -131,6 +133,17 @@
 }
 
 /*!
+ \return pointer to a button
+ The pointer is valid until the HsMenuViewBuilder instance is destroyed.
+ Memory ownership is not changed.
+ */
+HbPushButton *HsMenuViewBuilder::collectionButton() const
+{
+    return qobject_cast<HbPushButton *>(mDocumentLoader.findWidget(
+            BUTTON_NAME));
+}
+
+/*!
  \return pointer to All Applications Action. Guaranteed to be not NULL.
  The pointer is valid until the HsMenuViewBuilder instance is destroyed.
  Memory ownership is not changed.
@@ -230,13 +243,13 @@
  */
 HsMenuViewBuilder::HsMenuViewBuilder():
     DOCUMENT_FILE_NAME(":/xml/applibrary.docml"),
-    COMMON_SECTION_NAME("commonDefinitions"),
     ALL_APPS_ACTION_NAME("allAppsAction"),
     ALL_COLLECTIONS_ACTION_NAME("allCollectionsAction"),
     SEARCH_ACTION_NAME("searchAction"),
     OVI_STORE_ACTION_NAME("oviStoreAction"),
     OPERATOR_ACTION_NAME("operatorAction"),
     SEARCH_PANEL_NAME("searchPanel"),
+    BUTTON_NAME("collectionButton"),
     TOOL_BAR_NAME("toolBar"),
     mToolBar(new HbToolBar),
     mToolBarExtension(new HbToolBarExtension),
@@ -246,7 +259,7 @@
     init();
 
     // parse common section and the one specified by view options
-    const bool result = parseSection(COMMON_SECTION_NAME);
+    const bool result = parseSection();
 
     Q_ASSERT_X(result,
                "HsMenuViewBuilder::HsMenuViewBuilder()",
@@ -284,12 +297,10 @@
     HSMENUTEST_FUNC_ENTRY("HsMenuViewBuilder::parseSection");
 
     bool loadStatusOk = false;
-
     const QObjectList loadedObjects =
         mDocumentLoader.load(DOCUMENT_FILE_NAME,
                              sectionName,
-                             &loadStatusOk);
-
+                             &loadStatusOk); 
     mLoadedObjects |= loadedObjects.toSet();
 
     Q_ASSERT_X(loadStatusOk,
@@ -342,6 +353,9 @@
     mViewContextToStringMap[HsCollectionContext] = "collection";
     mOperationalContextToStringMap[HsItemViewContext] = "";
     mOperationalContextToStringMap[HsSearchContext] = "Search";
+    mOperationalContextToStringMap[HsButtonContext] = "Button";
+    mOperationalContextToStringMap[HsEmptyLabelContext] = "EmptyLabel";
+
 }
 
 /*!
@@ -360,7 +374,6 @@
 void HsMenuViewBuilder::setOperationalContext(
     HsOperationalContext operationalContext)
 {
-
     mOperationalContext = operationalContext;
 }
 
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h	Fri Jun 11 13:30:16 2010 +0300
@@ -136,7 +136,6 @@
     void moveScene_onMouseReleased(
         QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
 
-    void onOrientationChanged(Qt::Orientation orientation);
     void widgetInteraction_onTapAndHoldTimeout();
     void sceneInteraction_onTapAndHoldTimeout();
     void onTitleChanged(QString title);
@@ -144,7 +143,7 @@
     bool openTaskSwitcher();
     void zoneAnimationFinished();
     void onSceneMenuTriggered(HbAction *action);
-    void onRemovePageMessageBoxClosed(HbAction *action);
+    void onRemovePageConfirmationOk();
     void onSceneMenuAboutToClose();
 
 private:
@@ -152,8 +151,6 @@
     HsIdleWidget *mUiWidget;
     
     QTimer mTimer;
-    qreal mTapAndHoldDistance;
-    qreal mPageChangeZoneWidth;
 
     QPointF mTouchScenePos;
     HsTitleResolver *mTitleResolver;
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsloadscenestate.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsloadscenestate.h	Fri Jun 11 13:30:16 2010 +0300
@@ -19,6 +19,11 @@
 #define HSLOADSCENESTATE_H
 
 #include <QState>
+#ifdef Q_OS_SYMBIAN
+#include <XQSettingsKey>
+
+class XQSettingsManager;
+#endif
 
 class HsLoadSceneState : public QState
 {
@@ -27,7 +32,10 @@
 public:
     HsLoadSceneState(QState *parent = 0);
     ~HsLoadSceneState();
-
+#ifdef Q_OS_SYMBIAN
+public slots:
+     void handleKeyChange(XQSettingsKey key, const QVariant &value);
+#endif
 signals:
     void event_history();
 
@@ -36,6 +44,12 @@
 
 private:
     Q_DISABLE_COPY(HsLoadSceneState)
+    void showUi();
+    
+#ifdef Q_OS_SYMBIAN
+    XQPublishAndSubscribeSettingsKey    mStartupKey;
+    XQSettingsManager                   *mSettingsMgr;
+#endif
 };
 
 #endif // HSLOADSCENESTATE_H
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -46,7 +46,6 @@
 #include "hsselectbackgroundstate.h"
 #include "hstrashbinwidget.h"
 #include "hspageindicator.h"
-#include "hswidgetpositioningonorientationchange.h"
 #include "hsmenueventfactory.h"
 #include "hshomescreenstatecommon.h"
 #include "hstitleresolver.h"
@@ -137,8 +136,6 @@
     ,mSettingsMgr(0)
 #endif
 {
-    mTapAndHoldDistance = HsConfiguration::tapAndHoldDistance();
-    mPageChangeZoneWidth = HsConfiguration::pageChangeZoneWidth();
     setupStates();
     mTimer.setSingleShot(true);
     mTitleResolver = new HsTitleResolver(this);
@@ -479,7 +476,7 @@
 */
 bool HsIdleState::isInLeftPageChangeZone()
 {
-    return mTouchScenePos.x() < mPageChangeZoneWidth;
+    return mTouchScenePos.x() < HsConfiguration::pageChangeZoneWidth();
 }
 
 /*!
@@ -489,7 +486,7 @@
 bool HsIdleState::isInRightPageChangeZone()
 {
     qreal pageWidth = HsScene::mainWindow()->layoutRect().width();
-    return mTouchScenePos.x() > pageWidth - mPageChangeZoneWidth;
+    return mTouchScenePos.x() > pageWidth - HsConfiguration::pageChangeZoneWidth();;
 }
 
 /*!
@@ -634,9 +631,7 @@
         mNavigationAction->setIcon(HbIcon(gApplicationLibraryIconName));
         connect(mNavigationAction, SIGNAL(triggered()), SIGNAL(event_applicationLibrary()));
         idleView->setNavigationAction(mNavigationAction);
-
-        // TODO: Workaround to Qt/Hb layouting bugs.
-        QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+        
         HsGui::setIdleView(idleView);
 
         if (mPageChangeAnimation) {
@@ -702,8 +697,7 @@
     }
 
     foreach (HsWidgetHost *widget, widgets) {
-        widget->initializeWidget();
-        widget->showWidget();
+        widget->startWidget();
     }
 
     page->layoutNewWidgets();
@@ -728,7 +722,7 @@
 {
     connect(HsScene::mainWindow(),
         SIGNAL(orientationChanged(Qt::Orientation)),
-        SLOT(onOrientationChanged(Qt::Orientation)));
+        SLOT(action_idle_showActivePage()));
 }
 
 /*!
@@ -785,7 +779,7 @@
 {
     disconnect(HsScene::mainWindow(),
         SIGNAL(orientationChanged(Qt::Orientation)),
-        this, SLOT(onOrientationChanged(Qt::Orientation)));
+        this, SLOT(action_idle_showActivePage()));
 }
 
 /*!
@@ -986,18 +980,16 @@
     if (mUiWidget->trashBin()->isUnderMouse()) {
         HbInstantFeedback::play(HsConfiguration::widgetDropToTrashbinFeedbackType());
         widget->page()->removeWidget(widget);
-        widget->uninitializeWidget();
-        widget->deleteFromDatabase();
-        widget->deleteLater();
+        widget->remove();
         scene->setActiveWidget(0);
     } else {
         if (widget->page() != page) {
             widget->page()->removeWidget(widget);
             page->addExistingWidget(widget);
             if (HsScene::orientation() == Qt::Horizontal) {
-                widget->deleteWidgetPresentation(Qt::Vertical);
+                widget->removePresentation(Qt::Vertical);
             } else {
-                widget->deleteWidgetPresentation(Qt::Horizontal);
+                widget->removePresentation(Qt::Horizontal);
             }
         }
 
@@ -1012,7 +1004,7 @@
         }
         widget->setPos(widgetX, widgetY);
 
-        widget->setWidgetPresentation();
+        widget->savePresentation();
         page->updateZValues();
     }
     mAllowZoneAnimation = true;
@@ -1061,9 +1053,9 @@
 
     int pageIndex = HsScene::instance()->activePageIndex();
 
-    if (mDeltaX < -pageSize.width() / 3) {
+    if (mDeltaX < -HsConfiguration::pageChangePanDistanceInPixels()) {
         pageIndex = qMin(pageIndex + 1, pages.count() - 1);
-    } else if (pageSize.width() / 3 < mDeltaX) {
+    } else if (HsConfiguration::pageChangePanDistanceInPixels() < mDeltaX) {
         pageIndex = qMax(pageIndex - 1, 0);
     }
 
@@ -1116,7 +1108,7 @@
 void HsIdleState::action_addPage_addPage()
 {
     HsScene *scene = HsScene::instance();
-    int pageIndex = scene->pages().count();
+	  int pageIndex = scene->activePageIndex() + 1;
     addPageToScene(pageIndex);
     scene->setActivePageIndex(pageIndex);
     startPageChangeAnimation(pageIndex, HsConfiguration::newPageAddedAnimationDuration());
@@ -1136,16 +1128,18 @@
 #ifndef HOMESCREEN_TEST //We don't want to test message box.
         //Confirm removal of page having content
         HbMessageBox *box = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+        box->setAttribute(Qt::WA_DeleteOnClose);
         box->setHeadingWidget(new HbLabel
                                 (hbTrId(hsLocTextId_Title_RemovePage)));
         box->setText(hbTrId(hsLocTextId_Confirmation_RemovePage));
-        box->setPrimaryAction(new HbAction(hbTrId(hsLocTextId_ConfirmationButton_Ok)));
-        box->setSecondaryAction(new HbAction(hbTrId(hsLocTextId_ConfirmationButton_Cancel)));
-        box->setAttribute(Qt::WA_DeleteOnClose);
+        
+        QAction *buttonOk = box->actions().at(0);
+        //We are keen only from OK button. Cancel is not connected to any slot.
+        connect(buttonOk, SIGNAL(triggered()), SLOT(onRemovePageConfirmationOk()));
 
         HsScene::mainWindow()->setInteractive(true);
 
-        box->open(this,SLOT(onRemovePageMessageBoxClosed(HbAction*)));
+        box->open();
 #endif //HOMESCREEN_TEST
     } else {
         //Empty page can be removed without confirmation
@@ -1217,7 +1211,7 @@
 
     QPointF point =
         event->scenePos() - event->buttonDownScenePos(Qt::LeftButton);
-    if (mTapAndHoldDistance < point.manhattanLength()) {
+    if (HsConfiguration::tapAndHoldDistance() < point.manhattanLength()) {
         // Threshold area for tap exceeded. This is pan or swipe
         mTimer.stop();
         if (HsScene::instance()->activeWidget()->isPannable(event)) {
@@ -1278,7 +1272,7 @@
 
     QPointF point =
         event->scenePos() - event->buttonDownScenePos(Qt::LeftButton);
-    if (mTapAndHoldDistance < point.manhattanLength()) {
+    if (HsConfiguration::tapAndHoldDistance() < point.manhattanLength()) {
         mTimer.stop();
         mUiWidget->clearDelayedPress();
         emit event_moveScene();
@@ -1328,37 +1322,32 @@
     QPointF delta(event->scenePos() - event->lastScenePos());
     widgetRect.moveTopLeft(widgetRect.topLeft() + delta);
 
-    //Widget can be moved over the pages left border if not in the first page.
-    //In the first page widget cannot cross the page's left border at all.
+    //Widget can be moved over the pages left border
     qreal lowerBoundX = -widgetRect.width();
     HsPage *page = scene->activePage();
-    if (page == scene->pages().first()) {
-        lowerBoundX = 0;
-    }
+    QRectF pageRect = HsGui::idleView()->rect();
+    //Widget can be moved over the pages right border
+    qreal upperBoundX = pageRect.width();
 
-    //Widget can be moved over the pages right border if not in the last page when maximum amount
-    //of pages exist. Widget cannot cross the lastest page's right border at all.
-    QRectF pageRect = HsGui::idleView()->rect();
-    qreal upperBoundX = pageRect.width() + widgetRect.width();
-    if (page == scene->pages().last() && scene->pages().count() == scene->maximumPageCount()) {
-        upperBoundX = pageRect.width() - widgetRect.width();
-    }
+    //Notice that chrome height is 64 pixels
+    qreal lowerBoundY = qreal(64) - widgetRect.height();
+    //Widget can be moved over the pages down border
+    qreal upperBoundY = pageRect.height();
 
-    //Widget cannot cross over top or bottom edges of the page.
+    qreal widgetX = qBound(lowerBoundX, widgetRect.x(), upperBoundX);
+    qreal widgetY = qBound(lowerBoundY, widgetRect.y(), upperBoundY);
     /* if using ItemClipsChildrenToShape-flag in widgethost then
        setPos does not update position here, however setGeometry does it, QT bug?
     */
-    qreal widgetX = qBound(lowerBoundX, widgetRect.x(), upperBoundX);
-    qreal widgetY = qBound(qreal(64), widgetRect.y(), pageRect.height() - widgetRect.height());
     widget->setGeometry(widgetX, widgetY, widgetRect.width(), widgetRect.height());
 
     int bounceFeedbackEffectDistance = HsConfiguration::bounceFeedbackEffectDistance();
     //Handle effects:
     //User is indicated by a tactile feedback if he/she is trying to move
     //widget over the first or the last page.
-    if( (page == scene->pages().first() && widgetRect.x() < bounceFeedbackEffectDistance ) ||
+    if( (page == scene->pages().first() && mTouchScenePos.x() < bounceFeedbackEffectDistance ) ||
         (page == scene->pages().last() && scene->pages().count() == scene->maximumPageCount()
-         && widgetRect.x()+ widgetRect.width() > pageRect.width() - bounceFeedbackEffectDistance)) {
+         && mTouchScenePos.x() > pageRect.width() - bounceFeedbackEffectDistance)) {
              HbInstantFeedback::play(HsConfiguration::widgetMoveBlockedFeedbackType());
             // TODO: use code below when Orbit has updated ContinuousFeedback API
             //if (!mContinuousFeedback->isPlaying()) {
@@ -1437,56 +1426,6 @@
 }
 
 /*!
-    Handles orientation change events. \a orientation is the
-    new orientation.
-*/
-void HsIdleState::onOrientationChanged(Qt::Orientation orientation)
-{
-    QList<HsPage *> pages = HsScene::instance()->pages();
-    QList<HsWidgetHost *> widgets;
-    HsWidgetHost *widget = 0;
-
-    QRectF pageRect = HsScene::mainWindow()->layoutRect();
-
-    // TODO: Temporary workaround for the Orbit bug.
-    if (orientation == Qt::Horizontal) {
-        pageRect = QRectF(0, 0, 640, 360);
-    } else {
-        pageRect = QRectF(0, 0, 360, 640);
-    }
-    // End of the workaround.
-
-    const int chromeHeight = 64; // TODO: get this somewhere
-
-    for (int i = 0; i < pages.count(); ++i) {
-        widgets = pages[i]->widgets();
-        for (int j = 0; j < widgets.count(); ++j) {
-            widget = widgets[j];
-            HsWidgetPresentationData presentation = widget->widgetPresentation(orientation);
-            if (presentation.widgetId < 0) {
-                QList<QRectF> geometries =
-                    HsWidgetPositioningOnOrientationChange::instance()->convert(
-                        QRectF(0, chromeHeight,
-                            pageRect.height(),
-                            pageRect.width() - chromeHeight),
-                        QList<QRectF>() << widget->geometry(),
-                        QRectF(0, chromeHeight,
-                            pageRect.width(),
-                            pageRect.height() - chromeHeight));
-                widget->setGeometry(geometries.first());
-                widget->setWidgetPresentation();
-            } else {
-                widget->setPos(presentation.x, presentation.y);
-                widget->setZValue(presentation.zValue);
-            }
-        }
-    }
-    // TODO: Workaround to Qt/Hb layouting bugs.
-    QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
-    action_idle_showActivePage();
-}
-
-/*!
     Handles tap-and-hold events for the widgetInteraction state.
 */
 void HsIdleState::widgetInteraction_onTapAndHoldTimeout()
@@ -1594,13 +1533,9 @@
 /*!
     Handles the close of remove page confirmation dialog for page having content.
 */
-void HsIdleState::onRemovePageMessageBoxClosed(HbAction *action)
+void HsIdleState::onRemovePageConfirmationOk()
 {
-    HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
-    if(action == dlg->primaryAction()) {
-        //Page removal accepted
-        removeActivePage();
-    }
+    removeActivePage();
 }
 
 /*!
@@ -1621,9 +1556,3 @@
         emit event_waitInput();
     }
 }
-
-// Undefine the helper macros.
-#undef ENTRY_ACTION
-#undef EXIT_ACTION
-#undef CONNECT_MOUSE_EVENT_HANDLER
-#undef DISCONNECT_MOUSE_EVENT_HANDLER
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlewidget.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlewidget.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -109,10 +109,17 @@
 void HsIdleWidget::setGeometry(const QRectF &rect)
 {
     int n = HsScene::instance()->pages().count();
-    mControlLayer->resize(rect.size());
-    mPageLayer->resize(n * rect.width(), rect.height());
-    mSceneLayer->resize(2 * rect.width() + HsConfiguration::bounceEffect(), rect.height());
-    HbWidget::setGeometry(rect);
+	QRectF layoutRect(HsScene::instance()->mainWindow()->layoutRect());
+    if (layoutRect == rect || (layoutRect.height() == rect.width() && layoutRect.width() == rect.height())) {
+        mControlLayer->resize(rect.size());
+		mPageLayer->resize(n * rect.width(), rect.height());
+		mSceneLayer->resize(2 * rect.width() + HsConfiguration::bounceEffect(), rect.height());
+		HbWidget::setGeometry(rect);
+	} else {
+		QRectF sceneRect = mapToScene(rect).boundingRect();
+		sceneRect.setTop(-sceneRect.top());
+		HbWidget::setGeometry(sceneRect);
+	}
 }
 
 /*!
@@ -257,6 +264,7 @@
 {
     mTrashBin->hide();
     mTrashBin->deactivate();
+    mPageIndicator->setSpacing(HsConfiguration::pageIndicatorSpacing()); // for usability optimization widget, can be removed later on
     mPageIndicator->setVisible(1 < mPageIndicator->itemCount());
 }
 
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsloadscenestate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsloadscenestate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -16,6 +16,10 @@
 */
 
 #include <HbMainWindow>
+#ifdef Q_OS_SYMBIAN
+#include <XQSettingsManager>
+#include <startupdomainpskeys.h>
+#endif
 #include "hsloadscenestate.h"
 #include "hsscene.h"
 
@@ -32,8 +36,17 @@
 */
 HsLoadSceneState::HsLoadSceneState(QState *parent)
     : QState(parent)
+#ifdef Q_OS_SYMBIAN
+      ,mStartupKey(KPSUidStartup.iUid, KPSStartupUiPhase),
+      mSettingsMgr(0)
+#endif        
 {
     connect(this, SIGNAL(entered()), SLOT(action_loadScene()));
+#ifdef Q_OS_SYMBIAN     
+
+    mSettingsMgr = new XQSettingsManager(this);
+    
+#endif //Q_OS_SYMBIAN    
 }
 
 /*!
@@ -55,6 +68,63 @@
 void HsLoadSceneState::action_loadScene()
 {
     HsScene::instance()->load();
+
+#ifdef Q_OS_SYMBIAN    
+ 
+    int startupPhase = mSettingsMgr->readItemValue(mStartupKey).toInt();
+    qDebug() << "HsLoadSceneState::action_loadScene boot phase " << startupPhase;
+    
+    if (EStartupUiPhaseAllDone != startupPhase) {
+        qDebug() << "HsLoadSceneState::HsLoadSceneState, starting to listen key";
+        
+        connect(mSettingsMgr,SIGNAL(valueChanged(XQSettingsKey, const QVariant &)), this,
+			          SLOT(handleKeyChange(XQSettingsKey, const QVariant &)));
+        
+        mSettingsMgr->startMonitoring(mStartupKey);
+    } else {
+        // We're already at the phase in boot where we can draw ourself to the foreground.
+        showUi();
+        delete mSettingsMgr;
+        mSettingsMgr = 0;
+		}
+
+#else
+
+    showUi();
+
+#endif		
+}
+#ifdef Q_OS_SYMBIAN
+/*!
+    \fn HsLoadSceneState::handleKeyChange()
+
+    Handles the key change. Activates hs ui when appropriate.
+*/
+
+void HsLoadSceneState::handleKeyChange(XQSettingsKey key, const QVariant &value)
+{
+		qDebug() << "HsLoadSceneState::handleKeyChange key " << key.key()
+		         << "value " << value.toInt();
+		
+		if (key.key() == KPSStartupUiPhase && value.toInt() == EStartupUiPhaseAllDone) {
+			showUi();			 	
+    		mSettingsMgr->stopMonitoring(mStartupKey);
+    		mSettingsMgr->deleteLater();
+    		mSettingsMgr = 0;
+		}
+}
+#endif
+/*!
+    \fn HsLoadSceneState::showUi()
+
+    Makes the main window visible, signals transition to idle state and 
+    brings the hs app to the foreground.
+*/
+	
+void HsLoadSceneState::showUi()
+{
+    qDebug() << "HsLoadSceneState::showUi";
+    HsScene::mainWindow()->raise();
     HsScene::mainWindow()->show();
     emit event_history();
 }
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddappstocollectionstate.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddappstocollectionstate.h	Fri Jun 11 13:30:16 2010 +0300
@@ -134,12 +134,8 @@
 
     HsCollectionNameDialog *mEditorDialog;
 
-    bool mEditorFinishedEntered;
-
     HsCollectionsListDialog *mListDialog;
 
-    bool mListFinishedEntered;
-
 };
 
 #endif /* ADDAPPSTOCOLLECTIONSTATE_H */
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h	Fri Jun 11 13:30:16 2010 +0300
@@ -27,9 +27,9 @@
 HS_STATES_TEST_CLASS(MenuStatesTest)
 
 class HbAction;
+class HbMessageBox;
 class CaEntry;
-class HbMessageBox;
-
+class CaNotifier;
 
 class HsAddToHomeScreenState: public  HsMenuBaseState
 {
@@ -50,6 +50,8 @@
     void cleanUp();
 
     void messageWidgetCorruptedFinished(HbAction* finishedAction);
+    
+    void memoryCardRemoved();
 
 signals:
 
@@ -67,6 +69,7 @@
 
     void logActionResult(QString operationName, int entryId,
                          bool operationSucceded);
+    void subscribeForMemoryCardRemove();
 
 private:
 
@@ -78,7 +81,10 @@
     HbMessageBox *mCorruptedMessage;
 
     HbAction *mConfirmAction;
+    
     HsMenuMode mMenuMode;
+    
+    CaNotifier *mNotifier;
 
 };
 
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsarrangestate.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsarrangestate.h	Fri Jun 11 13:30:16 2010 +0300
@@ -84,9 +84,6 @@
     QList<int> mArrangedCollIdList;
     
     QObjectList mObjectList;
-    
-    bool mFinishedEntered;
-
 
 };
 
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionnamestate.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionnamestate.h	Fri Jun 11 13:30:16 2010 +0300
@@ -71,7 +71,6 @@
 
     HsCollectionNameDialog *mCollectionNameDialog;
 
-    bool mFinishedEntered;
 };
 
 #endif /* COLLECTIONANAMESTATE_H */
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h	Fri Jun 11 13:30:16 2010 +0300
@@ -53,8 +53,6 @@
 
     void cleanUp();
 
-    void memoryCardRemoved();
-
 signals:
     void exit();
 
@@ -79,7 +77,7 @@
     int mEntryId;
 
     HbMessageBox *mCorruptedMessage;
-
+    
 };
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h	Fri Jun 11 13:30:16 2010 +0300
@@ -0,0 +1,73 @@
+/*
+ * 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 HSUNINSTALLITEMSTATE_H
+#define HSUNINSTALLITEMSTATE_H
+
+#include <QState>
+
+#include "hsmenustates_global.h"
+HS_STATES_TEST_CLASS(MenuStatesTest)
+
+class HbAction;
+class HbMessageBox;
+class HsShortcutService;
+class HsMenuService;
+
+class HsUninstallItemState: public QState
+{
+    Q_OBJECT
+
+    HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
+
+public:
+
+    HsUninstallItemState(QState *parent = 0);
+
+    virtual ~HsUninstallItemState();
+
+protected:
+
+    void onEntry(QEvent *event);
+
+private slots:
+
+    void uninstallMessageFinished(HbAction* finishedAction);
+
+    void cleanUp();
+
+signals:
+
+    void exit();
+
+private:
+
+    void construct();
+
+    HsShortcutService *shortcutService() const;
+
+private:
+
+    int mItemId;
+
+    HbMessageBox *mUninstallMessage; // deletes itself automatically on close
+
+    HbAction *mConfirmAction; // child for mConfirmMessage
+
+};
+
+#endif //HSUNINSTALLITEMSTATE_H
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml	Fri Jun 11 13:30:16 2010 +0300
@@ -2,6 +2,9 @@
 <hbdocument version="0.9">
     <widget name="view" type="HbView">
         <widget name="listView" role="HbView:widget" type="HbListView">
+            <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
+                <enums name="graphicsSize" value="LargeIcon"/>
+            </widget>
             <enums name="selectionMode" value="MultiSelection"/>
             <bool name="visible" value="TRUE"/>
             <string name="orientation" value="Horizontal"/>
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -180,8 +180,7 @@
     mNewCollectionState(0), mAppsCheckListState(0), mActionType(
         NoActionType), mApplicationsSortAttribute(NoHsSortAttribute),
     mCollectionsSortAttribute(NoHsSortAttribute), mAppsCheckList(0),
-    mEditorDialog(0), mEditorFinishedEntered(false), mListDialog(0),
-    mListFinishedEntered(false)
+    mEditorDialog(0), mListDialog(0)
 {
     construct();
 }
@@ -376,11 +375,15 @@
     mAppsCheckList = NULL;
 
     if (mEditorDialog) {
+        disconnect(mEditorDialog, SIGNAL(finished(HbAction*)),
+                   this, SLOT(editorDialogFinished(HbAction*)));
         mEditorDialog->close();
         mEditorDialog = NULL;
     }
 
     if (mListDialog) {
+        disconnect(mListDialog, SIGNAL(finished(HbAction*)),
+                   this, SLOT(listDialogFinished(HbAction*)));
         mListDialog->close();
         mListDialog = NULL;
     }
@@ -399,7 +402,6 @@
 {
     qDebug("HsAddAppsToCollectionState::newCollection");
     HSMENUTEST_FUNC_ENTRY("HsAddAppsToCollectionState::newCollection");
-    mEditorFinishedEntered = false;
     mEditorDialog = new HsCollectionNameDialog();
     mEditorDialog->open(this, SLOT(editorDialogFinished(HbAction*)));
 
@@ -415,31 +417,23 @@
 //
 void HsAddAppsToCollectionState::editorDialogFinished(HbAction* finishedAction)
 {
-    if (!mEditorFinishedEntered) {
-        mEditorFinishedEntered = true;
-
-        if (finishedAction == mEditorDialog->actions().value(0)) {
-            QString newName(mEditorDialog->newName(mEditorDialog->value().toString(), true));
-            if (mActionType == ViaAllViewOptionMenuType) {
-                qDebug("HsAddAppsToCollectionState::newCollection() "
-                       "- emit collectionNameSelectedCl(newName)");
-                emit transitToAppsCheckListState(newName);
-            } else {
-                qDebug("HsAddAppsToCollectionState::newCollection() "
-                       "- emit collectionNameSelected(newName)");
-                emit transitToSaveState(newName);
-            }
+    if (finishedAction == mEditorDialog->actions().value(0)) {
+        QString newName(mEditorDialog->newName(mEditorDialog->value().toString(), true));
+        if (mActionType == ViaAllViewOptionMenuType) {
+            qDebug("HsAddAppsToCollectionState::newCollection() "
+                   "- emit collectionNameSelectedCl(newName)");
+            emit transitToAppsCheckListState(newName);
         } else {
-            qDebug(
-                "HsAddAppsToCollectionState::newCollection() - emit cancel()");
-            emit transitToFinalState();
+            qDebug("HsAddAppsToCollectionState::newCollection() "
+                   "- emit collectionNameSelected(newName)");
+            emit transitToSaveState(newName);
         }
-        mEditorDialog = NULL; // set to null since this will be deleted after close
-
     } else {
-        // (work-around if more then one action is selected in HbDialog)
-        qWarning("Another signal finished was emited.");
+        qDebug(
+            "HsAddAppsToCollectionState::newCollection() - emit cancel()");
+        emit transitToFinalState();
     }
+    mEditorDialog = NULL; // set to null since this will be deleted after close
 }
 
 /*!
@@ -452,7 +446,6 @@
 {
     qDebug("HsAddAppsToCollectionState::selectCollection()");
     HSMENUTEST_FUNC_ENTRY("HsAddAppsToCollectionState::selectCollection");
-    mListFinishedEntered = false;
     mListDialog = new HsCollectionsListDialog(mCollectionsSortAttribute,
                                                        mCollectionId);
     mListDialog->open(this, SLOT(listDialogFinished(HbAction*)));
@@ -469,34 +462,25 @@
 //
 void HsAddAppsToCollectionState::listDialogFinished(HbAction* finishedAction)
 {
-    if (!mListFinishedEntered) {
-        mListFinishedEntered = true;
-
-        if (finishedAction != mListDialog->actions().value(0)) {
-            int itemId = mListDialog->getItemId();
-            if (itemId) {
-                if (mActionType == ViaAllViewOptionMenuType) {
-                    qDebug("emit collectionSelectedCl(%d)", itemId);
-                    emit transitToAppsCheckListState(itemId);
-                } else {
-                    qDebug("emit collectionSelected(%d)", itemId);
-                    emit transitToSaveState(itemId);
-                }
+    if (finishedAction != mListDialog->actions().value(0)) {
+        int itemId = mListDialog->getItemId();
+        if (itemId) {
+            if (mActionType == ViaAllViewOptionMenuType) {
+                qDebug("emit collectionSelectedCl(%d)", itemId);
+                emit transitToAppsCheckListState(itemId);
             } else {
-                qDebug("emit createNewCollection()");
-                emit transitToNewCollectionState();
+                qDebug("emit collectionSelected(%d)", itemId);
+                emit transitToSaveState(itemId);
             }
         } else {
-            qDebug("emit cancel()");
-            emit transitToFinalState();
+            qDebug("emit createNewCollection()");
+            emit transitToNewCollectionState();
         }
-
-        mListDialog = NULL; // set to null since this will be deleted after close
-
     } else {
-        // (work-around if more then one action is selected in HbDialog)
-        qWarning("Another signal finished was emited.");
+        qDebug("emit cancel()");
+        emit transitToFinalState();
     }
+    mListDialog = NULL; // set to null since this will be deleted after close
 }
 
 /*!
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -27,6 +27,8 @@
 
 #include "hsaddtohomescreenstate.h"
 #include "hsmenuevent.h"
+#include "canotifier.h"
+#include "canotifierfilter.h"
 #include "caservice.h"
 #include "caquery.h"
 #include "hsmenuservice.h"
@@ -54,7 +56,8 @@
 HsAddToHomeScreenState::HsAddToHomeScreenState(QState *parent) :
     HsMenuBaseState(ADD_TO_HOMESCREEN_STATE, parent), 
     mCorruptedMessage(NULL), mConfirmAction(NULL),
-    mMenuMode(NormalHsMenuMode)
+    mMenuMode(NormalHsMenuMode),
+    mNotifier(0)
 {
     requestServices(QList<QVariant> () << SHORTCUT_SERVICE_KEY
                     << CONTENT_SERVICE_KEY);
@@ -105,6 +108,7 @@
     if (success && (mMenuMode == NormalHsMenuMode)) {
         HbNotificationDialog *notificationDialog = new HbNotificationDialog();
         notificationDialog->setAttribute(Qt::WA_DeleteOnClose);
+        notificationDialog->setSequentialShow(false);
         notificationDialog->setTitle(hbTrId(
                                      "txt_applib_dpophead_added_to_homescreen") );
         notificationDialog->show();
@@ -130,6 +134,7 @@
     params[URI] = uri;
     bool success = contentService.createWidget(params);
     if (!success) {
+        subscribeForMemoryCardRemove();
         showMessageWidgetCorrupted();
     } else {
         emit exit();
@@ -154,6 +159,7 @@
 void HsAddToHomeScreenState::showMessageWidgetCorrupted()
 {
     HSMENUTEST_FUNC_ENTRY("HsCollectionState::showMessageWidgetCorrupted");
+
     mCorruptedMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
     mCorruptedMessage->setAttribute(Qt::WA_DeleteOnClose);
 
@@ -184,20 +190,13 @@
 void HsAddToHomeScreenState::messageWidgetCorruptedFinished
         (HbAction* finishedAction)
 {
-    if (mCorruptedMessage) {
-        if (finishedAction == mConfirmAction) {
-            HsMenuService::executeAction(mEntryId, removeActionIdentifier());
-        }
-        mCorruptedMessage = NULL;
-        emit exit();
-        if (mMenuMode == AddHsMenuMode) {
-            machine()->postEvent(
-                HsMenuEventFactory::createOpenHomeScreenEvent());
-        }
-
-    } else {
-        // (work-around for crash if more then one action is selected in HbDialog)
-        qWarning("Another signal finished was emited.");
+    if (finishedAction == mConfirmAction) {
+        HsMenuService::executeAction(mEntryId, removeActionIdentifier());
+    }
+    emit exit();
+    if (mMenuMode == AddHsMenuMode) {
+        machine()->postEvent(
+            HsMenuEventFactory::createOpenHomeScreenEvent());
     }
 }
 
@@ -210,9 +209,18 @@
 {
     // Close popups if App key was pressed
     if (mCorruptedMessage) {
+        disconnect(mCorruptedMessage, SIGNAL(finished(HbAction*)),
+                   this, SLOT(messageWidgetCorruptedFinished(HbAction*)));
         mCorruptedMessage->close();
         mCorruptedMessage = NULL;
     }
+    
+    disconnect(mNotifier,
+               SIGNAL(entryChanged(CaEntry,ChangeType)),
+               this, SLOT(memoryCardRemoved()));
+
+    delete mNotifier;
+    mNotifier = NULL;
 }
 
 
@@ -305,3 +313,33 @@
         qWarning() << message;
     }
 }
+
+/*!
+ Subscribe for memory card remove.
+ \retval void
+ */
+void HsAddToHomeScreenState::subscribeForMemoryCardRemove()
+{
+    CaNotifierFilter filter;
+    QList<int> entryIds;
+    entryIds.append(mEntryId);
+    filter.setIds(entryIds);
+    mNotifier = CaService::instance()->createNotifier(filter);
+    mNotifier->setParent(this);
+    connect(mNotifier,
+            SIGNAL(entryChanged(CaEntry,ChangeType)),
+            SLOT(memoryCardRemoved()));
+}
+
+/*!
+ Memory card with instaled widget was removed.
+ \retval void
+ */
+void HsAddToHomeScreenState::memoryCardRemoved()
+{
+    if (mCorruptedMessage) {
+        mCorruptedMessage->close();
+        mCorruptedMessage = NULL;
+    }
+    // exit not needed, it is called after dialog closed
+}
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsarrangestate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsarrangestate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -78,7 +78,7 @@
  */
 HsArrangeState::HsArrangeState(QState *parent) :
     QState(parent), mDialog(0), mEntriesList(0), 
-    mItemModel(0), mFinishedEntered(false)
+    mItemModel(0)
 {
     construct();
 }
@@ -193,21 +193,13 @@
  */
 void HsArrangeState::arrangeDialogFinished(HbAction* finishedAction)
 {
-    if (!mFinishedEntered) {
-        mFinishedEntered = true;
-
-        mEntriesList->setArrangeMode(false);
-        if (finishedAction == mDialog->actions().value(0)) {
-            save(*mEntriesList);
-        }
-        emit exit();
-    } else {
-        // (work-around for crash if more then one action is selected in HbDialog)
-        qWarning("Another signal finished was emited.");
+    mEntriesList->setArrangeMode(false);
+    if (finishedAction == mDialog->actions().value(0)) {
+        save(*mEntriesList);
     }
+    emit exit();
 }
 
-
 /*!
  Slot invoked when a state is exited.
  */
@@ -215,9 +207,10 @@
 {
     HSMENUTEST_FUNC_ENTRY("HsArrangeState::stateExited");
     if (mDialog) {
+        disconnect(mDialog, SIGNAL(finished(HbAction*)), this, SLOT(arrangeDialogFinished(HbAction*)));
         mDialog->close();
+        mDialog = NULL;
     }
-    mDialog = NULL;
 
     mObjectList.clear(); // mDialog as parent for all confml items
     
@@ -228,8 +221,6 @@
     mArrangedCollIdList.clear();
     mCollIdList.clear();
 
-    mFinishedEntered = false;
-
     HSMENUTEST_FUNC_EXIT("HsArrangeState::stateExited");
     qDebug("HsArrangeState::stateExited()");
 }
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -55,7 +55,7 @@
  */
 HsCollectionNameState::HsCollectionNameState(QState *parent) :
     QState(parent),
-    mItemId(0), mCollectionNameDialog(NULL), mFinishedEntered(false)
+    mItemId(0), mCollectionNameDialog(NULL)
 {
     construct();
 }
@@ -76,7 +76,6 @@
 {
     setObjectName(this->parent()->objectName() + "/collectionnamestate");
     connect(this, SIGNAL(exited()), SLOT(cleanUp()));
-
 }
 
 /*!
@@ -93,7 +92,6 @@
     QState::onEntry(event);
 
     mItemId = 0;
-    mFinishedEntered = false;
     if (event->type() == HsMenuEvent::eventType()) {
         HsMenuEvent *menuEvent = static_cast<HsMenuEvent *>(event);
         QVariantMap data = menuEvent->data();
@@ -115,24 +113,18 @@
 //
 void HsCollectionNameState::dialogFinished(HbAction* finishedAction)
 {
-    if (!mFinishedEntered) {
-        mFinishedEntered = true;
-        if (finishedAction == mCollectionNameDialog->actions().value(0)) {
-            QString newName(mCollectionNameDialog->newName(mCollectionNameDialog->value().toString(), true));
-            if (mItemId) {
-                if (newName != HsMenuService::getName(mItemId)) {
-                    HsMenuService::renameCollection(mItemId, newName);
-                }
-            } else {
-                HsMenuService::createCollection(newName);
+    if (finishedAction == mCollectionNameDialog->actions().value(0)) {
+        QString newName(mCollectionNameDialog->newName(mCollectionNameDialog->value().toString(), true));
+        if (mItemId) {
+            if (newName != HsMenuService::getName(mItemId)) {
+                HsMenuService::renameCollection(mItemId, newName);
             }
+        } else {
+            HsMenuService::createCollection(newName);
         }
-        mCollectionNameDialog = NULL; //set to NULL since this will be deleted atfer close
-        emit exit();
-    } else {
-        // (work-around if more then one action is selected in HbDialog)
-        qWarning("Another signal finished was emited.");
     }
+    mCollectionNameDialog = NULL; //set to NULL since this will be deleted atfer close
+    emit exit();
 }
 
 // ---------------------------------------------------------------------------
@@ -141,6 +133,7 @@
 void HsCollectionNameState::cleanUp()
 {
     if (mCollectionNameDialog) {
+        disconnect(mCollectionNameDialog, SIGNAL(finished(HbAction*)), this, SLOT(dialogFinished(HbAction*)));
         mCollectionNameDialog->close();
         mCollectionNameDialog = NULL;
     }
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionslistdialog.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionslistdialog.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -62,7 +62,10 @@
         int collectionId) :
     HbSelectionDialog(), mItemId(0)
 {
-    setPrimaryAction(NULL);
+    clearActions();
+    HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel"), this);
+    addAction(cancelAction);
+
     setHeadingWidget(new HbLabel(hbTrId("txt_applib_title_add_to")));
     // it must be single selection, although it shows checkboxes -
     // it is Orbit defect and will be fixed in next release
@@ -109,8 +112,6 @@
     HbDialog::closeEvent(event); // emits finished(HbAction*)
 }
 
-
-
 /*!
  Creates standard item model.
  \param sortOrder sort order.
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -66,9 +66,6 @@
  Sets entry event.
  \param event entry event.
  */
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
 void HsDeleteCollectionItemState::onEntry(QEvent *event)
 {
     HSMENUTEST_FUNC_ENTRY("HsDeleteCollectionItemState::onEntry");
@@ -102,26 +99,18 @@
 
     HSMENUTEST_FUNC_EXIT("HsDeleteCollectionItemState::onEntry");
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
 
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
+/*!
+ Action after closed confirmation dialog.
+ \param finishedAction chosen action.
+ \retval void
+ */
 void HsDeleteCollectionItemState::deleteMessageFinished(HbAction* finishedAction)
 {
-    if (mItemId !=0 ) { // (work-around for crash if more then one action is selected in HbDialog)
-
-        if (finishedAction == mConfirmAction) {
-            HsMenuService::removeApplicationFromCollection(mItemId, mCollectionId);
-        }
-        mItemId = 0;
-        emit exit();
-    } else {
-        // (work-around for crash if more then one action is selected in HbDialog)
-        qWarning("Another signal finished was emited.");
+    if (finishedAction == mConfirmAction) {
+        HsMenuService::removeApplicationFromCollection(mItemId, mCollectionId);
     }
+    emit exit();
 }
 
 /*!
@@ -132,11 +121,12 @@
 {
     // Close messagebox if App key was pressed
     if (mDeleteMessage) {
+		disconnect(mDeleteMessage, SIGNAL(finished(HbAction*)), this, SLOT(deleteMessageFinished(HbAction*)));
         mDeleteMessage->close();
+		mDeleteMessage = NULL;
     }
-
-    mDeleteMessage = NULL;
-    mConfirmAction= NULL;
+	
+    mConfirmAction = NULL;
     mItemId = 0;
     mCollectionId = 0;
 }
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -126,19 +126,12 @@
 //
 void HsDeleteCollectionState::deleteMessageFinished(HbAction* finishedAction)
 {
-    if (mItemId !=0 ) { // (work-around for crash if more then one action is selected in HbDialog)
-
-        if (finishedAction == mConfirmAction) {
-            HsMenuService::removeCollection(mItemId);
-            machine()->postEvent(
-            HsMenuEventFactory::createCollectionDeletedEvent());
-        }
-        mItemId = 0;
-        emit exit();
-    } else {
-        // (work-around for crash if more then one action is selected in HbDialog)
-        qWarning("Another signal finished was emited.");
+    if (finishedAction == mConfirmAction) {
+        HsMenuService::removeCollection(mItemId);
+        machine()->postEvent(
+        HsMenuEventFactory::createCollectionDeletedEvent());
     }
+    emit exit();
 }
 
 /*!
@@ -149,10 +142,11 @@
 {
     // Close messagebox if App key was pressed
     if (mDeleteMessage) {
+        disconnect(mDeleteMessage, SIGNAL(finished(HbAction*)), this, SLOT(deleteMessageFinished(HbAction*)));
         mDeleteMessage->close();
+        mDeleteMessage = NULL;
     }
 
-    mDeleteMessage = NULL;
-    mConfirmAction= NULL;
+    mConfirmAction = NULL;
     mItemId = 0;
 }
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenuworkerstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenuworkerstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -21,6 +21,7 @@
 #include "hsaddappstocollectionstate.h"
 #include "hsdeletecollectionstate.h"
 #include "hsdeletecollectionitemstate.h"
+#include "hsuninstallitemstate.h"
 #include "hsmenuworkerstate.h"
 #include "hscollectionnamestate.h"
 #include "hsarrangestate.h"
@@ -75,6 +76,8 @@
         HsMenuEvent::DeleteCollection);
     createChildState<HsDeleteCollectionItemState> (
         HsMenuEvent::RemoveAppFromCollection);
+    createChildState<HsUninstallItemState> (
+        HsMenuEvent::UninstallApplication);
     createChildState<HsArrangeState> (HsMenuEvent::ArrangeCollection);
 
     // create a new child state based on the template
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -41,11 +41,9 @@
 #include "canotifier.h"
 #include "canotifierfilter.h"
 #include "caservice.h"
-
 #include "hsdomainmodel_global.h"
 #include <hscontentservice.h>
 
-
 const char HS_PREVIEW_HS_WIDGET_STATE[] = "HsPreviewHSWidgetState";
 
 /*!
@@ -147,13 +145,13 @@
             mScrollArea->setContentWidget(mWidget); // ownership transferred
             
             subscribeForMemoryCardRemove();
-            mWidget->initializeWidget();
-            mWidget->showWidget();
+            mWidget->startWidget();
             // Launch popup asyncronously
             mPopupDialog->open(this, SLOT(previewDialogFinished(HbAction*)));    
         }
 
     } else {
+        subscribeForMemoryCardRemove();
         showMessageWidgetCorrupted();
     }
 
@@ -169,73 +167,54 @@
  */
 void HsPreviewHSWidgetState::cleanUp()
 {
-    // Close popups if App key was pressed
+    // Close popups if App key was pressed or memory card removed
     if (mPopupDialog) {
+        disconnect(mPopupDialog, SIGNAL(finished(HbAction*)), this, SLOT(previewDialogFinished(HbAction*)));
         mPopupDialog->close();
+        mPopupDialog = NULL;
     }
 
     if (mCorruptedMessage) {
+        disconnect(mCorruptedMessage, SIGNAL(finished(HbAction*)), this, SLOT(messageWidgetCorruptedFinished(HbAction*)));
         mCorruptedMessage->close();
+        mCorruptedMessage = NULL;
     }
 
-    mPopupDialog = NULL;
     mScrollArea = NULL;
     mWidget = NULL;
-    mCorruptedMessage = NULL;
 
     disconnect(mNotifier,
                SIGNAL(entryChanged(CaEntry,ChangeType)),
-               this, SLOT(memoryCardRemoved()));
+               this, SIGNAL(exit()));
 
     delete mNotifier;
     mNotifier = NULL;
 }
 
 /*!
- Memory card with instaled widget was removed.
- \retval void
- */
-void HsPreviewHSWidgetState::memoryCardRemoved()
-{
-    if (mPopupDialog) {
-        mPopupDialog->close();
-    }
-    // exit not needed, it is called after dialog closed
-
-}
-
-/*!
  Slot launched on dismissing the preview dialog
  \retval void
  */
 void HsPreviewHSWidgetState::previewDialogFinished(HbAction* finishedAction)
 {
-    if (mPopupDialog != NULL) { 
-        // (work-around for crash if more then one action is selected in HbDialog)
-        if (finishedAction == mPopupDialog->actions().value(0)) {
-            mWidget->hideWidget();
+    if (finishedAction == mPopupDialog->actions().value(0)) {
+        mWidget->hideWidget();
+        mScrollArea->takeContentWidget();
+        HsScene::instance()->activePage()->addNewWidget(
+            mWidget); // ownership transferred
+        HbNotificationDialog *notificationDialog = new HbNotificationDialog();
+        notificationDialog->setAttribute(Qt::WA_DeleteOnClose);
+        notificationDialog->setTitle(hbTrId(
+                                     "txt_applib_dpophead_added_to_homescreen") );
+        notificationDialog->show();
+    } else {
             mScrollArea->takeContentWidget();
-            HsScene::instance()->activePage()->addNewWidget(
-                mWidget); // ownership transferred
-            HbNotificationDialog *notificationDialog = new HbNotificationDialog();
-            notificationDialog->setAttribute(Qt::WA_DeleteOnClose);
-            notificationDialog->setTitle(hbTrId(
-                                         "txt_applib_dpophead_added_to_homescreen") );
-            notificationDialog->show();
-        } else {
-            mWidget->uninitializeWidget();
-            mWidget->deleteFromDatabase();
-        }
-        mPopupDialog = NULL;
-        emit exit();
-    } else {
-        // (work-around for crash if more then one action is selected in HbDialog)
-        qWarning("Another signal finished was emited.");
+            mWidget->remove();
+            mWidget = NULL;
     }
+    emit exit();
 }
 
-
-
 /*!
  Subscribe for memory card remove.
  \retval void
@@ -250,10 +229,9 @@
     mNotifier->setParent(this);
     connect(mNotifier,
             SIGNAL(entryChanged(CaEntry,ChangeType)),
-            SLOT(memoryCardRemoved()));
+            SIGNAL(exit()));
 }
 
-
 /*!
  Shows message about corrupted widget library. Deletes widget eventually
  \retval void
@@ -271,9 +249,9 @@
     QString message(hbTrId("txt_applib_dialog_file_corrupted_unable_to_use_wi"));
     mCorruptedMessage->setText(message);
 
-	mCorruptedMessage->clearActions();
+    mCorruptedMessage->clearActions();
     HbAction *primaryAction = new HbAction(hbTrId("txt_common_button_ok"), mCorruptedMessage);
-	mCorruptedMessage->addAction(primaryAction);
+    mCorruptedMessage->addAction(primaryAction);
 
     HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), mCorruptedMessage);
     mCorruptedMessage->addAction(secondaryAction);
@@ -291,14 +269,8 @@
  */
 void HsPreviewHSWidgetState::messageWidgetCorruptedFinished(HbAction* finishedAction)
 {
-    if (mCorruptedMessage) {
-        if (finishedAction == mCorruptedMessage->actions().value(0)) {
-            HsMenuService::executeAction(mEntryId, removeActionIdentifier());
-        }
-        mCorruptedMessage = NULL;
-        emit exit();
-    } else {
-        // (work-around for crash if more then one action is selected in HbDialog)
-        qWarning("Another signal finished was emited.");
+    if (finishedAction == mCorruptedMessage->actions().value(0)) {
+        HsMenuService::executeAction(mEntryId, removeActionIdentifier());
     }
+    emit exit();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -0,0 +1,147 @@
+/*
+ * 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: Menu delete collection item state
+ *
+ */
+
+#include <hbmessagebox.h>
+#include <hbaction.h>
+#include <hsmenuservice.h>
+#include <hsshortcutservice.h>
+
+#include "hsuninstallitemstate.h"
+#include "hsmenuevent.h"
+
+/*!
+ \class HsUninstallItemState
+ \ingroup group_hsworkerstateplugin
+ \brief Uninstall Item State.
+ Deletes app from collection.
+ */
+
+/*!
+ Constructor.
+ \param parent Owner.
+ */
+HsUninstallItemState::HsUninstallItemState(QState *parent) :
+    QState(parent),
+    mItemId(0),
+    mUninstallMessage(NULL),
+    mConfirmAction(NULL)
+{
+    construct();
+}
+
+/*!
+ Destructor.
+ */
+HsUninstallItemState::~HsUninstallItemState()
+{
+    cleanUp(); // in case of throw
+}
+
+/*!
+ Constructs contained objects.
+ */
+void HsUninstallItemState::construct()
+{
+    setObjectName(this->parent()->objectName()
+                  + "/UninstallItemState");
+    setProperty(HS_SERVICES_REGISTRATION_KEY, QList<QVariant> ()
+                << SHORTCUT_SERVICE_KEY);
+    connect(this, SIGNAL(exited()), SLOT(cleanUp()));
+}
+
+/*!
+ Sets entry event.
+ \param event entry event.
+ */
+void HsUninstallItemState::onEntry(QEvent *event)
+{
+    HSMENUTEST_FUNC_ENTRY("HsUninstallItemState::onEntry");
+    QState::onEntry(event);
+    qDebug("HsUninstallItemState::onEntry()");
+    HsMenuEvent *menuEvent = static_cast<HsMenuEvent *>(event);
+    QVariantMap data = menuEvent->data();
+
+    mItemId = data.value(itemIdKey()).toInt();
+
+    QString message;
+    if (shortcutService()->isItemShortcutWidget(mItemId)) {
+        message.append(
+            hbTrId("txt_applib_dialog_uninstalls_1_and_deletes_all_sh").arg(
+                HsMenuService::getName(mItemId)));
+    } else {
+        message.append(
+            hbTrId("txt_applib_dialog_1_will_be_removed_from_phone_c").arg(
+                HsMenuService::getName(mItemId)));
+    }
+
+    // create and show message box
+    mUninstallMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+    mUninstallMessage->setAttribute(Qt::WA_DeleteOnClose);
+
+    mUninstallMessage->setText(message);
+
+    mUninstallMessage->clearActions();
+    mConfirmAction = new HbAction(hbTrId("txt_common_button_ok"), mUninstallMessage);
+    mUninstallMessage->addAction(mConfirmAction);
+
+    HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), mUninstallMessage);
+    mUninstallMessage->addAction(secondaryAction);
+
+    mUninstallMessage->open(this, SLOT(uninstallMessageFinished(HbAction*)));
+
+    HSMENUTEST_FUNC_EXIT("HsUninstallItemState::onEntry");
+}
+
+/*!
+ Action after closed confirmation dialog.
+ \param finishedAction chosen action.
+ \retval void
+ */
+void HsUninstallItemState::uninstallMessageFinished(HbAction* finishedAction)
+{
+    if (finishedAction == mConfirmAction) {
+        HsMenuService::executeAction(mItemId, removeActionIdentifier());
+    }
+    emit exit();
+}
+
+/*!
+ Convenience method returning the shortcut service.
+ \since S60 ?S60_version.
+ \return Shortcut Service.
+ */
+HsShortcutService *HsUninstallItemState::shortcutService() const
+{
+    return property(SHORTCUT_SERVICE_KEY).value<HsShortcutService *> ();
+}
+
+/*!
+ Slot launched after state has exited and in destructor.
+ \retval void
+ */
+void HsUninstallItemState::cleanUp()
+{
+    // Close messagebox if App key was pressed
+    if (mUninstallMessage) {
+        disconnect(mUninstallMessage, SIGNAL(finished(HbAction*)), this, SLOT(uninstallMessageFinished(HbAction*)));
+        mUninstallMessage->close();
+        mUninstallMessage = NULL;
+    }
+
+    mConfirmAction = NULL;
+    mItemId = 0;
+}
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -89,14 +89,7 @@
     nameLabel->setPlainText(detailMap[CaSoftwareRegistry::componentNameKey()]);
     versionLabel->setPlainText(detailMap[CaSoftwareRegistry::componentVersionKey()]);
     supplierLabel->setPlainText(detailMap[CaSoftwareRegistry::componentVendorKey()]);
-    if(detailMap[CaSoftwareRegistry::componentDriveInfoKey()] == "C:")
-        memoryLabel->setPlainText(QString("%1 txt_applib_dialog_1_device_memory").arg(detailMap[CaSoftwareRegistry::componentDriveInfoKey()]));
-    else if (detailMap[CaSoftwareRegistry::componentDriveInfoKey()] == "E:")
-        memoryLabel->setPlainText(QString("%1 txt_applib_dialog_1_mass_storage").arg(detailMap[CaSoftwareRegistry::componentDriveInfoKey()]));
-    else if (detailMap[CaSoftwareRegistry::componentDriveInfoKey()] == "F:")
-        memoryLabel->setPlainText(QString("%1 txt_applib_dialog_1_memory_card").arg(detailMap[CaSoftwareRegistry::componentDriveInfoKey()]));
-    else
-        memoryLabel->setPlainText(detailMap[CaSoftwareRegistry::componentDriveInfoKey()]);
+    memoryLabel->setPlainText(detailMap[CaSoftwareRegistry::componentDriveInfoKey()]);
     sizeLabel->setPlainText(detailMap[CaSoftwareRegistry::componentSizeKey()]);
     typeLabel->setPlainText(detailMap[CaSoftwareRegistry::componentTypeKey()]);
     
--- a/homescreenapp/widgetplugins/hsshortcutwidgetplugin/inc/hsshortcutwidget.h	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/inc/hsshortcutwidget.h	Fri Jun 11 13:30:16 2010 +0300
@@ -37,6 +37,8 @@
     Q_PROPERTY(int caEntryId READ caEntryId WRITE setCaEntryId)
     Q_PROPERTY(QString uid READ uid WRITE setUid)
     
+    Q_PROPERTY(QString text READ text WRITE setText )
+    
 public:
     HsShortcutWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
     ~HsShortcutWidget();
@@ -46,6 +48,9 @@
     void setUid(const QString &uid);
     QString uid() const;
 
+    QString text() const;
+    void setText(const QString& textItem);
+
     bool eventFilter(QObject *watched, QEvent *event);
 
 signals:
--- a/homescreenapp/widgetplugins/hsshortcutwidgetplugin/resource/hsshortcutwidget.css	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/resource/hsshortcutwidget.css	Fri Jun 11 13:30:16 2010 +0300
@@ -1,30 +1,30 @@
 HsShortcutWidget {
+  layout: icon_shortcut;
+}
+
+HsShortcutWidget[text] {
   layout: icon_text_shortcut;
 }
 
-HsShortcutWidget[icon][text] {
-  layout: icon_text_shortcut;
-}
-
-HsShortcutWidget[icon][!text] {
+HsShortcutWidget[!text] {
   layout: icon_shortcut;
 }
 
 HsShortcutWidget::background {
   border-width: 0.0un;
   fixed-width: 12un;
-  fixed-height: expr(12.5un + var(hb-param-text-height-tiny));
+  fixed-height: 12un;
   zvalue: 0;
 }
 
-HsShortcutWidget[icon][text]::background {
+HsShortcutWidget[text]::background {
   border-width: 0.0un;
   fixed-width: 12un;
   fixed-height: expr(12.5un + var(hb-param-text-height-tiny));
   zvalue: 0;
 }
 
-HsShortcutWidget[icon][!text]::background {
+HsShortcutWidget[!text]::background {
   border-width: 0.0un;
   fixed-width: 12un;
   fixed-height: 12un;
--- a/homescreenapp/widgetplugins/hsshortcutwidgetplugin/src/hsshortcutwidget.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/src/hsshortcutwidget.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -98,6 +98,28 @@
 }
 
 /*!
+    Returns the text property. This property is needed by css selector.
+*/
+QString HsShortcutWidget::text() const
+{
+    if ( mText ) {
+        return mText->text();
+    } else {
+        return QString();
+        }
+}
+
+/*!
+    Sets the text property. This property is needed by css selector.
+*/
+void HsShortcutWidget::setText(const QString& textItem)
+{
+    if ( mText ) {
+        mText->setText(textItem);
+    }
+}
+
+/*!
     Filters touch area events.
 */
 bool HsShortcutWidget::eventFilter(QObject *watched, QEvent *event)
@@ -239,11 +261,10 @@
     }
 
     // Text
-    if (!mText) {
+    if ( HsConfiguration::shortcutLabelsVisible() && !mText ) {
         mText = new HbTextItem(this);
         HbStyle::setItemName(mText, QLatin1String("text"));
-    }
-
+        }
     // Touch Area
     if (!mTouchArea) {
         mTouchArea = new HbTouchArea(this);
@@ -261,7 +282,9 @@
     mCaEntryFlags = caEntry.flags();
     mCaEntryTypeName = caEntry.entryTypeName();
     mIcon->setIcon(caEntry.makeIcon());
-    mText->setText(caEntry.text());
+    if (mText) {
+        mText->setText(caEntry.text());
+        }
 }
 
 /*!
@@ -320,3 +343,5 @@
         emit finished();
     }
 }
+
+
--- a/taskswitcherapp/rom/tsapplication_core.iby	Thu May 27 12:46:08 2010 +0300
+++ b/taskswitcherapp/rom/tsapplication_core.iby	Fri Jun 11 13:30:16 2010 +0300
@@ -17,8 +17,6 @@
 #ifndef __TSAPP_CORE_IBY__
 #define __TSAPP_CORE_IBY__
 
-data=\epoc32\data\z\resource\qt\crml\tsexternalactivation.qcrml             resource\qt\crml\tsexternalactivation.qcrml
-
 file=ABI_DIR\BUILD_DIR\tsdevicedialogplugin.dll					       SHARED_LIB_DIR\tsdevicedialogplugin.dll
 data=\epoc32\data\z\resource\plugins\devicedialogs\tsdevicedialogplugin.qtplugin    resource\plugins\devicedialogs\tsdevicedialogplugin.qtplugin
 
--- a/taskswitcherapp/taskswitcherapp.pro	Thu May 27 12:46:08 2010 +0300
+++ b/taskswitcherapp/taskswitcherapp.pro	Fri Jun 11 13:30:16 2010 +0300
@@ -16,14 +16,14 @@
 
 TEMPLATE = subdirs
 
-SUBDIRS += tsdevicedialogplugin
-
 coverage {
     SUBDIRS += ../../homescreensrv/activityfw
     SUBDIRS += ../../homescreensrv/hsappkeyhandler
     SUBDIRS += ../../homescreensrv/tstaskmonitor
 }
 
+SUBDIRS += tsdevicedialogplugin
+
 tests {
     SUBDIRS += internal/tstestrunner    
     SUBDIRS += tsdevicedialogplugin/tsrc
@@ -33,7 +33,10 @@
     SUBDIRS += ../../homescreensrv/activityfw/activityserviceplugin/s60/tsrc
     SUBDIRS += ../../homescreensrv/tstaskmonitor/client/tsrc
     SUBDIRS += ../../homescreensrv/tstaskmonitor/server/tsrc
+    SUBDIRS += ../../homescreensrv/tstaskmonitor/screenshotplugin/tsrc
     SUBDIRS += ../../homescreensrv/activityfw/tsutils/tsrc
+    SUBDIRS += ../../homescreensrv/tstaskmonitor/utils/tsrc
+    SUBDIRS += ../../homescreensrv/tstaskmonitor/backstepping/tsrc
 }
 
 symbian:include(rom.pri)
--- a/taskswitcherapp/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -154,4 +154,12 @@
     return mError;
 }
 
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT
+
 Q_EXPORT_PLUGIN2(tsdevicedialogplugin, TsDeviceDialogPlugin)
+
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
--- a/taskswitcherapp/tsdevicedialogplugin/src/tsentrymodelitem.cpp	Thu May 27 12:46:08 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/src/tsentrymodelitem.cpp	Fri Jun 11 13:30:16 2010 +0300
@@ -56,7 +56,9 @@
             return QVariant(mEntry->name());
         case Qt::DecorationRole:
             {
-                QPixmap icon = mEntry->icon();
+                QPixmap icon = mEntry->screenshot().isNull() ? 
+                               mEntry->icon() :
+                               mEntry->screenshot();
                 if (icon.isNull()) {
                     return HbIcon("qtg_large_application");
                 } else {