201019
authorhgs
Fri, 14 May 2010 15:15:12 +0300
changeset 26 41ebde60981f
parent 25 31fc1277642e
child 27 271e901a9423
201019
group/bld.inf
htiui/HtiAdminQt/chtiadminengine.h
htiui/HtiAdminQt/htienginewrapper.cpp
htiui/HtiAdminQt/htienginewrapper.h
htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp
htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiBookmarkHandler.h
htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiBookmarkHandler.cpp
htiui/sis/HTI_S60-10_1.pkg
htiui/sis/HTI_S60-52.pkg
htiui/sis/HTI_S60_Upgrade-10_1.pkg
htiui/sis/HTI_S60_Upgrade-52.pkg
htiui/sis/HTI_stub.pkg
launcher/launcher.pro
launcher/src/applicationview.cpp
launcher/src/commonActions.cpp
launcher/src/launchermainwindow.cpp
launcher/src/outputview.cpp
layers.sysdef.xml
memspyui/data/memspyui.rss
memspyui/ui/avkon/group/memspyui.mmp
memspyui/ui/avkon/inc/MemSpyUiUtils.h
memspyui/ui/avkon/inc/MemSpyViewKernelObjects.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemActiveObject.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemChunk.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemCodeSeg.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneralInfo.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneric.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemHeap.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemList.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemServer.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemStack.h
memspyui/ui/avkon/src/MemSpyUiUtils.cpp
memspyui/ui/avkon/src/MemSpyViewKernelContainers.cpp
memspyui/ui/avkon/src/MemSpyViewKernelHeap.cpp
memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemActiveObject.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemChunk.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemCodeSeg.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneralInfo.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemHeap.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemList.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemServer.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemStack.cpp
memspyui/ui/avkon/src/MemSpyViewThreads.cpp
memspyui/ui/hb/hb.pro
memspyui/ui/hb/inc/enginewrapper.h
memspyui/ui/hb/inc/memspykernelobjecttypeview.h
memspyui/ui/hb/inc/memspythreaddetailindexview.h
memspyui/ui/hb/inc/memspythreaddetailview.h
memspyui/ui/hb/inc/viewmanager.h
memspyui/ui/hb/src/enginewrapper.cpp
memspyui/ui/hb/src/memspykernelobjecttypeview.cpp
memspyui/ui/hb/src/memspymainview.cpp
memspyui/ui/hb/src/memspythreaddetailindexview.cpp
memspyui/ui/hb/src/memspythreaddetailview.cpp
memspyui/ui/hb/src/memspythreadview.cpp
memspyui/ui/hb/src/viewmanager.cpp
perfmon/ui/hb/app/src/mainview.cpp
piprofilerui/group/bld.inf
piprofilerui/group/bld_generic.inf
piprofilerui/group/group.pro
piprofilerui/piprofilerui.pro
piprofilerui/sis/PIProfiler_S60-30.pkg
piprofilerui/sis/PIProfiler_S60-31.pkg
piprofilerui/sis/PIProfiler_S60-32.pkg
piprofilerui/sis/PIProfiler_S60-50.pkg
piprofilerui/sis/PIProfiler_Symbian3.pkg
piprofilerui/sis/PIProfiler_Symbian4.pkg
piprofilerui/sis/PIProfiler_stub.pkg
piprofilerui/ui/avkon/data/piprofilerui.rss
piprofilerui/ui/avkon/data/piprofilerui_reg.rss
piprofilerui/ui/avkon/group/backup_registration.xml
piprofilerui/ui/avkon/group/bld.inf
piprofilerui/ui/avkon/group/piprofilerui.mmp
piprofilerui/ui/avkon/group/piprofilerui_extraicons.mk
piprofilerui/ui/avkon/group/piprofilerui_icons_aif.mk
piprofilerui/ui/avkon/inc/profiler_gui.hrh
piprofilerui/ui/avkon/inc/profiler_gui_app.h
piprofilerui/ui/avkon/inc/profiler_gui_appui.h
piprofilerui/ui/avkon/inc/profiler_gui_attributes.h
piprofilerui/ui/avkon/inc/profiler_gui_document.h
piprofilerui/ui/avkon/inc/profiler_gui_maincontainer.h
piprofilerui/ui/avkon/inc/profiler_gui_mainview.h
piprofilerui/ui/avkon/inc/profiler_gui_model.h
piprofilerui/ui/avkon/inc/profiler_gui_samplersettingsviewdlg.h
piprofilerui/ui/avkon/inc/profiler_gui_settingsviewdlg.h
piprofilerui/ui/avkon/inc/profiler_gui_std.h
piprofilerui/ui/avkon/rom/piprofilerui_avkon.iby
piprofilerui/ui/avkon/src/profiler_gui_app.cpp
piprofilerui/ui/avkon/src/profiler_gui_appui.cpp
piprofilerui/ui/avkon/src/profiler_gui_document.cpp
piprofilerui/ui/avkon/src/profiler_gui_maincontainer.cpp
piprofilerui/ui/avkon/src/profiler_gui_mainview.cpp
piprofilerui/ui/avkon/src/profiler_gui_model.cpp
piprofilerui/ui/avkon/src/profiler_gui_samplersettingsviewdlg.cpp
piprofilerui/ui/avkon/src/profiler_gui_settingsviewdlg.cpp
piprofilerui/ui/hb/hb.pro
piprofilerui/ui/hb/inc/generalattributes.h
piprofilerui/ui/hb/inc/notifications.h
piprofilerui/ui/hb/inc/pimainview.h
piprofilerui/ui/hb/inc/pimainwindow.h
piprofilerui/ui/hb/inc/piprofilerengine.h
piprofilerui/ui/hb/inc/piprofilerengineprivate.h
piprofilerui/ui/hb/inc/pisettingsview.h
piprofilerui/ui/hb/inc/pluginattributes.h
piprofilerui/ui/hb/pimainview.docml
piprofilerui/ui/hb/piprofiler.qrc
piprofilerui/ui/hb/rom/piprofilerui_hb.iby
piprofilerui/ui/hb/src/main.cpp
piprofilerui/ui/hb/src/notifications.cpp
piprofilerui/ui/hb/src/pimainview.cpp
piprofilerui/ui/hb/src/pimainwindow.cpp
piprofilerui/ui/hb/src/piprofilerengine.cpp
piprofilerui/ui/hb/src/piprofilerengineprivate.cpp
piprofilerui/ui/hb/src/pisettingsview.cpp
piprofilerui/ui/hb/src/pluginattributes.cpp
piprofilerui/ui/icons/qgn_menu_piprofilerui.svg
piprofilerui/ui/icons/qgn_prob_piprofilerui_status_disabled.svg
piprofilerui/ui/icons/qgn_prob_piprofilerui_status_enabled.svg
screengrabber/inc/enginewrapper.h
screengrabber/inc/sgengine.h
screengrabber/src/enginewrapper.cpp
screengrabber/src/gifanimator.cpp
screengrabber/src/mainview.cpp
screengrabber/src/sgengine.cpp
stifui/avkon/group/ReleaseNote.txt
stifui/avkon/sis/Stifui_31.sis
stifui/avkon/stifui/inc/version.h
stifui/qt/ReleaseNote.txt
stifui/qt/inc/dlgoutput.h
stifui/qt/inc/dlgsetselector.h
stifui/qt/inc/frmmain.h
stifui/qt/inc/istfqtuicontroller.h
stifui/qt/inc/istfqtuimodel.h
stifui/qt/inc/stfqtuicontroller.h
stifui/qt/inc/stfqtuimodel.h
stifui/qt/inc/stifexecutor.h
stifui/qt/inc/uisetting.h
stifui/qt/inc/uiversion.h
stifui/qt/inc/version.h
stifui/qt/qss/coffee.qss
stifui/qt/resource/StfQtUI.qrc
stifui/qt/sis/StfQtUI.pkg
stifui/qt/src/dlgoutput.cpp
stifui/qt/src/dlgsetselector.cpp
stifui/qt/src/dlgsetting.cpp
stifui/qt/src/frmmain.cpp
stifui/qt/src/main.cpp
stifui/qt/src/stfqtuicontroller.cpp
stifui/qt/src/stfqtuimodel.cpp
stifui/qt/src/stifexecutor.cpp
stifui/qt/src/uisetting.cpp
stifui/qt/stifqtui.pro
--- a/group/bld.inf	Thu May 13 21:10:48 2010 +0300
+++ b/group/bld.inf	Fri May 14 15:15:12 2010 +0300
@@ -25,6 +25,6 @@
 //Orbit version added #include "../loadgen/group/bld.inf"
 //Orbit version added #include "../perfmon/group/bld.inf"
 //Orbit version added #include "../screengrabber/group/bld.inf"
-#include "../stifui/avkon/group/bld.inf"
+//Orbit version added #include "../stifui/avkon/group/bld.inf"
 //Orbit version added #include "../memspyui/group/bld.inf"
 //Orbit version added #include "../htiui/group/bld.inf"
--- a/htiui/HtiAdminQt/chtiadminengine.h	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/HtiAdminQt/chtiadminengine.h	Fri May 14 15:15:12 2010 +0300
@@ -20,7 +20,7 @@
 
 #include <e32std.h>
 #include <e32base.h>
-#include <BADESCA.H> 
+#include <badesca.h> 
 
 
 class HtiEngineWrapper;
--- a/htiui/HtiAdminQt/htienginewrapper.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/HtiAdminQt/htienginewrapper.cpp	Fri May 14 15:15:12 2010 +0300
@@ -21,7 +21,7 @@
 
 #include <coecntrl.h>
 #include <QString>
-#include <QLocale.h>
+#include <qlocale.h>
 
 
 #include <HtiVersion.h>
--- a/htiui/HtiAdminQt/htienginewrapper.h	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/HtiAdminQt/htienginewrapper.h	Fri May 14 15:15:12 2010 +0300
@@ -20,7 +20,7 @@
 
 #include <e32cmn.h>
 #include <qobject.h>
-#include <QStringList.h>
+#include <qstringlist.h>
 
 class CHtiAdminEngine;
 class QString;
--- a/htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp	Fri May 14 15:15:12 2010 +0300
@@ -35,7 +35,7 @@
 #include <swi/sisregistrysession.h>
 #include <swi/sisregistrypackage.h>
 #include <javaregistryincludes.h>
-#include <widgetregistryclient.h>
+#include <WidgetRegistryClient.h>
 
 using namespace Java;
 
@@ -622,7 +622,26 @@
                     iInstOpts.iLang =         (TLanguage) parameters[offset]; offset++;
                     iInstOpts.iUsePhoneLang = (TBool) parameters[offset]; offset++;
                     iInstOpts.iUpgradeData =  ConvertToPolicy( parameters[offset] );
+                    offset++;
+                    HTI_LOG_FORMAT( "parameters length: %d", parameters.Length());
+                    HTI_LOG_FORMAT( "next offset: %d", offset);
 
+                    if(parameters.Length() > offset)
+                        {
+                        TInt language = iInstOpts.iLang;
+                        if (parameters.Length() == offset+2)
+                            {
+                            language = parameters[offset] + parameters[offset+1]<<8;
+                            }
+                        if (parameters.Length() == offset+1)
+                            {
+                            language = parameters[offset];
+                            }
+                        if ((language > ELangTest) && (language < ELangMaximum))
+                            {
+                            iInstOpts.iLang =         (TLanguage) language;
+                            }
+                        }
                     HTI_LOG_FORMAT( "iDrive: %c",        iInstOpts.iDrive.GetLowerCase() );
                     HTI_LOG_FORMAT( "iLang: %d",         iInstOpts.iLang );
                     HTI_LOG_FORMAT( "iUsePhoneLang: %d", iInstOpts.iUsePhoneLang );
@@ -1558,7 +1577,7 @@
         offset += length; // skip over password
         offset += 4;      // the last one byte params
 
-        if ( aParams.Length() != offset )
+        if ( aParams.Length() < offset || aParams.Length() > offset + 2)
             {
             HTI_LOG_TEXT( "ValidateInstallParams: Failed, final length incorrect" );
             return EFalse;
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiBookmarkHandler.h	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiBookmarkHandler.h	Fri May 14 15:15:12 2010 +0300
@@ -21,8 +21,8 @@
 
 // INCLUDES
 #include <e32std.h>
-#include <favouriteslimits.h>
-#include <favouritessession.h>
+#include <FavouritesLimits.h>
+#include <FavouritesSession.h>
 #include <HtiServicePluginInterface.h>
 
 // CONSTANTS
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiBookmarkHandler.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiBookmarkHandler.cpp	Fri May 14 15:15:12 2010 +0300
@@ -25,14 +25,14 @@
 #include <cmdestination.h>
 #include <cmmanager.h>
 
-#include <favouritesitem.h>
-#include <favouritesitemlist.h>
+#include <FavouritesItem.h>
+#include <FavouritesItemList.h>
 #include <FavouritesDb.h>
 #include <FavouritesFile.h>
 #include <FavouritesWapAp.h>
 
 #include <HtiDispatcherInterface.h>
-#include <HTILogging.h>
+#include <HtiLogging.h>
 
 // EXTERNAL DATA STRUCTURES
 
--- a/htiui/sis/HTI_S60-10_1.pkg	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/sis/HTI_S60-10_1.pkg	Fri May 14 15:15:12 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,21,0
+#{"HTI"},(0x1020DEB6),2,22,0
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- a/htiui/sis/HTI_S60-52.pkg	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/sis/HTI_S60-52.pkg	Fri May 14 15:15:12 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,21,0
+#{"HTI"},(0x1020DEB6),2,22,0
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- a/htiui/sis/HTI_S60_Upgrade-10_1.pkg	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/sis/HTI_S60_Upgrade-10_1.pkg	Fri May 14 15:15:12 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,21,0,TYPE=SA,RU
+#{"HTI"},(0x1020DEB6),2,22,0,TYPE=SA,RU
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- a/htiui/sis/HTI_S60_Upgrade-52.pkg	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/sis/HTI_S60_Upgrade-52.pkg	Fri May 14 15:15:12 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,21,0,TYPE=SA,RU
+#{"HTI"},(0x1020DEB6),2,22,0,TYPE=SA,RU
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- a/htiui/sis/HTI_stub.pkg	Thu May 13 21:10:48 2010 +0300
+++ b/htiui/sis/HTI_stub.pkg	Fri May 14 15:15:12 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,21,0
+#{"HTI"},(0x1020DEB6),2,22,0
 
 ; Localised Vendor name
 %{"Nokia"}
--- a/launcher/launcher.pro	Thu May 13 21:10:48 2010 +0300
+++ b/launcher/launcher.pro	Fri May 14 15:15:12 2010 +0300
@@ -1,19 +1,3 @@
-#
-# 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: 
-#
-
 TEMPLATE = app
 TARGET = Launcher
 load(hb.prf)
@@ -22,8 +6,8 @@
 DEPENDPATH += inc
 INCLUDEPATH += inc
 
-HEADERS += launchermainwindow.h applicationview.h enginewrapper.h notifications.h  outputview.h commonactions.h
-SOURCES += main.cpp launchermainwindow.cpp applicationview.cpp enginewrapper.cpp notifications.cpp  outputview.cpp commonactions.cpp
+HEADERS += launchermainwindow.h applicationview.h enginewrapper.h notifications.h  outputview.h commonActions.h
+SOURCES += main.cpp launchermainwindow.cpp applicationview.cpp enginewrapper.cpp notifications.cpp  outputview.cpp commonActions.cpp
 RESOURCES += launcher.qrc
 
 symbian: {
--- a/launcher/src/applicationview.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/launcher/src/applicationview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -26,7 +26,7 @@
 #include "launchermainwindow.h"
 #include "enginewrapper.h"
 #include "notifications.h"
-#include "commonactions.h"
+#include "commonActions.h"
 #include "outputview.h"
 
 
--- a/launcher/src/commonActions.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/launcher/src/commonActions.cpp	Fri May 14 15:15:12 2010 +0300
@@ -20,7 +20,7 @@
 
 #include "hbaction.h"
 #include "hbmenu.h"
-#include "commonactions.h"
+#include "commonActions.h"
 #include "notifications.h"
 #include "enginewrapper.h"
 
--- a/launcher/src/launchermainwindow.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/launcher/src/launchermainwindow.cpp	Fri May 14 15:15:12 2010 +0300
@@ -21,7 +21,7 @@
 #include <hbdocumentloader.h>
 
 #include "enginewrapper.h"
-#include "commonactions.h"
+#include "commonActions.h"
 #include "applicationview.h"
 #include "outputview.h"
 #include "launchermainwindow.h"
--- a/launcher/src/outputview.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/launcher/src/outputview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -22,7 +22,7 @@
 #include <hbtextedit.h>
 
 #include "enginewrapper.h"
-#include "commonactions.h"
+#include "commonActions.h"
 #include "outputview.h"
 
 // xml definition of view
--- a/layers.sysdef.xml	Thu May 13 21:10:48 2010 +0300
+++ b/layers.sysdef.xml	Fri May 14 15:15:12 2010 +0300
@@ -6,9 +6,6 @@
 <SystemDefinition name="rndtools" schema="1.5.1">
   <systemModel>
     <layer name="app_layer">
-      <module name="rndtools">
-        <unit unitID="tools.rndtools" mrp="" bldFile="&layer_real_source_path;/group" name="rndtools" />
-      </module>
       <module name="screengrabber">
 				<unit unitID="tools.screengrabberqt" mrp="" bldFile="&layer_real_source_path;/screengrabber" name="screengrabber" proFile="screengrabber.pro" />
 			</module>
@@ -32,7 +29,13 @@
 			</module>
 			<module name="memspyui">
 				<unit unitID="tools.memspyuiqt" mrp="" bldFile="&layer_real_source_path;/memspyui" name="memspyui" proFile="memspyui.pro" />
-			</module>			
+			</module>
+			<module name="piprofilerui">
+				<unit unitID="tools.piprofilerui" mrp="" bldFile="&layer_real_source_path;/piprofilerui" name="piprofilerui" proFile="piprofilerui.pro" />
+			</module>
+			<module name="stifui">
+				<unit unitID="tools.stifuiqt" mrp="" bldFile="&layer_real_source_path;/stifui/qt" name="stifui" proFile="stifqtui.pro" />
+			</module>
     </layer>
   </systemModel>
 </SystemDefinition>
\ No newline at end of file
--- a/memspyui/data/memspyui.rss	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/data/memspyui.rss	Fri May 14 15:15:12 2010 +0300
@@ -35,7 +35,7 @@
 
 
 // User includes
-#include "MemSpy.hrh"
+#include "../ui/avkon/inc/MemSpy.hrh"
 
 
 RESOURCE RSS_SIGNATURE { }
--- a/memspyui/ui/avkon/group/memspyui.mmp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/group/memspyui.mmp	Fri May 14 15:15:12 2010 +0300
@@ -64,7 +64,6 @@
 source			MemSpyViewECom.cpp
 */
 source          MemSpyViewThreads.cpp
-/*
 source          MemSpyViewThreadInfoItemList.cpp
 source          MemSpyViewThreadInfoItemGeneric.cpp
 source          MemSpyViewThreadInfoItemHeap.cpp
@@ -74,6 +73,7 @@
 source          MemSpyViewThreadInfoItemServer.cpp
 source          MemSpyViewThreadInfoItemActiveObject.cpp
 source          MemSpyViewThreadInfoItemGeneralInfo.cpp
+/*
 source          MemSpyViewHeapTracking.cpp
 source          MemSpyViewHeapTrackingResults.cpp
 source          MemSpyViewHeapTrackingSettings.cpp
--- a/memspyui/ui/avkon/inc/MemSpyUiUtils.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyUiUtils.h	Fri May 14 15:15:12 2010 +0300
@@ -23,13 +23,40 @@
 
 // Engine includes
 #include <memspy/engine/memspyengineutils.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
 
+_LIT( KTab, "\t" );
+	
+_LIT( KTypeUnknown, "Unknown Type" );
+_LIT( KGeneral, "General" );
+_LIT( KHeap, "Heap" );
+_LIT( KStack, "Stack" );
+_LIT( KChunks, "Chunks" );
+_LIT( KCodeSegs, "Code Segments" );
+_LIT( KOpenFiles, "Open Files" );
+_LIT( KActiveObjects, "Active Objects" );
+_LIT( KThreadHandlers, "Handlers to other Threads" );
+_LIT( KProcessHandlers, "Handlers to other Processes" );
+_LIT( KServers, "Servers running in Thread" );
+_LIT( KConnections, "Client <> Server Connections" );
+_LIT( KSemaphores, "Semaphores" );
+_LIT( KThreadReferences, "References in Thread" );
+_LIT( KProcessReferences, "References in Process" );
+_LIT( KMutexes, "Mutexes" );
+_LIT( KTimers, "Timers" );
+_LIT( KDD, "Logical DD Channels" );
+_LIT( KChangeNotif, "Change Notifiers" );
+_LIT( KUndertakers, "Undertakers" );
+_LIT( KLogicalDrivers, "Logical Device Drivers" );
+_LIT( KPhysicalDrivers, "Physical Device Drivers" );	
 
 class MemSpyUiUtils : public MemSpyEngineUtils
     {
 public:
     static void Format( TDes& aBuf, TInt aResourceId, ...);
     static void GetErrorText( TDes& aBuf, TInt aError );
+    static HBufC* FormatItem( const TDesC& aCaption );
+    static TDesC& ThreadInfoItemNameByType( TMemSpyThreadInfoItemType aType );
     };
 
 
--- a/memspyui/ui/avkon/inc/MemSpyViewKernelObjects.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyViewKernelObjects.h	Fri May 14 15:15:12 2010 +0300
@@ -67,6 +67,7 @@
 
 private: // From MAknTabObserver
     void TabChangedL( TInt aIndex ); 
+    TPtrC TypeAsString( TMemSpyDriverContainerType aType );
     
 private: // Command handlers
     void OnCmdTerminateL();
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemActiveObject.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemActiveObject.h	Fri May 14 15:15:12 2010 +0300
@@ -27,14 +27,14 @@
 
 // Classes referenced
 class CMemSpyEngineActiveObjectArray;
-
+class RMemSpySession;
 
 
 class CMemSpyViewThreadInfoItemActiveObjectBase : public CMemSpyViewThreadInfoItemGeneric
     {
 public:
-    CMemSpyViewThreadInfoItemActiveObjectBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-
+    CMemSpyViewThreadInfoItemActiveObjectBase( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
+    
 public: // From CMemSpyViewBase
     TBool HandleCommandL( TInt aCommand );
 
@@ -55,7 +55,7 @@
 class CMemSpyViewThreadInfoItemActiveObject : public CMemSpyViewThreadInfoItemActiveObjectBase
     {
 public:
-    CMemSpyViewThreadInfoItemActiveObject( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    CMemSpyViewThreadInfoItemActiveObject( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
     void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
 
 public: // From CMemSpyViewBase
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemChunk.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemChunk.h	Fri May 14 15:15:12 2010 +0300
@@ -25,11 +25,12 @@
 // User includes
 #include "MemSpyViewThreadInfoItemGeneric.h"
 
+class RMemSpySession;
 
 class CMemSpyViewThreadInfoItemChunk : public CMemSpyViewThreadInfoItemGeneric
     {
 public:
-    CMemSpyViewThreadInfoItemChunk( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    CMemSpyViewThreadInfoItemChunk( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId,  TThreadId aId, TMemSpyThreadInfoItemType aType );
 
 private: // From CMemSpyViewBase
     CMemSpyViewBase* PrepareChildViewL();
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemCodeSeg.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemCodeSeg.h	Fri May 14 15:15:12 2010 +0300
@@ -25,11 +25,12 @@
 // User includes
 #include "MemSpyViewThreadInfoItemGeneric.h"
 
+class RMemSpySession;
 
 class CMemSpyViewThreadInfoItemCodeSeg : public CMemSpyViewThreadInfoItemGeneric
     {
 public:
-    CMemSpyViewThreadInfoItemCodeSeg( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    CMemSpyViewThreadInfoItemCodeSeg( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
 
 public: // From CMemSpyViewBase
     TBool HandleCommandL( TInt aCommand );
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneralInfo.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneralInfo.h	Fri May 14 15:15:12 2010 +0300
@@ -25,11 +25,14 @@
 // User includes
 #include "MemSpyViewThreadInfoItemGeneric.h"
 
+class CMemSpyThreadInfoContainer;
+class CMemSpyThreadInfoItemBase;
+class RMemSpySession;
 
 class CMemSpyViewThreadInfoItemGeneralInfo : public CMemSpyViewThreadInfoItemGeneric
     {
 public:
-    CMemSpyViewThreadInfoItemGeneralInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    CMemSpyViewThreadInfoItemGeneralInfo( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
 
 public: // From CMemSpyViewBase
     TBool HandleCommandL( TInt aCommand );
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneric.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneric.h	Fri May 14 15:15:12 2010 +0300
@@ -24,6 +24,7 @@
 
 // Engine includes
 #include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/api/memspyapithreadinfoitem.h>
 
 // User includes
 #include "MemSpyViewBase.h"
@@ -34,12 +35,13 @@
 class CMemSpyThread;
 class CMemSpyThreadInfoContainer;
 class CMemSpyThreadInfoItemBase;
-
+class RMemSpySession;
 
 class CMemSpyViewThreadInfoItemGeneric : public CMemSpyViewBase
     {
 public:
-    CMemSpyViewThreadInfoItemGeneric( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aInfoContainer, TMemSpyThreadInfoItemType aType );
+    //CMemSpyViewThreadInfoItemGeneric( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aInfoContainer, TMemSpyThreadInfoItemType aType );
+	CMemSpyViewThreadInfoItemGeneric( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcessId, TThreadId aId, TMemSpyThreadInfoItemType aType );
     ~CMemSpyViewThreadInfoItemGeneric();
 
 public: // From CMemSpyViewBase
@@ -69,12 +71,18 @@
     static TInt CheckForItemConstructionComplete( TAny* aSelf );
 
 protected: // Member data
-    CMemSpyThreadInfoContainer& iContainer;
-    CMemSpyThreadInfoItemBase* iInfoItem;
-
+    //CMemSpyThreadInfoContainer& iContainer;
+    //CMemSpyThreadInfoItemBase* iInfoItem;
+    
 private: // Member data
     CAknWaitDialog* iWaitNote;
     CPeriodic* iWaitConstructionChecker;
+    
+    RArray<CMemSpyApiThreadInfoItem*> iThreadInfoItems;  //cigasto
+    CDesCArrayFlat* iModel;
+    TThreadId iThreadId;
+    TProcessId iParentProcessId;
+    TMemSpyThreadInfoItemType iType;
     };
 
 
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemHeap.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemHeap.h	Fri May 14 15:15:12 2010 +0300
@@ -25,11 +25,12 @@
 // User includes
 #include "MemSpyViewThreadInfoItemGeneric.h"
 
+class RMemSpySession;
 
 class CMemSpyViewThreadInfoItemHeap : public CMemSpyViewThreadInfoItemGeneric
     {
 public:
-    CMemSpyViewThreadInfoItemHeap( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    CMemSpyViewThreadInfoItemHeap( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType  );
 
 public: // From CMemSpyViewBase
     TBool HandleCommandL( TInt aCommand );
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemList.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemList.h	Fri May 14 15:15:12 2010 +0300
@@ -30,18 +30,17 @@
 class CMemSpyProcess;
 class CMemSpyThread;
 class CMemSpyThreadInfoItemBase;
-
+class RMemSpySession;
 
 class CMemSpyViewThreadInfoItemList : public CMemSpyViewBase, public MMemSpyThreadInfoContainerObserver
     {
 public:
-    CMemSpyViewThreadInfoItemList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThread& aThread );
+    //CMemSpyViewThreadInfoItemList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThread& aThread );
+	CMemSpyViewThreadInfoItemList( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcess, TThreadId aThread );
     ~CMemSpyViewThreadInfoItemList();
     void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
 
 public: // API
-    const CMemSpyProcess& Process() const;
-    const CMemSpyThread& Thread() const;
     const CMemSpyThreadInfoItemBase& CurrentInfoItem() const;
 
 public: // From CMemSpyViewBase
@@ -67,11 +66,14 @@
     void HandleListBoxItemActionedL( TInt aCurrentIndex );
     void HandleListBoxItemSelectedL( TInt aCurrentIndex );
     static TInt IdleUpdateListBoxModel( TAny* aSelf );
-    void DoIdleUpdateListBoxModelL();
+    void DoIdleUpdateListBoxModelL();   
 
 private: // Member data
-    CMemSpyThread& iThread;
+    //CMemSpyThread& iThread;
+    TThreadId iThreadId;
+    TProcessId iParentProcessId;
     CMemSpyThreadInfoItemBase* iCurrentInfoItem;
+    TInt iCurrentInfoItemId;
     CPeriodic* iIdleResetListboxTimer;
     };
 
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemServer.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemServer.h	Fri May 14 15:15:12 2010 +0300
@@ -28,13 +28,12 @@
 
 // Classes referenced
 class TMemSpyDriverHandleInfoGeneric;
-
-
+class RMemSpySession;
 
 class CMemSpyViewThreadInfoItemServer : public CMemSpyViewThreadInfoItemGeneric
     {
 public:
-    CMemSpyViewThreadInfoItemServer( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    CMemSpyViewThreadInfoItemServer( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
 
 public: // From CMemSpyViewBase
     void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemStack.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemStack.h	Fri May 14 15:15:12 2010 +0300
@@ -25,11 +25,12 @@
 // User includes
 #include "MemSpyViewThreadInfoItemGeneric.h"
 
+class RMemSpySession;
 
 class CMemSpyViewThreadInfoItemStack : public CMemSpyViewThreadInfoItemGeneric
     {
 public:
-    CMemSpyViewThreadInfoItemStack( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    CMemSpyViewThreadInfoItemStack( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
 
 public: // From CMemSpyViewBase
     TBool HandleCommandL( TInt aCommand );
--- a/memspyui/ui/avkon/src/MemSpyUiUtils.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyUiUtils.cpp	Fri May 14 15:15:12 2010 +0300
@@ -63,3 +63,89 @@
         }
     }
 
+HBufC* MemSpyUiUtils::FormatItem( const TDesC& aCaption )
+	{
+	HBufC* retBuf = HBufC::NewL( 32 );
+	TPtr pRetBuf( retBuf->Des() );
+	pRetBuf.Zero();
+	pRetBuf.Append( _L("\t") );
+	pRetBuf.Append( aCaption );
+	return retBuf;
+	}
+
+TDesC& MemSpyUiUtils::ThreadInfoItemNameByType( TMemSpyThreadInfoItemType aType )
+	{	
+	TPtrC pType( KTypeUnknown );
+	
+	switch( aType )
+		{
+		case EMemSpyThreadInfoItemTypeFirst:			
+			pType.Set(KGeneral);
+			break;			
+		case EMemSpyThreadInfoItemTypeHeap:			
+			pType.Set(KHeap);
+			break;				
+		case EMemSpyThreadInfoItemTypeStack:			
+			pType.Set(KStack);
+			break;			
+		case EMemSpyThreadInfoItemTypeChunk:			
+			pType.Set(KChunks);
+			break;
+		case EMemSpyThreadInfoItemTypeCodeSeg:
+			pType.Set(KCodeSegs);
+			break;
+		case EMemSpyThreadInfoItemTypeOpenFiles:
+			pType.Set(KOpenFiles);
+			break;	
+		case EMemSpyThreadInfoItemTypeActiveObject:
+			pType.Set(KActiveObjects);
+			break;
+		case EMemSpyThreadInfoItemTypeOwnedThreadHandles:
+			pType.Set(KThreadHandlers);
+			break;
+		case EMemSpyThreadInfoItemTypeOwnedProcessHandles:
+			pType.Set(KProcessHandlers);
+			break;
+		case EMemSpyThreadInfoItemTypeServer:
+			pType.Set(KServers);
+			break;
+		case EMemSpyThreadInfoItemTypeSession:
+			pType.Set(KConnections);
+			break;
+		case EMemSpyThreadInfoItemTypeSemaphore:
+			pType.Set(KSemaphores);
+			break;
+		case EMemSpyThreadInfoItemTypeOtherThreads:
+			pType.Set(KThreadReferences);
+			break;
+		case EMemSpyThreadInfoItemTypeOtherProcesses:
+			pType.Set(KProcessReferences);
+			break;
+		case EMemSpyThreadInfoItemTypeMutex:
+			pType.Set(KMutexes);
+			break;
+		case EMemSpyThreadInfoItemTypeTimer:
+			pType.Set(KTimers);					
+			break;
+		case EMemSpyThreadInfoItemTypeLogicalChannel:
+			pType.Set(KDD);
+			break;
+		case EMemSpyThreadInfoItemTypeChangeNotifier:
+			pType.Set(KChangeNotif);
+			break;
+		case EMemSpyThreadInfoItemTypeUndertaker:
+			pType.Set(KUndertakers);
+			break;				
+		case EMemSpyThreadInfoItemTypeLDD:
+			pType.Set(KLogicalDrivers);
+			break;
+		case EMemSpyThreadInfoItemTypePDD:
+			pType.Set(KPhysicalDrivers);
+			break;
+			
+	    default:	       
+	    	break;  
+		}
+	return pType;
+	}
+
--- a/memspyui/ui/avkon/src/MemSpyViewKernelContainers.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewKernelContainers.cpp	Fri May 14 15:15:12 2010 +0300
@@ -109,7 +109,8 @@
 		TInt size = iKernelObjects[i]->Size();
 		const TMemSpySizeText sizeText( MemSpyEngineUtils::FormatSizeText( size, 0 ) ); //TODO: is this OK to call Engine Utils?
 								
-		HBufC* tempName = HBufC::NewL( iKernelObjects[i]->Name().Length() + 32 ); //TODO: to removed this bulharic constant
+		HBufC* tempName = HBufC::NewL( iKernelObjects[i]->Name().Length() + 32 );
+		//HBufC* tempName = HBufC::NewL( KMaxFullName );
 		CleanupStack::PushL( tempName );
 		TPtr tempNamePtr( tempName->Des() );
 		tempNamePtr.Copy( iKernelObjects[i]->Name() );									
@@ -126,7 +127,7 @@
 			pName.Append( _L("s") );
 			}
 
-		pName.AppendFormat( _L(", %S"), &sizeText ); // TODO: to create some ServerUtils class with formating methods for size and type!
+		pName.AppendFormat( _L(", %S"), &sizeText );
 		
 		model->AppendL( pName );
 		
@@ -173,7 +174,9 @@
 
 void CMemSpyViewKernelContainers::OnCmdOutputAllContainerContentsL()
     {
-	/* TODO
+	iMemSpySession.OutputAllContainerContents();
+		
+	/*
     CMemSpyEngineOutputSink& sink = iEngine.Sink();
     iModel->OutputL( sink );
     */
--- a/memspyui/ui/avkon/src/MemSpyViewKernelHeap.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewKernelHeap.cpp	Fri May 14 15:15:12 2010 +0300
@@ -101,7 +101,7 @@
 	CMemSpyApiHeap* iHeap;
 	iHeap = iMemSpySession.GetHeap( );
 		
-	CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( 22 ); //array for formated items TODO: to remove constant
+	CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( 22 );
 		
 	model = FormatModel( iHeap );	
 				
@@ -144,9 +144,8 @@
 
 
 void CMemSpyViewKernelHeap::OnCmdDumpKernelHeapL()
-    {
-	// TODO
-    //iEngine.HelperHeap().OutputHeapDataKernelL();
+    {	
+    iMemSpySession.DumpKernelHeap();
     }
 
 
@@ -178,7 +177,7 @@
 	 _LIT( KItem11, "Max. length" );
 	 _LIT( KItem12, "Debug Allocator Library" );
 	 
-	HBufC* iItem = HBufC::NewL( 64 );	
+	HBufC* iItem = HBufC::NewL( KMaxName );	
 	
 	iItem = FormatItem( KItem0, aHeap->Type() );
 	TPtr pItem( iItem->Des() );
@@ -305,7 +304,7 @@
 
 HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, const TDesC& aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( 64 );
+	HBufC* retBuf = HBufC::NewL( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 	pRetBuf.Append( _L("\t") );
@@ -317,7 +316,7 @@
 
 HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TInt aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( 64 );
+	HBufC* retBuf = HBufC::NewL( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
     
@@ -334,7 +333,7 @@
 
 HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TUint aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( 64 );
+	HBufC* retBuf = HBufC::NewL( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
     
@@ -352,7 +351,7 @@
 
 HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, const TInt64& aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( 64 );
+	HBufC* retBuf = HBufC::NewL( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 	    
@@ -369,7 +368,7 @@
 
 HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TAny* aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( 64 );
+	HBufC* retBuf = HBufC::NewL( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 		    
@@ -386,7 +385,7 @@
 
 HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TUint* aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( 64 );
+	HBufC* retBuf = HBufC::NewL( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 		    
@@ -403,7 +402,7 @@
 
 HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TUint8* aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( 64 );
+	HBufC* retBuf = HBufC::NewL( KMaxName );
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 		    
@@ -420,7 +419,7 @@
 
 HBufC* CMemSpyViewKernelHeap::FormatPercentageItem( const TDesC& aCaption, TReal aOneHundredPercentValue, TReal aValue )
 	{
-	HBufC* retBuf = HBufC::NewL( 64 );	//buffer for formatted item
+	HBufC* retBuf = HBufC::NewL( KMaxName );	//buffer for formatted item
 	TPtr pRetBuf( retBuf->Des() );
 	pRetBuf.Zero();
 	
--- a/memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp	Fri May 14 15:15:12 2010 +0300
@@ -165,7 +165,7 @@
 
 void CMemSpyViewKernelObjects::SetListBoxModelL()
     {
-    _LIT( KLineFormatSpec, "\t%S" );
+    //_LIT( KLineFormatSpec, "\t%S" );
     _LIT( KTab, "\t" );
        
     iMemSpySession.GetKernelObjectItems( iKernelObjectItems, iObjectType );
@@ -178,7 +178,10 @@
     	CleanupStack::PushL( tempName );
     	TPtr tempNamePtr( tempName->Des() );
     	tempNamePtr.Copy( KTab );
-    	tempNamePtr.Append( iKernelObjectItems[i]->Name() );
+    	
+    	TBuf<KMaxName> temp;
+    	temp.Copy(iKernelObjectItems[i]->Name());    	
+    	tempNamePtr.Append( temp	 );
     	iModel->AppendL( tempNamePtr );
     	
     	CleanupStack::PopAndDestroy( tempName ); 
@@ -248,27 +251,15 @@
 
 
 TKeyResponse CMemSpyViewKernelObjects::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-	// TODO: to remove support of tabs
+    {	
     TKeyResponse resp = EKeyWasNotConsumed;
-    if  ( iTabs && ( aKeyEvent.iScanCode == EStdKeyRightArrow || aKeyEvent.iScanCode == EStdKeyLeftArrow ) )
-        {
-        resp = iTabs->OfferKeyEventL( aKeyEvent, aType );
-        }
-    else
-        {
-        resp = CMemSpyViewBase::OfferKeyEventL( aKeyEvent, aType );    
-        }
+    resp = CMemSpyViewBase::OfferKeyEventL( aKeyEvent, aType );    
+    //}
     return resp;
     }
 
-
 void CMemSpyViewKernelObjects::TabChangedL( TInt /*aIndex*/ )
     {
-	/* TODO: tabs removed
-    iObjectType = (TMemSpyDriverContainerType)iTabs->ActiveTabId();
-    RefreshL();
-    */
     }
 
 
@@ -278,13 +269,13 @@
         {
         case EMemSpyDriverContainerTypeThread:
             {
+            TBool err = EFalse;
             TBool doTerminate = ETrue;
             
             //CMemSpyEngineObjectContainer& container = iEngine.Container();
             //TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
             TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread
-            
-            TBool err;
+                        
             iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
             
             // Try to find the thread in question...
@@ -299,7 +290,8 @@
 				
 				if ( doTerminate )
 					{
-					iMemSpySession.TerminateThread( id );
+					iMemSpySession.EndThread( id, ETerminate );
+					RefreshL();
 					}
             	}            
             
@@ -319,21 +311,35 @@
                     thread->TerminateL();
                     }                
                 }
-            */
-            RefreshL();
+            */            
             break;
             }        
         case EMemSpyDriverContainerTypeProcess:
             {
+            TBool err = EFalse;
             TBool doTerminate = ETrue;
-            // Obtain the process that corresponds to the selected item
-            //CMemSpyEngineObjectContainer& container = iEngine.Container();
-            //TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
             TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
+            iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
             
+            if( err )
+            	{
+				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();	
+                doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+                
+                if( doTerminate )
+                	{
+                    iMemSpySession.EndProcess( id, ETerminate );     
+                    RefreshL();
+                    }
+            	}
+            
+            // Obtain the process that corresponds to the selected item
+            /*
+            CMemSpyEngineObjectContainer& container = iEngine.Container();
+            TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );                                                
             CMemSpyProcess& process = container.ProcessByIdL( id );
-            process.Open();
-
+            process.Open();			
+            						
             if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
                 {
                 CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
@@ -344,7 +350,8 @@
                 {
                 process.TerminateL();
                 RefreshL();
-                }
+                }*/
+            
             break;
             }
         default:
@@ -357,7 +364,9 @@
 
 
 void CMemSpyViewKernelObjects::OnCmdSwitchToL()
-    {/*
+    {	
+	TBool brought = EFalse;
+	/*
     TInt wgCount;
     RWsSession wsSession;
     User::LeaveIfError( wsSession.Connect() );
@@ -370,11 +379,15 @@
     TBool brought( EFalse );
     TInt wgId( KErrNotFound );
     TThreadId threadId;
+    */
     switch ( iObjectType )
-        {
+        {    	    	    	
         case EMemSpyDriverContainerTypeThread:
             {
-            TThreadId currentThreadId( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
+            TThreadId currentThreadId( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
+            TInt error = iMemSpySession.SwitchToThread( currentThreadId, brought );
+            /*
+            TThreadId currentThreadId( iObjectList->At( iListBox->CurrentItemIndex() ).iId );            
             
             // loop trough all window groups and see if a thread id matches
             while( !brought && wgCount-- )
@@ -392,14 +405,21 @@
                         }
                     CleanupStack::PopAndDestroy( wgName );
                     }
-                }                
+                }
+                */                
             break;
             }
         case EMemSpyDriverContainerTypeProcess:
-            {
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            CMemSpyProcess& process = container.ProcessByIdL( id );
+            {                        
+            TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
+            TInt error = iMemSpySession.SwitchToProcess( id, brought  );
+            /*
+            //CMemSpyEngineObjectContainer& container = iEngine.Container();
+            //TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
+            //CMemSpyProcess& process = container.ProcessByIdL( id );
+            
+            TProcessId id( iKernelObjectItems[iListBox->CurrentItemIndex()]->Id() );
+            
             
             // loop trough threads in a process
             for ( TInt i = 0; i < process.MdcaCount(); i++ )
@@ -424,7 +444,7 @@
                         }
                     }
                 }
-
+			*/
             break;
             }
         default:
@@ -438,18 +458,36 @@
         // Error handling in HandleCommandL
         User::Leave( KErrGeneral );
         }
-    CleanupStack::PopAndDestroy( 2 ); //wgArray,wsSession*/
+    CleanupStack::PopAndDestroy( 2 ); //wgArray,wsSession    
     }
 
 
 void CMemSpyViewKernelObjects::OnCmdEndL()
-    {/*
+    {
     switch ( iObjectType )
         {
         case EMemSpyDriverContainerTypeThread:
             {
+            TBool err = EFalse;
             TBool doTerminate = ETrue;
             
+            TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread                                   
+            iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
+            
+            if( err )
+            	{
+				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+                        				
+				if ( doTerminate )
+					{
+					iMemSpySession.EndThread( id, EKill );
+					RefreshL();
+					}
+            	}            
+
+            
+            /*
             CMemSpyEngineObjectContainer& container = iEngine.Container();
             TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
             
@@ -473,11 +511,31 @@
                     thread->KillL();
                     }                
                 }
+            
             RefreshL();
+            */
             break;
             }
         case EMemSpyDriverContainerTypeProcess:
             {
+            TBool err = EFalse;
+            TBool doTerminate = ETrue;
+            TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
+            iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
+            
+            if( err )
+            	{
+				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();	
+				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+				
+				if( doTerminate )
+					{
+					iMemSpySession.EndProcess( id, EKill);     
+					RefreshL();
+					}
+            	}
+            
+            /*
             TBool doTerminate = ETrue;
             // Obtain the process that corresponds to the selected item
             CMemSpyEngineObjectContainer& container = iEngine.Container();
@@ -495,7 +553,63 @@
                 process.KillL();
                 RefreshL();
                 }
+			*/
+            break;
+            }
+        default:
+            {
+            // Programming error
+            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
+            }
+        }    
+    }
 
+
+void CMemSpyViewKernelObjects::OnCmdPanicL()
+    {
+    switch ( iObjectType )
+        {
+        case EMemSpyDriverContainerTypeThread:
+            {
+            TBool err = EFalse;
+            TBool doTerminate = ETrue;
+            
+            TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread                                   
+            iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
+            
+            if( err )
+            	{
+				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+                        				
+				if ( doTerminate )
+					{
+					iMemSpySession.EndThread( id, EPanic );
+					RefreshL();
+					}
+            	}
+            
+            break;
+            }
+        case EMemSpyDriverContainerTypeProcess:
+            {
+            TBool err = EFalse;
+            TBool doTerminate = ETrue;
+            TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
+            iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
+            
+            if( err )
+            	{
+				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();	
+				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+                           
+				if( doTerminate )
+					{
+					iMemSpySession.EndProcess( id, EPanic );     
+					RefreshL();
+					}
+            	}
+        
             break;
             }
         default:
@@ -503,108 +617,106 @@
             // Programming error
             __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
             }
-        }    */
-    }
-
-
-void CMemSpyViewKernelObjects::OnCmdPanicL()
-    {/*
-    switch ( iObjectType )
-        {
-        case EMemSpyDriverContainerTypeThread:
-            {
-            TBool doTerminate = ETrue;
-            
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            
-            // Try to find the thread in question...
-            CMemSpyProcess* process = NULL;
-            CMemSpyThread* thread = NULL; 
-            User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
-
-            if ( thread )
-                {
-                thread->Open();
-                //
-                if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
-                    {
-                    CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-                    doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                    }
-                //
-                if  ( doTerminate )
-                    {
-                    thread->PanicL();
-                    }                
-                }
-            RefreshL();
-            break;
-            }
-        case EMemSpyDriverContainerTypeProcess:
-            {
-            TBool doTerminate = ETrue;
-            // Obtain the process that corresponds to the selected item
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            CMemSpyProcess& process = container.ProcessByIdL( id );
-            process.Open();
-
-            if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
-                {
-                CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-                doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                }
-            if  ( doTerminate )
-                {
-                process.PanicL();
-                RefreshL();
-                }
-            break;
-            }
-        default:
-            {
-            // Programming error
-            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
-            }
-        }*/
+        }
     }
 
 
 void CMemSpyViewKernelObjects::CreateTabsL()
     {
+	TMemSpyDriverContainerType type = iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Type();
+	const TPtrC pType( TypeAsString( type ) );
+	
 	CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
 	TUid uid;
 	uid.iUid = EEikStatusPaneUidNavi;
 	iNaviPane = ( CAknNavigationControlContainer * ) statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );	
-	iNavDecorator=iNaviPane->CreateMessageLabelL(_L("Kernel Object Type")); //TODO: To print there kernel object type
-	iNaviPane->PushL(*iNavDecorator); 
-	/*
-    CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
-    TUid uid;
-    uid.iUid = EEikStatusPaneUidNavi;
-    iNavDecorator = ((CAknNavigationControlContainer*)(statusPane->ControlL(uid)))->Top();
-
-    if ( !iNavDecorator )
-        {
-        iNavContainer = (CAknNavigationControlContainer*)statusPane->ControlL(uid);
-        iNavDecorator = iNavContainer->CreateTabGroupL();
-
-        iTabs = ( CAknTabGroup* )iNavDecorator->DecoratedControl();
-        iTabs->SetTabFixedWidthL( KTabWidthWithThreeLongTabs );
-    
-        for ( TInt i = 0; i < iModel->Count(); i++ )
-            {
-            const CMemSpyEngineGenericKernelObjectList& item = iModel->At( i );
-            iTabs->AddTabL( item.Type(), item.TypeAsString( item.Type() ) );
-            }
-        iTabs->SetActiveTabById( iObjectType );
-        iTabs->SetObserver( this );
-        iNavContainer->PushL( *iNavDecorator );
-       }
-       */
+	iNavDecorator=iNaviPane->CreateMessageLabelL( pType );
+	iNaviPane->PushL(*iNavDecorator); 		
     }
 
+TPtrC CMemSpyViewKernelObjects::TypeAsString( TMemSpyDriverContainerType aType )
+	{
+	 _LIT( KTypeUnknown, "Unknown Type" );
+	 _LIT( KTypeThread, "Thread" );
+	 _LIT( KTypeProcess, "Process" );
+	 _LIT( KTypeChunk, "Chunk" );
+	 _LIT( KTypeLibrary, "Library" );
+	 _LIT( KTypeSemaphore, "Semaphore" );
+	 _LIT( KTypeMutex, "Mutex" );
+	 _LIT( KTypeTimer, "Timer" );
+	 _LIT( KTypeServer, "Server" );
+	 _LIT( KTypeSession, "Session" );
+	 _LIT( KTypeLogicalDevice, "Logical Device" );
+	 _LIT( KTypePhysicalDevice, "Physical Device" );
+	 _LIT( KTypeLogicalChannel, "Logical Channel" );
+	 _LIT( KTypeChangeNotifier, "Change Notifier" );
+	 _LIT( KTypeUndertaker, "Undertaker" );
+	 _LIT( KTypeMsgQueue, "Msg. Queue" );
+	 _LIT( KTypePropertyRef, "Property Ref." );
+	 _LIT( KTypeCondVar, "Conditional Var." );
+	 //
+	 TPtrC pType( KTypeUnknown );
+	 //
+	 switch( aType )
+		{
+	    case EMemSpyDriverContainerTypeThread:
+	    	pType.Set( KTypeThread );
+	    	break;
+	    case EMemSpyDriverContainerTypeProcess:
+	        pType.Set( KTypeProcess );
+	        break;
+	    case EMemSpyDriverContainerTypeChunk:
+	        pType.Set( KTypeChunk );
+	        break;
+	    case EMemSpyDriverContainerTypeLibrary:
+	        pType.Set( KTypeLibrary );
+	        break;
+	    case EMemSpyDriverContainerTypeSemaphore:
+	        pType.Set( KTypeSemaphore );
+	        break;
+	    case EMemSpyDriverContainerTypeMutex:
+	        pType.Set( KTypeMutex );
+	        break;
+	    case EMemSpyDriverContainerTypeTimer:
+	        pType.Set( KTypeTimer );
+	        break;
+	    case EMemSpyDriverContainerTypeServer:
+	        pType.Set( KTypeServer );
+	        break;
+	    case EMemSpyDriverContainerTypeSession:
+	        pType.Set( KTypeSession );
+	        break;
+	    case EMemSpyDriverContainerTypeLogicalDevice:
+	        pType.Set( KTypeLogicalDevice );
+	        break;
+	    case EMemSpyDriverContainerTypePhysicalDevice:
+	        pType.Set( KTypePhysicalDevice );
+	        break;
+	    case EMemSpyDriverContainerTypeLogicalChannel:
+	        pType.Set( KTypeLogicalChannel );
+	        break;
+	    case EMemSpyDriverContainerTypeChangeNotifier:
+	        pType.Set( KTypeChangeNotifier );
+	        break;
+	    case EMemSpyDriverContainerTypeUndertaker:
+	        pType.Set( KTypeUndertaker );
+	        break;
+	    case EMemSpyDriverContainerTypeMsgQueue:
+	        pType.Set( KTypeMsgQueue );
+	        break;
+	    case EMemSpyDriverContainerTypePropertyRef:
+	        pType.Set( KTypePropertyRef );
+	        break;
+	    case EMemSpyDriverContainerTypeCondVar:
+	        pType.Set( KTypeCondVar );
+	        break;
+	        
+	    default:
+	        break;
+		}
+	    //
+	return pType;
+	}
 
 void CMemSpyViewKernelObjects::DetailsL()
     {
--- a/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemActiveObject.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemActiveObject.cpp	Fri May 14 15:15:12 2010 +0300
@@ -112,8 +112,8 @@
 
 
 
-CMemSpyViewThreadInfoItemActiveObject::CMemSpyViewThreadInfoItemActiveObject( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemActiveObjectBase( aEngine, aObserver, aContainer )
+CMemSpyViewThreadInfoItemActiveObject::CMemSpyViewThreadInfoItemActiveObject( RMemSpySession& aSession, MMemSpyViewObserver& aObserver,  TThreadId aId, TMemSpyThreadInfoItemType aType )
+:   CMemSpyViewThreadInfoItemActiveObjectBase( aSession, aObserver, aId, aType )
     {
     }
 
--- a/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemChunk.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemChunk.cpp	Fri May 14 15:15:12 2010 +0300
@@ -33,16 +33,16 @@
 
 
 
-CMemSpyViewThreadInfoItemChunk::CMemSpyViewThreadInfoItemChunk( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeChunk )
+CMemSpyViewThreadInfoItemChunk::CMemSpyViewThreadInfoItemChunk( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
+:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, EMemSpyThreadInfoItemTypeChunk )
     {
     }
 
 
 CMemSpyViewBase* CMemSpyViewThreadInfoItemChunk::PrepareChildViewL()
-    {
+    {	
     CMemSpyViewBase* child = NULL;
-    
+    /* TODO
     // Get the code segment list
     CMemSpyThreadInfoChunk* chunkInfoItem = static_cast< CMemSpyThreadInfoChunk* >( iInfoItem );
     CMemSpyEngineChunkList* list = &chunkInfoItem->List();
@@ -62,8 +62,8 @@
         child->ConstructL( Rect(), *Parent() );
         CleanupStack::Pop( child );
         }
-        
-    return child;
+    */
+    return child;    
     }
 
 
--- a/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemCodeSeg.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemCodeSeg.cpp	Fri May 14 15:15:12 2010 +0300
@@ -33,8 +33,8 @@
 
 
 
-CMemSpyViewThreadInfoItemCodeSeg::CMemSpyViewThreadInfoItemCodeSeg( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeCodeSeg )
+CMemSpyViewThreadInfoItemCodeSeg::CMemSpyViewThreadInfoItemCodeSeg( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
+:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, EMemSpyThreadInfoItemTypeCodeSeg )
     {
     }
 
@@ -47,9 +47,9 @@
 
 
 CMemSpyViewBase* CMemSpyViewThreadInfoItemCodeSeg::PrepareChildViewL()
-    {
+    {	
     CMemSpyViewBase* child = NULL;
-    
+    /* TODO
     // Get the code segment list
     CMemSpyThreadInfoCodeSeg* codeSegInfoItem = static_cast< CMemSpyThreadInfoCodeSeg* >( iInfoItem );
     CMemSpyEngineCodeSegList* list = &codeSegInfoItem->List();
@@ -69,8 +69,8 @@
         child->ConstructL( Rect(), *Parent() );
         CleanupStack::Pop( child );
         }
-        
-    return child;
+    */
+    return child;    
     }
 
 
--- a/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneralInfo.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneralInfo.cpp	Fri May 14 15:15:12 2010 +0300
@@ -26,6 +26,7 @@
 #include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
 #include <memspy/engine/memspyenginehelperprocess.h>
 #include <memspy/engine/memspyenginehelperheap.h>
+#include <memspysession.h>
 
 // User includes
 #include "MemSpyContainerObserver.h"
@@ -33,11 +34,16 @@
 #include "MemSpyViewThreadInfoItemHeap.h"
 
 
-
+/*
 CMemSpyViewThreadInfoItemGeneralInfo::CMemSpyViewThreadInfoItemGeneralInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
 :   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeGeneralInfo )
     {
     }
+*/
+CMemSpyViewThreadInfoItemGeneralInfo::CMemSpyViewThreadInfoItemGeneralInfo( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
+:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, EMemSpyThreadInfoItemTypeGeneralInfo )
+    {
+    }
 
 
 TBool CMemSpyViewThreadInfoItemGeneralInfo::HandleCommandL( TInt aCommand )
--- a/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp	Fri May 14 15:15:12 2010 +0300
@@ -29,49 +29,42 @@
 #include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
 #include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
 #include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspysession.h>
 
 // User includes
 #include "MemSpyContainerObserver.h"
 #include "MemSpyViewThreadInfoItemList.h"
+#include "MemSpyUiUtils.h"
 
 // Constants
 const TInt KMemSpyConstructionCheckerTimerPeriod = 500000; // 1/2 second
 
-
-
-CMemSpyViewThreadInfoItemGeneric::CMemSpyViewThreadInfoItemGeneric( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aInfoContainer, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewBase( aEngine, aObserver ), iContainer( aInfoContainer )
+CMemSpyViewThreadInfoItemGeneric::CMemSpyViewThreadInfoItemGeneric( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcessId, TThreadId aId, TMemSpyThreadInfoItemType aType )
+:   CMemSpyViewBase( aSession, aObserver )//, iThreadId( aId ), iType( aType )		//iContainer( aInfoContainer )
     {
-    iContainer.Thread().Process().Open();
-    iContainer.Thread().Open();
-    iContainer.Open();
-    //
-    iInfoItem = &iContainer.Item( aType );
-    __ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
-    iInfoItem->Open();
+	iParentProcessId = aProcessId;
+	iThreadId = aId;
+	iType = aType;
     }
 
 
 CMemSpyViewThreadInfoItemGeneric::~CMemSpyViewThreadInfoItemGeneric()
-    {
+    {/* TODO:
     if  ( iInfoItem )
         {
         iInfoItem->Close();
-        }
-    //
-    DestroyWaitNote();
-    //
-    iContainer.Close();
-    iContainer.Thread().Close();
-    iContainer.Thread().Process().Close();
+        }    
+    DestroyWaitNote();    
+    */
     }
 
 
 void CMemSpyViewThreadInfoItemGeneric::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
     {
-    const TPtrC pTitle( iInfoItem->Name().Mid( 1 ) );
-    SetTitleL( pTitle );
+	const TPtrC pTitle( MemSpyUiUtils::ThreadInfoItemNameByType( iType ) );
+	SetTitleL( pTitle );
     //
+    /* TODO:
     if  ( iInfoItem->IsReady() == EFalse )
         {
 #ifdef _DEBUG
@@ -81,39 +74,39 @@
         // Wait for engine data to be made ready... 
         ShowWaitNoteL();
         }
-
+	*/
     CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
     }
 
 
 CMemSpyProcess& CMemSpyViewThreadInfoItemGeneric::Process() const
     {
-    return iContainer.Thread().Process();
+  //  return iContainer.Thread().Process();
     }
 
 
 CMemSpyThread& CMemSpyViewThreadInfoItemGeneric::Thread() const
     {
-    return iContainer.Thread();
+  //  return iContainer.Thread();
     }
 
 
 CMemSpyThreadInfoContainer& CMemSpyViewThreadInfoItemGeneric::Container() const
     {
-    return iContainer;
+ //   return iContainer;
     }
 
 
 CMemSpyThreadInfoItemBase& CMemSpyViewThreadInfoItemGeneric::InfoItem() const
     {
-    __ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
-    return *iInfoItem;
+ //   __ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
+ //   return *iInfoItem;
     }
 
 
 void CMemSpyViewThreadInfoItemGeneric::RefreshL()
     {
-    iInfoItem->RebuildL();    
+ //   iInfoItem->RebuildL();     //TODO
     SetListBoxModelL();
     CMemSpyViewBase::RefreshL();
     }
@@ -123,7 +116,8 @@
     {
     TMemSpyViewType type = EMemSpyViewTypeNone;
     //
-    switch( iInfoItem->Type() )
+    //switch( iInfoItem->Type() )
+    switch( iType )
         {
     case EMemSpyThreadInfoItemTypeHeap:
         type = EMemSpyViewTypeThreadInfoItemHeap;
@@ -196,7 +190,7 @@
         break;
 
     default:
-        __ASSERT_DEBUG( EFalse, User::Invariant() );
+        //__ASSERT_DEBUG( EFalse, User::Invariant() );
         break;
         }
     //
@@ -206,9 +200,9 @@
 
 CMemSpyViewBase* CMemSpyViewThreadInfoItemGeneric::PrepareParentViewL()
     {
-    CMemSpyViewThreadInfoItemList* parent = new(ELeave) CMemSpyViewThreadInfoItemList( iEngine, iObserver, Thread() );
+    CMemSpyViewThreadInfoItemList* parent = new(ELeave) CMemSpyViewThreadInfoItemList( iMemSpySession, iObserver, iParentProcessId, iThreadId );
     CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), iInfoItem );
+    parent->ConstructL( Rect(), *Parent() ); //TODO: arguent removed: iInfoItem
     CleanupStack::Pop( parent );
     return parent;
     }
@@ -216,7 +210,7 @@
 
 CMemSpyViewBase* CMemSpyViewThreadInfoItemGeneric::PrepareChildViewL()
     {
-    __ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
+    //__ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
     CMemSpyViewBase* child = NULL;
     //
     return child;
@@ -232,8 +226,40 @@
 
 void CMemSpyViewThreadInfoItemGeneric::SetListBoxModelL()
     {
+	iMemSpySession.GetThreadInfoItems( iThreadInfoItems, iThreadId, iType );
+	
+	iModel = new (ELeave) CDesC16ArrayFlat( iThreadInfoItems.Count() + 10 );
+	
+	for( TInt i=0; i<iThreadInfoItems.Count(); i++)
+		{						
+		HBufC* iCombined = HBufC::NewL( iThreadInfoItems[i]->Caption().Length() + iThreadInfoItems[i]->Value().Length() + 30 );		
+			/*
+		else if ( iCombined->Des().MaxLength() < requiredLength )
+			{
+			iCombined = iCombined->ReAllocL( requiredLength );
+			}*/
+		
+		CleanupStack::PushL( iCombined );
+        
+		TPtr pCombined( iCombined->Des() );
+		pCombined.Zero();
+		pCombined.Copy( _L("\t") );
+		if( iThreadInfoItems[i]->Caption() != KNullDesC )
+			pCombined.Append( iThreadInfoItems[i]->Caption() );
+		if( iType != EMemSpyThreadInfoItemTypeChunk )
+			{
+			pCombined.Append( _L("\t\t") );
+			pCombined.Append( iThreadInfoItems[i]->Value() );
+			}					
+		
+		iModel->AppendL( pCombined );				
+		
+		CleanupStack::PopAndDestroy( iCombined );
+		}	
+	
     CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iInfoItem );
+    //listbox->Model()->SetItemTextArray( iInfoItem );
+    listbox->Model()->SetItemTextArray( iModel );
     listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
     }
 
@@ -256,7 +282,7 @@
 void CMemSpyViewThreadInfoItemGeneric::ShowWaitNoteL()
     {
     // Ugly, but I'm not adding an observer mechanism just for this wait dialog.
-    __ASSERT_ALWAYS( iWaitConstructionChecker == NULL, User::Invariant() );
+   // __ASSERT_ALWAYS( iWaitConstructionChecker == NULL, User::Invariant() );
     iWaitConstructionChecker = CPeriodic::NewL( CActive::EPriorityLow );
     iWaitConstructionChecker->Start( KMemSpyConstructionCheckerTimerPeriod, 
                                      KMemSpyConstructionCheckerTimerPeriod, 
@@ -293,12 +319,15 @@
 
 TInt CMemSpyViewThreadInfoItemGeneric::CheckForItemConstructionComplete( TAny* aSelf )
     {
+	/*
     CMemSpyViewThreadInfoItemGeneric& self = *reinterpret_cast< CMemSpyViewThreadInfoItemGeneric* >( aSelf );
+    */
     //
 #ifdef _DEBUG
-    RDebug::Printf( "CMemSpyViewThreadInfoItemGeneric::CheckForItemConstructionComplete() - ready status: %d, iType: %d", self.iInfoItem->IsReady(), self.iInfoItem->Type() );
+/*   RDebug::Printf( "CMemSpyViewThreadInfoItemGeneric::CheckForItemConstructionComplete() - ready status: %d, iType: %d", self.iInfoItem->IsReady(), self.iInfoItem->Type() );*/
 #endif
 	//
+    /*
     TBool callAgain = ETrue;
     if  ( self.iInfoItem->IsReady() )
         {
@@ -307,6 +336,7 @@
         }
     //
     return callAgain;
+    */
     }
 
 
--- a/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemHeap.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemHeap.cpp	Fri May 14 15:15:12 2010 +0300
@@ -33,11 +33,16 @@
 #include "MemSpyViewThreadInfoItemHeap.h"
 
 
-
+/*
 CMemSpyViewThreadInfoItemHeap::CMemSpyViewThreadInfoItemHeap( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
 :   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeHeap )
     {
     }
+*/
+CMemSpyViewThreadInfoItemHeap::CMemSpyViewThreadInfoItemHeap( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
+:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId , EMemSpyThreadInfoItemTypeHeap )
+    {
+    } 
 
 
 TBool CMemSpyViewThreadInfoItemHeap::HandleCommandL( TInt aCommand )
@@ -69,19 +74,19 @@
 
 void CMemSpyViewThreadInfoItemHeap::OnCmdHeapDataL()
     {
-    iEngine.HelperHeap().OutputHeapDataUserL( Thread() );
+    //iEngine.HelperHeap().OutputHeapDataUserL( Thread() ); //TODO
     }
 
 
 void CMemSpyViewThreadInfoItemHeap::OnCmdHeapCellListingL()
     {
-    iEngine.HelperHeap().OutputCellListingUserL( Thread() );
+    //iEngine.HelperHeap().OutputCellListingUserL( Thread() ); //TODO
     }
 
 
 void CMemSpyViewThreadInfoItemHeap::OnCmdHeapInfoL()
     {
-    iEngine.HelperHeap().OutputHeapInfoUserL( Thread() );
+    //iEngine.HelperHeap().OutputHeapInfoUserL( Thread() ); //TODO
     }
 
 
@@ -89,6 +94,6 @@
     {
     if  ( aResourceId == R_MEMSPY_MENUPANE )
         {
-        aMenuPane->SetItemDimmed( EMemSpyCmdHeap, Thread().IsDead() );
+        //aMenuPane->SetItemDimmed( EMemSpyCmdHeap, Thread().IsDead() ); //TODO
         }
     }
--- a/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemList.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemList.cpp	Fri May 14 15:15:12 2010 +0300
@@ -25,6 +25,10 @@
 #include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
 #include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
 #include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspysession.h>
+
+// UI Utils include
+#include "MemSpyUiUtils.h"
 
 // User includes
 #include "MemSpyContainerObserver.h"
@@ -42,16 +46,15 @@
 const TInt KMemSpyIdleResetListboxTimerPeriod = 250000;
 
 
-CMemSpyViewThreadInfoItemList::CMemSpyViewThreadInfoItemList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThread& aThread )
-:   CMemSpyViewBase( aEngine, aObserver ), iThread( aThread )
+CMemSpyViewThreadInfoItemList::CMemSpyViewThreadInfoItemList( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcess, TThreadId aThread )
+:   CMemSpyViewBase( aSession, aObserver ), iParentProcessId( aProcess ), iThreadId( aThread )
     {
-    iThread.Process().Open();
-    iThread.Open();
     }
 
 
 CMemSpyViewThreadInfoItemList::~CMemSpyViewThreadInfoItemList()
     {
+	/* TODO: to consider what to do with this
     delete iIdleResetListboxTimer;
 
     TRAP_IGNORE( 
@@ -63,9 +66,7 @@
         {
         iCurrentInfoItem->Close();
         }
-
-    iThread.Process().Close();
-    iThread.Close();
+    */
     }
 
 
@@ -77,13 +78,15 @@
     //
     iIdleResetListboxTimer = CPeriodic::NewL( CActive::EPriorityIdle );
     //
+    /*
     CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
     container.ObserverAddL( *this );
+    */
     //
     CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
     //
-    if  ( aSelectionRune )
-        {
+    /*if  ( aSelectionRune )
+        {		
         CMemSpyThreadInfoItemBase* selectedItem = reinterpret_cast< CMemSpyThreadInfoItemBase* >( aSelectionRune );
         const TInt index = container.InfoItemIndexByType( selectedItem->Type() );
         if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
@@ -93,32 +96,18 @@
             }
         }
     else if ( container.MdcaCount() > 0 )
-        {
-        iListBox->SetCurrentItemIndex( 0 );
+        {*/
+        iListBox->SetCurrentItemIndex( 0 ); //for now
         HandleListBoxItemSelectedL( 0 );
-        }
+        //}
     }
 
-
-const CMemSpyProcess& CMemSpyViewThreadInfoItemList::Process() const
-    {
-    return iThread.Process();
-    }
-
-
-const CMemSpyThread& CMemSpyViewThreadInfoItemList::Thread() const
-    {
-    return iThread;
-    }
-
-
 const CMemSpyThreadInfoItemBase& CMemSpyViewThreadInfoItemList::CurrentInfoItem() const
     {
-    __ASSERT_ALWAYS( iCurrentInfoItem != NULL, User::Invariant() );
+    //__ASSERT_ALWAYS( iCurrentInfoItem != NULL, User::Invariant() );
     return *iCurrentInfoItem;
     }
 
-
 void CMemSpyViewThreadInfoItemList::RefreshL()
     {
     SetListBoxModelL();
@@ -134,9 +123,9 @@
 
 CMemSpyViewBase* CMemSpyViewThreadInfoItemList::PrepareParentViewL()
     {
-    CMemSpyViewBase* parent = new(ELeave) CMemSpyViewThreads( iEngine, iObserver, iThread.Process() );
+    CMemSpyViewBase* parent = new(ELeave) CMemSpyViewThreads( iMemSpySession, iObserver, iParentProcessId );
     CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), &iThread );
+    parent->ConstructL( Rect(), *Parent() );
     CleanupStack::Pop( parent );
     return parent;
     }
@@ -144,38 +133,41 @@
 
 CMemSpyViewBase* CMemSpyViewThreadInfoItemList::PrepareChildViewL()
     {
-    __ASSERT_ALWAYS( iCurrentInfoItem != NULL, User::Invariant() );
     CMemSpyViewBase* child = NULL;
 
-    // Decide what type of child view to create...
-    const TMemSpyThreadInfoItemType type = iCurrentInfoItem->Type();
-    //
+    TMemSpyThreadInfoItemType type;
+    iMemSpySession.GetInfoItemType( iCurrentInfoItemId, iThreadId, type );
+    
     switch( type )
-        {
+        {    	
     case EMemSpyThreadInfoItemTypeHeap:
-        child = new(ELeave) CMemSpyViewThreadInfoItemHeap( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
+        child = new(ELeave) CMemSpyViewThreadInfoItemHeap( iMemSpySession, iObserver, iParentProcessId, iThreadId, type );
+        break;        
     case EMemSpyThreadInfoItemTypeStack:
-        child = new(ELeave) CMemSpyViewThreadInfoItemStack( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
+        child = new(ELeave) CMemSpyViewThreadInfoItemStack( iMemSpySession, iObserver, iParentProcessId, iThreadId, type );
+        break;        
     case EMemSpyThreadInfoItemTypeChunk:
-        child = new(ELeave) CMemSpyViewThreadInfoItemChunk( iEngine, iObserver, iThread.InfoContainerL() );
+        child = new(ELeave) CMemSpyViewThreadInfoItemChunk( iMemSpySession, iObserver, iParentProcessId, iThreadId, type  );
         break;
     case EMemSpyThreadInfoItemTypeCodeSeg:
-        child = new(ELeave) CMemSpyViewThreadInfoItemCodeSeg( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
+        child = new(ELeave) CMemSpyViewThreadInfoItemCodeSeg( iMemSpySession, iObserver, iParentProcessId, iThreadId, type  );
+        break;        
     case EMemSpyThreadInfoItemTypeServer:
-        child = new(ELeave) CMemSpyViewThreadInfoItemServer( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
+        child = new(ELeave) CMemSpyViewThreadInfoItemServer( iMemSpySession, iObserver, iParentProcessId, iThreadId, type  );
+        break;        
     case EMemSpyThreadInfoItemTypeActiveObject:
-        child = new(ELeave) CMemSpyViewThreadInfoItemActiveObject( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
+        child = new(ELeave) CMemSpyViewThreadInfoItemActiveObject( iMemSpySession, iObserver, iParentProcessId, iThreadId, type  );
+        break;             
     case EMemSpyThreadInfoItemTypeGeneralInfo:
-        child = new(ELeave) CMemSpyViewThreadInfoItemGeneralInfo( iEngine, iObserver, iThread.InfoContainerL() );
+        child = new(ELeave) CMemSpyViewThreadInfoItemGeneralInfo( iMemSpySession, iObserver, iParentProcessId, iThreadId, type );
         break;
+    /* 
+     * This subview is permanently removed from Thread Info Item subview.
+     * 
     case EMemSpyThreadInfoItemTypeMemoryTracking:
         child = new(ELeave) CMemSpyViewThreadInfoItemMemoryTracking( iEngine, iObserver, iThread.InfoContainerL() );
         break;
+    */
     case EMemSpyThreadInfoItemTypeSession:
     case EMemSpyThreadInfoItemTypeSemaphore:
     case EMemSpyThreadInfoItemTypeMutex:
@@ -192,14 +184,14 @@
     case EMemSpyThreadInfoItemTypeOtherProcesses:
     case EMemSpyThreadInfoItemTypeOwnedThreadHandles:
     case EMemSpyThreadInfoItemTypeOwnedProcessHandles:
-        child = new(ELeave) CMemSpyViewThreadInfoItemGeneric( iEngine, iObserver, iThread.InfoContainerL(), type );
+        child = new(ELeave) CMemSpyViewThreadInfoItemGeneric( iMemSpySession, iObserver, iParentProcessId, iThreadId, type );
         break;
     
     default:
-        __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0) );
-        break;
+       // __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0) );
+        break;        
         }
-    //
+       
     CleanupStack::PushL( child );
     child->ConstructL( Rect(), *Parent() );
     CleanupStack::Pop( child );
@@ -230,7 +222,7 @@
     {
     if  ( aResourceId == R_MEMSPY_MENUPANE )
         {
-        aMenuPane->SetItemDimmed( EMemSpyCmdThread, iThread.IsDead() );
+     //   aMenuPane->SetItemDimmed( EMemSpyCmdThread, iThread.IsDead() ); //TODO
         }
     else if ( aResourceId == MenuCascadeResourceId() )
         {
@@ -243,12 +235,12 @@
 
 void CMemSpyViewThreadInfoItemList::OnCmdInfoHandlesL()
     {
-    iThread.InfoContainerForceSyncronousConstructionL().PrintL();
+    //iThread.InfoContainerForceSyncronousConstructionL().PrintL(); //TODO:
     }
 
 
 void CMemSpyViewThreadInfoItemList::HandleMemSpyEngineInfoContainerEventL( TEvent aEvent, TMemSpyThreadInfoItemType aType )
-    {
+    {/*
     if  ( aEvent == EInfoItemChanged )
         {
         }
@@ -263,13 +255,123 @@
 
     iIdleResetListboxTimer->Cancel();
     iIdleResetListboxTimer->Start( KMemSpyIdleResetListboxTimerPeriod, KMemSpyIdleResetListboxTimerPeriod, TCallBack( IdleUpdateListBoxModel, this ) );
+    */
     }
 
 
 void CMemSpyViewThreadInfoItemList::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iThread.InfoContainerL() );
+    {	
+	CDesC16ArrayFlat* iModel = new (ELeave) CDesC16ArrayFlat( 32 );
+	
+	HBufC* iItem = HBufC::NewL( 32 );
+	
+	iItem = MemSpyUiUtils::FormatItem( KGeneral );
+	TPtr pItem( iItem->Des() );
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KHeap );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KStack );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KChunks );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KCodeSegs );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KOpenFiles );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KActiveObjects );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KThreadHandlers );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KProcessHandlers );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KServers );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KConnections );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KSemaphores );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KThreadReferences );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KProcessReferences );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KMutexes );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KTimers );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KDD );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KChangeNotif );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KUndertakers );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KLogicalDrivers );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = MemSpyUiUtils::FormatItem( KPhysicalDrivers );
+	pItem = iItem->Des();
+	iModel->AppendL( pItem );
+	pItem.Zero();		
+	
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox ); 
+    listbox->Model()->SetItemTextArray( iModel );
     listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
     }
 
@@ -283,6 +385,9 @@
 
 void CMemSpyViewThreadInfoItemList::HandleListBoxItemSelectedL( TInt aIndex )
     {
+	iCurrentInfoItemId = aIndex;
+	
+	/*
     if  ( iCurrentInfoItem )
         {
         CMemSpyThreadInfoItemBase* item = iCurrentInfoItem;
@@ -293,7 +398,7 @@
     // Identify the type of item to display...
     iCurrentInfoItem = &iThread.InfoContainerL().Item( aIndex );
     iCurrentInfoItem->Open();
-
+*/
     // Notify observer about item selection
     ReportEventL( MMemSpyViewObserver::EEventItemSelected );
     }
@@ -309,6 +414,7 @@
 
 void CMemSpyViewThreadInfoItemList::DoIdleUpdateListBoxModelL()
     {
+	/*
     CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
 
     // Try to maintain current item selection if at all possible.
@@ -332,5 +438,5 @@
         }
 
     iIdleResetListboxTimer->Cancel();
+    */
     }
-
--- a/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemServer.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemServer.cpp	Fri May 14 15:15:12 2010 +0300
@@ -36,8 +36,8 @@
 
 
 
-CMemSpyViewThreadInfoItemServer::CMemSpyViewThreadInfoItemServer( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeServer )
+CMemSpyViewThreadInfoItemServer::CMemSpyViewThreadInfoItemServer( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
+:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, EMemSpyThreadInfoItemTypeServer )
     {
     }
 
@@ -53,11 +53,12 @@
 #ifdef _DEBUG
     RDebug::Printf( "CMemSpyViewThreadInfoItemServer::ConstructL() - aSelectionRune: 0x%08x", aSelectionRune );
 #endif
-
+    /* TODO
     // Try to select the correct server
     CMemSpyThreadInfoHandleObjectBase* infoItem = static_cast< CMemSpyThreadInfoHandleObjectBase* >( iInfoItem );
+    */
     TInt selectedIndex = 0;
-    if  ( aSelectionRune )
+    /*if  ( aSelectionRune )
         {
         // Treat the rune as a handle, and try to look it up
         selectedIndex = infoItem->DetailsIndexByHandle( aSelectionRune );
@@ -65,10 +66,10 @@
 
     // Select item
     if  ( infoItem->DetailsCount() > 0 )
-        {
+        {*/
         iListBox->SetCurrentItemIndex( selectedIndex );
         HandleListBoxItemSelectedL( selectedIndex );
-        }
+        /*}*/
     }
 
 
@@ -81,16 +82,18 @@
 
 CMemSpyViewBase* CMemSpyViewThreadInfoItemServer::PrepareChildViewL()
     {
+	/*
     CMemSpyViewThreadInfoItemServerDetails* child = new(ELeave) CMemSpyViewThreadInfoItemServerDetails( iEngine, iObserver, iContainer, iCurrentInfoItemDetails );
     CleanupStack::PushL( child );
     child->ConstructL( Rect(), *Parent() );
     CleanupStack::Pop( child );
     return child;
+    */
     }
 
 
 void CMemSpyViewThreadInfoItemServer::HandleListBoxItemSelectedL( TInt aIndex )
-    {
+    {/* TODO
     // Identify the type of item to display...
     CMemSpyThreadInfoHandleObjectBase* infoItem = static_cast< CMemSpyThreadInfoHandleObjectBase* >( iInfoItem );
     iCurrentInfoItemDetails = infoItem->DetailsAt( aIndex );
@@ -98,7 +101,7 @@
 #ifdef _DEBUG
     RDebug::Printf( "CMemSpyViewThreadInfoItemServer::HandleListBoxItemSelectedL() - iCurrentInfoItemDetails.iHandle: 0x%08x", iCurrentInfoItemDetails.iHandle );
 #endif
-
+*/
     // Notify observer about item selection
     ReportEventL( MMemSpyViewObserver::EEventItemSelected );
     }
@@ -127,7 +130,7 @@
 
 
 
-
+/*
 CMemSpyViewThreadInfoItemServerDetails::CMemSpyViewThreadInfoItemServerDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, const TMemSpyDriverHandleInfoGeneric& aInfoItemDetails )
 :   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeServer ), iInfoItemDetails( aInfoItemDetails )
     {
@@ -229,19 +232,25 @@
     CleanupStack::Pop( model );
     }
 
-
-void CMemSpyViewThreadInfoItemServerDetails::HandleListBoxItemActionedL( TInt /*aIndex*/ )
-    {
-    // Notify observer about an item being 'fired'
+*/
+/*
+void CMemSpyViewThreadInfoItemServerDetails::HandleListBoxItemActionedL( TInt /*aIndex*/ /*)
+*/
+/*    
+   	{
+    // Notify observer about an item being 'fired'    
     ReportEventL( MMemSpyViewObserver::EEventItemActioned );
     }
 
 
-void CMemSpyViewThreadInfoItemServerDetails::HandleListBoxItemSelectedL( TInt /*aIndex*/ )
+void CMemSpyViewThreadInfoItemServerDetails::HandleListBoxItemSelectedL( TInt /*aIndex*/ /*)
+*/
+/*
     {
     // Notify observer about item selection
     ReportEventL( MMemSpyViewObserver::EEventItemSelected );
     }
+*/
 
 
 
@@ -266,8 +275,7 @@
 
 
 
-
-
+/*
 
 
 CMemSpyViewThreadInfoItemServerSessions::CMemSpyViewThreadInfoItemServerSessions( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, const TMemSpyDriverHandleInfoGeneric& aInfoItemDetails )
@@ -374,6 +382,7 @@
     CleanupStack::Pop( model );
     }
 
+*/
 
 
 
@@ -383,9 +392,3 @@
 
 
 
-
-
-
-
-
-
--- a/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemStack.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemStack.cpp	Fri May 14 15:15:12 2010 +0300
@@ -34,8 +34,8 @@
 
 
 
-CMemSpyViewThreadInfoItemStack::CMemSpyViewThreadInfoItemStack( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeStack )
+CMemSpyViewThreadInfoItemStack::CMemSpyViewThreadInfoItemStack( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
+:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, EMemSpyThreadInfoItemTypeStack )
     {
     }
 
@@ -69,19 +69,19 @@
 
 void CMemSpyViewThreadInfoItemStack::OnCmdStackInfoL()
     {
-    iEngine.HelperStack().OutputStackInfoL( Thread() );
+   // TODO iEngine.HelperStack().OutputStackInfoL( Thread() );
     }
 
 
 void CMemSpyViewThreadInfoItemStack::OnCmdStackDataUserL()
     {
-    iEngine.HelperStack().OutputStackDataL( Thread(), EMemSpyDriverDomainUser );
+    // TODO iEngine.HelperStack().OutputStackDataL( Thread(), EMemSpyDriverDomainUser );
     }
 
 
 void CMemSpyViewThreadInfoItemStack::OnCmdStackDataKernelL()
     {
-    iEngine.HelperStack().OutputStackDataL( Thread(), EMemSpyDriverDomainKernel );
+    // TODO iEngine.HelperStack().OutputStackDataL( Thread(), EMemSpyDriverDomainKernel );
     }    
 
 
@@ -89,6 +89,6 @@
     {
     if  ( aResourceId == R_MEMSPY_MENUPANE )
         {
-        aMenuPane->SetItemDimmed( EMemSpyCmdStack, Thread().IsDead() );
+        //TODO aMenuPane->SetItemDimmed( EMemSpyCmdStack, Thread().IsDead() );
         }
     }
--- a/memspyui/ui/avkon/src/MemSpyViewThreads.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/avkon/src/MemSpyViewThreads.cpp	Fri May 14 15:15:12 2010 +0300
@@ -122,14 +122,12 @@
 
 
 CMemSpyViewBase* CMemSpyViewThreads::PrepareChildViewL()
-    {
-	/*
-    CMemSpyViewThreadInfoItemList* child = new(ELeave) CMemSpyViewThreadInfoItemList( iEngine, iObserver, *iCurrentThread );
+    {	
+    CMemSpyViewThreadInfoItemList* child = new(ELeave) CMemSpyViewThreadInfoItemList( iMemSpySession, iObserver, iParentProcessId, iCurrentThreadId );
     CleanupStack::PushL( child );
     child->ConstructL( Rect(), *Parent() );
     CleanupStack::Pop( child );
-    return child;
-    */
+    return child;    
     }
 
 
--- a/memspyui/ui/hb/hb.pro	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/hb.pro	Fri May 14 15:15:12 2010 +0300
@@ -30,6 +30,7 @@
 	inc/memspymainview.h \
 	inc/memspyprocessview.h \
 	inc/memspythreadview.h \
+	inc/memspythreaddetailindexview.h \
 	inc/memspythreaddetailview.h \
 	inc/memspykernelobjecttypeview.h \
 	inc/memspykernelobjectview.h \
@@ -42,6 +43,7 @@
 	src/memspymainview.cpp \
 	src/memspyprocessview.cpp \
 	src/memspythreadview.cpp \
+	src/memspythreaddetailindexview.cpp \
 	src/memspythreaddetailview.cpp \
 	src/memspykernelobjecttypeview.cpp \
 	src/memspykernelobjectview.cpp \
--- a/memspyui/ui/hb/inc/enginewrapper.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/inc/enginewrapper.h	Fri May 14 15:15:12 2010 +0300
@@ -21,29 +21,10 @@
 #include <QObject>
 
 #include <memspysession.h>
-#include <memspyapiprocess.h>
 
 typedef quint64 ProcessId;
 typedef quint64 ThreadId;
 
-class MemSpyProcess
-{
-public:
-	MemSpyProcess(CMemSpyApiProcess* process)
-		: mProcess(process)
-	{}
-	
-	virtual  ~MemSpyProcess() { delete mProcess;	}
-	
-	ProcessId id() const { return mProcess->Id(); }
-	
-	QString name() const { return QString((QChar*) mProcess->Name().Ptr(), mProcess->Name().Length()); }
-	
-	
-private:
-	CMemSpyApiProcess *mProcess;
-};
-
 enum ThreadPriority
 {
 	ThreadPriorityNull=(-30),
@@ -94,6 +75,51 @@
 	KernelObjectTypeCondVar
 };
 
+enum ThreadInfoType
+{
+	ThreadInfoTypeGeneral = EMemSpyThreadInfoItemTypeGeneralInfo,
+	ThreadInfoTypeHeap = EMemSpyThreadInfoItemTypeHeap,
+	ThreadInfoTypeStack = EMemSpyThreadInfoItemTypeStack,
+	ThreadInfoTypeChunk = EMemSpyThreadInfoItemTypeChunk,
+	ThreadInfoTypeCodeSeg = EMemSpyThreadInfoItemTypeCodeSeg,
+	ThreadInfoTypeOpenFiles = EMemSpyThreadInfoItemTypeOpenFiles,
+	ThreadInfoTypeActiveObjects = EMemSpyThreadInfoItemTypeActiveObject,
+	ThreadInfoTypeOwnedThreadHandles = EMemSpyThreadInfoItemTypeOwnedThreadHandles,
+	ThreadInfoTypeOwnedProcessHandles = EMemSpyThreadInfoItemTypeOwnedProcessHandles,
+	ThreadInfoTypeServer = EMemSpyThreadInfoItemTypeServer,
+	ThreadInfoTypeSession = EMemSpyThreadInfoItemTypeSession,
+	ThreadInfoTypeSemaphore = EMemSpyThreadInfoItemTypeSemaphore,
+	ThreadInfoTypeOtherThreads = EMemSpyThreadInfoItemTypeOtherThreads,
+	ThreadInfoTypeOtherProcesses = EMemSpyThreadInfoItemTypeOtherProcesses,
+	ThreadInfoTypeMutex = EMemSpyThreadInfoItemTypeMutex,
+	ThreadInfoTypeTimer = EMemSpyThreadInfoItemTypeTimer,
+	ThreadInfoTypeChannel = EMemSpyThreadInfoItemTypeLogicalChannel,
+	ThreadInfoTypeChangeNotifier = EMemSpyThreadInfoItemTypeChangeNotifier,
+	ThreadInfoTypeUndertaker = EMemSpyThreadInfoItemTypeUndertaker,
+	ThreadInfoTypeMessageQueue = EMemSpyThreadInfoItemTypeMessageQueue,
+	ThreadInfoTypeConditionalVariable = EMemSpyThreadInfoItemTypeConditionalVariable,
+	ThreadInfoTypeLDD = EMemSpyThreadInfoItemTypeLDD,
+	ThreadInfoTypePDD = EMemSpyThreadInfoItemTypePDD,
+};
+
+class MemSpyProcess
+{
+public:
+	MemSpyProcess(CMemSpyApiProcess* process)
+		: mProcess(process)
+	{}
+	
+	virtual  ~MemSpyProcess() { delete mProcess;	}
+	
+	ProcessId id() const { return mProcess->Id(); }
+	
+	QString name() const { return QString((QChar*) mProcess->Name().Ptr(), mProcess->Name().Length()); }
+	
+	
+private:
+	CMemSpyApiProcess *mProcess;
+};
+
 class MemSpyThread
 {
 public:
@@ -127,6 +153,10 @@
 	
 	QString name() const { return QString((QChar*) mType->Name().Ptr(), mType->Name().Length()); }
 	
+	int count() const { return mType->Count(); }
+	
+	qint64 size() const { return mType->Size(); }
+	
 private:
 	CMemSpyApiKernelObject *mType;
 };
@@ -236,6 +266,23 @@
 	CMemSpyApiKernelObjectItem *mObject;
 };
 
+class MemSpyThreadInfoItem 
+{
+public:
+	MemSpyThreadInfoItem(CMemSpyApiThreadInfoItem *item)
+		: mItem(item)
+	{}
+	
+	virtual  ~MemSpyThreadInfoItem() { delete mItem;	}
+	
+	QString caption() const { return QString((QChar*) mItem->Caption().Ptr(), mItem->Caption().Length()); }
+	
+	QString value() const { return QString((QChar*) mItem->Value().Ptr(), mItem->Value().Length()); }
+	
+private:
+	CMemSpyApiThreadInfoItem* mItem;
+};
+
 class EngineWrapper : public QObject
 {
 public:
@@ -246,6 +293,8 @@
 	
 	QList<MemSpyThread*> getThreads(ProcessId processId);
 	
+	QList<MemSpyThreadInfoItem*> getThreadInfo(ThreadId threadId, ThreadInfoType type);
+	
 	void setThreadPriority(ThreadId threadId, ThreadPriority priority);
 	
 	QList<MemSpyKernelObjectType*> getKernelObjectTypes();
--- a/memspyui/ui/hb/inc/memspykernelobjecttypeview.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/inc/memspykernelobjecttypeview.h	Fri May 14 15:15:12 2010 +0300
@@ -33,6 +33,9 @@
 	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
 	
 private:
+	QString formatSize(qint64 size) const;
+	
+private:
 	QList<MemSpyKernelObjectType*> mObjectTypes;
 };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/memspythreaddetailindexview.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,46 @@
+/*
+ * 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 MEMSPYTHREADDETAILINDEXVIEW_H_
+#define MEMSPYTHREADDETAILINDEXVIEW_H_
+
+#include "memspyview.h"
+#include "enginewrapper.h"
+
+class HbMenu;
+
+class MemSpyThreadDetailIndexView : public MemSpyView
+{
+	Q_OBJECT
+	
+public:
+	MemSpyThreadDetailIndexView(EngineWrapper &engine, ViewManager &viewManager) 
+		: MemSpyView(engine, viewManager) {}
+protected:
+	virtual void initialize(const QVariantMap& params);
+	virtual HbMenu* createToolMenu();
+
+private slots:
+	void changePriority();
+	void itemClicked(const QModelIndex& index);
+	
+private:
+	ThreadId mThreadId;
+	HbMenu *mPriorityMenu;
+};
+
+#endif /* MEMSPYTHREADDETAILINDEXVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspythreaddetailview.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/inc/memspythreaddetailview.h	Fri May 14 15:15:12 2010 +0300
@@ -23,6 +23,22 @@
 
 class HbMenu;
 
+class MemSpyThreadDetailModel : public QAbstractListModel
+{
+public:
+	MemSpyThreadDetailModel(EngineWrapper &engine, ThreadId threadId, ThreadInfoType type, QObject *parent = 0);
+	
+	~MemSpyThreadDetailModel();
+	
+	int rowCount(const QModelIndex &parent = QModelIndex()) const;
+	
+	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+	
+private:
+	QList<MemSpyThreadInfoItem*> mThreadInfo;
+};
+
+
 class MemSpyThreadDetailView : public MemSpyView
 {
 	Q_OBJECT
@@ -32,10 +48,6 @@
 		: MemSpyView(engine, viewManager) {}
 protected:
 	virtual void initialize(const QVariantMap& params);
-	virtual HbMenu* createToolMenu();
-
-private slots:
-	void changePriority();
 	
 private:
 	ThreadId mThreadId;
--- a/memspyui/ui/hb/inc/viewmanager.h	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/inc/viewmanager.h	Fri May 14 15:15:12 2010 +0300
@@ -26,6 +26,7 @@
 	MainView,
 	ProcessView,
 	ThreadView,
+	ThreadDetailIndexView,
 	ThreadDetailView,
 	KernelObjectTypeView,
 	KernelObjectView,
--- a/memspyui/ui/hb/src/enginewrapper.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/src/enginewrapper.cpp	Fri May 14 15:15:12 2010 +0300
@@ -54,9 +54,22 @@
 	return result;
 }
 
+QList<MemSpyThreadInfoItem*> EngineWrapper::getThreadInfo(ThreadId threadId, ThreadInfoType type)
+{
+	QList<MemSpyThreadInfoItem*> result;
+	RArray<CMemSpyApiThreadInfoItem*> threadInfo;
+	TRAPD(error, mSession.GetThreadInfoItems(threadInfo, threadId, 
+			static_cast<TMemSpyThreadInfoItemType>(type)));
+	if (error == KErrNone)
+		for (TInt i=0; i<threadInfo.Count(); i++)
+			result.append(new MemSpyThreadInfoItem(threadInfo[i]));
+	
+	return result;
+}
+
 void EngineWrapper::setThreadPriority(ThreadId threadId, ThreadPriority priority)
 {
-	TRAPD(error, mSession.SetThreadPriorityL(threadId, priority));
+	TRAP_IGNORE(mSession.SetThreadPriorityL(threadId, priority));
 }
 
 QList<MemSpyKernelObjectType*> EngineWrapper::getKernelObjectTypes()
--- a/memspyui/ui/hb/src/memspykernelobjecttypeview.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/src/memspykernelobjecttypeview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -42,6 +42,9 @@
 	if (role == Qt::DisplayRole) {
 		QStringList lines;
 		lines << mObjectTypes.at(index.row())->name();
+		lines << QString("%1, %2").
+			arg(tr("%n item(s)", "", mObjectTypes.at(index.row())->count())).
+			arg(formatSize(mObjectTypes.at(index.row())->size()));
 		
 		return lines;
 	}
@@ -52,19 +55,26 @@
 	return QVariant();
 }
 
+QString MemSpyKernelObjectTypeModel::formatSize(qint64 size) const
+{
+	// If < 1000K
+	if  (size < 1024000)
+		return QString("%1K").arg(size ? qBound<int>(1, (size + 512) >> 10, 999) : 0);
+	
+	// larger than 1M
+	double sizeInM = size / 1048576.;
+	return sizeInM >= 1000 ?
+		QString("%1G").arg(qMax<double>(1, sizeInM / 1024), 0, 'f', 1) :
+		QString("%1M").arg(qBound<double>(1, sizeInM, 999.9), 0, 'f', 1);
+}
+
 void MemSpyKernelObjectTypeView::initialize(const QVariantMap& params)
 {
 	MemSpyView::initialize(params);
 	
 	setTitle(tr("Kernel Objects"));
-	
-	QStringList list = QStringList() << "Thread" << "Process" << "Chunk" << "Library" <<
-			"Semaphore" << "Mutex" << "Timer" << "Server" << "Session" << "Logical Device" <<
-			"Physical Device" << "Logical Channel" << "Change Notifier" << "Undertaker" <<
-			"Message Queue" << "Property Ref." << "Conditional Var.";
 			
-	//mListView.setModel(new MemSpyKernelObjectTypeModel(mEngine, this));
-	mListView.setModel(new QStringListModel(list, this));
+	mListView.setModel(new MemSpyKernelObjectTypeModel(mEngine, this));
 	
 	connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
 }
--- a/memspyui/ui/hb/src/memspymainview.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/src/memspymainview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -16,7 +16,7 @@
  */
 
 #include "memspymainview.h"
-#include "viewManager.h"
+#include "viewmanager.h"
 
 #include <QStringListModel>
 #include <QDebug>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/memspythreaddetailindexview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,116 @@
+/*
+ * 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:
+ *  
+ */
+
+#include <QAction>
+#include <QStringListModel>
+#include <HbMenu>
+
+#include "memspythreaddetailindexview.h"
+#include "viewmanager.cpp"
+
+void MemSpyThreadDetailIndexView::initialize(const QVariantMap& params)
+{
+	MemSpyView::initialize(params);
+	
+	setTitle(tr("Thread Details"));
+	
+	mThreadId = qVariantValue<ThreadId>(params["tid"]);
+	
+	QStringList lines = QStringList() << tr("General") << tr("Heap") << tr("Stack") 
+			<< tr("Chunks") << tr("Code Segments") << tr("Open Files") << tr("Active Objects")
+			<< tr("Handles to other Threads") << tr("Handles to other Processes") 
+			<< tr("Servers Running in Thread") << tr("Client <-> Server connections")
+			<< tr("Semaphores") << tr("References this Thread") << tr("References this Process")
+			<< tr("Mutexes") << tr("Timers") << tr("Logical DD Channels") 
+			<< tr("Change Notifiers") << tr("Undertakers") << tr("Logical Device Drivers")
+			<< tr("Physical Device Drivers");
+	
+	mListView.setModel(new QStringListModel(lines, this));
+	
+	connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
+}
+
+HbMenu* MemSpyThreadDetailIndexView::createToolMenu()
+{
+	HbMenu* menu = new HbMenu(tr("Thread"));
+	mPriorityMenu = menu->addMenu("Change Priority");
+	
+	mPriorityMenu->addAction(tr("Abs. Very Low"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Low Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Low"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Background Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Background"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Foreground Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Foreground"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. High Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. High"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 1"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 2"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 3"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 4"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 5"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 6"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 7"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 8"), this, SLOT(changePriority()));
+	
+	return menu;
+}
+	
+void MemSpyThreadDetailIndexView::changePriority()
+{
+	QAction *s = qobject_cast<QAction*>(sender());
+	int index = mPriorityMenu->actions().indexOf(s);
+	
+	ThreadPriority priorities[] = {
+		ThreadPriorityAbsoluteVeryLow,
+		ThreadPriorityAbsoluteLowNormal,
+		ThreadPriorityAbsoluteLow,
+		ThreadPriorityAbsoluteBackgroundNormal,
+		ThreadPriorityAbsoluteBackground,
+		ThreadPriorityAbsoluteForegroundNormal,
+		ThreadPriorityAbsoluteForeground,
+		ThreadPriorityAbsoluteHighNormal,
+		ThreadPriorityAbsoluteHigh,
+		ThreadPriorityAbsoluteRealTime1,
+		ThreadPriorityAbsoluteRealTime2,
+		ThreadPriorityAbsoluteRealTime3,
+		ThreadPriorityAbsoluteRealTime4,
+		ThreadPriorityAbsoluteRealTime5,
+		ThreadPriorityAbsoluteRealTime6,
+		ThreadPriorityAbsoluteRealTime7, 
+		ThreadPriorityAbsoluteRealTime8 };
+	
+	mEngine.setThreadPriority(mThreadId, priorities[index]);
+}
+
+void MemSpyThreadDetailIndexView::itemClicked(const QModelIndex& index)
+{
+	ThreadInfoType types[] = { ThreadInfoTypeGeneral, ThreadInfoTypeHeap, 
+			ThreadInfoTypeStack, ThreadInfoTypeChunk, ThreadInfoTypeCodeSeg, 
+			ThreadInfoTypeOpenFiles, ThreadInfoTypeActiveObjects, ThreadInfoTypeOwnedThreadHandles,
+			ThreadInfoTypeOwnedProcessHandles, ThreadInfoTypeServer, ThreadInfoTypeSession, 
+			ThreadInfoTypeSemaphore, ThreadInfoTypeOtherThreads, ThreadInfoTypeOtherProcesses,
+			ThreadInfoTypeMutex, ThreadInfoTypeTimer, ThreadInfoTypeChannel,
+			ThreadInfoTypeChangeNotifier, ThreadInfoTypeUndertaker,
+			ThreadInfoTypeLDD, ThreadInfoTypePDD };
+	
+	QVariantMap map;
+	map.insert("tid", mThreadId);
+	map.insert("type", types[index.row()]);
+	mViewManager.showView(ThreadDetailView, map);
+}
+
--- a/memspyui/ui/hb/src/memspythreaddetailview.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/src/memspythreaddetailview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -21,76 +21,43 @@
 
 #include "memspythreaddetailview.h"
 
+MemSpyThreadDetailModel::MemSpyThreadDetailModel(EngineWrapper &engine, ThreadId threadId, ThreadInfoType type, QObject *parent) :
+	QAbstractListModel(parent),
+	mThreadInfo(engine.getThreadInfo(threadId, type))
+{
+}
+
+MemSpyThreadDetailModel::~MemSpyThreadDetailModel()
+{
+	qDeleteAll(mThreadInfo);
+}
+	
+int MemSpyThreadDetailModel::rowCount(const QModelIndex &parent) const
+{
+	Q_UNUSED(parent);
+	return mThreadInfo.count();
+}
+	
+QVariant MemSpyThreadDetailModel::data(const QModelIndex &index, int role) const
+{
+	if (role == Qt::DisplayRole) {
+		QStringList lines;
+		lines << mThreadInfo.at(index.row())->caption();
+		lines << mThreadInfo.at(index.row())->value();
+		return lines;
+	}
+	
+	return QVariant();
+}
+
 void MemSpyThreadDetailView::initialize(const QVariantMap& params)
 {
 	MemSpyView::initialize(params);
 	
 	setTitle(tr("Thread Details"));
 	
-	mThreadId = qVariantValue<ThreadId>(params["tid"]);
-	
-	QStringList lines = QStringList() << tr("General") << tr("Heap") << tr("Stack") 
-			<< tr("Chunks") << tr("Code Segments") << tr("Open Files") << tr("Active Objects")
-			<< tr("Handles to other Threads") << tr("Handles to other Processes") 
-			<< tr("Servers Running in Thread") << tr("Client <-> Server connections")
-			<< tr("Semaphores") << tr("References this Thread") << tr("References this Process")
-			<< tr("Mutexes") << tr("Timers") << tr("Logical DD Channels") 
-			<< tr("Change Notifiers") << tr("Undertakers") << tr("Logical Device Drivers")
-			<< tr("Physical Device Drivers") << tr("Memory Tracking");
-	
-	mListView.setModel(new QStringListModel(lines, this));
-}
-
-HbMenu* MemSpyThreadDetailView::createToolMenu()
-{
-	HbMenu* menu = new HbMenu(tr("Thread"));
-	mPriorityMenu = menu->addMenu("Change Priority");
+	ThreadId threadId = qVariantValue<ThreadId>(params["tid"]);
+	ThreadInfoType type = static_cast<ThreadInfoType>(qVariantValue<int>(params["type"]));
 	
-	mPriorityMenu->addAction(tr("Abs. Very Low"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Low Normal"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Low"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Background Normal"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Background"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Foreground Normal"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Foreground"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. High Normal"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. High"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Real Time 1"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Real Time 2"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Real Time 3"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Real Time 4"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Real Time 5"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Real Time 6"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Real Time 7"), this, SLOT(changePriority()));
-	mPriorityMenu->addAction(tr("Abs. Real Time 8"), this, SLOT(changePriority()));
-	
-	return menu;
+	mListView.setModel(new MemSpyThreadDetailModel(mEngine, threadId, type, this));
 }
-	
-void MemSpyThreadDetailView::changePriority()
-{
-	QAction *s = qobject_cast<QAction*>(sender());
-	int index = mPriorityMenu->actions().indexOf(s);
-	
-	ThreadPriority priorities[] = {
-		ThreadPriorityAbsoluteVeryLow,
-		ThreadPriorityAbsoluteLowNormal,
-		ThreadPriorityAbsoluteLow,
-		ThreadPriorityAbsoluteBackgroundNormal,
-		ThreadPriorityAbsoluteBackground,
-		ThreadPriorityAbsoluteForegroundNormal,
-		ThreadPriorityAbsoluteForeground,
-		ThreadPriorityAbsoluteHighNormal,
-		ThreadPriorityAbsoluteHigh,
-		ThreadPriorityAbsoluteRealTime1,
-		ThreadPriorityAbsoluteRealTime2,
-		ThreadPriorityAbsoluteRealTime3,
-		ThreadPriorityAbsoluteRealTime4,
-		ThreadPriorityAbsoluteRealTime5,
-		ThreadPriorityAbsoluteRealTime6,
-		ThreadPriorityAbsoluteRealTime7, 
-		ThreadPriorityAbsoluteRealTime8 };
-	
-	mEngine.setThreadPriority(mThreadId, priorities[index]);
-}
-
--- a/memspyui/ui/hb/src/memspythreadview.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/src/memspythreadview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -132,7 +132,7 @@
 {
 	QVariantMap map;
 	map["tid"] = index.data(Qt::UserRole);
-	mViewManager.showView(ThreadDetailView, map);
+	mViewManager.showView(ThreadDetailIndexView, map);
 }
 
 void MemSpyThreadView::catchLongPress(HbAbstractViewItem *item, const QPointF &coords)
--- a/memspyui/ui/hb/src/viewmanager.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/memspyui/ui/hb/src/viewmanager.cpp	Fri May 14 15:15:12 2010 +0300
@@ -25,6 +25,7 @@
 #include "memspymainview.h"
 #include "memspyprocessview.h"
 #include "memspythreadview.h"
+#include "memspythreaddetailindexview.h"
 #include "memspythreaddetailview.h"
 #include "memspykernelobjecttypeview.h"
 #include "memspykernelobjectview.h"
@@ -40,6 +41,7 @@
 	&factory<MemSpyMainView>,
 	&factory<MemSpyProcessView>,
 	&factory<MemSpyThreadView>,
+	&factory<MemSpyThreadDetailIndexView>,
 	&factory<MemSpyThreadDetailView>,
 	&factory<MemSpyKernelObjectTypeView>,
 	&factory<MemSpyKernelObjectView>,
--- a/perfmon/ui/hb/app/src/mainview.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/perfmon/ui/hb/app/src/mainview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -20,7 +20,7 @@
 #include <HbMenu>
 #include <HbToolBar>
 #include <HbAction>
-#include <HbMessagebox>
+#include <HbMessageBox>
 #include <HbLabel>
 
 #include "mainview.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/group/bld.inf	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2007 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:   
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+#include "bld_generic.inf"
+#include "../ui/avkon/group/bld.inf"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/group/bld_generic.inf	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2010 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: 
+*
+*/
+
+PRJ_MMPFILES
+#ifndef SBSV2
+  #ifdef MARM
+  gnumakefile piprofiler_stub_sis.mk
+  #endif
+#endif
+
+PRJ_EXTENSIONS
+#ifdef SBSV2
+  #ifdef MARM
+  START EXTENSION app-services/buildstubsis
+  OPTION SRCDIR ../sis
+  OPTION SISNAME PIProfiler_stub
+  END
+  #endif  
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/group/group.pro	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2010 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: 
+#
+#
+
+TEMPLATE = subdirs
+
+BLD_INF_RULES.prj_platforms += "$${LITERAL_HASH}include  \"bld_generic.inf\""
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/piprofilerui.pro	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,23 @@
+#
+# Copyright (c) 2010 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: 
+#
+#
+
+TEMPLATE = subdirs
+
+DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT QT_NO_DEBUG
+
+SUBDIRS = group \
+          ui/hb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/sis/PIProfiler_S60-30.pkg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,37 @@
+;
+; 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: 
+;
+&EN
+
+; Standard SIS file header
+#{"PIProfilerUI"},(0x2001E5AE),2,2,01,TYPE=SA, RU
+
+; Supports S60 v 3.0 and 5.0
+[0x101F7961], 0, 0, 0, {"S60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; normal stuff:
+"\epoc32\RELEASE\armv5\urel\PIProfilerUI.exe"-"!:\sys\bin\PIProfilerUI.exe"
+"\epoc32\data\z\Resource\apps\piprofilerui_aif.mif"-"!:\Resource\Apps\piprofilerui_aif.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui_ExtraIcons.mif"-"!:\Resource\Apps\piprofilerui_ExtraIcons.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui.rsc"-"!:\Resource\Apps\piprofilerui.rsc"
+"\epoc32\data\z\PRIVATE\10003A3F\APPS\piprofilerui_reg.rsc"-"!:\private\10003a3f\import\apps\piprofilerui_reg.rsc"
+"..\ui\avkon\group\backup_registration.xml"-"!:\private\2001E5AE\backup_registration.xml"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/sis/PIProfiler_S60-31.pkg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,37 @@
+;
+; 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: 
+;
+&EN
+
+; Standard SIS file header
+#{"PIProfilerUI"},(0x2001E5AE),2,2,01,TYPE=SA, RU
+
+; Supports S60 v 3.0 and 5.0
+[0x101F7961], 0, 0, 0, {"S60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; normal stuff:
+"\epoc32\RELEASE\armv5\urel\PIProfilerUI.exe"-"!:\sys\bin\PIProfilerUI.exe"
+"\epoc32\data\z\Resource\apps\piprofilerui_aif.mif"-"!:\Resource\Apps\piprofilerui_aif.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui_ExtraIcons.mif"-"!:\Resource\Apps\piprofilerui_ExtraIcons.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui.rsc"-"!:\Resource\Apps\piprofilerui.rsc"
+"\epoc32\data\z\PRIVATE\10003A3F\APPS\piprofilerui_reg.rsc"-"!:\private\10003a3f\import\apps\piprofilerui_reg.rsc"
+"..\ui\avkon\group\backup_registration.xml"-"!:\private\2001E5AE\backup_registration.xml"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/sis/PIProfiler_S60-32.pkg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,37 @@
+;
+; 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: 
+;
+&EN
+
+; Standard SIS file header
+#{"PIProfilerUI"},(0x2001E5AE),2,2,01,TYPE=SA, RU
+
+; Supports S60 v 3.0 and 5.0
+[0x101F7961], 0, 0, 0, {"S60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; normal stuff:
+"\epoc32\RELEASE\armv5\urel\PIProfilerUI.exe"-"!:\sys\bin\PIProfilerUI.exe"
+"\epoc32\data\z\Resource\apps\piprofilerui_aif.mif"-"!:\Resource\Apps\piprofilerui_aif.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui_ExtraIcons.mif"-"!:\Resource\Apps\piprofilerui_ExtraIcons.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui.rsc"-"!:\Resource\Apps\piprofilerui.rsc"
+"\epoc32\data\z\PRIVATE\10003A3F\APPS\piprofilerui_reg.rsc"-"!:\private\10003a3f\import\apps\piprofilerui_reg.rsc"
+"..\ui\avkon\group\backup_registration.xml"-"!:\private\2001E5AE\backup_registration.xml"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/sis/PIProfiler_S60-50.pkg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,37 @@
+;
+; 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: 
+;
+&EN
+
+; Standard SIS file header
+#{"PIProfilerUI"},(0x2001E5AE),2,2,01,TYPE=SA, RU
+
+; Supports S60 v 3.0 and 5.0
+[0x101F7961], 0, 0, 0, {"S60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; normal stuff:
+"\epoc32\RELEASE\armv5\urel\PIProfilerUI.exe"-"!:\sys\bin\PIProfilerUI.exe"
+"\epoc32\data\z\Resource\apps\piprofilerui_aif.mif"-"!:\Resource\Apps\piprofilerui_aif.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui_ExtraIcons.mif"-"!:\Resource\Apps\piprofilerui_ExtraIcons.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui.rsc"-"!:\Resource\Apps\piprofilerui.rsc"
+"\epoc32\data\z\PRIVATE\10003A3F\APPS\piprofilerui_reg.rsc"-"!:\private\10003a3f\import\apps\piprofilerui_reg.rsc"
+"..\ui\avkon\group\backup_registration.xml"-"!:\private\2001E5AE\backup_registration.xml"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/sis/PIProfiler_Symbian3.pkg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,37 @@
+;
+; 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: 
+;
+&EN
+
+; Standard SIS file header
+#{"PIProfilerUI"},(0x2001E5AE),2,2,01,TYPE=SA, RU
+
+; Supports S60 v 3.0 and 5.0
+[0x101F7961], 0, 0, 0, {"S60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; normal stuff:
+"\epoc32\RELEASE\armv5\urel\PIProfilerUI.exe"-"!:\sys\bin\PIProfilerUI.exe"
+"\epoc32\data\z\Resource\apps\piprofilerui_aif.mif"-"!:\Resource\Apps\piprofilerui_aif.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui_ExtraIcons.mif"-"!:\Resource\Apps\piprofilerui_ExtraIcons.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui.rsc"-"!:\Resource\Apps\piprofilerui.rsc"
+"\epoc32\data\z\PRIVATE\10003A3F\APPS\piprofilerui_reg.rsc"-"!:\private\10003a3f\import\apps\piprofilerui_reg.rsc"
+"..\ui\avkon\group\backup_registration.xml"-"!:\private\2001E5AE\backup_registration.xml"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/sis/PIProfiler_Symbian4.pkg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,37 @@
+;
+; 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: 
+;
+&EN
+
+; Standard SIS file header
+#{"PIProfilerUI"},(0x2001E5AE),2,2,01,TYPE=SA, RU
+
+; Supports S60 v 3.0 and 5.0
+[0x101F7961], 0, 0, 0, {"S60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; normal stuff:
+"\epoc32\RELEASE\armv5\urel\PIProfilerUI.exe"-"!:\sys\bin\PIProfilerUI.exe"
+"\epoc32\data\z\Resource\apps\piprofilerui_aif.mif"-"!:\Resource\Apps\piprofilerui_aif.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui_ExtraIcons.mif"-"!:\Resource\Apps\piprofilerui_ExtraIcons.mif"
+"\epoc32\data\z\Resource\apps\piprofilerui.rsc"-"!:\Resource\Apps\piprofilerui.rsc"
+"\epoc32\data\z\PRIVATE\10003A3F\APPS\piprofilerui_reg.rsc"-"!:\private\10003a3f\import\apps\piprofilerui_reg.rsc"
+"..\ui\avkon\group\backup_registration.xml"-"!:\private\2001E5AE\backup_registration.xml"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/sis/PIProfiler_stub.pkg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,33 @@
+;
+; 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: 
+;
+&EN
+
+; Standard SIS file header
+#{"ProfilerGUI"},(0x2001E5AE),1,0,0
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; normal stuff:
+""-"!:\sys\bin\PIProfilerUI.exe"
+""-"!:\Resource\Apps\piprofilerui_aif.mif"
+""-"!:\Resource\Apps\piprofilerui_ExtraIcons.mif"
+""-"!:\Resource\Apps\piprofilerui.rsc"
+""-"!:\private\10003a3f\import\apps\piprofilerui_reg.rsc"
+""-"!:\private\2001E5AE\backup_registration.xml"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/data/piprofilerui.rss	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,962 @@
+/*
+* 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:   
+*
+*/
+
+
+
+
+NAME PIPR
+
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <avkon.rh>
+#include <avkon.rsg>
+#include <avkon.mbg>
+#include <CommonDialogs.hrh>
+#include <CommonDialogs.rh>
+#include <pathconfiguration.hrh>
+
+#include "profiler_gui.hrh"
+#include "profiler_gui_std.h"
+#include <data_caging_paths_strings.hrh>
+#include <appinfo.rh>
+
+
+// ---------------------------------------------------------
+//   
+//    Define the resource file signature 
+//    This resource should be empty.
+//
+// ---------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+
+// ---------------------------------------------------------
+//   
+//    Default Document Name
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_default_document_name { buf=""; }
+
+// ---------------------------------------------------------
+//   
+//    Define default menu and CBA key.
+//
+// ---------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO { }
+	
+//----------------------------------------------------
+//   
+//    r_profiler_gui_hotkeys
+//
+//----------------------------------------------------
+//
+RESOURCE HOTKEYS r_profiler_gui_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EAknCmdExit; key='e'; }
+        };
+    }
+
+
+//----------------------------------------------------
+//    r_profiler_gui_view_main
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_profiler_gui_view_main
+    {
+    hotkeys=r_profiler_gui_hotkeys;
+    menubar=r_profiler_gui_menubar_view_main;  
+    cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT;    
+    }
+
+//----------------------------------------------------
+//    r_profiler_gui_menubar_view_main
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_profiler_gui_menubar_view_main
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_profiler_gui_app_menu; txt="App"; },
+        MENU_TITLE { menu_pane=r_profiler_gui_view_main_menu; txt="Main"; }
+        };
+    }
+
+//----------------------------------------------------
+//    r_profiler_gui_view_main_menu
+//----------------------------------------------------
+//
+
+RESOURCE MENU_PANE r_profiler_gui_view_main_menu
+    {
+    items=
+        {
+        };
+    }
+
+           
+        
+//----------------------------------------------------
+//    r_profiler_gui_app_menu
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_profiler_gui_app_menu
+    {
+    items=
+        {
+        MENU_ITEM { command=EProfilerGuiCmdStartAll;cascade = r_profiler_start_submenu; txt="Start"; },
+        MENU_ITEM { command=EProfilerGuiCmdStopAll; txt="Stop profiling"; },
+        MENU_ITEM { command=EProfilerGuiCmdSamplerControl; txt="Sampler control"; cascade=r_profiler_sampler_control_menu; }, 
+        MENU_ITEM { command=EProfilerGuiCmdSettings; txt="Settings"; },
+        MENU_ITEM { command=EProfilerGuiCmdAbout; txt="About"; },
+        MENU_ITEM { command=EAknCmdExit; txt="Exit"; }
+        };
+    }
+
+//----------------------------------------------------
+//    r_profiler_start_submenu
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_profiler_start_submenu
+    {
+    items = 
+        {
+        MENU_ITEM 
+            {
+            command = EProfilerGuiCmdStartAll;
+            txt = "Profiling";
+            }
+        };
+    }
+
+//----------------------------------------------------
+//    r_profiler_sampler_control_menu
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_profiler_sampler_control_menu
+    {
+    items=
+        {
+        MENU_ITEM { command=EProfilerGuiCmdSamplerEnable; txt="Enable"; },
+        MENU_ITEM { command=EProfilerGuiCmdSamplerDisable; txt="Disable"; },
+        MENU_ITEM { command=EProfilerGuiCmdSamplerSettings; txt="Sampler settings"; },
+        MENU_ITEM { command=EProfilerGuiCmdSamplerInfo; txt="Sampler info"; }
+        };
+    }
+
+
+//----------------------------------------------------
+//    r_profiler_gui_settings_dialog
+//    Dialog for setting list
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_profiler_gui_settings_dialog
+    {
+    flags =
+        EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
+        EEikDialogFlagButtonsRight | EEikDialogFlagCbaButtons |
+        EEikDialogFlagWait | EEikDialogFlagNoTitleBar;
+    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtSettingListBox;
+            id = EProfilerGuiSettingItemList;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = LISTBOX
+                {
+                flags = EAknListBoxSelectionList;
+                };
+            }
+        };
+    }
+
+// generic resources
+RESOURCE POPUP_SETTING_LIST r_popup_setting_list_editor
+	{
+	}
+RESOURCE AVKON_SETTING_PAGE r_binary_setting_page
+    {   
+    number = EAknSettingPageNoOrdinalDisplayed;
+    type = EAknCtPopupSettingList;
+	editor_resource_id = r_popup_setting_list_editor;
+    }
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_yesno_binaryselection_texts
+	{
+	setting_texts_resource = r_yesno_binaryselection_text_array;
+	}
+RESOURCE ARRAY r_yesno_binaryselection_text_array
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT { value=0; text = "No"; },
+		AVKON_ENUMERATED_TEXT { value=1; text = "Yes"; }
+		};
+	}
+
+
+//
+// resources for plugin name mode selection
+//
+RESOURCE TBUF r_plugin_name_mode_setting_title
+    {
+    buf = "Sampler name length";
+    }
+RESOURCE AVKON_SETTING_PAGE r_plugin_name_mode_setting_page
+	{
+    number = EAknSettingPageNoOrdinalDisplayed; 
+	type = EAknCtPopupSettingList;
+	editor_resource_id = r_popup_setting_list_editor;
+	}
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_plugin_name_mode_setting_texts
+	{
+	setting_texts_resource = r_plugin_name_mode_text_array;
+	}
+RESOURCE ARRAY r_plugin_name_mode_text_array
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT { value=ESamplerNameShort; text = "Short"; },
+		AVKON_ENUMERATED_TEXT { value=ESamplerNameMedium; text = "Medium"; },
+		AVKON_ENUMERATED_TEXT { value=ESamplerNameLong; text = "Long"; }
+		};
+	}
+
+
+//
+// resources for trace output selection
+//
+RESOURCE TBUF r_trace_output_setting_title
+    {
+    buf = "Output to";
+    }
+RESOURCE AVKON_SETTING_PAGE r_trace_output_setting_page
+	{
+    number = EAknSettingPageNoOrdinalDisplayed; 
+	type = EAknCtPopupSettingList;
+	editor_resource_id = r_popup_setting_list_editor;
+	}
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_trace_output_setting_texts
+	{
+	setting_texts_resource = r_trace_output_text_array;
+	}
+RESOURCE ARRAY r_trace_output_text_array
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT { value=EOutputToDebugPort; text = "Debug output"; },
+		AVKON_ENUMERATED_TEXT { value=EOutputToFileSystem; text = "File system"; }
+		};
+	}
+
+
+//
+// resources for save_file_prefix selection
+//
+RESOURCE TBUF r_save_file_prefix_setting_title
+    {
+    buf = "File prefix";
+    }
+RESOURCE AVKON_SETTING_PAGE r_save_file_prefix_setting_page
+	{
+	type = EEikCtEdwin;
+	editor_resource_id = r_save_file_prefix_text_editor;
+	}
+
+RESOURCE EDWIN r_save_file_prefix_text_editor
+	{
+	lines = 0;  // expanding to multiple rows
+	maxlength = 63;
+	flags = EEikEdwinNoLineOrParaBreaks;
+	}
+
+//
+// resources for save file drive selection
+//
+RESOURCE TBUF r_save_file_drive_setting_title
+    {
+    buf = "Save file in";
+    }
+RESOURCE AVKON_SETTING_PAGE r_save_file_drive_setting_page
+	{
+	type = EEikCtEdwin;
+	editor_resource_id = r_save_file_drive_text_editor;
+	}
+
+RESOURCE EDWIN r_save_file_drive_text_editor
+	{
+	lines = 0;  // expanding to multiple rows
+	maxlength = 63;	
+	flags = EEikEdwinNoLineOrParaBreaks;
+	}
+
+//
+// resources for trace mode selection
+//
+RESOURCE TBUF r_trace_mode_setting_title
+    {
+    buf = "Trace mode";
+    }
+RESOURCE AVKON_SETTING_PAGE r_trace_mode_setting_page
+	{
+    number = EAknSettingPageNoOrdinalDisplayed; 
+	type = EAknCtPopupSettingList;
+	editor_resource_id = r_popup_setting_list_editor;
+	}
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_trace_mode_setting_texts
+	{
+	setting_texts_resource = r_trace_mode_text_array;
+	}
+RESOURCE ARRAY r_trace_mode_text_array
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT { value=ETraceModeStream; text = "Stream"; },
+		AVKON_ENUMERATED_TEXT { value=ETraceModeBuffer; text = "Memory buffer"; }
+		};
+	}
+
+//
+// resources for timed_sampling_period selection
+//
+RESOURCE TBUF r_timed_sampling_period_setting_title
+    {
+    buf = "Profiling period (sec.)";
+    }
+RESOURCE AVKON_SETTING_PAGE r_timed_sampling_period_setting_page
+    {
+    type = EAknCtIntegerEdwin;
+    editor_resource_id = r_timed_sampling_period_integer_editor;
+    }
+
+RESOURCE AVKON_INTEGER_EDWIN r_timed_sampling_period_integer_editor
+    {
+    maxlength = 6;
+    min = 1;
+    max = 999999;
+    }
+
+
+//----------------------------------------------------
+//    r_profiler_gui_settings_menubar
+//----------------------------------------------------
+//
+
+RESOURCE MENU_BAR r_profiler_gui_settings_menubar
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_profiler_gui_settings_menupane;
+            txt = " ";   // dummy
+            }
+        };
+    }
+
+RESOURCE MENU_PANE r_profiler_gui_settings_menupane
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EProfilerGuiCmdSettingsChange;
+            txt = "Change";
+            },
+        MENU_ITEM
+            {
+            command = EProfilerGuiCmdSettingsExit;
+            txt = "Exit";
+            }
+        };
+    }
+
+//----------------------------------------------------
+//    r_profiler_gui_settings_dialog
+//    Dialog for setting list
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_profiler_sampler_settings_dialog
+    {
+    flags =
+        EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
+        EEikDialogFlagButtonsRight | EEikDialogFlagCbaButtons |
+        EEikDialogFlagWait | EEikDialogFlagNoTitleBar;
+    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtSettingListBox;
+            id = EProfilerSamplerSettingItemList;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = LISTBOX
+                {
+                flags = EAknListBoxSelectionList;
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------
+//    r_profiler_sampler_settings_menubar
+//----------------------------------------------------
+//
+
+RESOURCE MENU_BAR r_profiler_sampler_settings_menubar
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_profiler_sampler_settings_menupane;
+            txt = "Sampler settings";
+            }
+        };
+    }
+
+RESOURCE MENU_PANE r_profiler_sampler_settings_menupane
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EProfilerGuiCmdSettingsChange;
+            txt = "Change";
+            },
+        MENU_ITEM
+            {
+            command = EProfilerGuiCmdSettingsExit;
+            txt = "Exit";
+            }
+        };
+    }
+
+  
+// ---------------------------------------------------------
+//   
+//   r_profiler_gui_about_dialog
+//   About dialog - show version and copyright info etc.
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_profiler_gui_about_dialog
+    {
+    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                label = "About Profiler";
+                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+               	message = "Version 2.2.0.2 - 4th May 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.";
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   r_sampler_rate_setting_page
+// ---------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_sampler_rate_setting_page
+    {
+    type = EAknCtIntegerEdwin;
+    editor_resource_id = r_sampler_rate_integer_editor;
+    }
+RESOURCE AVKON_INTEGER_EDWIN r_sampler_rate_integer_editor
+    {
+    maxlength = 6;
+    min = 250;
+    max = 999999;
+    }    
+
+// ---------------------------------------------------------
+//   r_cpu_sampler_rate_setting_page
+// ---------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_cpu_sampler_rate_setting_page
+    {
+    type = EAknCtIntegerEdwin;
+    editor_resource_id = r_cpu_sampler_rate_integer_editor;
+    }
+RESOURCE AVKON_INTEGER_EDWIN r_cpu_sampler_rate_integer_editor
+    {
+    maxlength = 5;
+    min = 1;
+    max = 10000;
+    } 
+
+// ---------------------------------------------------------
+//   
+//   r_generic_sampler_dlg_line_sample_rate
+//   Empty about dialog - show sampler plugin info in this
+//
+// ---------------------------------------------------------
+//
+RESOURCE DLG_LINE r_generic_sampler_dlg_line_sample_rate
+    {
+    type = EEikCtNumberEditor;
+    prompt = "Sample rate (ms)";
+    id = EProfilerGuiGenericSamplerQuerySampleRate;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = NUMBER_EDITOR
+        {
+        min = 1000;    
+        max = 10000;    
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//   r_profiler_gui_empty_about_dialog
+//   Empty about dialog - show sampler plugin info in this
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_profiler_gui_empty_about_dialog
+    {
+    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                label = "About";
+                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                message = "";
+                };
+            }
+        };
+    }
+
+
+RESOURCE TBUF r_dummy_setting_title
+    {
+    buf = "";
+    }
+
+RESOURCE TBUF r_sample_rate_setting_title
+    {
+    buf = "Sample rate (ms)";
+    }
+
+RESOURCE TBUF r_item1_setting_title
+    {
+    buf = "Item1";
+    }
+
+RESOURCE TBUF r_item2_setting_title
+    {
+    buf = "Item2";
+    }
+
+RESOURCE TBUF r_item3_setting_title
+    {
+    buf = "Item3";
+    }
+
+RESOURCE TBUF r_item4_setting_title
+    {
+    buf = "Item4";
+    }
+
+RESOURCE TBUF r_item5_setting_title
+    {
+    buf = "Item5";
+    }
+
+RESOURCE TBUF r_item6_setting_title
+    {
+    buf = "Item6";
+    }
+
+RESOURCE AVKON_SETTING_PAGE r_numeric_setting_page
+	{
+	type = EAknCtIntegerEdwin;
+	editor_resource_id = r_numeric_integer_editor;
+	}
+RESOURCE AVKON_INTEGER_EDWIN r_numeric_integer_editor
+	{
+	maxlength = 5;
+	min = 0;
+	max = 10000;
+	}    
+
+//
+// resources for text selection
+//
+RESOURCE AVKON_SETTING_PAGE r_generic_text_setting_page
+	{
+	type = EEikCtEdwin;
+	editor_resource_id = r_generic_text_editor;
+	}
+
+RESOURCE EDWIN r_generic_text_editor
+	{
+	lines = 0;  // expanding to multiple rows
+	maxlength = 63;	
+	flags = EEikEdwinNoLineOrParaBreaks;
+	}
+
+
+// ---------------------------------------------------------
+//   r_general_confirmation_query
+// ---------------------------------------------------------
+//
+
+RESOURCE DIALOG r_general_confirmation_query
+	{
+	flags = EGeneralQueryFlags;
+	buttons = R_AVKON_SOFTKEYS_YES_NO;
+	items =
+		{
+		DLG_LINE
+			{
+			type = EAknCtQuery;
+			id = EGeneralQuery;
+			control = AVKON_CONFIRMATION_QUERY
+				{
+				layout = EConfirmationQueryLayout;
+				};
+			}
+		};
+	}
+
+// ---------------------------------------------------------
+//   r_general_text_query
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_general_text_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY
+                {
+                layout = EDataLayout;
+                control = EDWIN
+                    {
+                    width = 256;
+                    lines = 3;
+                    maxlength = 256;
+                    };
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   r_general_text_query
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_general_numeric_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control= AVKON_DATA_QUERY
+                {
+                layout = ENumberLayout;
+                control = AVKON_INTEGER_EDWIN
+                    {
+                    min = -999999;
+                    max = 999999;
+                    };
+                };
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//   r_item_action_query
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_item_action_query_enabled
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items =
+        {
+        AVKON_LIST_QUERY_DLG_LINE
+            {
+            control= AVKON_LIST_QUERY_CONTROL
+                {
+				listtype = EAknCtSinglePopupMenuListBox;
+				listbox = AVKON_LIST_QUERY_LIST
+					{
+					array_id = r_item_action_query_array_enabled;
+					};
+				heading = "Sampler controls";
+			    };
+            }
+        };
+    }
+
+RESOURCE DIALOG r_item_action_query_disabled
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items =
+        {
+        AVKON_LIST_QUERY_DLG_LINE
+            {
+            control= AVKON_LIST_QUERY_CONTROL
+                {
+				listtype = EAknCtSinglePopupMenuListBox;
+				listbox = AVKON_LIST_QUERY_LIST
+					{
+					array_id = r_item_action_query_array_disabled;
+					};
+				heading = "Sampler controls";
+			    };
+            }
+        };
+    }
+
+RESOURCE DIALOG r_item_action_query_hidden_settings_enabled
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items =
+        {
+        AVKON_LIST_QUERY_DLG_LINE
+            {
+            control= AVKON_LIST_QUERY_CONTROL
+                {
+                listtype = EAknCtSinglePopupMenuListBox;
+                listbox = AVKON_LIST_QUERY_LIST
+                    {
+                    array_id = r_item_action_query_array_hidden_settings_enabled;
+                    };
+                heading = "Sampler controls";
+                };
+            }
+        };
+    }
+
+RESOURCE DIALOG r_item_action_query_hidden_settings_disabled
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items =
+        {
+        AVKON_LIST_QUERY_DLG_LINE
+            {
+            control= AVKON_LIST_QUERY_CONTROL
+                {
+                listtype = EAknCtSinglePopupMenuListBox;
+                listbox = AVKON_LIST_QUERY_LIST
+                    {
+                    array_id = r_item_action_query_array_hidden_settings_disabled;
+                    };
+                heading = "Sampler controls";
+                };
+            }
+        };
+    }
+
+RESOURCE DIALOG r_item_action_query_hidden_start_stop
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items =
+        {
+        AVKON_LIST_QUERY_DLG_LINE
+            {
+            control= AVKON_LIST_QUERY_CONTROL
+                {
+				listtype = EAknCtSinglePopupMenuListBox;
+				listbox = AVKON_LIST_QUERY_LIST
+					{
+					array_id = r_item_action_query_array_hidden_start_stop;
+					};
+				heading = "Sampler controls";
+			    };
+            }
+        };
+    }
+
+RESOURCE ARRAY r_item_action_query_array_disabled
+	{
+	items =
+		{
+		LBUF {txt = "Enable"; },
+		LBUF {txt = "Sampler settings"; },
+		LBUF {txt = "Sampler info"; }
+		};
+	} 	
+
+RESOURCE ARRAY r_item_action_query_array_enabled
+	{
+	items =
+		{
+		LBUF {txt = "Disable"; },
+		LBUF {txt = "Sampler settings"; },
+		LBUF {txt = "Sampler info"; }
+		};
+	} 
+
+RESOURCE ARRAY r_item_action_query_array_hidden_settings_disabled
+    {
+    items =
+        {
+        LBUF {txt = "Enable"; },
+        LBUF {txt = "Sampler info"; }
+        };
+    } 
+
+RESOURCE ARRAY r_item_action_query_array_hidden_settings_enabled
+    {
+    items =
+        {
+        LBUF {txt = "Disable"; },
+        LBUF {txt = "Sampler info"; }
+        };
+    } 
+
+RESOURCE ARRAY r_item_action_query_array_hidden_start_stop
+	{
+	items =
+		{
+		LBUF {txt = "Sampler settings"; },
+		LBUF {txt = "Sampler info"; }
+		};
+	} 
+
+RESOURCE STATUS_PANE_APP_MODEL r_profiler_gui_status_pane
+	{
+	panes = 
+		{
+		SPANE_PANE
+			{
+			id = EEikStatusPaneUidTitle;
+			type = EAknCtTitlePane;
+			resource = r_profiler_gui_title_resource;
+			},
+		SPANE_PANE
+			{
+			id = EEikStatusPaneUidNavi;
+			type = EAknCtNaviPane;
+			resource = r_profiler_gui_navi_text_idle;
+			}
+		};
+	}
+
+RESOURCE TITLE_PANE r_profiler_gui_title_resource
+	{
+	txt = "PI Profiler";
+	}
+
+RESOURCE TBUF r_profiler_gui_navi_text_idle
+	{
+	buf = "Idle";
+	}
+
+RESOURCE TBUF r_profiler_gui_navi_text_initializing
+	{
+	buf = "Initializing...";
+	}
+
+RESOURCE TBUF r_profiler_gui_navi_text_running
+	{
+	buf = "Profiling...";
+	}
+
+RESOURCE TBUF r_profiler_gui_navi_text_stopping
+	{
+	buf = "Stopping...";
+	}
+
+RESOURCE DIALOG r_profiler_gui_conf_query
+	{
+	flags = EAknGeneralQueryFlags;
+	buttons = R_AVKON_SOFTKEYS_YES_NO;
+	items = 
+		{
+		DLG_LINE
+			{
+			type = EAknCtQuery;
+			id = EProfilerGuiViewConfQuery;
+			control = AVKON_CONFIRMATION_QUERY
+				{
+				layout = EConfirmationQueryLayout;
+				label = "Leave profiling on?";
+				};
+			}
+		};
+	}
+
+//   
+//    RESOURCE LOCALISABLE_APP_INFO
+//
+// ---------------------------------------------------------
+//
+RESOURCE LOCALISABLE_APP_INFO r_profiler_gui_localisable_app_info
+    {
+    short_caption = "PI Profiler";
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        caption = "PI Profiler";
+
+        number_of_icons = 1;
+
+        // Note for ROM-based apps it is recommended to add the drive letter
+        icon_file = APP_BITMAP_DIR"\\piprofilerui_aif.mif";
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/data/piprofilerui_reg.rss	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* 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:   
+*
+*/
+
+
+
+
+#include <piprofilerui.rsg>
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x2001E5AE
+
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "PIProfilerUI";
+    localisable_resource_file = APP_RESOURCE_DIR"\\PIProfilerUI";
+    localisable_resource_id = R_PROFILER_GUI_LOCALISABLE_APP_INFO;
+    group_name = "RnD Tools";    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/group/backup_registration.xml	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+  <passive_backup>
+    <include_directory name="\"/>
+  </passive_backup>
+  <system_backup/>
+  <restore requires_reboot = "no"/>
+</backup_registration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/group/bld.inf	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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:   
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+
+PRJ_EXPORTS
+../group/backup_registration.xml    Z:/private/2001E5AE/backup_registration.xml
+../rom/piprofilerui_avkon.iby		CORE_IBY_EXPORT_PATH(tools,piprofilerui.iby)
+
+PRJ_MMPFILES
+#ifndef SBSV2
+  gnumakefile piprofilerui_icons_aif.mk
+  gnumakefile piprofilerui_extraicons.mk
+#endif
+
+piprofilerui.mmp
+
+
+#ifdef SBSV2
+  PRJ_EXTENSIONS
+  START EXTENSION s60/mifconv
+  OPTION TARGETFILE piprofilerui_aif.mif
+  OPTION SOURCEDIR ../../icons
+  OPTION SOURCES -c8,8 qgn_menu_piprofilerui
+  END
+
+  START EXTENSION s60/mifconv
+  OPTION TARGETFILE piprofilerui_extraicons.mif
+  OPTION HEADERFILE piprofilerui_extraicons.mbg
+  OPTION SOURCEDIR ../../icons
+  OPTION SOURCES -c8,8 qgn_prob_piprofilerui_status_disabled -c8,8 qgn_prob_piprofilerui_status_enabled
+  END
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/group/piprofilerui.mmp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,86 @@
+/*
+* 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:   
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+
+TARGET            PIProfilerUI.exe
+TARGETTYPE        exe
+EPOCSTACKSIZE     0x8000
+EPOCHEAPSIZE      0x10000 0x1000000  // Min 64Kb, Max 16Mb
+
+UID               0x100039CE 0x2001E5AE
+
+VENDORID          VID_DEFAULT
+CAPABILITY        ALL -TCB //swevent networkservices
+SMPSAFE
+
+LANG              SC
+
+START RESOURCE    ../data/piprofilerui.rss
+HEADER
+TARGETPATH        APP_RESOURCE_DIR
+END
+
+START RESOURCE    ../data/piprofilerui_reg.rss
+DEPENDS           piprofilerui.rsg
+TARGETPATH        /private/10003a3f/apps
+END
+
+APP_LAYER_SYSTEMINCLUDE
+USERINCLUDE       ../inc
+SOURCEPATH        ../src
+
+
+SOURCE            profiler_gui_app.cpp
+SOURCE            profiler_gui_document.cpp 
+SOURCE            profiler_gui_appui.cpp
+SOURCE            profiler_gui_model.cpp
+SOURCE            profiler_gui_mainview.cpp 
+SOURCE            profiler_gui_maincontainer.cpp 
+SOURCE            profiler_gui_settingsviewdlg.cpp
+SOURCE            profiler_gui_samplersettingsviewdlg.cpp
+
+
+LIBRARY           euser.lib
+LIBRARY			  eiksrv.lib
+LIBRARY           commonengine.lib
+LIBRARY           apparc.lib
+LIBRARY           cone.lib 
+LIBRARY           eikcore.lib
+LIBRARY           eikcoctl.lib
+LIBRARY           eikctl.lib
+LIBRARY           eikdlg.lib  
+LIBRARY           avkon.lib 
+LIBRARY           ws32.lib 
+LIBRARY           apgrfx.lib
+LIBRARY           efsrv.lib
+LIBRARY           bafl.lib
+LIBRARY           gdi.lib
+LIBRARY           aknnotify.lib
+LIBRARY           aknicon.lib
+LIBRARY           aknskins.lib
+LIBRARY           aknskinsrv.lib
+LIBRARY           egul.lib
+LIBRARY           estor.lib
+LIBRARY           flogger.lib
+LIBRARY			  charconv.lib 
+LIBRARY			  sysutil.lib 
+LIBRARY			  platformenv.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/group/piprofilerui_extraicons.mk	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,60 @@
+#
+# 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:   
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=$(EPOCROOT)epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\piprofilerui_extraicons.mif
+
+HEADERDIR=$(EPOCROOT)epoc32\include
+HEADERFILENAME=$(HEADERDIR)\piprofilerui_extraicons.mbg
+
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN :
+	@if exist $(ICONTARGETFILENAME) erase $(ICONTARGETFILENAME)
+	@if exist $(HEADERFILENAME) erase $(HEADERFILENAME)
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE : $(ICONTARGETFILENAME)
+
+$(ICONTARGETFILENAME) (HEADERFILENAME) : ..\..\icons\qgn_prob_piprofilerui_status_disabled.svg ..\..\icons\qgn_prob_piprofilerui_status_enabled.svg
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+		/c8,8 ..\..\icons\qgn_prob_piprofilerui_status_disabled.svg \
+		/c8,8 ..\..\icons\qgn_prob_piprofilerui_status_enabled.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME) && \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/group/piprofilerui_icons_aif.mk	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,54 @@
+#
+# 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:   
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=$(EPOCROOT)epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\piprofilerui_aif.mif
+
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN :
+	@if exist $(ICONTARGETFILENAME) erase $(ICONTARGETFILENAME)
+	
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE : $(ICONTARGETFILENAME)
+
+$(ICONTARGETFILENAME) : ..\..\icons\qgn_menu_piprofilerui.svg
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 ..\..\icons\qgn_menu_piprofilerui.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui.hrh	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,117 @@
+/*
+* 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 PROFILERGUI_HRH
+#define PROFILERGUI_HRH
+
+enum TProfilerCmdSamplerIds
+    {
+    EProfilerGuiCmdSamplerEnable = 1,   // id cannot be 0
+    EProfilerGuiCmdSamplerDisable,
+    EProfilerGuiCmdSamplerSettings,
+    EProfilerGuiCmdSamplerInfo
+    };
+
+enum TSamplerSettingItemIds
+    {
+    EProfilerGuiGenericSamplerQuerySampleRate = 0,
+    EProfilerGuiGenericSamplerQueryItem1,
+    EProfilerGuiGenericSamplerQueryItem2,
+    EProfilerGuiGenericSamplerQueryItem3,
+    EProfilerGuiGenericSamplerQueryItem4,
+    EProfilerGuiGenericSamplerQueryItem5,
+    EProfilerGuiGenericSamplerQueryItem6
+    };
+
+enum TGeneralSettingItemIds
+    {
+    ESettingListItemPluginTraceOutput = 0,
+    ESettingListItemPluginSaveFileDrive,
+    ESettingListItemPluginTraceFilePrefix,
+    ESettingListItemPluginSamplingTime
+    };
+
+enum TProfilerGuiCommandIds
+    {
+    EProfilerGuiCmdStart = 1000,
+    EProfilerGuiCmdStop,
+    EProfilerGuiCmdStartAll,
+    EProfilerGuiCmdStartTimed,
+    EProfilerGuiCmdStopAll,
+    
+    EProfilerGuiCmdSamplerControl,
+    EProfilerGuiCmdSamplerSettingsChange,
+    EProfilerGuiCmdSamplerSettingsExit,
+    
+    EProfilerGuiCmdSettings,
+    EProfilerGuiCmdSettingsChange,
+    EProfilerGuiCmdSettingsExit,
+    EProfilerGuiCmdSettingsBack,
+
+    EProfilerGuiCmdAbout,
+
+    EProfilerGuiViewConfQuery,
+    EProfilerGuiSettingItemList,
+    EProfilerSamplerSettingItemList
+    };
+
+enum TProfilerGuiSettingSamplerNameLength
+	{
+	ESamplerNameShort,
+	ESamplerNameMedium,
+	ESamplerNameLong
+	};
+
+enum TProfilerGuiSettingTraceMode
+	{
+	ETraceModeStream,
+	ETraceModeBuffer
+	};
+
+enum TProfilerGuiSettingOutputMode
+	{
+	EOutputToDebugPort = 0,
+	EOutputToFileSystem
+	};
+
+enum TProfilerGuiSettingSaveFileDrive
+	{
+	ETraceSaveFileDriveC,
+	ETraceSaveFileDriveD,
+	ETraceSaveFileDriveE,
+	ETraceSaveFileDriveF,
+	ETraceSaveFileDriveG,
+	ETraceSaveFileDriveH,
+	ETraceSaveFileDriveI,
+	ETraceSaveFileDriveJ,
+	ETraceSaveFileDriveK,
+	ETraceSaveFileDriveL
+	};
+
+enum TItemActionMenuTypes
+    {
+    EItemActionMenuTypeEnable = 0,
+    EItemActionMenuTypeDisable,
+    EItemActionMenuTypeEditSettings,    
+    EItemActionMenuTypeInfo,    
+    EItemActionMenuTypeStart,	// for future use
+    EItemActionMenuTypeStop	    // for future use
+    };
+
+#endif      // PROFILERGUI_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui_app.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* 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 PROFILER_GUI_APP_H
+#define PROFILER_GUI_APP_H
+
+
+// INCLUDES
+#include <aknapp.h>
+
+// CONSTANTS
+// UID of the application
+const TUid KUidProfilerGui = { 0x2001E5AE };
+
+// CLASS DECLARATION
+
+/**
+* CProfilerGuiApp application class.
+* Provides factory to create concrete document object.
+* 
+*/
+class CProfilerGuiApp : public CAknApplication
+    {
+    
+    public: // Functions from base classes
+
+    private:
+
+        /**
+        * From CApaApplication, creates CProfilerGuiDocument document object.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID (KUidProfilerGui).
+        * @return The value of KUidProfilerGui.
+        */
+        TUid AppDllUid() const;
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui_appui.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* 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 PROFILER_GUI_APPUI_H
+#define PROFILER_GUI_APPUI_H
+
+// INCLUDES
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <e32std.h>
+#include <coeccntx.h>
+#include <aknViewAppUi.h>
+#include <akntabgrp.h>
+#include <aknnavide.h>
+#include "profiler_gui_std.h"
+
+// profiler engine inclusions
+#include <piprofiler/ProfilerConfig.h>
+
+// FORWARD DECLARATIONS
+class CProfilerGuiModel;
+
+// CLASS DECLARATIONS
+
+class CProfilerGuiAppUi : public CAknViewAppUi
+    {
+public: // constructors and destructor
+    void ConstructL();
+    ~CProfilerGuiAppUi();
+    
+    // profiler specific 
+	void StartProfilerL();
+	void StopProfilerL();
+private: // From MEikMenuObserver
+    void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+
+private:
+    void HandleCommandL(TInt aCommand);
+    virtual TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+    void HandleSystemEventL(const TWsEvent& aEvent);
+    
+    void SaveSettingsL();
+	void LoadSettingsL();
+	TInt RunConfQueryL( const TDesC* aOverrideText ); 
+private: //Data
+    CProfilerGuiModel*              iModel;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui_attributes.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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 PROFILER_GUI_ATTRIBUTES_H
+#define PROFILER_GUI_ATTRIBUTES_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATIONS
+       
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui_document.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* 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 PROFILER_GUI_DOCUMENT_H
+#define PROFILER_GUI_DOCUMENT_H
+
+// INCLUDES
+#include <AknDoc.h>
+   
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CEikAppUi;
+class CProfilerGuiModel;
+
+
+// CLASS DECLARATION
+
+/**
+*  CProfilerGuiDocument application class.
+*/
+class CProfilerGuiDocument : public CAknDocument
+    {
+    public: // Constructors and destructor
+        static CProfilerGuiDocument* NewL(CEikApplication& aApp);
+        virtual ~CProfilerGuiDocument();
+
+    public: // New functions
+
+    public:	// from CEikDocument
+
+    protected:  // New functions
+
+    protected:  // Functions from base classes
+
+    private:
+
+        /**
+        * EPOC default constructor.
+        */
+        CProfilerGuiDocument(CEikApplication& aApp);
+        void ConstructL();
+
+    private:
+
+        /**
+        * From CEikDocument, create CProfilerGuiAppUi "App UI" object.
+        */
+        CEikAppUi* CreateAppUiL();
+
+    public:
+        inline CProfilerGuiModel* Model() { return iModel; }
+
+    private:
+        CProfilerGuiModel* iModel;
+
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui_maincontainer.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* 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 PROFILER_GUI_VALUESCONTAINER_H
+#define PROFILER_GUI_VALUESCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h> 
+#include <aknlists.h> 
+#include <AknInfoPopupNoteController.h> 
+
+// FORWARD DECLARATIONS
+class CProfilerGuiModel;
+class CAknInfoPopupNoteController;
+
+// CLASS DECLARATIONS
+
+class CProfilerGuiMainContainer : public CCoeControl, MCoeControlObserver, MEikListBoxObserver
+    {
+public:
+    void ConstructL(const TRect& aRect);
+    ~CProfilerGuiMainContainer();
+
+private:
+    void SizeChanged();  
+    TInt CountComponentControls() const;
+    CCoeControl* ComponentControl(TInt aIndex) const;
+    void Draw(const TRect& aRect) const;
+    void HandleResourceChange(TInt aType);
+    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);  // From MEikListBoxObserver
+    void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);  // From MCoeControlObserver
+	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+
+public:
+    const CArrayFix<TInt>* ListBoxSelectionIndexes();
+    TInt ListBoxSelectionIndexesCount();
+    void SetDefaultTitlePaneTextL();
+    TInt CurrentListBoxItemIndex();
+    void SetListBoxTextArrayL(CDesCArray* aTextArray);
+    inline CAknSingleGraphicStyleListBox* ListBox() { return iListBox; }
+    void ShowWriterInfoPopupL(const TDesC& aNote);
+private:
+    CProfilerGuiModel*                              iModel;
+    CAknSingleGraphicStyleListBox*      			iListBox;
+    CAknInfoPopupNoteController*        			iInfoPopup;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui_mainview.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* 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 PROFILER_GUI_VALUESVIEW_H
+#define PROFILER_GUI_VALUESVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+
+#include "profiler_gui_std.h"
+#include "profiler_gui_model.h"
+
+
+// CONSTANTS
+// UID of view
+const TUid KMainViewUID = {1};
+
+// FORWARD DECLARATIONS
+class CProfilerGuiMainContainer;
+class CProfilerGuiModel;
+class CProfilerEngineStatusChecker;
+class CAknNavigationDecorator;
+
+
+/**
+*  CProfilerGuiMainView view class.
+* 
+*/
+class CProfilerGuiMainView : public CAknView
+    {
+    public: // Constructors and destructor
+        void ConstructL();
+        ~CProfilerGuiMainView();
+
+    public: // Functions from base classes
+        TUid Id() const;
+        void HandleCommandL(TInt aCommand);
+        void HandleClientRectChange();
+        
+        /**
+         * Method for updating the Profiler engine status pane
+         * Called by Model class
+         * 
+         * @param aStatus new status of profiler engine  
+         */
+        void UpdateStatusPaneL( TInt aStatus ); 
+        
+    private: // From MEikMenuObserver
+        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
+        
+    private: // From AknView
+        void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage);
+        void DoDeactivate();
+        void HandleStatusPaneSizeChange();
+        void SetupStatusPaneL();
+        void CleanupStatusPaneL();
+		HBufC* GetLabelTextLC(TInt aStatus);
+    private: // Data
+    	CAknNavigationDecorator*			iNaviDecorator;
+        CProfilerGuiMainContainer*        	iContainer;
+        CProfilerGuiModel*                  iModel;
+
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui_model.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,161 @@
+/*
+* 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 PROFILER_GUI_MODEL_H
+#define PROFILER_GUI_MODEL_H
+
+// SYSTEM INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <apgcli.h>
+#include <gdi.h>
+#include <utf.h>
+#include <e32property.h>    // RProperty
+
+// LOCAL INCLUDES
+#include "profiler_gui_mainview.h"
+#include "profiler_gui.hrh"
+
+// COMMON INCLUDES
+#include <piprofiler/ProfilerConfig.h>
+#include <piprofiler/ProfilerAttributes.h>
+#include <piprofiler/ProfilerEngineStatusChecker.h>
+
+// setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
+const TUid KPSettingPluginNameMode                         = { 0x00 };
+const TUid KPSettingPluginSaveFileDrive                    = { 0x01 };
+const TUid KPSettingPluginTraceOutput                      = { 0x02 };
+const TUid KPSettingPluginSaveFilePrefix                   = { 0x03 };
+const TUid KPSettingPluginTraceMode                        = { 0x04 };
+
+
+// FORWARD DECLARATIONS
+class CProfilerGuiMainView;
+class CProfilerGuiMainContainer;
+class CEikonEnv;
+class TSamplerAttributes;
+class CProfilerEngineStatusChecker;
+class MProfilerStatusObserver;
+
+
+typedef CArrayFixSeg<TSamplerAttributes> CSamplerItemList;
+
+
+
+class CProfilerGuiModel : public CActive, MProfilerStatusObserver
+	{
+private:
+    enum TContainerDrawState
+    	{
+    	EDrawStateInvalid = -1,
+    	EDrawStateMain
+    	};
+ public:
+	static CProfilerGuiModel* NewL();
+	~CProfilerGuiModel();
+	void ActivateModelL();
+	void DeActivateModelL();
+	void SetMainView(CProfilerGuiMainView* aMainView);
+	void UpdateState(TInt aState);
+	TBool GetSelectedItemHasSettings();
+    TBool GetSelectedItemEnabled();
+    TBool GetSelectedItemHidden();
+    TInt EditSelectedSamplerL(TInt index);
+    void SelectedSamplerInfoL(TInt index);
+    void TerminateProfilerL();
+    TBool CheckTraceLocationSanityL(TGeneralAttributes& aAttr, TBool aQuietCheck);
+ private:
+    void RunL();
+	void DoCancel();
+	void LoadPluginsL();	
+    TInt EditSamplerL(TSamplerAttributes& aItem);
+    void SamplerInfoL(TSamplerAttributes& aItem);
+private:
+	CProfilerGuiModel();
+	void ConstructL();
+    TInt LoadGeneralSettingsL();
+
+    void AppendToSamplerItemListL(TSamplerAttributes& aItem);
+    void DisableOrEnableFromSamplerItemListL(TInt aIndex);
+    void DeleteAllSamplerItems();
+    void RefreshViewL(TBool aClearSelection=ETrue);
+    void LaunchProfilerEngineL();
+    void UpdateUIRunningStateL();
+    TInt FindProcessL(RProcess& aProc);
+    
+public:
+    
+    enum TProfilingMode
+        {
+        EProfilingModeNormal = 0,
+        EProfilingModeTimed
+        };
+    
+ 	void StartAllSamplerItemsL(TProfilingMode aProfilingMode = EProfilingModeNormal);
+    void StopAllSamplerItemsL();
+    void DeleteAllSamplerItemsL();
+    void DisableAllSamplerItemsL();
+    void EnableAllSamplerItemsL();
+            
+    TInt SamplerItemCount() const;
+    void ShowItemActionMenuL();
+    void StopSelectedOrHighlightedItemsL();
+    void DisableOrEnableSelectedOrHighlightedItemsL();
+
+    CDesCArray* GenerateListBoxItemTextArrayL();
+	void StartNewSamplerL(TInt aCommand);
+    void AddNewSamplersL(CArrayFixFlat<TSamplerAttributes>& iSamplerAttributes);
+
+    void SaveGeneralSettingsL();
+    void SetMainContainer(CProfilerGuiMainContainer* aContainer);
+    TInt LaunchSettingsDialogL();
+    inline CEikonEnv* EikonEnv() { return iEnv; }
+    inline CProfilerGuiMainContainer* MainContainer() { return iMainContainer; }
+    inline TBool SamplerItemsExists() { return iSamplerItemList->Count() > 0; } 
+    inline TGeneralAttributes const& GeneralSettings() const { return iGeneralAttributes; }
+    
+    TPtrC GetWriterInfoNoteL(const TDesC& aNote);
+    void AttachClient();
+    void RemoveClient();
+
+public:
+    // from MProfilerStatusObserver
+    void NotifyContainerReadyL();
+    void HandleProfilerStatusChange( KProfilerStatus aStatus );
+    void HandleProfilerErrorL( TInt aError );
+        
+private:
+	static const TInt                   iSamplerNameMode = ESamplerNameLong;
+    CProfilerGuiMainContainer*          iMainContainer;
+    CEikonEnv*                          iEnv;
+    TInt                                iDrawState;
+    CSamplerItemList*                   iSamplerItemList;
+    TInt                                iReferenceNumber;
+    CArrayFixFlat<TSamplerAttributes>*	iSamplerAttributes;
+    TGeneralAttributes                  iGeneralAttributes;
+    TBool                               iProfilerStatus;   // Status of Engine before it was launched by this application
+    CProfilerGuiMainView*               iMainView;
+
+    // checkers
+    CProfilerEngineStatusChecker*       iStatusChecker;
+public:
+    TInt							     iState;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui_samplersettingsviewdlg.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,92 @@
+/*
+* 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 PROFILER_GUI_SAMPLERSETTINGSVIEWDLG_H
+#define PROFILER_GUI_SAMPLERSETTINGSVIEWDLG_H
+
+//  INCLUDES
+#include <AknDialog.h>
+#include <eiklbo.h>
+#include <AknTabObserver.h> 
+#include <akntabgrp.h>
+#include <aknsettingitemlist.h> 
+#include <akncheckboxsettingpage.h> 
+
+#include "profiler_gui_model.h"
+
+
+//  FORWARD DECLARATIONS
+class CAknSettingItemArray;
+class CAknSettingStyleListBox;
+class CAknNavigationControlContainer;
+class CAknNavigationDecorator;
+class CAknTabGroup; 
+class TProfilerSamplerSettings;
+
+// CONSTANTS
+const TUint KMaxItemCount = 7;
+const TInt KMaxSettingUITextLength = 64;
+
+//  CLASS DEFINITIONS
+
+class CProfilerSamplerSettingsViewDlg : public CAknDialog, public MEikListBoxObserver, public MAknTabObserver
+    {
+public:
+    static CProfilerSamplerSettingsViewDlg* NewL(TSamplerAttributes& aSettings);
+    virtual ~CProfilerSamplerSettingsViewDlg();
+
+public: // From MEikListBoxObserver
+    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+public: // From MAknTabObserver
+    void TabChangedL(TInt aIndex); 
+
+public: // From CAknDialog
+    void ProcessCommandL(TInt aCommandId);
+
+protected: // From CEikDialog
+    TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
+    void PreLayoutDynInitL();
+    TBool OkToExitL(TInt aButtonId);    
+
+private: // New methods
+    void ShowSettingPageL(TBool aCalledFromMenu);
+    void SetVisibilitiesOfSettingItemsL();
+    void UpdateListBoxL();
+    void AddSettingItemL(TInt aId, TInt aTitleResource, TInt aSettingPageResource, TInt aAssociatedResource, TInt aOrdinal);
+
+private: // Constructors
+    CProfilerSamplerSettingsViewDlg(TSamplerAttributes& aSettings);
+    void ConstructL();        
+    CAknSettingItem* GetSettingItemL(TSettingItem& aItem, TInt aIndex, TInt& aSettingPageResource);
+private: // Data
+    CAknSettingItemArray*               iSettingItemArray;
+    CAknSettingStyleListBox*            iListBox;
+    CAknNavigationControlContainer*     iNaviContainer;
+    TSamplerAttributes&                 iSettings;
+    TInt 								iItemCount;
+    
+    // item bufs for textual settings data 
+    TInt                                iItemBuf[KMaxItemCount];
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui_settingsviewdlg.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* 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 PROFILER_GUI_SETTINGSVIEWDLG_H
+#define PROFILER_GUI_SETTINGSVIEWDLG_H
+
+//  INCLUDES
+#include <AknDialog.h>
+#include <eiklbo.h>
+#include <AknTabObserver.h> 
+#include <akntabgrp.h>
+#include <aknsettingitemlist.h> 
+#include <akncheckboxsettingpage.h> 
+
+#include "profiler_gui_model.h"
+
+
+//  FORWARD DECLARATIONS
+class CAknSettingItemArray;
+class CAknSettingStyleListBox;
+class CAknNavigationControlContainer;
+class CAknNavigationDecorator;
+class CAknTabGroup; 
+class TProfilerGuiSettings;
+
+
+//  CLASS DEFINITIONS
+
+class CProfilerGuiSettingsViewDlg : public CAknDialog, public MEikListBoxObserver, public MAknTabObserver
+    {
+public:
+    static CProfilerGuiSettingsViewDlg* NewL(TGeneralAttributes& aSettings);
+    virtual ~CProfilerGuiSettingsViewDlg();
+
+public: // From MEikListBoxObserver
+    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+public: // From MAknTabObserver
+    void TabChangedL(TInt aIndex); 
+
+public: // From CAknDialog
+    void ProcessCommandL(TInt aCommandId);
+
+protected: // From CEikDialog
+    TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
+    void PreLayoutDynInitL();
+    TBool OkToExitL(TInt aButtonId);    
+
+private: // New methods
+    void ShowSettingPageL(TBool aCalledFromMenu);
+    void SetVisibilitiesOfSettingItemsL();
+    void UpdateListBoxL();
+    void AddSettingItemL(TInt aId, TInt aTitleResource, TInt aSettingPageResource, TInt aAssociatedResource, TInt aOrdinal);
+
+private: // Constructors
+    CProfilerGuiSettingsViewDlg(TGeneralAttributes& aSettings);
+    void ConstructL();        
+
+private: // Data
+    CAknSettingItemArray*               iSettingItemArray;
+    CAknSettingStyleListBox*            iListBox;
+    CAknNavigationControlContainer*     iNaviContainer;
+    TGeneralAttributes&                 iSettings;
+    
+    // temporary member variables
+    TInt                                iTraceOutput;
+    TBuf<64>                            iSaveDrive;
+    TBuf<64>                            iFilePrefix;
+    };
+
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/inc/profiler_gui_std.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* 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 PROFILER_GUI_STD_H
+#define PROFILER_GUI_STD_H
+
+
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/rom/piprofilerui_avkon.iby	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* 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 __PROFILERGUI_IBY__
+#define __PROFILERGUI_IBY__
+
+S60_APP_EXE(PIProfilerUI)
+S60_APP_AIF_ICONS(PIProfilerUI)
+S60_APP_RESOURCE(PIProfilerUI)
+SCALABLE_IMAGE(APP_BITMAP_DIR, APP_BITMAP_DIR, PIProfilerui_ExtraIcons)
+#ifdef S60_UPGRADABLE_APP_REG_RSC
+  S60_UPGRADABLE_APP_REG_RSC(PIProfilerUI)
+#else
+  S60_APP_AIF_RSC(PIProfilerUI)
+#endif
+
+data=ZPRIVATE\2001E5AE\backup_registration.xml        	private\2001E5AE\backup_registration.xml
+data=ZSYSTEM\Install\PIProfilerUI_stub.sis              system\install\PIProfilerUI_stub.sis
+
+#endif // __PROFILERGUI_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/src/profiler_gui_app.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* 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:   
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "profiler_gui_app.h"
+#include "profiler_gui_document.h"
+#include <piprofiler/ProfilerTraces.h>
+
+#include <eikstart.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CProfilerGuiApp::AppDllUid()
+// Returns application UID
+// ---------------------------------------------------------
+//
+TUid CProfilerGuiApp::AppDllUid() const
+    {
+    return KUidProfilerGui;
+    }
+   
+// ---------------------------------------------------------
+// CProfilerGuiApp::CreateDocumentL()
+// Creates CProfilerGuiDocument object
+// ---------------------------------------------------------
+//
+CApaDocument* CProfilerGuiApp::CreateDocumentL()
+    {
+    return CProfilerGuiDocument::NewL( *this );
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CProfilerGuiApp;
+    }
+
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+
+// End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/src/profiler_gui_appui.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,260 @@
+/*
+* 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:   
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "profiler_gui_appui.h"
+#include "profiler_gui_mainview.h"
+#include "profiler_gui.hrh"
+#include "profiler_gui_model.h"
+#include "profiler_gui_document.h"
+#include <piprofilerui.rsg>
+#include <piprofiler/ProfilerTraces.h>
+#include <piprofiler/ProfilerSession.h>
+#include <piprofiler/ProfilerConfig.h>
+
+#include <AknWaitDialog.h>
+#include <AknGlobalNote.h>
+#include <avkon.hrh>
+#include <AknQueryDialog.h>
+#include <aknmessagequerydialog.h> 
+#include <pathinfo.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+void CProfilerGuiAppUi::ConstructL()
+    {
+    // set as system application to prevent getting shut down events 
+    iEikonEnv->SetSystem(ETrue);
+    
+    BaseConstructL(EAknEnableSkin);
+    
+    // get model
+    iModel = static_cast<CProfilerGuiDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+	
+	LOGTEXT(_L("ProfilerGuiAppUi::ConstructL - setting main view settings"));
+    
+    CProfilerGuiMainView* mainView = new(ELeave) CProfilerGuiMainView;
+    CleanupStack::PushL(mainView);
+    mainView->ConstructL();
+    AddViewL(mainView);           // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();          // mainView
+
+	LOGTEXT(_L("ProfilerGuiAppUi::ConstructL - setting default view"));
+
+    SetDefaultViewL(*mainView);
+
+    LOGTEXT(_L("ProfilerGuiAppUi::ConstructL - activating model"));
+
+    // notify the model that everything has been constructed
+    iModel->ActivateModelL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CProfilerGuiAppUi::~CProfilerGuiAppUi()
+    {
+    // notify the model that the application is closing 
+    if (iModel)   
+        TRAP_IGNORE(iModel->DeActivateModelL());
+
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    if( aResourceId == R_PROFILER_START_SUBMENU )
+        {
+        CEikMenuPaneItem::SData itemData;
+        _LIT(KMenuText, "Profiling for %d sec.");
+        itemData.iText.Format(KMenuText, iModel->GeneralSettings().iTimedSamplingPeriod);// = _L("Profiling for %d sec.");  // Label text for the menu item
+        itemData.iCommandId = EProfilerGuiCmdStartTimed;    // Command ID for the menu item
+        itemData.iFlags = 0;
+        itemData.iCascadeId = 0;
+        aMenuPane->AddMenuItemL( itemData );
+        }
+    if (aResourceId == R_PROFILER_GUI_APP_MENU)
+        {
+        if(iModel->iState == MProfilerStatusObserver::ERunning)
+        	{
+			aMenuPane->SetItemDimmed(EProfilerGuiCmdStartAll, ETrue);
+			aMenuPane->SetItemDimmed(EProfilerGuiCmdStopAll, EFalse);
+			aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerControl, ETrue);
+            aMenuPane->SetItemDimmed(EProfilerGuiCmdSettings, ETrue);
+        	}
+        else if(iModel->iState == MProfilerStatusObserver::EIdle)
+        	{
+			aMenuPane->SetItemDimmed(EProfilerGuiCmdStartAll, EFalse);
+			aMenuPane->SetItemDimmed(EProfilerGuiCmdStopAll, ETrue);
+            aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerControl, EFalse);
+            aMenuPane->SetItemDimmed(EProfilerGuiCmdSettings, EFalse);
+        	}
+        else
+        	{
+        	// if initializing or stopping no start/stop actions allowed 
+			aMenuPane->SetItemDimmed(EProfilerGuiCmdStartAll, ETrue);
+			aMenuPane->SetItemDimmed(EProfilerGuiCmdStopAll, ETrue);
+            aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerControl, ETrue);
+            aMenuPane->SetItemDimmed(EProfilerGuiCmdSettings, ETrue);
+        	}
+        }
+    
+    if(aResourceId == R_PROFILER_SAMPLER_CONTROL_MENU)
+        {
+        // check if item hidden, i.e. sampler cannot be started/stopped
+        if(!iModel->GetSelectedItemHidden())
+            {
+            // item enabled => dimm the "enable" item, and other way round
+            if(iModel->GetSelectedItemEnabled())
+                {
+                aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerEnable, ETrue);
+                aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerDisable, EFalse);
+                }
+            // item enabled => dimm the "enable" item, and other way round
+            else
+                {
+                aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerEnable, EFalse);
+                aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerDisable, ETrue);
+                }
+
+            }
+        // item hidden => dimm both enable and disable items
+        else
+            {
+            aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerEnable, ETrue);
+            aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerDisable, ETrue);
+            }
+        
+        // if sampler item has specific settings to control 
+        if(iModel->GetSelectedItemHasSettings())
+            {
+            aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerSettings, EFalse);
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed(EProfilerGuiCmdSamplerSettings, ETrue);
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CProfilerGuiAppUi::HandleKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
+    {
+    return EKeyWasNotConsumed;
+    }
+
+void CProfilerGuiAppUi::HandleSystemEventL(const TWsEvent& aEvent)
+    {
+    switch (*(TApaSystemEvent*)(aEvent.EventData()))
+        {
+        case EApaSystemEventShutdown:
+            // check if still profiling
+            if( iModel->iState != MProfilerStatusObserver::EIdle )
+                {
+                // stop profiling process
+                iModel->StopAllSamplerItemsL();
+                }
+
+            // terminate profiler engine
+            iModel->TerminateProfilerL();
+            break;
+        default:
+            break;
+        }
+    // call base class implementation
+    CAknAppUi::HandleSystemEventL(aEvent);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiAppUi::HandleCommandL(TInt aCommand)
+    {
+    switch ( aCommand )
+        {
+        case EProfilerGuiCmdSettings:
+            {
+            // check if exit command received
+            if (iModel->LaunchSettingsDialogL() == EAknCmdExit)
+                {
+                // terminate profiler engine...
+                iModel->TerminateProfilerL();
+                
+                // ... and exit
+                Exit();
+                }
+            break;
+            }
+        case EProfilerGuiCmdAbout:
+            {
+	        CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
+            dialog->ExecuteLD(R_PROFILER_GUI_ABOUT_DIALOG);
+            }
+            break;
+            
+        // a normal way to close an application
+        case EAknCmdExit:
+        case EEikCmdExit:
+        case EAknSoftkeyExit: 
+			{
+			// decrease the client reference count in the server:
+			iModel->RemoveClient();
+            // check if still profiling
+            if( iModel->iState != MProfilerStatusObserver::EIdle && 
+                    iModel->iState != MProfilerStatusObserver::EStopping )
+                {
+                // ask user if he wants to leave profiling running in background process 
+                if( this->RunConfQueryL( NULL ) == 0 )
+                    {
+                    // stop profiling process
+                    iModel->StopAllSamplerItemsL();
+
+                    // terminate profiler engine
+                    iModel->TerminateProfilerL();
+                    }
+                }
+            else
+                {
+                // terminate profiler engine
+                iModel->TerminateProfilerL();
+                }
+            
+            Exit();
+ 			}
+            break;
+
+        default:
+            break;      
+        }
+    }
+
+TInt CProfilerGuiAppUi::RunConfQueryL( const TDesC* aOverrideText )
+	{
+	CAknQueryDialog* queryDialog = CAknQueryDialog::NewL();
+	
+	if(aOverrideText)
+		{
+		queryDialog->SetPromptL(*aOverrideText);
+		}
+	return queryDialog->ExecuteLD(R_PROFILER_GUI_CONF_QUERY);
+	}
+
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/src/profiler_gui_document.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* 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:   
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "profiler_gui_document.h"
+#include "profiler_gui_appui.h"
+#include "profiler_gui_model.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// constructor
+CProfilerGuiDocument::CProfilerGuiDocument(CEikApplication& aApp)
+: CAknDocument(aApp)    
+    {
+    }
+
+// ----------------------------------------------------
+
+// destructor
+CProfilerGuiDocument::~CProfilerGuiDocument()
+    {
+    delete iModel;
+    }
+
+// ----------------------------------------------------
+
+// EPOC default constructor can leave.
+void CProfilerGuiDocument::ConstructL()
+    {
+    iModel = CProfilerGuiModel::NewL();
+    }
+
+// ----------------------------------------------------
+
+// Two-phased constructor.
+CProfilerGuiDocument* CProfilerGuiDocument::NewL(CEikApplication& aApp)
+    {
+    CProfilerGuiDocument* self = new(ELeave) CProfilerGuiDocument(aApp);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+    
+// ----------------------------------------------------
+// CProfilerGuiDocument::CreateAppUiL()
+// constructs CProfilerGuiAppUi
+// ----------------------------------------------------
+//
+CEikAppUi* CProfilerGuiDocument::CreateAppUiL()
+    {
+    return new (ELeave) CProfilerGuiAppUi;
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/src/profiler_gui_maincontainer.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,332 @@
+/*
+* 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:   
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "profiler_gui_maincontainer.h"
+#include "profiler_gui.hrh"
+#include "profiler_gui_document.h"
+#include "profiler_gui_appui.h"
+#include "profiler_gui_model.h"
+#include <piprofilerui_extraicons.mbg>
+
+#include <aknlists.h>
+#include <eikclb.h>
+#include <eikclbd.h>
+#include <aknconsts.h>
+#include <AknUtils.h>
+#include <aknnotewrappers.h>
+#include <AknIconArray.h> 
+#include <f32file.h>
+#include <AknIconUtils.h>
+#include <AknDef.h>
+#include <akntitle.h>
+#include <eikspane.h> 
+
+_LIT(KExtraIconsPath, "\\resource\\apps\\piprofilerui_extraicons.mif");
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+void CProfilerGuiMainContainer::ConstructL(const TRect& aRect)
+    {
+    iModel = static_cast<CProfilerGuiDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+    iModel->SetMainContainer(this);
+
+    CreateWindowL();
+    SetRect(aRect);
+    SetBlank();
+    
+    // init listbox
+    iListBox = new(ELeave) CAknSingleGraphicStyleListBox;
+    iListBox->SetContainerWindowL(*this);
+    iListBox->ConstructL(this, EAknListBoxMarkableList);
+    iListBox->View()->SetListEmptyTextL(_L("No plugins found yet"));
+
+    // if description length longer than screen width, scroll the text
+    iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
+    
+    // create icon array and add marking indicator to it
+    CAknIconArray* iconArray = new(ELeave) CAknIconArray(1);
+    CleanupStack::PushL(iconArray);
+    CFbsBitmap* markBitmap = NULL;
+    CFbsBitmap* markBitmapMask = NULL;
+    
+    TRgb defaultColor;
+    defaultColor = iEikonEnv->Color(EColorControlText);
+
+    AknsUtils::CreateColorIconL(AknsUtils::SkinInstance(),
+            KAknsIIDQgnIndiMarkedAdd,
+            KAknsIIDQsnIconColors,
+            EAknsCIQsnIconColorsCG13,
+            markBitmap,
+            markBitmapMask,
+            AknIconUtils::AvkonIconFileName(),
+            EMbmAvkonQgn_indi_marked_add,
+            EMbmAvkonQgn_indi_marked_add_mask,
+            defaultColor
+            );
+     
+    CGulIcon* markIcon = CGulIcon::NewL(markBitmap, markBitmapMask);
+    iconArray->AppendL(markIcon);                       
+    
+    // append icons from profiler_gui_extraicons.mif
+    TFileName extraIconsPath;
+    extraIconsPath.Copy(KExtraIconsPath);
+    TParsePtrC parse((CEikonEnv::Static()->EikAppUi()->Application())->AppFullName()); // get path where this app is installed
+    extraIconsPath.Insert(0, parse.Drive()); // drive letter
+    
+    CFbsBitmap* redBitmap = NULL;
+    CFbsBitmap* redBitmapMask = NULL;
+    CFbsBitmap* greenBitmap = NULL;
+    CFbsBitmap* greenBitmapMask = NULL;
+    
+    AknIconUtils::CreateIconL(redBitmap, redBitmapMask, extraIconsPath, EMbmPiprofilerui_extraiconsQgn_prob_piprofilerui_status_disabled, EMbmPiprofilerui_extraiconsQgn_prob_piprofilerui_status_disabled_mask);
+    AknIconUtils::CreateIconL(greenBitmap, greenBitmapMask, extraIconsPath, EMbmPiprofilerui_extraiconsQgn_prob_piprofilerui_status_enabled, EMbmPiprofilerui_extraiconsQgn_prob_piprofilerui_status_enabled_mask);
+
+    CGulIcon* redIcon = CGulIcon::NewL(redBitmap, redBitmapMask);
+    iconArray->AppendL(redIcon);  
+    
+    CGulIcon* greenIcon = CGulIcon::NewL(greenBitmap, greenBitmapMask);
+    iconArray->AppendL(greenIcon);  
+
+    // set icon array
+    CleanupStack::Pop(); // iconArray
+    iListBox->ItemDrawer()->ColumnData()->SetIconArray(iconArray);
+
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+    iListBox->SetListBoxObserver(this);
+    
+    // set size of the listbox
+    TSize outputRectSize;
+    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
+    TRect outputRect(outputRectSize);
+    iListBox->SetRect(outputRect);
+
+    iListBox->ActivateL();    
+    
+    ActivateL();
+    
+    iInfoPopup = CAknInfoPopupNoteController::NewL();
+    iInfoPopup->SetTimePopupInView(5000);
+    iInfoPopup->SetTimeDelayBeforeShow(500);
+    iInfoPopup->SetTextL(_L("TIP: Check also sampler specific settings!")); 
+    iInfoPopup->ShowInfoPopupNote();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CProfilerGuiMainContainer::~CProfilerGuiMainContainer()
+    {
+    delete iInfoPopup;
+    
+    if (iListBox)
+        delete iListBox;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiMainContainer::SizeChanged()
+{
+    TSize outputRectSize;
+    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
+    TRect outputRect(outputRectSize);
+    
+    if (iListBox)
+        iListBox->SetRect(outputRect);
+}
+
+// --------------------------------------------------------------------------------------------
+
+TInt CProfilerGuiMainContainer::CountComponentControls() const
+    {
+    if (iListBox)
+        return 1;
+    else
+        return 0;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CCoeControl* CProfilerGuiMainContainer::ComponentControl(TInt /*aIndex*/) const
+    {
+    if (iListBox)
+        return iListBox;
+    else
+        return NULL;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CProfilerGuiMainContainer::CurrentListBoxItemIndex()
+    {
+    if (iListBox)
+        {
+        return iListBox->CurrentItemIndex();
+        }
+    else
+        return KErrNotFound;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiMainContainer::SetListBoxTextArrayL(CDesCArray* aTextArray)
+    {
+    if (iListBox)
+        {    
+        iListBox->Model()->SetItemTextArray(aTextArray);
+        iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
+        iListBox->HandleItemAdditionL();
+        iListBox->UpdateScrollBarsL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+const CArrayFix<TInt>* CProfilerGuiMainContainer::ListBoxSelectionIndexes()
+    {
+    if (iListBox)
+        {
+        const CListBoxView::CSelectionIndexArray* indices = iListBox->SelectionIndexes();
+        return static_cast<const CArrayFix<TInt>*>(indices);
+        }
+    else
+        return NULL;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CProfilerGuiMainContainer::ListBoxSelectionIndexesCount()
+    {
+    if (iListBox)
+        {
+        return iListBox->SelectionIndexes()->Count();
+        }
+    else
+        return KErrNotFound;
+    }
+                        
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiMainContainer::Draw(const TRect& aRect) const
+    {
+    CWindowGc& gc = SystemGc();
+    gc.Clear(aRect);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiMainContainer::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiMainContainer::SetDefaultTitlePaneTextL()
+    {
+    _LIT(KTitleText, "PIProfiler");
+
+    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
+    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    tp->SetTextL( KTitleText );
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CProfilerGuiMainContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+    if(aType != EEventKey)
+        return EKeyWasNotConsumed;
+    
+    if (iListBox && iListBox->Model()->NumberOfItems() > 0)
+        {
+        // handle OK/Enter keys
+        if (aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter)
+            {
+            // check if profiler state is idle
+            if(iModel->iState == MProfilerStatusObserver::EIdle)
+                {
+                // show action menu only if state is idle
+                iModel->ShowItemActionMenuL();
+                }
+            }
+        else
+            {
+            return iListBox->OfferKeyEventL(aKeyEvent, aType);
+            }
+        }
+    
+    return EKeyWasNotConsumed;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiMainContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+    {
+    switch (aEventType)
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemDoubleClicked:
+            {
+            iModel->ShowItemActionMenuL();
+            }
+            break;
+        default:
+            break;
+        }
+    }
+            
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiMainContainer::HandleResourceChange(TInt aType)
+    {
+    if ( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+
+        TSize outputRectSize;
+        AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
+        TRect outputRect(outputRectSize);
+        iListBox->SetRect(outputRect);
+        }
+    else
+        {
+        CCoeControl::HandleResourceChange(aType);
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiMainContainer::ShowWriterInfoPopupL(const TDesC& aNote)
+	{
+	if(!iInfoPopup)
+	    {
+	    iInfoPopup = CAknInfoPopupNoteController::NewL();
+	    }
+    // Hide the note. The last note may be visible when creating the second
+	iInfoPopup->HideInfoPopupNote();
+    iInfoPopup->SetTimePopupInView(5000);
+    iInfoPopup->SetTimeDelayBeforeShow(500);
+    iInfoPopup->SetTextL(iModel->GetWriterInfoNoteL(aNote));
+    iInfoPopup->ShowInfoPopupNote();
+	}
+
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/src/profiler_gui_mainview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,334 @@
+/*
+* 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:   
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "profiler_gui.hrh"
+#include "profiler_gui_mainview.h"
+#include "profiler_gui_maincontainer.h"
+#include "profiler_gui_document.h" 
+#include "profiler_gui_model.h"
+#include <piprofilerui.rsg>
+
+#include <AknWaitDialog.h>
+#include <AknGlobalNote.h>
+#include <eikenv.h>
+#include <aknViewAppUi.h> 
+#include <akncontext.h>
+#include <StringLoader.h>
+#include <aknnavi.h>
+#include <akntitle.h>
+#include <barsread.h>
+#include <aknnavide.h>
+#include <aknmessagequerydialog.h> 
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CProfilerGuiMainView::ConstructL(const TRect& aRect)
+// EPOC two-phased constructor
+// ---------------------------------------------------------
+//
+void CProfilerGuiMainView::ConstructL()
+    {
+    BaseConstructL( R_PROFILER_GUI_VIEW_MAIN );
+    
+    iModel = static_cast<CProfilerGuiDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+    iNaviDecorator = NULL;
+    iModel->SetMainView(this);
+    }
+
+// ---------------------------------------------------------
+// CProfilerGuiMainView::~CProfilerGuiMainView()
+// ---------------------------------------------------------
+//
+CProfilerGuiMainView::~CProfilerGuiMainView()
+    {
+
+    if(iNaviDecorator)
+    	{
+    	delete iNaviDecorator;
+    	iNaviDecorator = NULL;
+    	}
+    
+    if (iContainer)
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    
+    }
+
+// ---------------------------------------------------------
+// TUid CProfilerGuiMainView::Id()
+// ---------------------------------------------------------
+//
+TUid CProfilerGuiMainView::Id() const
+    {
+    return KMainViewUID;
+    }
+
+// ---------------------------------------------------------
+// TUid CProfilerGuiMainView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+// ---------------------------------------------------------
+//
+void CProfilerGuiMainView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
+    }
+
+  
+// ---------------------------------------------------------
+// CProfilerGuiMainView::HandleCommandL(TInt aCommand)
+// ---------------------------------------------------------
+//
+void CProfilerGuiMainView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        // commands from sampler control sub menu 
+        case EProfilerGuiCmdSamplerEnable:
+            {
+            iModel->DisableOrEnableSelectedOrHighlightedItemsL();
+            break;
+            }
+        case EProfilerGuiCmdSamplerDisable:
+            {
+            iModel->DisableOrEnableSelectedOrHighlightedItemsL();
+            break;
+            }
+        case EProfilerGuiCmdSamplerSettings:
+            {
+            // check if sampler settings dialog returned exit command
+            iModel->EditSelectedSamplerL(iContainer->CurrentListBoxItemIndex());
+            break;
+            }
+        case EProfilerGuiCmdSamplerInfo:
+            {
+            iModel->SelectedSamplerInfoL(iContainer->CurrentListBoxItemIndex());
+            break;
+            }
+            
+        case EProfilerGuiCmdStartAll:
+        case EProfilerGuiCmdStartTimed:
+            {
+            // still using the old way of starting all the samplers simultaneously
+            if( iModel->iState != MProfilerStatusObserver::ERunning )
+            	{
+            	// set state as "initializing" for a moment before profiling has started, 
+            	// NOTE: engine changes to "Running" state
+            	iModel->iState = MProfilerStatusObserver::EInitializing;
+                // start the actual sampling process on Profiler Engine 
+            	if( aCommand == EProfilerGuiCmdStartTimed )
+            	    iModel->StartAllSamplerItemsL(CProfilerGuiModel::EProfilingModeTimed);
+            	else
+            	    iModel->StartAllSamplerItemsL();
+            	}
+
+			// prevent the control of sampler specific settings during the trace 
+            iContainer->SetDimmed(ETrue);
+            break;
+            }
+        case EProfilerGuiCmdStopAll:
+            {
+			// check if still profiling
+			if( iModel->iState != MProfilerStatusObserver::EIdle )
+				{
+				// set to stopping mode
+				iModel->iState = MProfilerStatusObserver::EStopping;
+                // stop actual sampling process on Profiler Engine
+				iModel->StopAllSamplerItemsL();
+				}
+            
+			// return the control to sampler specific settings when tracing stopped
+			iContainer->SetDimmed(EFalse);
+
+            break;
+            }
+            
+        default:
+            {
+            AppUi()->HandleCommandL(aCommand);
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CProfilerGuiMainView::HandleClientRectChange()
+// ---------------------------------------------------------
+//
+void CProfilerGuiMainView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------
+// CProfilerGuiMainView::DoActivateL(...)
+// ---------------------------------------------------------
+//
+void CProfilerGuiMainView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    // show wait dialog
+    CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
+    waitDialog->SetSoftkeys(R_AVKON_SOFTKEYS_EMPTY);
+    TInt dialogId = waitDialog->ShowNoteL(EAknGlobalWaitNote, _L("Initializing samplers"));
+
+    // setup the profiler engine status pane
+    SetupStatusPaneL();
+    
+    // check if container creation succesfull
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CProfilerGuiMainContainer;
+        iModel->SetMainContainer(iContainer);
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect() );
+        iModel->NotifyContainerReadyL();
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+    
+	// remove the wait dialog
+	waitDialog->CancelNoteL(dialogId);
+	CleanupStack::PopAndDestroy(); //waitDialog;
+   }
+
+// ---------------------------------------------------------
+// CProfilerGuiMainView::DoDeactivate()
+// ---------------------------------------------------------
+//
+void CProfilerGuiMainView::DoDeactivate()
+    {
+    TRAP_IGNORE(CleanupStatusPaneL());
+    
+    if (iContainer)
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+void CProfilerGuiMainView::HandleStatusPaneSizeChange()
+	{
+	CAknView::HandleStatusPaneSizeChange();
+	
+	TInt result;
+	TRAP(result, SetupStatusPaneL());
+	}
+
+
+void CProfilerGuiMainView::SetupStatusPaneL()
+	{
+	TUid naviPaneUid = TUid::Uid(EEikStatusPaneUidNavi);
+	CEikStatusPaneBase::TPaneCapabilities subPaneNavi = StatusPane()->PaneCapabilities(naviPaneUid);
+	if(subPaneNavi.IsPresent() && subPaneNavi.IsAppOwned())
+		{
+		CAknNavigationControlContainer* naviPane = static_cast<CAknNavigationControlContainer*> (StatusPane()->ControlL(naviPaneUid));
+		if(iNaviDecorator)
+			{
+			delete iNaviDecorator;
+			iNaviDecorator = NULL;
+			}
+		
+		// get the initial status label
+		HBufC* labelText = GetLabelTextLC(iModel->iState);
+		iNaviDecorator = naviPane->CreateNavigationLabelL(*labelText);
+		CleanupStack::PopAndDestroy(labelText);
+		
+		naviPane->PushL(*iNaviDecorator);
+		}
+	}
+
+void CProfilerGuiMainView::CleanupStatusPaneL()
+	{
+	// destructor for navi pane, called by destructor
+	TUid naviPaneUid = TUid::Uid(EEikStatusPaneUidNavi);
+	CEikStatusPaneBase::TPaneCapabilities subPaneNavi = StatusPane()->PaneCapabilities(naviPaneUid);
+	if(subPaneNavi.IsPresent() && subPaneNavi.IsAppOwned())
+		{
+		CAknNavigationControlContainer* naviPane = static_cast<CAknNavigationControlContainer*> (StatusPane()->ControlL(naviPaneUid));
+		if(iNaviDecorator)
+			{
+			naviPane->Pop(iNaviDecorator);
+			delete iNaviDecorator;
+			iNaviDecorator = NULL;
+			}
+		}
+	}
+
+HBufC* CProfilerGuiMainView::GetLabelTextLC(TInt aStatus)
+	{
+	// get the predefined status text
+	HBufC* labelText = NULL;
+	switch(aStatus)
+		{
+		case MProfilerStatusObserver::EIdle:
+			labelText = StringLoader::LoadLC(R_PROFILER_GUI_NAVI_TEXT_IDLE);
+			break;
+		case MProfilerStatusObserver::EInitializing:
+			labelText = StringLoader::LoadLC(R_PROFILER_GUI_NAVI_TEXT_INITIALIZING);
+			break;
+		case MProfilerStatusObserver::ERunning:
+			labelText = StringLoader::LoadLC(R_PROFILER_GUI_NAVI_TEXT_RUNNING);
+			break;
+		case MProfilerStatusObserver::EStopping:
+			labelText = StringLoader::LoadLC(R_PROFILER_GUI_NAVI_TEXT_STOPPING);
+			break;
+	     case MProfilerStatusObserver::ERestarting:
+            labelText = StringLoader::LoadLC(R_PROFILER_GUI_NAVI_TEXT_RUNNING);
+            break;
+	     default:
+	        labelText = StringLoader::LoadLC(R_PROFILER_GUI_NAVI_TEXT_IDLE); 
+	        break;
+		}
+	return labelText;
+	}
+
+void CProfilerGuiMainView::UpdateStatusPaneL( TInt aStatus )
+	{
+	TUid naviPaneUid = TUid::Uid(EEikStatusPaneUidNavi);
+	CEikStatusPaneBase::TPaneCapabilities subPaneNavi = StatusPane()->PaneCapabilities(naviPaneUid);
+	// check if navi pane is correctly initialized
+	if(subPaneNavi.IsPresent() && subPaneNavi.IsAppOwned())
+		{
+		CAknNavigationControlContainer* naviPane = static_cast<CAknNavigationControlContainer*> (StatusPane()->ControlL(naviPaneUid));
+		if(iNaviDecorator)
+			{
+			delete iNaviDecorator;
+			iNaviDecorator = NULL;
+			}
+		HBufC* labelText;
+
+		// get the right status label text 
+		labelText = GetLabelTextLC(aStatus);
+		iNaviDecorator = naviPane->CreateNavigationLabelL(*labelText);
+		CleanupStack::PopAndDestroy(labelText);
+		
+		naviPane->PushL(*iNaviDecorator);
+		}
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/src/profiler_gui_model.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,1176 @@
+/*
+* 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:   
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "profiler_gui_samplersettingsviewdlg.h"
+#include "profiler_gui_model.h"
+#include "profiler_gui_app.h"
+#include "profiler_gui_settingsviewdlg.h"
+#include "profiler_gui_maincontainer.h"
+#include "profiler_gui.hrh"
+#include <piprofilerui.rsg>
+
+#include <coeutils.h>
+#include <bautils.h>
+#include <eikenv.h>
+#include <AknQueryDialog.h>
+#include <AknGlobalNote.h>
+#include <aknmessagequerydialog.h> 
+#include <e32math.h> 
+#include <akntitle.h> 
+#include <s32file.h>
+#include <aknnotewrappers.h>
+#include <sysutil.h>
+
+// UIDs
+#include <piprofiler/EngineUIDs.h>
+
+#include <piprofiler/ProfilerTraces.h>
+#include <piprofiler/ProfilerSession.h>
+
+// LITERALS
+_LIT(KAppName, "PI Profiler");
+_LIT(KWarningNote, "NOTE: output changed!\n");
+_LIT(KProfilerEngineExe, "PIProfilerEngine.exe");
+
+// literals for default general setting values
+_LIT8(KTraceOutput, "file_system");
+_LIT8(KTraceDebugOutput, "debug_output");
+_LIT8(KProfilerDefaultDrive, "E:\\data");
+_LIT8(KProfilerDefaultPrefix, "Profiler_#");
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CProfilerGuiModel* CProfilerGuiModel::NewL() 
+	{
+	CProfilerGuiModel* self = new(ELeave) CProfilerGuiModel;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+// --------------------------------------------------------------------------------------------
+
+CProfilerGuiModel::CProfilerGuiModel() : CActive(EPriorityStandard)
+	{
+	}
+	
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::ConstructL()
+	{
+	// initialize basic settings
+	iDrawState = EDrawStateInvalid;
+	iReferenceNumber = 0;
+	iState = MProfilerStatusObserver::EIdle;
+	
+    iEnv = CEikonEnv::Static();
+
+    // profiler engine specific initialization
+    LaunchProfilerEngineL();
+    
+    // max sampler item list length is 64, i.e. max 64 sampler plugins loaded 
+    iSamplerItemList = new(ELeave) CSamplerItemList(64);
+
+    // initialize attribute arrays
+    iSamplerAttributes = new(ELeave) CArrayFixFlat<TSamplerAttributes>(20); // max sampler count is 20
+    
+    // engine status checker
+    iStatusChecker = CProfilerEngineStatusChecker::NewL();
+    iStatusChecker->SetObserver(this);
+ 	
+	CActiveScheduler::Add(this);
+	}
+
+void CProfilerGuiModel::UpdateUIRunningStateL()
+    {
+    // prevent the control of sampler specific settings during the trace 
+    iMainContainer->SetDimmed(ETrue);
+    
+    // update status pane
+    iMainView->UpdateStatusPaneL(iState);
+
+    // show an info popup showing the logging method
+    iMainContainer->ShowWriterInfoPopupL(KNullDesC);
+    
+    // refresh view
+    RefreshViewL();
+    }
+
+// --------------------------------------------------------------------------------------------
+void CProfilerGuiModel::NotifyContainerReadyL()
+	{
+	// load initial plugins
+    LoadPluginsL();
+    
+    // get the initial state
+    if( iStatusChecker->GetInitialState() == MProfilerStatusObserver::ERunning )
+        {
+        // set model state to restarting and grabbing an existing profiler process
+        iState = MProfilerStatusObserver::ERestarting;
+        
+        // update status pane to correspond the running mode
+        UpdateUIRunningStateL();
+
+        // set model state to running
+        iState = MProfilerStatusObserver::ERunning;
+
+        }
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::ActivateModelL()
+	{
+	// load general settings
+	if( LoadGeneralSettingsL() != KErrNone )
+	    {
+	    LOGTEXT(_L("ProfilerGuiAppUi::ActivateModelL - could not connect profiler engine"));
+	    }
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::DeActivateModelL()
+	{
+	Cancel();
+	
+	// for a faster exit, send the application to background
+    TApaTask selfTask(iEnv->WsSession());
+    selfTask.SetWgId(iEnv->RootWin().Identifier());
+    selfTask.SendToBackground();
+	}
+	
+// --------------------------------------------------------------------------------------------
+
+CProfilerGuiModel::~CProfilerGuiModel()
+	{
+    if (iSamplerItemList)
+        {
+        DeleteAllSamplerItems();
+        delete iSamplerItemList;
+        iSamplerItemList = NULL;
+        }
+    
+    if(iStatusChecker)
+        {
+        iStatusChecker->Cancel();
+        delete iStatusChecker;
+        iStatusChecker = NULL;
+        }
+    
+  
+    if(iSamplerAttributes)
+        {
+        iSamplerAttributes->Reset();
+        delete iSamplerAttributes;
+        iSamplerAttributes = NULL;
+        }
+     
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::DoCancel()
+	{
+    
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::RunL()
+	{
+
+	}
+	
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::SetMainContainer(CProfilerGuiMainContainer* aContainer)
+    {
+    iMainContainer = aContainer;
+    iDrawState = EDrawStateMain;
+    }
+
+void CProfilerGuiModel::UpdateState(TInt aState)
+	{
+	iState = aState;
+	}
+
+TInt CProfilerGuiModel::FindProcessL(RProcess& aProc)
+    {
+    TProcessId engId;
+    TFindProcess procName;
+    procName.Find(_L("PIProfilerEngine.exe*"));
+    TFullName aResult;
+    TFullName aResult2;
+    TInt err(KErrNone);
+
+    // find the first appearance
+    err = procName.Next(aResult);
+    if(err != KErrNone)
+        {
+        // did not find any engine process
+        return err;
+        }
+    else
+        {
+        err = aProc.Open(procName);
+        if(err == KErrNone)
+            {
+            if(aProc.ExitCategory().Length() > 0)
+                {
+                aProc.Close();
+                // process already exited => create a new one
+                return KErrNotFound;
+                }
+            aProc.Close();
+            }
+        }
+    
+//    // check now if a second appearance exists in process list, 
+//    // i.e. engine started from eshell => two engine processes appear in normal case
+//    procName.Next(aResult2);
+//
+//    // check if aResult2 contained the second appearance of profiler engine
+//    if(aResult2.CompareF(aResult) > 0)
+//        {
+//        // other process found, i.e. right process to communicate with, in case started from eshell
+//        err = aProc.Open(procName);
+//        if(err == KErrNone)
+//            {
+//            if(aProc.ExitCategory().Length() > 0)
+//                {
+//                // process already exited => create a new one
+//                return KErrNotFound;
+//                }
+//            aProc.Close();
+//            }
+//        }
+    
+    return err;
+    }
+
+void CProfilerGuiModel::LaunchProfilerEngineL()
+    {
+    LOGTEXT(_L("CProfilerGuiModel::LaunchProfilerEngineL - start"));
+
+    TRequestStatus stat = KRequestPending;
+    RProcess proc;
+    
+    TInt err(KErrNone);
+    
+    // check if process exists
+    err = FindProcessL(proc);
+    
+    // check if already exists and don't start a new eshell profiling
+    if( err == KErrNotFound )
+        {
+        // try create new process
+        err = proc.Create(KProfilerEngineExe, _L(""));
+
+        // check if RProcess::Create() succeeded
+        if( err == KErrNone )
+            {
+            // Trigger rendezvous on the supplied TRequestStatus object
+            proc.Rendezvous(stat); 
+
+            // kick off the engine process
+            proc.Resume();
+            
+            // wait for the constructor to complete 
+            User::WaitForRequest(stat); 
+            
+            // just lose the handle
+            proc.Close();
+            }
+        }
+    
+    // Increase the client reference count in server:
+    AttachClient();    
+    }
+
+//-----------------------------------------------------------------------------
+// CProfilerGuiModel::TerminateProfilerL()
+// Stops Profiler Engine if it has been launched by this launcher. 
+//-----------------------------------------------------------------------------
+
+void CProfilerGuiModel::TerminateProfilerL()
+    {
+    LOGTEXT(_L("CProfilerGuiModel::TerminateProfiler - entry"));
+    
+    // exit profiler engine 
+    RProfiler::ExitProfiler();
+        
+    LOGTEXT(_L("CProfilerGuiModel::TerminateProfiler - exit"));
+    
+    }
+
+void CProfilerGuiModel::AttachClient()
+    {
+    LOGTEXT(_L("CProfilerGuiModel::AttachClient - entry"));
+    
+    // 
+    RProfiler::AttachClient();
+        
+    LOGTEXT(_L("CProfilerGuiModel::AttachClient - exit"));
+    
+    }
+
+void CProfilerGuiModel::RemoveClient()
+    {
+    LOGTEXT(_L("CProfilerGuiModel::RemoveClient - entry"));
+    
+    // 
+    RProfiler::RemoveClient();
+        
+    LOGTEXT(_L("CProfilerGuiModel::RemoveClient - exit"));
+    
+    }
+
+void CProfilerGuiModel::AddNewSamplersL(CArrayFixFlat<TSamplerAttributes>& aAttributes)
+	{
+	TSamplerAttributes item;
+	
+	TInt count(aAttributes.Count());
+
+	// loop the attribute array and insert them into view list
+	for (TInt i(0);i<count;i++)
+		{
+    	// get a TSamplerAttributes from list at a time  
+		item = aAttributes.At(i);
+
+		iReferenceNumber++;
+	
+        // add item to the array
+        AppendToSamplerItemListL(item);
+        
+        // update the listbox
+        RefreshViewL(EFalse);
+        
+        // set item index to the begin	
+        iMainContainer->ListBox()->SetCurrentItemIndexAndDraw(iMainContainer->ListBox()->Model()->NumberOfItems()-1);
+
+		}
+    // refresh again
+    if(iReferenceNumber > 0)
+        {
+        RefreshViewL(ETrue);
+        }
+	}
+
+TBool CProfilerGuiModel::CheckTraceLocationSanityL(TGeneralAttributes& aAttr, TBool aQuietCheck)
+    {
+    RFs fs;
+    User::LeaveIfError(fs.Connect());
+
+    TBuf<32> drive;
+    
+    CnvUtfConverter::ConvertToUnicodeFromUtf8(drive, aAttr.iSaveFileDrive);
+
+    TDriveUnit driveUnit = TDriveUnit(drive);
+
+    TBool ret(EFalse);
+
+    // check that the root folder is correct
+    if (drive.Length() > 2 && BaflUtils::CheckFolder(fs, drive.Left(3)) == KErrNone )
+        {
+        // check then if drive has still some space
+        if(!SysUtil::DiskSpaceBelowCriticalLevelL(&fs, 0, driveUnit))
+            {
+            ret = ETrue;
+            }
+        }
+    
+    // check if the sanity check failed
+    if(!ret)
+        {
+        // show an error note
+        if(aQuietCheck == EFalse)
+            {
+            CAknErrorNote* note = new(ELeave) CAknErrorNote();
+            note->ExecuteLD(_L("Invalid path, check settings!"));
+            }
+        }
+    fs.Close();
+    return ret;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CProfilerGuiModel::LaunchSettingsDialogL()
+    {
+    // launch the settings dialog
+    TGeneralAttributes newSettings = iGeneralAttributes;
+    TBool quietCheck(EFalse);
+    
+    CProfilerGuiSettingsViewDlg* dlg = CProfilerGuiSettingsViewDlg::NewL(newSettings);
+    TInt returnValue = dlg->ExecuteLD(R_PROFILER_GUI_SETTINGS_DIALOG);
+    
+    // check if exit command => no error note to user
+    if(returnValue == EAknCmdExit)
+        quietCheck = ETrue;
+    
+    // always save settings since the settings dialog does not provide a possibility to cancel
+    iGeneralAttributes.iTraceOutput.Copy(newSettings.iTraceOutput);
+    iGeneralAttributes.iTraceFilePrefix.Copy(newSettings.iTraceFilePrefix);
+    iGeneralAttributes.iTimedSamplingPeriod = newSettings.iTimedSamplingPeriod;
+
+    // check if debug output selected no check of
+    if(newSettings.iTraceOutput.CompareF(KTraceDebugOutput) != 0)
+        {
+        // Check save file drive sanity
+        if(CheckTraceLocationSanityL(newSettings, quietCheck))
+            {
+            // save the new location
+            iGeneralAttributes.iSaveFileDrive.Copy(newSettings.iSaveFileDrive);
+            }
+        }
+    
+    // saves the general settings to profiler engine
+    SaveGeneralSettingsL();   
+    
+    // make sure that the title of the application is correct
+    CEikStatusPane* sp = iEnv->AppUiFactory()->StatusPane();
+    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    tp->SetTextL(KAppName);
+    
+    return returnValue;
+    }
+
+
+TPtrC CProfilerGuiModel::GetWriterInfoNoteL(const TDesC& aNote)
+	{
+    TBuf<256> buf;
+    TBuf<128> descBuf;
+    
+    buf.Zero();
+
+    // get active profiler since it 
+    RProfiler::GetActiveWriter(buf);
+    
+	if(iGeneralAttributes.iTraceOutput.CompareF(KTraceOutput) == 0)
+		{
+		if(iState == MProfilerStatusObserver::EInitializing ||
+                iState == MProfilerStatusObserver::ERestarting )
+			{
+			descBuf.Zero();
+			// set the additional note if available
+			buf.Copy(aNote); 
+			RProfiler::GetFileName(descBuf);
+			buf.Append(_L("Writing to "));
+			buf.Append(descBuf);
+			}
+		else if(iState == MProfilerStatusObserver::EIdle ||
+		        iState == MProfilerStatusObserver::EStopping ||
+		        iState == MProfilerStatusObserver::ERunning )
+			{
+			descBuf.Zero();
+            // set the additional note if available
+            buf.Copy(aNote); 
+            RProfiler::GetFileName(descBuf);
+			buf.Append(_L("Wrote trace data to "));
+			buf.Append(descBuf);
+			}
+		else
+		    {
+	          buf.Copy(KNullDesC);
+		    }
+		}
+	else if(iGeneralAttributes.iTraceOutput.CompareF(KTraceDebugOutput) == 0)
+		{
+		if(iState == MProfilerStatusObserver::EInitializing ||
+                iState == MProfilerStatusObserver::ERestarting )
+			{
+			buf.Copy(_L("Writing to debug output..."));
+			}
+		else if( iState == MProfilerStatusObserver::EIdle || 
+	             iState == MProfilerStatusObserver::EStopping ||
+		         iState == MProfilerStatusObserver::ERunning )
+			{
+			buf.Copy(_L("Wrote trace data to debug output"));
+			}
+		else
+		    {
+		    buf.Copy(KNullDesC);
+		    }
+		}
+	else
+	    {
+	    // should not reach this point
+        buf.Copy(KNullDesC);
+	    }
+    
+    return TPtrC(buf);	
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CProfilerGuiModel::EditSamplerL(TSamplerAttributes& aItem)
+    {
+    // edit sampler specific settings i.e. attributes
+    TSamplerAttributes& newSettings = aItem;
+    TInt indexToReplace(iMainContainer->CurrentListBoxItemIndex());
+    
+    // create a new settings editor dialog
+    CProfilerSamplerSettingsViewDlg* dlg = CProfilerSamplerSettingsViewDlg::NewL(newSettings);
+    TInt returnValue = dlg->ExecuteLD(R_PROFILER_SAMPLER_SETTINGS_DIALOG);
+    
+    // save settings
+    aItem = newSettings;
+
+    // replace the old attribute container with saved values
+    iSamplerItemList->Delete(indexToReplace);
+    iSamplerItemList->InsertL(indexToReplace, newSettings);
+    
+    // save the settings to sampler item
+    RProfiler::SetSamplerAttributes(newSettings);
+    
+    // make sure that the title of the application is correct
+    CEikStatusPane* sp = iEnv->AppUiFactory()->StatusPane();
+    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    tp->SetTextL(KAppName);
+
+    return returnValue;
+    }
+
+
+void CProfilerGuiModel::SamplerInfoL(TSamplerAttributes& aItem)
+    {
+    TBuf<64> header;
+    TBuf<256> info;
+    
+    _LIT(KSamplerStr, "Sampler Info");
+    
+//    CnvUtfConverter::ConvertToUnicodeFromUtf8(header, aItem.iName);
+    
+    header.Append(KSamplerStr);
+
+    CnvUtfConverter::ConvertToUnicodeFromUtf8(info, aItem.iDescription);
+
+    CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
+    //dialog->ExecuteLD(info);
+    dialog->PrepareLC( R_PROFILER_GUI_EMPTY_ABOUT_DIALOG );
+    dialog->SetHeaderText(header);
+    dialog->SetMessageTextL(info);
+    dialog->RunLD(); 
+
+    RefreshViewL(EFalse);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::StartAllSamplerItemsL(TProfilingMode aProfilingMode)
+    {
+    TBuf<256> activeWriterDes;
+    TBuf8<256> writer8;
+    
+    iState = MProfilerStatusObserver::EInitializing;
+    
+    RProfiler::TProfilingMode profilingMode = aProfilingMode == EProfilingModeTimed ? RProfiler::EProfilingModeTimed : RProfiler::EProfilingModeNormal;
+    
+    // update status pane to correspond the initializing mode
+    // prevent the control of sampler specific settings during the trace 
+    iMainContainer->SetDimmed(ETrue);
+    
+    // update status pane
+    iMainView->UpdateStatusPaneL(iState);
+    
+    // refresh view
+    RefreshViewL();
+    
+    // try to start profiling process through client-server interface
+    if(RProfiler::StartSampling(profilingMode) == KErrNotFound)
+        {
+        
+        // profiler stopped (e.g. from eshell) and must be restarted 
+        LaunchProfilerEngineL();
+        
+        // set general attributes
+        SaveGeneralSettingsL();
+        
+        // set sampler attributes
+        for(TInt i(0);i<iSamplerAttributes->Count();i++)
+            {
+            // set the attributes for each sampler loaded in the UI
+            RProfiler::SetSamplerAttributes(iSamplerAttributes->At(i));
+            }
+        
+        // try to launch sampling again
+        RProfiler::StartSampling(profilingMode);
+        }
+    
+    // get selected writer
+    RProfiler::GetActiveWriter(activeWriterDes);
+    CnvUtfConverter::ConvertFromUnicodeToUtf8(writer8, activeWriterDes);
+    
+    // check that output mode has not changed for a problem with trace file name
+    // problem cases:
+    // - trace file name and/or path false
+    // - disk full, cannot write to given location
+    // - false drive, e.g. x:
+    if(writer8.CompareF(iGeneralAttributes.iTraceOutput) != 0)
+        {
+        // save change also to general attributes
+        iGeneralAttributes.iTraceOutput.Copy(writer8);
+        // show an info popup showing the logging method
+        iMainContainer->ShowWriterInfoPopupL(KWarningNote);
+        }
+    else
+        {
+        // show an info popup showing the logging method
+        iMainContainer->ShowWriterInfoPopupL(KNullDesC);
+        }
+    
+    // update the view
+    RefreshViewL();    
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::DeleteAllSamplerItemsL()
+    {
+    DeleteAllSamplerItems();
+    
+    RefreshViewL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::StopAllSamplerItemsL()
+    {
+    // show an info popup showing the logging method
+    iMainContainer->ShowWriterInfoPopupL(KNullDesC);
+    
+    // Stop profiling process through CS session
+    RProfiler::StopSampling();
+    
+    RefreshViewL();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::RefreshViewL(TBool aClearSelection)
+    {
+    // refresh the main list view
+    if (iMainContainer && iDrawState == EDrawStateMain && iMainContainer->ListBox())
+        {
+        // clear selections if any
+        iMainContainer->ListBox()->ClearSelection();
+        
+        // set item index to 0
+        if (aClearSelection)
+            iMainContainer->ListBox()->SetCurrentItemIndex(0); 
+        
+        // set text items
+        iMainContainer->SetListBoxTextArrayL(GenerateListBoxItemTextArrayL());
+        }
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::AppendToSamplerItemListL(TSamplerAttributes& aItem)
+    {
+    // append single sampler item into sampler item list
+    if (iSamplerItemList)
+        iSamplerItemList->AppendL( aItem );
+    else
+        User::Leave(KErrNotReady);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::DisableOrEnableFromSamplerItemListL(TInt aIndex)
+    {
+    if (iSamplerItemList)
+        {
+        if (iSamplerItemList->Count() > aIndex && aIndex >= 0)
+            {
+            TSamplerAttributes& attr = iSamplerItemList->At(aIndex);
+            if (attr.iEnabled)
+                {
+                attr.iEnabled = EFalse;
+                }
+            else if (!attr.iEnabled)
+                {
+                attr.iEnabled = ETrue;
+                }
+            // save settings to engine
+            RProfiler::SetSamplerAttributes(attr);
+            }
+        else
+            User::Leave(KErrNotFound);
+        }
+    else
+        {
+        User::Leave(KErrNotReady);
+        }
+
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CProfilerGuiModel::SamplerItemCount() const
+    {
+    TInt count(0);
+    
+    if (iSamplerItemList)
+        count = iSamplerItemList->Count();
+    
+    return count;
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::DeleteAllSamplerItems()
+    {
+    // reset sampler array
+    iSamplerItemList->Reset();    
+    }  
+          
+// --------------------------------------------------------------------------------------------
+
+CDesCArray* CProfilerGuiModel::GenerateListBoxItemTextArrayL()
+    {
+    CDesCArray* textArray = new(ELeave) CDesCArrayFlat(64);
+    CleanupStack::PushL(textArray);
+
+    _LIT(KEntryTemplateRedIcon,   "1\t%S\t\t");
+    _LIT(KEntryTemplateGreenIcon, "2\t%S\t\t");
+    
+    TSamplerAttributes attr;
+    TInt itemCount(SamplerItemCount()); 
+    for (TInt i(0); i<itemCount; i++)
+        {
+        // add description from each entry
+        TBuf<512> textEntry;
+        TBuf<512> description; 
+
+        attr = iSamplerItemList->At(i);
+        
+        description.Copy(attr.iName);
+        
+        if (attr.iEnabled)
+            textEntry.Format(KEntryTemplateGreenIcon, &description);
+        else
+            textEntry.Format(KEntryTemplateRedIcon, &description);
+        
+        textArray->AppendL(textEntry);
+        }    
+    
+    CleanupStack::Pop(); //textArray
+    return textArray;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CProfilerGuiModel::GetSelectedItemEnabled()
+    {
+    TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
+    
+    if (SamplerItemCount() > currentItemIndex && currentItemIndex >= 0)
+        {
+        return iSamplerItemList->At(currentItemIndex).iEnabled;
+        }
+    return EFalse;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CProfilerGuiModel::GetSelectedItemHasSettings()
+    {
+    TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
+    
+    if (SamplerItemCount() > currentItemIndex && currentItemIndex >= 0)
+        {
+        if(iSamplerItemList->At(currentItemIndex).iItemCount != 0 || 
+                iSamplerItemList->At(currentItemIndex).iSampleRate != KErrNotFound)
+            {
+            return ETrue;
+            }
+        else
+            {
+            return EFalse;
+            }
+        }
+    return EFalse;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CProfilerGuiModel::GetSelectedItemHidden()
+    {
+    TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
+    
+    if (SamplerItemCount() > currentItemIndex && currentItemIndex >= 0)
+        {
+        if(iSamplerItemList->At(currentItemIndex).iIsHidden)
+            {
+            return ETrue;
+            }
+        else
+            {
+            return EFalse;
+            }
+        }
+    return EFalse;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CProfilerGuiModel::EditSelectedSamplerL(TInt index)
+    {
+    TSamplerAttributes sampler;
+    if(SamplerItemCount() > index && index >= 0)
+        {
+        sampler = iSamplerItemList->At(index);
+        return EditSamplerL(sampler);
+        }
+    return KErrNone;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::SelectedSamplerInfoL(TInt index)
+    {
+    if(SamplerItemCount() > index && index >= 0)
+        {
+        SamplerInfoL(iSamplerItemList->At(index));
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::ShowItemActionMenuL()
+    {
+    TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
+    
+    if (SamplerItemCount() > currentItemIndex && currentItemIndex >= 0)
+        {
+        // show a query dialog    
+        TInt queryIndex(0);
+        CAknListQueryDialog* listQueryDlg = new(ELeave) CAknListQueryDialog(&queryIndex);
+        TInt resource = 0;
+        TSamplerAttributes sampler = iSamplerItemList->At(currentItemIndex);
+        
+        // check if sampler enabled
+        if(sampler.iEnabled)
+        	{
+        	resource = R_ITEM_ACTION_QUERY_ENABLED;
+            }
+        else
+        	{
+        	resource = R_ITEM_ACTION_QUERY_DISABLED;
+        	}
+        
+        // check if sampler plugin hidden => don't allow starting and stopping of sampling
+        if(sampler.iIsHidden)
+        	{
+        	resource = R_ITEM_ACTION_QUERY_HIDDEN_START_STOP;
+        	}
+        else if(( sampler.iItemCount == 0 && 
+        		sampler.iSampleRate == KErrNotFound ) && 
+        		sampler.iEnabled )
+            {
+            resource = R_ITEM_ACTION_QUERY_HIDDEN_SETTINGS_ENABLED;
+            }
+        else if(( sampler.iItemCount == 0 && 
+                sampler.iSampleRate == KErrNotFound ) && 
+                !sampler.iEnabled )
+            {
+            resource = R_ITEM_ACTION_QUERY_HIDDEN_SETTINGS_DISABLED;
+            }
+        
+        // execute query dialog with the given resource
+        if (listQueryDlg->ExecuteLD(resource))
+            {
+            if(!sampler.iIsHidden)
+            	{
+            	if(sampler.iItemCount != 0 || 
+            	        sampler.iSampleRate != KErrNotFound )
+            	    {
+                    // enable/disable sampler
+                    if (queryIndex == EItemActionMenuTypeEnable)
+                        {
+                        DisableOrEnableSelectedOrHighlightedItemsL();
+                        }
+                    // edit sampler settings
+                    else if (queryIndex == EItemActionMenuTypeEditSettings - 1)
+                        {
+                        EditSamplerL(sampler);
+                        }
+                    // info
+                    else if (queryIndex == EItemActionMenuTypeInfo - 1)
+                        {
+                        SamplerInfoL(sampler);
+                        }
+            	    }
+            	else
+            	    {
+                    // special case, use raw query indexes
+                     if (queryIndex == 0)
+                         {
+                         DisableOrEnableSelectedOrHighlightedItemsL();
+                         }
+                     else if (queryIndex == 1)
+                         {
+                         SamplerInfoL(sampler);
+                         }
+            	    }
+            	}
+            else
+				{
+				if(sampler.iItemCount != 0 || 
+				        sampler.iSampleRate != KErrNotFound)
+					{
+					// special case, use raw query indexes
+					// edit sampler settings
+					if (queryIndex == 0)
+						{
+						EditSamplerL(sampler);
+						}
+					// sampler info
+					else if (queryIndex == 1)
+						{
+						SamplerInfoL(sampler);
+						}
+					}
+				else
+					{
+					// only sampler info available if hidden and no setting items to be set
+					if (queryIndex == 0)
+						{
+						SamplerInfoL(sampler);
+						}
+					
+					}
+				}
+            }
+        }
+    }
+
+void CProfilerGuiModel::DisableOrEnableSelectedOrHighlightedItemsL()
+    {
+    const CArrayFix<TInt>* selectionIndexes = iMainContainer->ListBoxSelectionIndexes();
+
+    // by default use selected items
+    if (selectionIndexes && selectionIndexes->Count() > 0)
+        {
+        TInt ref(0);
+        TKeyArrayFix key(0, ECmpTUint16);
+        TInt index(0);
+
+        for (TInt i=0; i<SamplerItemCount(); i++)
+            {
+            ref = i;
+
+            if (selectionIndexes->Find(ref, key, index) == 0)  
+                {
+                DisableOrEnableFromSamplerItemListL(i);
+                }
+            }
+        
+        RefreshViewL(EFalse);
+        }
+    
+    // or if none selected, use the current item index
+    else
+        {
+        TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
+        
+        if (SamplerItemCount() > currentItemIndex && currentItemIndex >= 0)
+            {
+            DisableOrEnableFromSamplerItemListL(currentItemIndex);
+            
+            RefreshViewL(EFalse);
+            }
+        }  
+    }
+
+void CProfilerGuiModel::LoadPluginsL()
+	{
+    // get samplers from Profiler Engine (client-server session) 
+	// and add the to the samplers list for the first time
+    LOGTEXT(_L("CProfilerGuiModel::LoadPlugins - get sampler plugins"));
+    TInt err = RProfiler::GetSamplerAttributes(*iSamplerAttributes);
+    
+    // check if engine provided a list of samplers
+    if( err != KErrNone )
+        {
+        // could not get samplers from engine
+        LOGTEXT(_L("CProfilerGuiModel::LoadPlugins - failed to connect engine"));
+        }
+    else
+        {
+        LOGTEXT(_L("CProfilerGuiModel::LoadPlugins - adding new samplers into view"));
+        AddNewSamplersL(*iSamplerAttributes);
+        }
+    
+    LOGTEXT(_L("CProfilerGuiModel::LoadPlugins - exit"));
+	}
+
+// --------------------------------------------------------------------------------------------
+
+TInt CProfilerGuiModel::LoadGeneralSettingsL()
+    {
+    // local variable for getting saved settings from profiler engine
+    TGeneralAttributes generalAttr;
+    TInt err(KErrNone);
+    
+    // before loading saved settings (from settings file) set the default values 
+    iGeneralAttributes.iTraceOutput.Copy(KTraceOutput);
+    iGeneralAttributes.iTraceFilePrefix.Copy(KProfilerDefaultPrefix);
+    iGeneralAttributes.iSaveFileDrive.Copy(KProfilerDefaultDrive);
+    iGeneralAttributes.iTimedSamplingPeriod = KDefaultTimedSamplingPeriod;
+    
+    // request to 
+    err = RProfiler::GetGeneralAttributes(generalAttr);
+    
+    // check that request succesfull
+    if( err != KErrNone )
+        {
+        // could not connect profiler engine, use 
+        return err;
+        }
+    
+    // check if saved settings different than the default
+    if(generalAttr.iTraceOutput.MatchF(iGeneralAttributes.iTraceOutput) == KErrNotFound)
+        {
+        iGeneralAttributes.iTraceOutput.Copy(generalAttr.iTraceOutput);
+        }
+
+    if(generalAttr.iTraceFilePrefix.MatchF(iGeneralAttributes.iTraceFilePrefix) == KErrNotFound)
+        {
+        iGeneralAttributes.iTraceFilePrefix.Copy(generalAttr.iTraceFilePrefix);
+        }
+
+    if(generalAttr.iSaveFileDrive.MatchF(iGeneralAttributes.iSaveFileDrive) == KErrNotFound)
+        {
+        iGeneralAttributes.iSaveFileDrive.Copy(generalAttr.iSaveFileDrive);
+        }
+    
+    if( generalAttr.iTimedSamplingPeriod > 0)
+        {
+        iGeneralAttributes.iTimedSamplingPeriod = generalAttr.iTimedSamplingPeriod;
+        }
+    
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::SaveGeneralSettingsL()
+    {
+    TInt err(KErrNone);
+    
+    // save general attributes to Profiler Engine
+    err = RProfiler::SetGeneralAttributes(iGeneralAttributes);
+    
+    // check if save failed
+    if(err == KErrNotFound)
+        {
+        // profiler stopped (e.g. from eshell) and must be restarted 
+        LaunchProfilerEngineL();
+        
+        err = RProfiler::SetGeneralAttributes(iGeneralAttributes);
+        if(err != KErrNone)
+            {
+            // leave no use to continue
+            User::Leave(err);
+            }
+        }
+    }
+
+void CProfilerGuiModel::SetMainView(CProfilerGuiMainView* aMainView)
+    {
+    iMainView = aMainView;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiModel::HandleProfilerStatusChange( KProfilerStatus aStatus )
+    {
+    iState = aStatus;
+    if( aStatus == EIdle )
+        {
+        iMainContainer->ShowWriterInfoPopupL(KNullDesC);
+        // set plugin list back to enabled
+        iMainContainer->SetDimmed(EFalse);
+        }
+    TRAP_IGNORE(iMainView->UpdateStatusPaneL(aStatus));
+    }
+
+void CProfilerGuiModel::HandleProfilerErrorL( TInt aError )
+    {
+    TBuf<64> errorMsg;
+    _LIT(KErrorMessage, "Error: ");
+    _LIT(KNoMemory, "Cannot write to file, check settings");
+    
+    errorMsg.Copy(KErrorMessage);
+    // message from pwr sampler
+    if( aError < -1000 )
+        {
+        errorMsg.Append(_L("Stop other power measurement tools!"));
+        }
+    else if( aError == KErrAlreadyExists || aError == 11 )
+        {
+        errorMsg.Append(_L("Close old Profiler before start!"));
+        }
+    else if( aError == KErrNotReady )
+        {
+        errorMsg.Append(_L("Memory card removed, failed to write!"));
+        }
+    else if( aError == KErrPathNotFound )
+        {
+        errorMsg.Append(_L("Given trace data location does not exist"));
+        }
+    else
+        {
+        if( aError == KErrNoMemory || 
+                aError == KErrOverflow || 
+                aError == KErrDirFull || 
+                aError == KErrDiskFull || 
+                aError == KErrNotReady )
+            {
+            errorMsg.Append(KNoMemory);
+            }
+        else
+            {
+            errorMsg.Append(_L("code: "));
+            errorMsg.AppendNum(aError);
+            }
+        }
+    // simply show an error note
+    CAknErrorNote* note = new(ELeave) CAknErrorNote();
+    note->ExecuteLD(errorMsg);
+    
+    // set state idle in all error cases
+    iState = MProfilerStatusObserver::EIdle;
+    
+    // update status pane
+    iMainView->UpdateStatusPaneL(iState);
+    
+    // set plugin list back to enabled
+    iMainContainer->SetDimmed(EFalse);
+    
+    // refresh and set menus etc. in correct state
+    RefreshViewL();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/src/profiler_gui_samplersettingsviewdlg.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,479 @@
+/*
+* 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:   
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "profiler_gui_samplersettingsviewdlg.h"
+#include "profiler_gui_model.h"
+#include "profiler_gui.hrh"
+#include "profiler_gui_std.h"
+#include <piprofilerui.rsg>
+
+#include <aknsettingitemlist.h>
+#include <CAknMemorySelectionSettingItem.h> 
+#include <aknlists.h>
+#include <akntitle.h>
+#include <aknnavi.h>
+#include <aknnavide.h>
+#include <StringLoader.h>
+#include <aknnotewrappers.h> 
+
+// LITERALS
+_LIT8(KCPUSamplerName, "gpp");
+_LIT(KEmptySettingItem, "");
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CProfilerSamplerSettingsViewDlg* CProfilerSamplerSettingsViewDlg::NewL(TSamplerAttributes& aSettings)
+    {
+    CProfilerSamplerSettingsViewDlg* self = new(ELeave) CProfilerSamplerSettingsViewDlg(aSettings);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CProfilerSamplerSettingsViewDlg::~CProfilerSamplerSettingsViewDlg()
+    {
+    // restore default navi pane
+    if(iNaviContainer)
+        iNaviContainer->Pop();
+    
+    if (iSettingItemArray)
+        {
+        iSettingItemArray->ResetAndDestroy();
+        delete iSettingItemArray; 
+        }
+    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CProfilerSamplerSettingsViewDlg::CProfilerSamplerSettingsViewDlg(TSamplerAttributes& aSettings) 
+	: 	iSettings(aSettings)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerSamplerSettingsViewDlg::ConstructL()
+    {
+    // construct a menu bar
+    CAknDialog::ConstructL(R_PROFILER_SAMPLER_SETTINGS_MENUBAR);
+   
+    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
+    
+    // set empty navi pane label
+    iNaviContainer = static_cast<CAknNavigationControlContainer*>(sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
+    iNaviContainer->PushDefaultL();
+    
+    TBuf<64> settingsTitle;
+
+    settingsTitle.Zero();
+    settingsTitle.Copy(iSettings.iName);
+    
+    // set title text
+    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    tp->SetTextL( settingsTitle );
+
+    iItemCount = iSettings.iItemCount;
+    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerSamplerSettingsViewDlg::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+    {
+    switch (aEventType)
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemDoubleClicked:
+            ShowSettingPageL(EFalse);
+            break;
+        default:
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerSamplerSettingsViewDlg::TabChangedL(TInt /*aIndex*/)
+    {
+    iListBox->SetCurrentItemIndex(0);
+
+    SetVisibilitiesOfSettingItemsL();   
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerSamplerSettingsViewDlg::ProcessCommandL(TInt aCommandId)
+    {
+    CAknDialog::ProcessCommandL(aCommandId);
+
+    switch (aCommandId)
+        {
+        case EProfilerGuiCmdSettingsChange:
+            ShowSettingPageL(ETrue);
+            break;
+        case EProfilerGuiCmdSettingsExit:
+            TryExitL(EAknCmdExit);
+            break;
+        default:
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CProfilerSamplerSettingsViewDlg::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+
+    return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+    }    
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerSamplerSettingsViewDlg::PreLayoutDynInitL()
+    {
+    iListBox = static_cast<CAknSettingStyleListBox*>( Control(EProfilerSamplerSettingItemList) );
+    iListBox->SetMopParent(this);
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+    iListBox->SetListBoxObserver(this);
+
+    iSettingItemArray = new(ELeave) CAknSettingItemArray(16, EFalse, 0);
+
+    CTextListBoxModel* model = iListBox->Model();
+    model->SetItemTextArray(iSettingItemArray);
+    model->SetOwnershipType(ELbmDoesNotOwnItemArray);
+
+    UpdateListBoxL();    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CProfilerSamplerSettingsViewDlg::OkToExitL(TInt aButtonId)
+    {
+    // save all settings when exiting, only numeric values are needed to saved since copied from TBuf
+    for(TInt i(1);i<iItemCount+1;i++)
+    	{
+    	if(iSettingItemArray->At(i)->IsHidden() == EFalse)
+    	    {
+            switch(i)
+    	        {
+                case 1:
+                    {
+                    // check if settings value type integer
+                    if(iSettings.iSettingItem1.iType == TSettingItem::ESettingItemTypeInt)
+                        {
+                        iSettings.iSettingItem1.iValue.Num(iItemBuf[i]);
+                        }
+                    break;
+                    }
+                case 2:
+                    {
+                    // check if settings value type integer
+                    if(iSettings.iSettingItem2.iType == TSettingItem::ESettingItemTypeInt)
+                        {
+                        iSettings.iSettingItem2.iValue.Num(iItemBuf[i]);
+                        }
+                    break;
+                    }
+                case 3:
+                    {
+                    // check if settings value type integer
+                    if(iSettings.iSettingItem3.iType == TSettingItem::ESettingItemTypeInt)
+                        {
+                        iSettings.iSettingItem3.iValue.Num(iItemBuf[i]);
+                        }
+                    break;
+                    }
+                case 4:
+                    {
+                    // check if settings value type integer
+                    if(iSettings.iSettingItem4.iType == TSettingItem::ESettingItemTypeInt)
+                        {
+                        iSettings.iSettingItem4.iValue.Num(iItemBuf[i]);
+                        }
+
+                    break;
+                    }
+                case 5:
+                    {
+                    // check if settings value type integer
+                    if(iSettings.iSettingItem5.iType == TSettingItem::ESettingItemTypeInt)
+                        {
+                        iSettings.iSettingItem5.iValue.Num(iItemBuf[i]);
+                        }
+
+                    break;
+                    }
+                case 6:
+                    {
+                    // check if settings value type integer
+                    if(iSettings.iSettingItem6.iType == TSettingItem::ESettingItemTypeInt)
+                        {
+                        iSettings.iSettingItem6.iValue.Num(iItemBuf[i]);
+                        }
+
+                    break;
+                    }
+    	        }
+    	    }
+    	}
+	return CAknDialog::OkToExitL(aButtonId);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerSamplerSettingsViewDlg::ShowSettingPageL(TInt aCalledFromMenu)
+    {
+    TInt listIndex = iListBox->CurrentItemIndex();
+    TInt realIndex = iSettingItemArray->ItemIndexFromVisibleIndex(listIndex);
+    CAknSettingItem* item = iSettingItemArray->At(realIndex);
+    item->EditItemL(aCalledFromMenu);
+    item->StoreL();
+    SetVisibilitiesOfSettingItemsL();
+    DrawNow();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerSamplerSettingsViewDlg::SetVisibilitiesOfSettingItemsL()
+    {
+    if (iSettingItemArray->Count() > 0)
+        {
+        if(iSettings.iSampleRate > 0)
+        	{
+        	((*iSettingItemArray)[EProfilerGuiGenericSamplerQuerySampleRate])->SetHidden(EFalse);
+        	}
+        else
+        	{
+        	((*iSettingItemArray)[EProfilerGuiGenericSamplerQuerySampleRate])->SetHidden(ETrue);
+        	}
+        if(iItemCount>0)
+        	((*iSettingItemArray)[EProfilerGuiGenericSamplerQueryItem1])->SetHidden(EFalse);
+        if(iItemCount>1)
+        	((*iSettingItemArray)[EProfilerGuiGenericSamplerQueryItem2])->SetHidden(EFalse);
+        if(iItemCount>2)
+        	((*iSettingItemArray)[EProfilerGuiGenericSamplerQueryItem3])->SetHidden(EFalse);
+        if(iItemCount>3)
+        	((*iSettingItemArray)[EProfilerGuiGenericSamplerQueryItem4])->SetHidden(EFalse);
+        if(iItemCount>4)
+        	((*iSettingItemArray)[EProfilerGuiGenericSamplerQueryItem5])->SetHidden(EFalse);
+        if(iItemCount>5)
+        	((*iSettingItemArray)[EProfilerGuiGenericSamplerQueryItem6])->SetHidden(EFalse);
+
+        iSettingItemArray->RecalculateVisibleIndicesL();
+        iListBox->HandleItemAdditionL();
+        iListBox->UpdateScrollBarsL();
+        }
+    }   
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerSamplerSettingsViewDlg::UpdateListBoxL()
+    {
+    iSettingItemArray->ResetAndDestroy();
+    
+    // create items
+    TInt ordinal(0);
+    
+    AddSettingItemL(EProfilerGuiGenericSamplerQuerySampleRate,
+					R_SAMPLE_RATE_SETTING_TITLE,
+                    R_SAMPLER_RATE_SETTING_PAGE,
+                    NULL,
+                    ordinal++);    
+    
+    if(iItemCount>0)
+	AddSettingItemL(EProfilerGuiGenericSamplerQueryItem1,
+					R_ITEM1_SETTING_TITLE,
+					NULL,
+					NULL,
+					ordinal++);
+    if(iItemCount>1)
+    AddSettingItemL(EProfilerGuiGenericSamplerQueryItem2,
+					R_ITEM2_SETTING_TITLE,
+					NULL,
+                    NULL,
+                    ordinal++);
+    if(iItemCount>2)
+    AddSettingItemL(EProfilerGuiGenericSamplerQueryItem3,
+					R_ITEM3_SETTING_TITLE,
+					NULL,
+                    NULL,
+                    ordinal++);
+    if(iItemCount>3)
+    AddSettingItemL(EProfilerGuiGenericSamplerQueryItem4,
+					R_ITEM4_SETTING_TITLE,
+					NULL,
+                    NULL,
+                    ordinal++);
+    if(iItemCount>4)
+    AddSettingItemL(EProfilerGuiGenericSamplerQueryItem5,
+					R_ITEM5_SETTING_TITLE,
+					NULL,
+                    NULL,
+                    ordinal++);
+    if(iItemCount>5)
+    AddSettingItemL(EProfilerGuiGenericSamplerQueryItem6,
+					R_ITEM6_SETTING_TITLE,
+					NULL,
+                    NULL,
+                    ordinal++);
+
+    SetVisibilitiesOfSettingItemsL(); 
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CAknSettingItem* CProfilerSamplerSettingsViewDlg::GetSettingItemL(TSettingItem& aItem, TInt aIndex, TInt& aSettingPageResource)
+    {
+    CAknSettingItem* settingItem = NULL;
+    
+    // set default setting page dialog style resource
+    aSettingPageResource = R_GENERIC_TEXT_SETTING_PAGE;
+    
+    // check if setting item type integer
+    if(aItem.iType == TSettingItem::ESettingItemTypeInt)
+        {
+        TLex* lex = new TLex(aItem.iValue);
+        // check if value valid
+        if(lex->Val(iItemBuf[aIndex]) != KErrNone)
+            {
+            // if value not valid set to 0 
+            iItemBuf[aIndex] = 0;
+            }
+        settingItem = new(ELeave) CAknIntegerEdwinSettingItem(aIndex, iItemBuf[aIndex]);
+        aSettingPageResource = R_NUMERIC_SETTING_PAGE;
+        delete lex;
+        return settingItem;
+        }
+    else    // else manipulate as a text setting
+        {
+        settingItem = new(ELeave) CAknTextSettingItem(aIndex, aItem.iValue);
+        settingItem->SetEmptyItemTextL(KEmptySettingItem); 
+        return settingItem;
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerSamplerSettingsViewDlg::AddSettingItemL(TInt aId,
+                                                 TInt aTitleResource,
+                                                 TInt aSettingPageResource,
+                                                 TInt aAssociatedResource,
+                                                 TInt aOrdinal)
+    {
+    // create a setting item
+    CAknSettingItem* settingItem = NULL;
+
+    TBuf<KMaxSettingUITextLength> ptr;
+    switch(aId)
+        {
+        case EProfilerGuiGenericSamplerQuerySampleRate:
+            {
+            settingItem = new (ELeave) CAknIntegerEdwinSettingItem(aId, iSettings.iSampleRate);
+            break;
+            }
+        case EProfilerGuiGenericSamplerQueryItem1:
+            {
+            ptr.Copy(iSettings.iSettingItem1.iUIText);
+            settingItem = GetSettingItemL(iSettings.iSettingItem1, aId, aSettingPageResource);
+            break;
+            }
+        case EProfilerGuiGenericSamplerQueryItem2:
+            {
+            ptr.Copy(iSettings.iSettingItem2.iUIText); 
+            settingItem = GetSettingItemL(iSettings.iSettingItem2, aId, aSettingPageResource);
+            break;
+            }
+        case EProfilerGuiGenericSamplerQueryItem3:
+            {
+            ptr.Copy(iSettings.iSettingItem3.iUIText);
+            settingItem = GetSettingItemL(iSettings.iSettingItem3, aId, aSettingPageResource);
+            break;
+            }
+        case EProfilerGuiGenericSamplerQueryItem4:
+            {
+            ptr.Copy(iSettings.iSettingItem4.iUIText); 
+            settingItem = GetSettingItemL(iSettings.iSettingItem4, aId, aSettingPageResource);
+            break;
+            }
+        case EProfilerGuiGenericSamplerQueryItem5:
+            {
+            ptr.Copy(iSettings.iSettingItem5.iUIText);
+            settingItem = GetSettingItemL(iSettings.iSettingItem5, aId, aSettingPageResource);
+            break;
+            }
+        case EProfilerGuiGenericSamplerQueryItem6:
+            {
+            ptr.Copy(iSettings.iSettingItem6.iUIText); 
+            settingItem = GetSettingItemL(iSettings.iSettingItem6, aId, aSettingPageResource);
+            break;
+            }
+		default:
+			{
+			// Id not supported
+			User::Leave(KErrNotSupported);
+			break;
+			}
+        }
+
+    CleanupStack::PushL(settingItem);
+
+    // get title text
+    HBufC* itemTitle;
+    
+    if( ptr.Compare(KNullDesC) == 0 )
+        {
+        itemTitle = StringLoader::LoadLC(aTitleResource);
+        
+        // special case: check if CPU sampler
+        if(iSettings.iShortName.CompareF(KCPUSamplerName) == 0)
+            {
+            // change setting page using different value range, since > 10000 ms rates are too big
+            aSettingPageResource = R_CPU_SAMPLER_RATE_SETTING_PAGE;
+            }
+
+        // construct the setting item
+        settingItem->ConstructL(EFalse, aOrdinal, *itemTitle, NULL, aSettingPageResource,
+                                EAknCtPopupSettingList, NULL, aAssociatedResource);
+        // append the setting item to settingitem array
+        iSettingItemArray->InsertL(aOrdinal, settingItem);
+
+        CleanupStack::PopAndDestroy(); //itemTitle
+        }
+    else
+        {
+        // construct the setting item
+        settingItem->ConstructL(EFalse, aOrdinal, ptr, NULL, aSettingPageResource,
+                                EAknCtPopupSettingList, NULL, aAssociatedResource);
+
+        // append the setting item to settingitem array
+        iSettingItemArray->InsertL(aOrdinal, settingItem);
+        }
+
+    CleanupStack::Pop(); //settingItem
+    }
+
+// --------------------------------------------------------------------------------------------
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/avkon/src/profiler_gui_settingsviewdlg.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,386 @@
+/*
+* 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:   
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "profiler_gui_settingsviewdlg.h"
+#include "profiler_gui_model.h"
+#include "profiler_gui.hrh"
+#include "profiler_gui_std.h"
+#include <piprofilerui.rsg>
+
+#include <aknsettingitemlist.h>
+#include <CAknMemorySelectionSettingItem.h> 
+#include <aknlists.h>
+#include <akntitle.h>
+#include <aknnavi.h>
+#include <aknnavide.h>
+#include <StringLoader.h>
+#include <aknnotewrappers.h> 
+
+// LITERALS
+_LIT8(KDebugOutput, "debug_output");
+_LIT8(KFileSystem, "file_system");
+_LIT(KEmptySettingItem, "");
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CProfilerGuiSettingsViewDlg* CProfilerGuiSettingsViewDlg::NewL(TGeneralAttributes& aSettings)
+    {
+    CProfilerGuiSettingsViewDlg* self = new(ELeave) CProfilerGuiSettingsViewDlg(aSettings);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CProfilerGuiSettingsViewDlg::~CProfilerGuiSettingsViewDlg()
+    {
+    // restore default navi pane
+    if(iNaviContainer)
+        iNaviContainer->Pop();
+    
+    if (iSettingItemArray)
+        {
+        iSettingItemArray->ResetAndDestroy();
+        delete iSettingItemArray; 
+        }
+    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CProfilerGuiSettingsViewDlg::CProfilerGuiSettingsViewDlg(TGeneralAttributes& aSettings) : iSettings(aSettings)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiSettingsViewDlg::ConstructL()
+    {
+    // construct a menu bar
+    CAknDialog::ConstructL(R_PROFILER_GUI_SETTINGS_MENUBAR);
+   
+    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
+    
+    // set empty navi pane label
+    iNaviContainer = static_cast<CAknNavigationControlContainer*>(sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
+    iNaviContainer->PushDefaultL();
+    
+    // set title text
+    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    tp->SetTextL( _L("Settings") );
+
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiSettingsViewDlg::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+    {
+    switch (aEventType)
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemDoubleClicked:
+            ShowSettingPageL(EFalse);
+            break;
+        default:
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiSettingsViewDlg::TabChangedL(TInt /*aIndex*/)
+    {
+    iListBox->SetCurrentItemIndex(0);
+
+    SetVisibilitiesOfSettingItemsL();   
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiSettingsViewDlg::ProcessCommandL(TInt aCommandId)
+    {
+    CAknDialog::ProcessCommandL(aCommandId);
+
+    switch (aCommandId)
+        {
+        case EProfilerGuiCmdSettingsChange:
+            ShowSettingPageL(ETrue);
+            break;
+        case EProfilerGuiCmdSettingsExit:
+            TryExitL(EAknCmdExit);
+            break;
+        default:
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CProfilerGuiSettingsViewDlg::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+    /*
+    if (iTabGroup == NULL)
+        {
+        return EKeyWasNotConsumed;
+        }
+        */
+/*
+    TInt active = iTabGroup->ActiveTabIndex();
+    TInt count = iTabGroup->TabCount();
+
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyLeftArrow:
+            if (active > 0)
+                {
+                active--;
+                iTabGroup->SetActiveTabByIndex(active);
+                TabChangedL(active); 
+                }
+            break;
+        
+        case EKeyRightArrow:
+            if((active + 1) < count)
+                {
+                active++;
+                iTabGroup->SetActiveTabByIndex(active);
+                TabChangedL(active); 
+                }
+            break;
+        }
+*/
+    return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+    }    
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiSettingsViewDlg::PreLayoutDynInitL()
+    {
+    iListBox = static_cast<CAknSettingStyleListBox*>( Control(EProfilerGuiSettingItemList) );
+    iListBox->SetMopParent(this);
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+    iListBox->SetListBoxObserver(this);
+
+    iSettingItemArray = new(ELeave) CAknSettingItemArray(16, EFalse, 0);
+
+    CTextListBoxModel* model = iListBox->Model();
+    model->SetItemTextArray(iSettingItemArray);
+    model->SetOwnershipType(ELbmDoesNotOwnItemArray);
+
+    UpdateListBoxL();    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CProfilerGuiSettingsViewDlg::OkToExitL(TInt aButtonId)
+    {
+    // save settings to iSettings before exiting
+    
+    // check if trace output target changed
+    if(iTraceOutput == EOutputToDebugPort)
+        {
+        iSettings.iTraceOutput.Copy(KDebugOutput);
+        }
+    else
+        {
+        iSettings.iTraceOutput.Copy(KFileSystem);
+        }
+    
+    // save trace file prefix
+    if(iFilePrefix.CompareF(KNullDesC) != 0)
+        {
+        CnvUtfConverter::ConvertFromUnicodeToUtf8(iSettings.iTraceFilePrefix, iFilePrefix);
+        }
+    
+    // save the drive 
+    if(iSaveDrive.CompareF(KNullDesC) != 0)
+        {
+        CnvUtfConverter::ConvertFromUnicodeToUtf8(iSettings.iSaveFileDrive, iSaveDrive);
+        }
+    
+    return CAknDialog::OkToExitL(aButtonId);
+    }
+
+
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiSettingsViewDlg::ShowSettingPageL(TInt aCalledFromMenu)
+    {
+    TInt listIndex = iListBox->CurrentItemIndex();
+    TInt realIndex = iSettingItemArray->ItemIndexFromVisibleIndex(listIndex);
+    CAknSettingItem* item = iSettingItemArray->At(realIndex);
+    item->EditItemL(aCalledFromMenu);
+    item->StoreL();
+    SetVisibilitiesOfSettingItemsL();
+    DrawNow();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiSettingsViewDlg::SetVisibilitiesOfSettingItemsL()
+    {
+
+    // check if setting item array contains more than 0 items
+    if (iSettingItemArray->Count() > 0)
+        {
+//        ((*iSettingItemArray)[ESettingListItemPluginNameMode])->SetHidden(ETrue);
+        ((*iSettingItemArray)[ESettingListItemPluginTraceOutput])->SetHidden(EFalse);
+        if(iTraceOutput == EOutputToDebugPort)
+        	{
+        	((*iSettingItemArray)[ESettingListItemPluginSaveFileDrive])->SetHidden(ETrue);
+        	((*iSettingItemArray)[ESettingListItemPluginTraceFilePrefix])->SetHidden(ETrue);
+        	}
+        else 
+        	{
+        	((*iSettingItemArray)[ESettingListItemPluginSaveFileDrive])->SetHidden(EFalse);
+        	((*iSettingItemArray)[ESettingListItemPluginTraceFilePrefix])->SetHidden(EFalse);
+        	}
+//        ((*iSettingItemArray)[ESettingListItemPluginTraceMode])->SetHidden(ETrue);
+
+        iSettingItemArray->RecalculateVisibleIndicesL();
+        iListBox->HandleItemAdditionL();
+        iListBox->UpdateScrollBarsL();
+        }
+    }   
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiSettingsViewDlg::UpdateListBoxL()
+    {
+    iSettingItemArray->ResetAndDestroy();
+
+    // create items
+    TInt ordinal(0);
+    
+//    AddSettingItemL(ESettingListItemPluginNameMode,
+//                    R_PLUGIN_NAME_MODE_SETTING_TITLE,
+//                    R_PLUGIN_NAME_MODE_SETTING_PAGE,
+//                    R_PLUGIN_NAME_MODE_SETTING_TEXTS,
+//                    ordinal++);    
+
+    AddSettingItemL(ESettingListItemPluginTraceOutput,
+                    R_TRACE_OUTPUT_SETTING_TITLE,
+                    R_TRACE_OUTPUT_SETTING_PAGE,
+                    R_TRACE_OUTPUT_SETTING_TEXTS,
+                    ordinal++);
+    
+    AddSettingItemL(ESettingListItemPluginSaveFileDrive,
+                    R_SAVE_FILE_DRIVE_SETTING_TITLE,
+                    R_SAVE_FILE_DRIVE_SETTING_PAGE,
+                    NULL, //R_SAVE_FILE_DRIVE_SETTING_TEXTS,
+                    ordinal++);
+
+    AddSettingItemL(ESettingListItemPluginTraceFilePrefix,
+                    R_SAVE_FILE_PREFIX_SETTING_TITLE,
+                    R_SAVE_FILE_PREFIX_SETTING_PAGE,
+                    NULL,
+                    ordinal++);
+    
+    AddSettingItemL(ESettingListItemPluginSamplingTime,
+                    R_TIMED_SAMPLING_PERIOD_SETTING_TITLE,
+                    R_TIMED_SAMPLING_PERIOD_SETTING_PAGE,
+                    NULL,
+                    ordinal++);
+    
+    
+
+//    AddSettingItemL(ESettingListItemPluginTraceMode,
+//                    R_TRACE_MODE_SETTING_TITLE,
+//                    R_TRACE_MODE_SETTING_PAGE,
+//                    R_TRACE_MODE_SETTING_TEXTS,
+//                    ordinal++);
+
+    SetVisibilitiesOfSettingItemsL(); 
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CProfilerGuiSettingsViewDlg::AddSettingItemL(TInt aId,
+                                                 TInt aTitleResource,
+                                                 TInt aSettingPageResource,
+                                                 TInt aAssociatedResource,
+                                                 TInt aOrdinal)
+    {
+    // create a setting item
+    CAknSettingItem* settingItem = NULL;
+    
+    switch (aId)
+        {
+
+        case ESettingListItemPluginSaveFileDrive:
+            {
+            CnvUtfConverter::ConvertToUnicodeFromUtf8(iSaveDrive, iSettings.iSaveFileDrive);
+            settingItem = new(ELeave) CAknTextSettingItem(aId, iSaveDrive);
+            settingItem->SetEmptyItemTextL(KEmptySettingItem); 
+            break;
+            }
+        case ESettingListItemPluginTraceOutput:
+            if(iSettings.iTraceOutput.MatchF(KDebugOutput) != KErrNotFound)
+                {
+                iTraceOutput = EOutputToDebugPort;
+                }
+            else
+                {
+                iTraceOutput = EOutputToFileSystem;
+                }
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iTraceOutput); 
+
+            break;
+
+        case ESettingListItemPluginTraceFilePrefix:
+            {
+            CnvUtfConverter::ConvertToUnicodeFromUtf8(iFilePrefix, iSettings.iTraceFilePrefix);
+            settingItem = new(ELeave) CAknTextSettingItem(aId, iFilePrefix);
+            settingItem->SetEmptyItemTextL(KEmptySettingItem); 
+            break;
+            }
+        case ESettingListItemPluginSamplingTime:
+            {
+            settingItem = new(ELeave) CAknIntegerEdwinSettingItem(aId, iSettings.iTimedSamplingPeriod);
+            break;
+            }
+        default:
+            User::Panic(_L("NotSetItem"), 50);
+            break;
+
+        }
+        
+    CleanupStack::PushL(settingItem);
+
+    // get title text
+    HBufC* itemTitle = StringLoader::LoadLC(aTitleResource);
+
+    // construct the setting item
+    settingItem->ConstructL(EFalse, aOrdinal, *itemTitle, NULL, aSettingPageResource,
+                            EAknCtPopupSettingList, NULL, aAssociatedResource);
+    
+    // append the setting item to settingitem array
+    iSettingItemArray->InsertL(aOrdinal, settingItem);
+
+    CleanupStack::PopAndDestroy(); //itemTitle
+    CleanupStack::Pop(); //settingItem
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/hb.pro	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,64 @@
+#
+# Copyright (c) 2010 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: 
+#
+#
+
+
+TEMPLATE = app
+TARGET = PIProfilerUI
+DEPENDPATH += ./src
+INCLUDEPATH += inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+load(hb.prf) 
+symbian:CONFIG -= symbian_i18n 
+
+# Input
+HEADERS += 	./inc/pimainview.h \
+			./inc/piprofilerengineprivate.h \
+			./inc/pluginattributes.h \
+			./inc/notifications.h \
+			./inc/pisettingsview.h \
+			./inc/pimainwindow.h \
+			./inc/generalattributes.h \
+			./inc/piprofilerengine.h
+SOURCES += 	./src/pimainview.cpp \
+			./src/piprofilerengineprivate.cpp \
+			./src/main.cpp \
+			./src/pluginattributes.cpp \
+			./src/notifications.cpp \
+			./src/pisettingsview.cpp \
+			./src/pimainwindow.cpp \
+			./src/piprofilerengine.cpp 
+			
+			
+RESOURCES += piprofiler.qrc
+
+
+symbian: {
+    TARGET.UID2 = 0x100039CE
+    TARGET.UID3 = 0x2001E5AE
+    
+    BLD_INF_RULES.prj_exports += "./rom/piprofilerui_hb.iby \
+    	CORE_IBY_EXPORT_PATH(tools,piprofilerui.iby)"
+    
+	TARGET.CAPABILITY = ALL -TCB
+
+	LIBS += -lcharconv -lbafl -lsysutil
+    
+    ICON = ../icons/qgn_menu_piprofilerui.svg 
+    
+} else {
+    error("Only Symbian supported!")
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/inc/generalattributes.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2010 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 GENERALATTRIBUTES_H_
+#define GENERALATTRIBUTES_H_
+/*
+ * 
+ * GeneralAttributes class definition, internal settings format
+ *  
+ */
+class GeneralAttributes
+{
+public:
+    QString mTraceOutput;
+    QString mTraceFilePrefix;
+    QString mSaveFileDrive;
+    int mTimedSamplingPeriod;
+};
+
+#endif /* GENERALATTRIBUTES_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/inc/notifications.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2010 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 NOTIFICATIONS_H_
+#define NOTIFICATIONS_H_
+
+#include <qstring> 
+
+/**
+ * Notifications class for viewing notification messages.
+ */
+
+class Notifications
+{
+public:
+
+    static void showInformationNote(const QString &text);
+    static void showErrorNote(const QString &text);
+    static void showMessageBox(const QString &text);
+
+private:
+
+};
+
+#endif // NOTIFICATIONS_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/inc/pimainview.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2010 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 PIMAINVIEW_H
+#define PIMAINVIEW_H
+
+#include <hbview.h>
+#include <hbicon.h>
+
+#include "pluginattributes.h"
+#include "piprofilerengine.h"
+
+class HbAction;
+class HbMainWindow;
+class HbDocumentLoader;
+class HbApplication;
+class HbLabel;
+class HbWidget;
+class HbListWidget;
+class HbListWidgetItem;
+class HbMenu;
+class PISettingsView;
+class PIMainWindow;
+class HbDialog;
+
+class PIMainView: public HbView
+{
+Q_OBJECT
+
+public:
+
+    /**
+     * Constructor
+     */
+    PIMainView();
+
+    /**
+     * Destructor
+     */
+    ~PIMainView();
+
+    /**
+     * Initializes view
+     */
+    void init(PIMainWindow *mainWindow, HbApplication *app, HbDocumentLoader &loader,
+        PIProfilerEngine *engine);
+
+    /**
+     * Sets and updates new plug-in list into main view
+     * @param pluginList List of plug-ins
+     */
+    void setPluginList(QList<PluginAttributes> *pluginList);
+
+private:
+
+    /**
+     * connects signals and slots
+     */
+    void connectSignalsAndSlots(HbApplication* app);
+
+    /**
+     * Loads all UI items from xml file
+     */
+    void loadItemsFromResources(HbDocumentLoader &loader);
+
+    /**
+     * Updates plug-in list according to member variable mPluginList
+     */
+    void updatePlugInLists();
+
+    /**
+     * Gets plug-in attributes for plug-in which UID number is defined in parameter
+     * If plugin for UID if not found, empty pluginattributes variable is returned
+     */
+    PluginAttributes getPluginAttributes(int uid);
+
+    /**
+     * Shows profiling note
+     */
+    void showProfilingNote();
+
+private slots:
+
+    /**
+     * Slot that is called when profiling status is changed.
+     * Method updated text in popup that is shown in the screen
+     */
+    void profilingStatusChanged(ProfilerEngineStatus status, const QString &text = 0,
+        ProfilingMode profilingMode = PI_PROFILINGMODENORMAL, ProfilingOutput output =
+            PI_FILE_OUTPUT);
+
+    /**
+     * shows about popup
+     */
+    void showAboutPopup();
+
+    /**
+     * opens settings view
+     */
+    void openSettingsView();
+
+    /**
+     * Enables or disables plug-in from plug-in list. If parameter is zero, selected 
+     * plug-in from plug-in list is enabled/disabled.
+     */
+    void enableOrDisablePlugin(HbListWidgetItem *widget = 0);
+
+    /**
+     * Shows context menu for list widget
+     */
+    void showContexMenu(HbListWidgetItem *widget, const QPointF &point);
+
+    /**
+     * Opens sampler info for plug-in that is selected.
+     */
+    void openSampleInfo();
+
+    /**
+     * sets context menu pointer to zero
+     */
+
+    void contextMenuClosed();
+
+    /**
+     * Shows profiling-popup and starts profiling
+     */
+    void startProfiling();
+
+    /**
+     * Shows profiling popup and starts profiling
+     */
+    void startTimedProfiling();
+
+    /**
+     * Stops profiling
+     */
+    void stopProfiling();
+
+    /**
+     * Updates "Start timed profiling for xx seconds" text according to settings
+     */
+    void updateTimedProfilingText();
+
+    /**
+     * Exits and leaves profiling on
+     */
+    void exitAndLeaveProfilingOn();
+
+    /**
+     * Opens plug-in specific settings for selected plug-in
+     */
+    void openPluginSpecificSettings();
+private:
+
+    // main application
+    HbApplication *application;
+
+    // main window
+    PIMainWindow *mMainWindow;
+
+    // engine pointer
+    PIProfilerEngine *mEngine;
+
+    // list of plug-ins
+    QList<PluginAttributes> *mPluginList;
+
+    // context menu
+    HbMenu *mContextMenu;
+
+    // Actions
+    HbAction *mActionExit;
+    HbAction *mActionExitAndLeaveProfilingOn;
+    HbAction *mActionAbout;
+    HbAction *mActionStartProfiling;
+    HbAction *mActionStartTimedProfiling;
+    HbAction *mActionSettings;
+    HbAction *mActionStopProfiling;
+
+    // plug-in list widget
+    HbListWidget *mListPlugins;
+
+    // Profiling note
+    HbDialog *mProfilingNote;
+
+    // Icons for enabled and disabled plug-ins
+    HbIcon mIconEnabled;
+    HbIcon mIconDisabled;
+
+};
+
+#endif // PIMAINVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/inc/pimainwindow.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2010 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 PIPROFILERMAINWINDOW_H_
+#define PIPROFILERMAINWINDOW_H_
+
+// System includes
+#include <QObject.h>
+#include <hbmainwindow.h>
+
+// User includes
+#include "pluginattributes.h"
+
+// Forward declarations
+class PIMainView;
+class PISettingsView;
+class PIProfilerEngine;
+class HbDocumentLoader;
+class HbApplication;
+
+// Class declaration
+class PIMainWindow: public HbMainWindow
+{
+Q_OBJECT
+public:
+
+    // Member functions
+
+    PIMainWindow(PIProfilerEngine* engine, HbDocumentLoader &loader, HbApplication *app);
+    virtual ~PIMainWindow();
+
+signals:
+
+    /**
+     * Signal that is emitted when back button is pressed at settings view
+     */
+    void returnedFromSettings();
+
+public slots:
+
+    /**
+     * Activates main view
+     */
+    void activateMainView();
+
+    /**
+     * Activates settings view
+     */
+    void activateSettingsView(int uid = 0);
+
+    /**
+     * method that is called when back button pressed at settings view
+     */
+    void settingsViewClosed();
+
+    /**
+     * Sets and new plugin list to all views
+     */
+    void setPluginList(QList<PluginAttributes> &pluginList);
+
+private:
+
+    /**
+     * creates and adds main view to window
+     */
+    void addMainView(HbDocumentLoader &loader, HbApplication *app);
+
+    /**
+     * creates and adds settings view to main window
+     */
+    void addSettingsView();
+
+private slots:
+
+private:
+    // data
+
+    // Engine wrapper
+    PIProfilerEngine* mEngine;
+
+    // Main view
+    PIMainView* mMainView;
+
+    // Settings view
+    PISettingsView* mSettingsView;
+
+    // Back Action
+    HbAction *mBackAction;
+
+    // plug-in attributes
+    QList<PluginAttributes> mPluginAttributes;
+
+};
+
+#endif /* PIPROFILERMAINWINDOW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/inc/piprofilerengine.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2010 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 PIPROFILEREGINE_H
+#define PIPROFILEREGINE_H
+
+#include <qobject.h>
+#include <qlist.h>
+
+#include "pluginattributes.h"
+
+class PIProfilerEnginePrivate;
+class GeneralAttributes;
+
+enum ProfilerEngineStatus
+{
+    PI_PROFILING = 0, PI_FINISHED_SUCCEFULLY, PI_ERROR
+};
+enum ProfilingMode
+{
+    PI_PROFILINGMODENORMAL = 0, PI_PROFILINGMODETIMED
+};
+enum ProfilingOutput
+{
+    PI_DEBUG_OUTPUT = 0, PI_FILE_OUTPUT
+};
+
+class PIProfilerEngine: public QObject
+{
+Q_OBJECT
+public:
+
+    /**
+     * Constructor
+     */
+    PIProfilerEngine();
+
+    /**
+     * Initilises engine
+     */
+    bool init();
+
+    /**
+     * Destructor
+     */
+    ~PIProfilerEngine();
+
+    /**
+     * Gets PI Profiler general settings
+     */
+    void getGeneralSettings(GeneralAttributes &settings);
+
+    /**
+     * Notifys engine that ui is ready
+     */
+    void notifyUIReady();
+
+    /**
+     * Saves general settings into engine
+     */
+    bool saveGeneralSettings(GeneralAttributes &settings);
+
+    /**
+     * Saves plug-in settings into engine
+     */
+    bool savePluginSettings(const PluginAttributes &pluginAttributes);
+
+    /**
+     * Starts normal profiling
+     */
+    bool startProfiling();
+
+    /**
+     * Starts timed profiling 
+     */
+    bool startTimedProfiling();
+
+    /**
+     * Stops profiling
+     */
+    void stopProfiling();
+
+    /**
+     * gets time limit for timed profiling
+     */
+    int getTimeLimit();
+
+    /**
+     * Sets PI profiler engine to continue running after ui is closed.
+     */
+    void leaveProfilingOnAfterClosing();
+
+    bool checkTraceLocationSanity(QString &location);
+
+signals:
+
+    /**
+     * Signal that is emitted when plug-in list is loaded
+     */
+    void pluginListUpdated(QList<PluginAttributes> &samplerList);
+
+    /**
+     * Signal that is emitted when profiling status is changed
+     */
+    void profilingStatusChanged(ProfilerEngineStatus status, const QString &text = 0,
+        ProfilingMode profilingMode = PI_PROFILINGMODENORMAL, ProfilingOutput output =
+            PI_FILE_OUTPUT);
+
+private:
+
+    // private implementation
+    PIProfilerEnginePrivate *mPrivate;
+
+private:
+    // Friend classes
+
+    friend class PIProfilerEnginePrivate;
+
+};
+
+#endif // PIPROFILEREGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/inc/piprofilerengineprivate.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,217 @@
+/*
+* Copyright (c) 2010 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 PIPROFILEREGINEPRIVATE_H
+#define PIPROFILEREGINEPRIVATE_H
+
+#include <e32base.h> 
+#include <piprofiler/ProfilerAttributes.h>
+#include <piprofiler/ProfilerEngineStatusChecker.h> 
+
+class TSamplerAttributes;
+class PIMainView;
+class PluginAttributes;
+class GeneralAttributes;
+class SettingItem;
+class CProfilerEngineStatusChecker;
+class PIProfilerEngine;
+class PIProfilerEnginePrivate: public MProfilerStatusObserver
+{
+
+public:
+
+    enum TProfilingMode
+    {
+        EProfilingModeNormal = 0, EProfilingModeTimed
+    };
+
+    /**
+     * Constructor
+     */
+    PIProfilerEnginePrivate(PIProfilerEngine *aEngine);
+
+    /**
+     * Destructor
+     */
+    ~PIProfilerEnginePrivate();
+
+    /**
+     * Initializesprofiler engine
+     */
+    bool Init();
+
+    /**
+     * Method that is called when UI is ready
+     */
+    void NotifyUIReady();
+
+    /**
+     * Saves plug-in settings into engine
+     */
+    bool SavePluginSettings(const PluginAttributes &pluginAttributes);
+
+    /**
+     * Starts normal profiling
+     */
+    bool StartProfiling();
+
+    /**
+     * Starts timed profiling 
+     */
+    bool StartTimedProfiling();
+
+    /**
+     * Stops profiling
+     */
+    void StopProfiling();
+
+    /**
+     * MProfilerStatusObserver method that is called when profiler engine's status is changed
+     */
+    void HandleProfilerStatusChange(KProfilerStatus aStatus);
+
+    /**
+     * MProfilerStatusObserver method that is called when profiler error is occured.
+     */
+    void HandleProfilerErrorL(TInt aError);
+
+    /**
+     * Gets PI Profiler general settings
+     */
+    void GetGeneralSettings(GeneralAttributes &settings);
+
+    /**
+     * Saves general settings into engine
+     */
+    bool SaveGeneralSettings(GeneralAttributes &settings);
+
+    /**
+     * gets time limit for timed profiling
+     */
+    int GetTimeLimit();
+
+    /**
+     * Sets PI profiler engine to continue running after ui is closed.
+     */
+    void LeaveProfilingOnAfterClosing();
+
+    bool CheckTraceLocationSanity(QString &location);
+
+private:
+
+    /**
+     * Saves general settings into engine
+     */
+    void SaveGeneralSettingsL();
+
+    /**
+     * loads general settings from engine
+     */
+    TInt LoadGeneralSettingsL();
+
+    /**
+     * Starts to profile
+     */
+    void StartAllSamplerItemsL(TProfilingMode aProfilingMode);
+
+    // Converters for symbian to qt and qt to symbian 
+
+    /**
+     * TSamplerAttributes -> SamplerAttributes
+     */
+    static void convertTSamplerAttributesToPluginAttributes(TSamplerAttributes &tSamplerAttributes,
+        PluginAttributes &samplerAttributes);
+
+    /**
+     * TSettingItem -> SettingItem
+     */
+    static void convertTSettingItemToSettingItem(TSettingItem &tSettingItem,
+        SettingItem &settingItem);
+
+    /**
+     * SettingItem -> TSettingItem
+     */
+    static void convertSettingItemToTSettingItem(TSettingItem &tSettingItem,
+        const SettingItem &settingItem);
+
+    /**
+     * TGeneralAttributes -> GeneralAttributes
+     */
+    static void convertTGeneralAttributesToGeneralAttributes(
+        TGeneralAttributes &tSamplerAttributes, GeneralAttributes &samplerAttributes);
+
+    /**
+     * GeneralAttributes -> TGeneralAttributes
+     */
+    static void convertGeneralAttributesToTGeneralAttributes(
+        TGeneralAttributes &tSamplerAttributes, GeneralAttributes &samplerAttributes);
+
+    /**
+     * Launches PI Profiler engine
+     */
+    int LaunchEngineL();
+
+    /**
+     * Terminates PI Profiler engine
+     */
+    void terminateEngine();
+
+    /**
+     * Gets plug-ins from engine
+     */
+    void addNewSamplers(CArrayFixFlat<TSamplerAttributes>& aAttributes);
+
+    /**
+     * Loads plug-ins
+     */
+    void loadPlugins();
+
+    /**
+     * Finds PI Profiler Engine process
+     */
+    TInt FindProcessL(RProcess& aProc);
+
+    /**
+     * Attaches client into PI Profiler engine
+     */
+    void AttachClient();
+
+    /**
+     * Checks trace location sanity
+     */
+    TBool CheckTraceLocationSanityL(TBuf8<KPrefixMaxLength>& aAttr);
+
+private:
+
+    // Should Engine leaved on after ui is closed
+    bool iLeaveProfilingOnAfterClosing;
+
+    // Public part of engine
+    PIProfilerEngine *iPublic;
+
+    // Sampler Attributes
+    CArrayFixFlat<TSamplerAttributes>* iSamplerAttributes;
+
+    // General attributes
+    TGeneralAttributes iGeneralAttributes;
+
+    // Engine status checker
+    CProfilerEngineStatusChecker* iStatusChecker;
+
+};
+
+#endif // PIPROFILEREGINEPRIVATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/inc/pisettingsview.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2010 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 PISETTINGSVIEW_H
+#define PISETTINGSVIEW_H
+
+#include <hbview.h>
+#include <qlist.h>
+
+#include "generalattributes.h"
+
+class PIProfilerEngine;
+class HbMainWindow;
+class HbDataForm;
+class HbDataFormModel;
+class HbDataFormModelItem;
+class PluginAttributes;
+class SettingItem;
+
+class PISettingsView: public HbView
+{
+Q_OBJECT
+
+public:
+
+    enum OutputMode
+    {
+        OUTPUT_MODE_DEBUG, OUTPUT_MODE_FILE
+    };
+
+    /**
+     * Constructor
+     */
+    PISettingsView(PIProfilerEngine *engine);
+
+    /**
+     * Destructor
+     */
+    ~PISettingsView();
+
+    /**
+     * Reads general settings from data form and returns GeneralAttributes
+     */
+    GeneralAttributes& getGeneralAttributes();
+
+    /**
+     * Reads plug-in specific settings from data form and saves them into mPluginlist
+     */
+    void readPluginSettings();
+
+    /**
+     * Sets plug-in specific settings and creates data form items for them
+     */
+    void setPluginSettings(QList<PluginAttributes> *pluginList);
+
+    /**
+     * Expands one plug-ins settings group. Other groups are collapsed. 
+     */
+    void expandPluginGroup(int uid);
+
+private:
+
+    /**
+     * Creates general settings form items
+     */
+    void createGeneralSettingForms();
+
+    /**
+     * Creates plug-in specific form items
+     */
+    void createPluginSpecificSettings();
+
+    /**
+     * Loads general settings and updates them into form
+     */
+    void loadGeneralSettings();
+
+    /**
+     * Creates one plug-in setting item
+     */
+    HbDataFormModelItem *createPluginSettingItem(const SettingItem *item,
+        HbDataFormModelItem *parentGroup);
+    
+    /**
+     * reads ont plug-in setting value and saves it into qstring value
+     */
+    void readPluginSettingItemValue(HbDataFormModelItem *dataFormItem, SettingItem *settingItem);
+
+private slots:
+
+    /**
+     * Adds text validators into form items
+     */
+    void addTextValidators(const QModelIndex index);
+
+private:
+
+    // engine pointer
+    PIProfilerEngine *mEngine;
+
+    // General settings
+    GeneralAttributes mGeneralAttributes;
+
+    // list of plug-ins
+    QList<PluginAttributes> *mPluginList;
+
+    // setting form
+    HbDataForm *mSettingForm;
+
+    // model class
+    HbDataFormModel *mModel;
+
+    // data form groups
+    HbDataFormModelItem *mGeneralSettingsGroup;
+    HbDataFormModelItem *mPluginSettingsGroup;
+
+    // general setting items
+    HbDataFormModelItem *mOutputItem;
+    HbDataFormModelItem *mFileLocation;
+    HbDataFormModelItem *mPrefix;
+    HbDataFormModelItem *mSamplingPeriod;
+
+    HbDataFormModelItem *testItem;//TODO remove!
+};
+
+#endif // PISETTINGSVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/inc/pluginattributes.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2010 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 PLUGINATTRIBUTES_H_
+#define PLUGINATTRIBUTES_H_
+
+/*
+ * 
+ * PluginAttributes class definition, internal settings format
+ *  
+ */
+#include <qobject.h>
+#include <qvariant.h>
+#include <qstring.h>
+
+class HbDataFormModelItem;
+
+/*
+ * 
+ * TSettingItem class definition, internal settings format
+ *  
+ */
+class SettingItem
+{
+public:
+    enum
+    {
+        SettingItemTypeInt = 0, SettingItemTypeBool, SettingItemTypeHex, SettingItemTypeText
+    };
+
+public:
+    QString mSettingText;
+    int mType;
+    QString mValue;
+    QString mSettingDescription;
+    QString mUIText;
+};
+
+class PluginAttributes// : public QObject
+{
+    //Q_OBJECT
+public:
+
+    // default constructor
+    PluginAttributes();
+
+    ~PluginAttributes();
+public:
+    int mUid;
+    QString mShortName; // name of the plugin, short name
+    QString mName; // name of the plugin, long name
+    QString mDescription; // plugin description, info about HW/SW dependencies etc.
+    int mSampleRate; // sample rate of the plugin
+    bool mEnabled; // enabled for profiling
+    bool mIsHidden; // hidden, i.e. no start/stop controls
+    int mItemCount; // plugin specific setting item count
+
+
+    // plugin specific settings, plugin implementation dependent
+    SettingItem mSettingItem1;
+    SettingItem mSettingItem2;
+    SettingItem mSettingItem3;
+    SettingItem mSettingItem4;
+    SettingItem mSettingItem5;
+    SettingItem mSettingItem6;
+
+    HbDataFormModelItem *mFormItemSettingItem1;
+    HbDataFormModelItem *mFormItemSettingItem2;
+    HbDataFormModelItem *mFormItemSettingItem3;
+    HbDataFormModelItem *mFormItemSettingItem4;
+    HbDataFormModelItem *mFormItemSettingItem5;
+    HbDataFormModelItem *mFormItemSettingItem6;
+    HbDataFormModelItem *mFormItemSampleRate;
+
+};
+
+#endif /* PLUGINATTRIBUTES_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/pimainview.docml	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.9">
+    <object name="actionStartProfiling" type="HbAction">
+        <string name="text" value="Start profiling"/>
+    </object>
+    <object name="actionSettings" type="HbAction">
+        <string name="text" value="Settings"/>
+    </object>
+    <object name="actionAbout" type="HbAction">
+        <string name="text" value="About"/>
+    </object>
+    <object name="actionExit" type="HbAction">
+        <string name="text" value="Exit"/>
+    </object>
+    <object name="actionStartTimedProfiling" type="HbAction">
+        <string name="text" value="Start profiling for 60 seconds"/>
+    </object>
+    <widget name="PIMainView" type="PIMainView">
+        <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+            <string name="HbVkbHost" value=""/>
+            <ref object="actionStartProfiling" role="HbMenu:addAction"/>
+            <ref object="actionStartTimedProfiling" role="HbMenu:addAction"/>
+            <ref object="actionSettings" role="HbMenu:addAction"/>
+            <ref object="actionAbout" role="HbMenu:addAction"/>
+            <ref object="actionExit" role="HbMenu:addAction"/>
+        </widget>
+        <widget name="viewToolbar" role="HbView:toolBar" type="HbToolBar">
+            <ref object="actionStartProfiling" role="HbToolBar:addAction"/>
+            <ref object="actionSettings" role="HbToolBar:addAction"/>
+        </widget>
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <widget name="listPlugins" type="HbListWidget">
+                <sizehint height="32.53731un" type="PREFERRED" width="51.04478un"/>
+                <bool name="visible" value="TRUE"/>
+            </widget>
+            <real name="z" value="0"/>
+            <layout type="anchor">
+                <anchoritem dst="listPlugins" dstEdge="LEFT" spacing="5" src="" srcEdge="LEFT"/>
+                <anchoritem dst="listPlugins" dstEdge="RIGHT" spacing="5" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="listPlugins" dstEdge="TOP" spacing="5" src="" srcEdge="TOP"/>
+                <anchoritem dst="listPlugins" dstEdge="BOTTOM" spacing="5" src="" srcEdge="BOTTOM"/>
+            </layout>
+        </widget>
+        <string name="title" value="PI Profiler"/>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+    </metadata>
+</hbdocument>
+
+<!-- 
+
+Copyright (c) 2010 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: 
+
+
+  --> 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/piprofiler.qrc	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,29 @@
+<!-- 
+
+Copyright (c) 2010 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: 
+
+
+  --> 
+
+<RCC>
+    <qresource prefix="/xml" >
+        <file alias="pimainview.docml" >pimainview.docml</file>
+    </qresource>
+    <qresource prefix="/gfx" >
+        <file alias="piprofiler.svg">../icons/qgn_menu_piprofilerui.svg</file>
+        <file alias="enabled.svg">../icons/qgn_prob_piprofilerui_status_enabled.svg</file>
+        <file alias="disabled.svg">../icons/qgn_prob_piprofilerui_status_disabled.svg</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/rom/piprofilerui_hb.iby	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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 __PROFILERGUI_IBY__
+#define __PROFILERGUI_IBY__
+
+S60_APP_EXE(PIProfilerUI)
+//S60_APP_AIF_ICONS(PIProfilerUI)
+data=ZRESOURCE\apps\PIProfilerUI.mif resource\apps\PIProfilerUI.mif
+data=ZRESOURCE\apps\PIProfilerUI.rsc resource\apps\PIProfilerUI.rsc
+//S60_APP_RESOURCE(PIProfilerUI)
+data=ZPRIVATE\10003a3f\import\apps\PIProfilerUI_reg.rsc private\10003a3f\import\apps\PIProfilerUI_reg.rsc
+
+data=ZPRIVATE\2001E5AE\backup_registration.xml        	private\2001E5AE\backup_registration.xml
+data=ZSYSTEM\Install\PIProfilerUI_stub.sis              system\install\PIProfilerUI_stub.sis
+
+#endif // __PROFILERGUI_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/src/main.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2010 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: 
+*
+*/
+
+
+#include <hbapplication.h>
+#include <hblabel.h>
+#include <hbmainwindow.h>
+#include <hbdocumentloader.h>
+#include <hbview.h>
+#include "pimainview.h"
+#include "piprofilerengine.h"
+#include "notifications.h"
+#include "pimainwindow.h"
+
+// Create custom document loader to be able to use custom views in XML.
+class PIProfilerDocumentLoader: public HbDocumentLoader
+{
+public:
+    virtual QObject *createObject(const QString& type, const QString &name);
+};
+
+int main(int argc, char *argv[])
+{
+
+    // Create application and document loader.
+    HbApplication app(argc, argv);
+    PIProfilerDocumentLoader loader;
+
+    // Create Engine and initialize it
+    PIProfilerEngine engine;
+    if (!engine.init()) {
+        Notifications::showErrorNote(QString("Unable to start PI Profiler engine"));
+        return EXIT_FAILURE;
+    }
+
+    // create and show main window
+    PIMainWindow mainWindow(&engine, loader, &app);
+    mainWindow.show();
+
+    return app.exec();
+}
+
+QObject *PIProfilerDocumentLoader::createObject(const QString& type, const QString &name)
+{
+    // Main view
+    if (type == PIMainView::staticMetaObject.className()) {
+        QObject *object = new PIMainView;
+        object->setObjectName(name);
+        return object;
+    }
+
+    return HbDocumentLoader::createObject(type, name);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/src/notifications.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2010 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: 
+*
+*/
+
+#include <hbmessagebox.h>
+#include <hbpopup.h>
+#include <hbaction.h>
+#include <hblabel.h>
+#include <hbdialog.h>
+#include <hbaction.h>
+#include <hbtextitem.h>
+
+#include "notifications.h"
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showInformationNote(const QString &text)
+{
+    
+    // Create new dialog 
+     HbDialog *infoNote = new HbDialog();
+     infoNote->setAttribute(Qt::WA_DeleteOnClose);
+
+     // set dismiss policy
+     infoNote->setTimeout(0); //
+
+     // create text item for popup
+     HbTextItem *label = new HbTextItem(text, infoNote);
+     label->setAlignment(Qt::AlignCenter);
+     infoNote->setContentWidget(label);
+     infoNote->setPrimaryAction(new HbAction("Ok"));
+
+     infoNote->show();
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showMessageBox(const QString &text)
+{
+    HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation );
+    note->setAttribute(Qt::WA_DeleteOnClose);
+    note->setTimeout(0);
+    note->setText(text);
+    note->show();
+
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showErrorNote(const QString &text)
+{
+    HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeWarning );
+    note->setAttribute(Qt::WA_DeleteOnClose);
+    note->setTimeout(0);
+    note->setText(text);
+    note->show();
+
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/src/pimainview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,565 @@
+/*
+* Copyright (c) 2010 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: 
+*
+*/
+
+
+#include <hbdocumentloader.h>
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+#include <hbaction.h>
+#include <qgraphicslayout.h>
+#include <qvariant.h>
+#include <qobject.h>
+#include <qlist.h>
+#include <hbmessagebox.h>
+#include <hblabel.h>
+#include <hbwidget.h>
+#include <qstringlist.h>
+#include <qsignalmapper.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
+#include <hbmenu.h>
+#include <hbtoolbar.h>
+#include <hbdialog.h>
+#include <hbprogressdialog.h>
+#include <hbtextitem.h>
+#include <hbindicator.h>
+#include <qdebug.h>
+
+#include "pimainview.h"
+#include "piprofilerengine.h"
+#include "notifications.h"
+#include "pimainwindow.h"
+
+const char *INVALIDCONFIGURATIONFILE = "Invalid configuration file";
+const char *APPLICATIONNAME = "PI Profiler";
+
+// actions that are found from xml
+const char *ACTIONEXIT = "actionExit";
+const char *ACTIONSTARTPROFILING = "actionStartProfiling";
+const char *ACTIONSTARTTIMEDPROFILING = "actionStartTimedProfiling";
+const char *ACTIONSETTINGS = "actionSettings";
+const char *ACTIONABOUT = "actionAbout";
+
+// UI components that are found from xml
+
+const char *LISTWIDGETPLUGINS = "listPlugins";
+const char *TEXTMANDATORYPLUGINS = "Mandatory plug-ins:";
+const char *TEXTOPTIONALPLUGINS = "Optional plug-ins:";
+
+// ---------------------------------------------------------------------------
+
+PIMainView::PIMainView() :
+    application(0), mMainWindow(0), mEngine(0), mPluginList(0), mContextMenu(0), mActionExit(0),
+        mActionExitAndLeaveProfilingOn(0), mActionAbout(0), mActionStartTimedProfiling(0),
+        mActionSettings(0), mActionStopProfiling(0), mListPlugins(0), mProfilingNote(0)
+{
+
+}
+
+// ---------------------------------------------------------------------------
+
+PIMainView::~PIMainView()
+{
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::init(PIMainWindow *mainWindow, HbApplication* app, HbDocumentLoader &loader,
+    PIProfilerEngine *engine)
+{
+
+    application = app;
+    mMainWindow = mainWindow;
+
+    // Load items from xml file
+    loadItemsFromResources(loader);
+
+    // Set list widget items
+    mListPlugins->setLongPressEnabled(true);
+    mListPlugins->setClampingStyle(HbScrollArea::BounceBackClamping);
+    mListPlugins->setFrictionEnabled(true);
+
+    // Create stop profiling action
+    mActionStopProfiling = new HbAction("Stop Profiling", this);
+
+    // Create exit and leave profiling on action
+    mActionExitAndLeaveProfilingOn = new HbAction("Close UI\n(Continue profiling)", this);
+
+    mEngine = engine;
+
+    // Connect signals and slots
+    this->connectSignalsAndSlots(app);
+
+    // Create icons
+    mIconDisabled = HbIcon(":/gfx/disabled.svg");
+    mIconEnabled = HbIcon(":/gfx/enabled.svg");
+
+    // update timed profiling text according to settings
+    updateTimedProfilingText();
+}
+
+// ---------------------------------------------------------------------------
+
+
+void PIMainView::connectSignalsAndSlots(HbApplication* app)
+{
+
+    // Menu items:
+    connect(mActionExit, SIGNAL(triggered()), app, SLOT( quit() ));
+    connect(mActionSettings, SIGNAL(triggered()), this, SLOT( openSettingsView() ));
+    connect(mActionAbout, SIGNAL(triggered()), this, SLOT( showAboutPopup() ));
+    connect(mActionStartProfiling, SIGNAL(triggered()), this, SLOT( startProfiling() ));
+    connect(mActionStartTimedProfiling, SIGNAL(triggered()), this, SLOT( startTimedProfiling() ));
+
+    // List widget actions
+    connect(mListPlugins, SIGNAL(activated(HbListWidgetItem*)), this,
+        SLOT(enableOrDisablePlugin(HbListWidgetItem*)));
+    connect(mListPlugins, SIGNAL(longPressed(HbListWidgetItem*, QPointF)), this,
+        SLOT(showContexMenu(HbListWidgetItem*, QPointF)));
+
+    connect(
+        mEngine,
+        SIGNAL(profilingStatusChanged(ProfilerEngineStatus, const QString&, ProfilingMode, ProfilingOutput)),
+        this,
+        SLOT(profilingStatusChanged(ProfilerEngineStatus, const QString&, ProfilingMode, ProfilingOutput)));
+
+    connect(mMainWindow, SIGNAL(returnedFromSettings()), this, SLOT( updateTimedProfilingText() ));
+    connect(mActionExitAndLeaveProfilingOn, SIGNAL(triggered()), this,
+        SLOT( exitAndLeaveProfilingOn() ));
+    connect(mActionStopProfiling, SIGNAL(triggered()), this, SLOT( stopProfiling() ));
+
+}
+
+// ---------------------------------------------------------------------------
+
+
+void PIMainView::loadItemsFromResources(HbDocumentLoader &loader)
+{
+
+    // ACTIONS:
+
+    // Exit
+    QObject *object = loader.findObject(ACTIONEXIT);
+    Q_ASSERT_X((object != 0), APPLICATIONNAME, INVALIDCONFIGURATIONFILE);
+    this->mActionExit = qobject_cast<HbAction *> (object);
+
+    // About
+    object = loader.findObject(ACTIONABOUT);
+    Q_ASSERT_X((object != 0), APPLICATIONNAME, INVALIDCONFIGURATIONFILE);
+    this->mActionAbout = qobject_cast<HbAction *> (object);
+
+    // Settings
+    object = loader.findObject(ACTIONSETTINGS);
+    Q_ASSERT_X((object != 0), APPLICATIONNAME, INVALIDCONFIGURATIONFILE);
+    this->mActionSettings = qobject_cast<HbAction *> (object);
+
+    // Start profiling
+    object = loader.findObject(ACTIONSTARTPROFILING);
+    Q_ASSERT_X((object != 0), APPLICATIONNAME, INVALIDCONFIGURATIONFILE);
+    this->mActionStartProfiling = qobject_cast<HbAction *> (object);
+
+    // Start timed profiling
+    object = loader.findObject(ACTIONSTARTTIMEDPROFILING);
+    Q_ASSERT_X((object != 0), APPLICATIONNAME, INVALIDCONFIGURATIONFILE);
+    this->mActionStartTimedProfiling = qobject_cast<HbAction *> (object);
+
+    QGraphicsWidget *widget = loader.findWidget(LISTWIDGETPLUGINS);
+    Q_ASSERT_X((widget != 0), "Launcher", "Invalid launcher.xml file");
+    this->mListPlugins = qobject_cast<HbListWidget *> (widget);
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::showAboutPopup()
+{
+
+    Notifications::showMessageBox("Version 2.2.0.2 - 4th May 2010. \n"
+            "Copyright © 2010 Nokia Corporation "
+            "and/or its subsidiary(-ies). "
+            "All rights reserved.");
+
+}
+// ---------------------------------------------------------------------------
+
+void PIMainView::setPluginList(QList<PluginAttributes> *pluginList)
+{
+
+    this->mPluginList = pluginList;
+    this->updatePlugInLists();
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::openSettingsView()
+{
+    mMainWindow->activateSettingsView();
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::updatePlugInLists()
+{
+
+    mListPlugins->clear();
+
+    // Create Compulsory and Optional labels into list widget:
+    HbListWidgetItem *compulsory = new HbListWidgetItem();
+    compulsory->setText(TEXTMANDATORYPLUGINS);
+    mListPlugins->addItem(compulsory);
+
+    HbListWidgetItem *optional = new HbListWidgetItem();
+    optional->setText(TEXTOPTIONALPLUGINS);
+    mListPlugins->addItem(optional);
+
+    HbIcon *icon;
+
+    // Go thru pluginlist and add list item for each plug-in into list widget 
+    for (int index = 0; index < mPluginList->size(); index++) {
+        QString plugInName = mPluginList->at(index).mName;
+
+        // get icon for item 
+        if (mPluginList->at(index).mEnabled) {
+            icon = &mIconEnabled;
+        }
+        else {
+            icon = &mIconDisabled;
+        }
+
+        // Create list widget item
+        // TODO ensure that this does not leak memory
+        HbListWidgetItem *newItem = new HbListWidgetItem();
+        newItem->setIcon(*icon);
+        newItem->setText(plugInName);
+        newItem->setData(mPluginList->at(index).mUid);
+
+        // check if plug-in is compulsory or optional
+        if (mPluginList->at(index).mIsHidden) {
+            mListPlugins->insertItem(mListPlugins->row(optional), newItem);
+        }
+        else {
+            mListPlugins->addItem(newItem);
+
+        }
+    }
+
+}
+// ---------------------------------------------------------------------------
+
+void PIMainView::enableOrDisablePlugin(HbListWidgetItem *widget)
+{
+
+    // if widget is not found, set currently highlighted item as widget
+    // (in that case this method is called from context menu)
+    if (widget == 0) {
+        widget = mListPlugins->currentItem();
+    }
+
+    // if this method is called from list widget's activated signal, do nothing
+    // if context menu is open.
+    else {
+        if (mContextMenu != 0) {
+            return;
+        }
+    }
+    bool ok = false;
+    int widgetUid = widget->data().toInt(&ok);
+    if (!ok) {
+        qWarning("PIProfiler: Unable to find plug-in uid");
+        return;
+    }
+
+    // go thru plug-in array and find checked plug-in
+    for (int index = 0; index < mPluginList->size(); index++) {
+
+        if (mPluginList->at(index).mUid == widgetUid) {
+            PluginAttributes pluginAttributes = mPluginList->at(index);
+
+            // if plug-in is hidden it cannot be disabled
+            if (pluginAttributes.mIsHidden) {
+                return;
+            }
+
+            // change enable status and set icon correct
+            if (pluginAttributes.mEnabled) {
+                pluginAttributes.mEnabled = false;
+                widget->setIcon(mIconDisabled);
+            }
+            else {
+                pluginAttributes.mEnabled = true;
+                widget->setIcon(mIconEnabled);
+            }
+
+            // save plug-in settings
+            if (mEngine->savePluginSettings(pluginAttributes)) {
+                mPluginList->replace(index, pluginAttributes);
+            }
+            else {
+                // if saving operation failed, revert icon back
+                if (pluginAttributes.mEnabled) {
+                    widget->setIcon(mIconEnabled);
+                }
+                else {
+                    pluginAttributes.mEnabled = true;
+                    widget->setIcon(mIconDisabled);
+                }
+                Notifications::showErrorNote(
+                    "Error occured while saving settings to Profiler engine.");
+            }
+            break;
+        }
+
+    }
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::showContexMenu(HbListWidgetItem *widget, const QPointF &point)
+{
+
+    bool ok = false;
+    int uid = widget->data().toInt(&ok);
+
+    if (!ok) {
+        return;
+    }
+
+    for (int index = 0; index < mPluginList->size(); index++) {
+
+        if (mPluginList->at(index).mUid == uid) {
+
+            // Create Context menu:
+            mContextMenu = new HbMenu();
+            mContextMenu->setPreferredPos(point, HbPopup::TopLeftCorner);
+            mContextMenu->setDismissPolicy(HbPopup::TapOutside);
+            mContextMenu->setAttribute(Qt::WA_DeleteOnClose);
+
+            // Enable/disable plug-in
+            if (!mPluginList->at(index).mIsHidden) {
+                HbAction *enableAction;
+                if (mPluginList->at(index).mEnabled) {
+                    enableAction = mContextMenu->addAction(QString("Disable"));
+                }
+                else {
+                    enableAction = mContextMenu->addAction(QString("Enable"));
+                }
+                connect(enableAction, SIGNAL(triggered()), this, SLOT( enableOrDisablePlugin() ));
+            }
+
+            //FIXME take these into use once expanding and collapsing data form groups works. 
+            // Plug-in specific settings 
+            /*if (mPluginList->at(index).mItemCount != 0 || mPluginList->at(index).mSampleRate != -1) {
+             HbAction *pluginSettingsAction = mContextMenu->addAction(QString(
+             "Plug-in settings"));
+             connect(pluginSettingsAction, SIGNAL(triggered()), this,
+             SLOT(openPluginSpecificSettings()));
+             }*/
+
+            // Plug in info
+            HbAction *infoAction = mContextMenu->addAction(QString("Plug-in info"));
+            connect(infoAction, SIGNAL(triggered()), this, SLOT( openSampleInfo() ));
+
+            connect(mContextMenu, SIGNAL(aboutToClose()), this, SLOT( contextMenuClosed() ));
+            mContextMenu->open(this, SLOT(contextMenuClosed()));
+            break;
+        }
+    }
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::openSampleInfo()
+{
+
+    // Show plug-in specific info
+    bool ok = false;
+    int uid = mListPlugins->currentItem()->data().toInt(&ok);
+    if (!ok) {
+        return;
+    }
+    Notifications::showInformationNote(this->getPluginAttributes(uid).mDescription);
+}
+// ---------------------------------------------------------------------------
+
+PluginAttributes PIMainView::getPluginAttributes(int uid)
+{
+    // Get plug-in attributes from the plug-in list based on uid number
+    for (int index = 0; index < mPluginList->size(); index++) {
+        if (mPluginList->at(index).mUid == uid) {
+            return mPluginList->at(index);
+        }
+    }
+    return PluginAttributes();
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::contextMenuClosed()
+{
+    mContextMenu = 0;
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::startProfiling()
+{
+
+    showProfilingNote();
+    if (!mEngine->startProfiling()) {
+        Notifications::showErrorNote("Unable to start profiling");
+        mProfilingNote->close();
+        mProfilingNote = 0;
+    }
+}
+
+// ---------------------------------------------------------------------------
+void PIMainView::startTimedProfiling()
+{
+    showProfilingNote();
+    if (!mEngine->startTimedProfiling()) {
+        Notifications::showErrorNote("Unable to start profiling");
+        mProfilingNote->close();
+        mProfilingNote = 0;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+
+void PIMainView::stopProfiling()
+{
+    mProfilingNote = 0;
+    mEngine->stopProfiling();
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::profilingStatusChanged(ProfilerEngineStatus status, const QString &text,
+    ProfilingMode profilingMode, ProfilingOutput outputMode)
+{
+
+    if (status == PI_FINISHED_SUCCEFULLY) {
+        // Profiling finished successfully
+
+        // close profiling note
+        if (mProfilingNote != 0) {
+            mProfilingNote->close();
+            mProfilingNote = 0;
+        }
+
+        // Show info text
+        Notifications::showInformationNote(text);
+        return;
+    }
+
+    if (mProfilingNote == 0) {
+        // if profiling note is not yet shown, create it
+        showProfilingNote();
+    }
+
+    if (status == PI_ERROR) {
+        // if errors occured, close profiling note and show error message
+        if (mProfilingNote != 0) {
+            mProfilingNote->close();
+            mProfilingNote = 0;
+        }
+        Notifications::showErrorNote(text);
+    }
+
+    else if (status == PI_PROFILING) {
+        // if profiling is on-going, update info text according to output:
+
+        HbLabel *titleLabel = new HbLabel("Profiling...", mProfilingNote);
+        titleLabel->setAlignment(Qt::AlignCenter);
+
+        HbTextItem *textItem = new HbTextItem(text, mProfilingNote);
+        textItem->setAlignment(Qt::AlignCenter);
+
+        mProfilingNote->setHeadingWidget(titleLabel);
+        mProfilingNote->setContentWidget(textItem);
+    }
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::showProfilingNote()
+{
+    // Create new dialog 
+    mProfilingNote = new HbDialog();
+    mProfilingNote->setAttribute(Qt::WA_DeleteOnClose);
+
+    // Make it modal.
+    mProfilingNote->setModal(true);
+
+    // set dismiss policy
+    mProfilingNote->setDismissPolicy(HbPopup::NoDismiss);
+    mProfilingNote->setTimeout(0); //
+    mProfilingNote->setBackgroundFaded(true);
+
+    // create label and text item for popup
+    HbTextItem *titleLabel = new HbTextItem("Profiling...", mProfilingNote);
+    HbTextItem *label = new HbTextItem("Starting to profile", mProfilingNote);
+
+    label->setAlignment(Qt::AlignCenter);
+    titleLabel->setAlignment(Qt::AlignCenter);
+    mProfilingNote->setHeadingWidget(titleLabel);
+    mProfilingNote->setContentWidget(label);
+
+    // set actions
+    mProfilingNote->setPrimaryAction(mActionStopProfiling);
+    mProfilingNote->setSecondaryAction(mActionExitAndLeaveProfilingOn);
+
+    mProfilingNote->open();
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::updateTimedProfilingText()
+{
+    QString text = "Start timed profiling(";
+    QString number;
+    number.setNum(mEngine->getTimeLimit(), 10);
+    text.append(number);
+    text.append("s)");
+    mActionStartTimedProfiling->setText(text);
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PIMainView::exitAndLeaveProfilingOn()
+{
+    mEngine->leaveProfilingOnAfterClosing();
+    application->quit();
+}
+// ---------------------------------------------------------------------------
+
+void PIMainView::openPluginSpecificSettings()
+{
+    HbListWidgetItem *listItem = mListPlugins->currentItem();
+    bool ok = false;
+    int uid = listItem->data().toInt(&ok);
+    if (ok) {
+        mMainWindow->activateSettingsView(uid);
+    }
+}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/src/pimainwindow.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2010 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: 
+*
+*/
+
+
+// System include
+#include <QDebug>
+#include <hbaction.h>
+#include <hbdocumentloader.h>
+#include <hbapplication.h>
+#include <hbicon.h>
+#include <hbprogressdialog.h>
+
+// User includes
+#include "pimainwindow.h"
+//#include "mcsendengine.h"
+#include "pimainview.h"
+#include "pisettingsview.h"
+#include "generalattributes.h"
+#include "piprofilerengine.h"
+#include "notifications.h"
+
+// xml definition of view
+const char *PI_MAINVIEW_XML = ":/xml/pimainview.docml";
+
+// name of the application view object in the xml file.
+const char *APPLICATIONVIEW = "PIMainView";
+
+// ViewManager Constructor
+PIMainWindow::PIMainWindow(PIProfilerEngine* engine, HbDocumentLoader &loader, HbApplication *app) :
+    mEngine(engine), mMainView(0), mSettingsView(0), mBackAction(0)
+{
+
+    HbProgressDialog *note = new HbProgressDialog(HbProgressDialog::WaitDialog);
+    note->setAttribute(Qt::WA_DeleteOnClose);
+    note->setText("Loading PI Profiler plug-ins...");
+    note->open();
+
+    // Add the views to the main window
+    addMainView(loader, app);
+    addSettingsView();
+
+    // Set main view to be displayed on startup
+    activateMainView();
+
+    connect(mEngine, SIGNAL(pluginListUpdated(QList<PluginAttributes>&)), this,
+        SLOT(setPluginList(QList<PluginAttributes>&)));
+
+    QMetaObject::connectSlotsByName(this);
+
+    mEngine->notifyUIReady();
+
+    note->close();
+
+}
+
+PIMainWindow::~PIMainWindow()
+{
+    if (mMainView != 0) {
+        delete mMainView;
+        mMainView = 0;
+    }
+    if (mSettingsView != 0) {
+        delete mSettingsView;
+        mSettingsView = 0;
+    }
+
+}
+
+// Methods to add views to the main window
+
+void PIMainWindow::addMainView(HbDocumentLoader &loader, HbApplication *app)
+{
+    // Load xml-file
+    bool ok = false;
+    loader.load(PI_MAINVIEW_XML, &ok);
+
+    // Load Application View:
+    QGraphicsWidget *widget = loader.findWidget(APPLICATIONVIEW);
+    Q_ASSERT_X(ok && (widget != 0), "PIProfiler", "Invalid docml file");
+    mMainView = qobject_cast<PIMainView *> (widget);
+
+    mMainView->init(this, app, loader, mEngine);
+
+    // Add view to main window
+    this->addView(mMainView);
+
+}
+
+void PIMainWindow::addSettingsView()
+{
+    mSettingsView = new PISettingsView(mEngine);
+    mBackAction = new HbAction("back", this);
+
+    bool value = connect(mBackAction, SIGNAL(triggered()), this, SLOT(settingsViewClosed()));
+    mSettingsView->setNavigationAction(mBackAction);
+    mSettingsView->navigationAction()->setIcon(HbIcon(":/gfx/enabled.svg"));
+    addView(mSettingsView);
+}
+
+// Slots to handle view change
+void PIMainWindow::activateMainView()
+{
+    setCurrentView(mMainView);
+}
+
+void PIMainWindow::activateSettingsView(int uid)
+{
+    if (uid != 0) {
+        mSettingsView->expandPluginGroup(uid);
+    }
+    setCurrentView(mSettingsView);
+}
+
+void PIMainWindow::settingsViewClosed()
+{
+    if (currentView() == mSettingsView) {
+        bool error = false;
+        if (!mEngine->saveGeneralSettings(mSettingsView->getGeneralAttributes())) {
+            error = true;
+        }
+
+        mSettingsView->readPluginSettings();
+
+        for (int index = 0; index < mPluginAttributes.size(); index++) {
+            if (!mEngine->savePluginSettings(mPluginAttributes.at(index))) {
+                error = true;
+            }
+        }
+
+        if (error) {
+            Notifications::showErrorNote("Unable to save some of the settings into engine");
+        }
+        activateMainView();
+        emit returnedFromSettings();
+    }
+    else {
+        qWarning("Back action is not triggered at the correct view!");
+    }
+}
+
+void PIMainWindow::setPluginList(QList<PluginAttributes> &pluginList)
+{
+    mPluginAttributes = pluginList;
+    mMainView->setPluginList(&mPluginAttributes);
+    mSettingsView->setPluginSettings(&mPluginAttributes);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/src/piprofilerengine.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2010 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: 
+*
+*/
+
+
+#include "piprofilerengine.h"
+#include "piprofilerengineprivate.h"
+
+PIProfilerEngine::PIProfilerEngine()
+{
+
+}
+
+PIProfilerEngine::~PIProfilerEngine()
+{
+    if (mPrivate != 0) {
+        delete mPrivate;
+        mPrivate = 0;
+    }
+}
+
+bool PIProfilerEngine::init()
+{
+    mPrivate = new PIProfilerEnginePrivate(this);
+    return mPrivate->Init();
+}
+
+void PIProfilerEngine::getGeneralSettings(GeneralAttributes &settings)
+{
+    mPrivate->GetGeneralSettings(settings);
+}
+
+void PIProfilerEngine::notifyUIReady()
+{
+    mPrivate->NotifyUIReady();
+}
+
+bool PIProfilerEngine::saveGeneralSettings(GeneralAttributes &settings)
+{
+    return mPrivate->SaveGeneralSettings(settings);
+
+}
+
+bool PIProfilerEngine::savePluginSettings(const PluginAttributes &pluginAttributes)
+{
+    return mPrivate->SavePluginSettings(pluginAttributes);
+}
+
+bool PIProfilerEngine::startProfiling()
+{
+    return mPrivate->StartProfiling();
+}
+bool PIProfilerEngine::startTimedProfiling()
+{
+    return mPrivate->StartTimedProfiling();
+}
+void PIProfilerEngine::stopProfiling()
+{
+    return mPrivate->StopProfiling();
+}
+
+int PIProfilerEngine::getTimeLimit()
+{
+    return mPrivate->GetTimeLimit();
+}
+
+void PIProfilerEngine::leaveProfilingOnAfterClosing()
+{
+    mPrivate->LeaveProfilingOnAfterClosing();
+}
+
+bool PIProfilerEngine::checkTraceLocationSanity(QString &location)
+{
+    mPrivate->CheckTraceLocationSanity(location);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/src/piprofilerengineprivate.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,678 @@
+/*
+* Copyright (c) 2010 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: 
+*
+*/
+
+
+#include <e32std.h>
+#include <qstring.h>
+#include <qlist.h>
+#include <qstringlist.h>
+#include <f32file.h>
+#include <xqconversions.h>
+#include <utf.h>
+#include <bautils.h>
+#include <sysutil.h>
+#include "piprofilerengineprivate.h"
+#include <piprofiler/ProfilerSession.h>
+#include "pluginattributes.h"
+#include "generalattributes.h"
+#include "piprofilerengine.h"
+
+// literals for default general setting values
+_LIT8(KTraceOutput, "file_system");
+_LIT8(KTraceDebugOutput, "debug_output");
+_LIT8(KProfilerDefaultDrive, "E:\\data");
+_LIT8(KProfilerDefaultPrefix, "Profiler_#");
+_LIT(KProfilerEngineExe, "PIProfilerEngine.exe");
+const TInt KProfilerDefaultTimedSamplingPeriod = 60; // Sampling time in seconds  
+
+// ---------------------------------------------------------------------------
+
+PIProfilerEnginePrivate::PIProfilerEnginePrivate(PIProfilerEngine *aEngine) :
+    iPublic(aEngine), iSamplerAttributes(0), iStatusChecker(0), iLeaveProfilingOnAfterClosing(
+        EFalse)
+{
+
+}
+
+// ---------------------------------------------------------------------------
+
+PIProfilerEnginePrivate::~PIProfilerEnginePrivate()
+{
+
+    // remove profiler client
+    RProfiler::RemoveClient();
+    // Terminate engine in case it is running.
+    if (iLeaveProfilingOnAfterClosing == EFalse) {
+        terminateEngine();
+    }
+
+    // delete sampler attributes.
+    if (iSamplerAttributes) {
+        delete iSamplerAttributes;
+        iSamplerAttributes = 0;
+    }
+
+    if (iStatusChecker) {
+        iStatusChecker->Cancel();
+        delete iStatusChecker;
+        iStatusChecker = NULL;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+bool PIProfilerEnginePrivate::Init()
+{
+    TRAPD(error, this->LaunchEngineL());
+    if (error != KErrNone) {
+        return false;
+    }
+
+    // initialize attribute arrays
+
+    TRAP(error, iSamplerAttributes = new (ELeave) CArrayFixFlat<TSamplerAttributes> (20)); // max sampler count is 20
+    if (error != KErrNone) {
+        return false;
+    }
+
+    // engine status checker
+    TRAP(error, iStatusChecker = CProfilerEngineStatusChecker::NewL());
+    if (error != KErrNone) {
+        return false;
+    }    
+
+    iStatusChecker->SetObserver(this);
+
+    TRAP(error, LoadGeneralSettingsL());
+    if (error != KErrNone) {
+        return false;
+    }
+
+    return true;
+}
+
+// ---------------------------------------------------------------------------
+
+
+int PIProfilerEnginePrivate::LaunchEngineL()
+{
+
+    TRequestStatus stat = KRequestPending;
+    RProcess proc;
+
+    TInt err(KErrNone);
+
+    // check if process exists
+    err = FindProcessL(proc);
+
+    // check if already exists and don't start a new eshell profiling
+    if (err == KErrNotFound) {
+        // try create new process
+        err = proc.Create(KProfilerEngineExe, _L(""));
+
+        // check if RProcess::Create() succeeded
+        if (err == KErrNone) {
+            // Trigger rendezvous on the supplied TRequestStatus object
+            proc.Rendezvous(stat);
+
+            // kick off the engine process
+            proc.Resume();
+
+            // wait for the constructor to complete 
+            User::WaitForRequest(stat);
+
+            // just lose the handle
+            proc.Close();
+        }
+    }
+
+    // Increase the client reference count in server:
+    AttachClient();
+}
+
+// ---------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::AttachClient()
+{
+    RProfiler::AttachClient();
+}
+// ---------------------------------------------------------------------------
+
+int PIProfilerEnginePrivate::FindProcessL(RProcess& aProc)
+{
+    TProcessId engId;
+    TFindProcess procName;
+    procName.Find(_L("PIProfilerEngine.exe*"));
+    TFullName aResult;
+    TFullName aResult2;
+    TInt err(KErrNone);
+
+    // find the first appearance
+    err = procName.Next(aResult);
+    if (err != KErrNone) {
+        // did not find any engine process
+        return err;
+    }
+    else {
+        err = aProc.Open(procName);
+        if (err == KErrNone) {
+            if (aProc.ExitCategory().Length() > 0) {
+                aProc.Close();
+                // process already exited => create a new one
+                return KErrNotFound;
+            }
+            aProc.Close();
+        }
+    }
+
+    // check now if a second appearance exists in process list, 
+    // i.e. engine started from eshell => two engine processes appear in normal case
+    procName.Next(aResult2);
+
+    // check if aResult2 contained the second appearance of profiler engine
+    if(aResult2.CompareF(aResult) > 0)
+        {
+        // other process found, i.e. right process to communicate with, in case started from eshell
+        err = aProc.Open(procName);
+        if(err == KErrNone)
+            {
+            if(aProc.ExitCategory().Length() > 0)
+                {
+                // process already exited => create a new one
+                return KErrNotFound;
+                }
+            aProc.Close();
+            }
+        }
+
+    return err;
+}
+
+// ---------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::terminateEngine()
+{
+    // exit profiler engine 
+    RProfiler::ExitProfiler();
+}
+// ---------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::NotifyUIReady()
+{
+    // load initial plugins
+    loadPlugins();
+
+    // get the initial state
+    int initialState = iStatusChecker->GetInitialState();
+    if (initialState == ERunning) {
+        HandleProfilerStatusChange(ERunning);
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+
+void PIProfilerEnginePrivate::loadPlugins()
+{
+    // get samplers from Profiler Engine (client-server session) 
+    // and add the to the samplers list for the first time
+    LOGTEXT(_L("CProfilerGuiModel::LoadPlugins - get sampler plugins"));
+
+    TInt err = RProfiler::GetSamplerAttributes(*iSamplerAttributes);
+
+    // check if engine provided a list of samplers
+    if (err != KErrNone) {
+        // could not get samplers from engine
+        LOGTEXT(_L("CProfilerGuiModel::LoadPlugins - failed to connect engine"));
+    }
+    else {
+        LOGTEXT(_L("CProfilerGuiModel::LoadPlugins - adding new samplers into view"));
+        addNewSamplers(*iSamplerAttributes);
+    }LOGTEXT(_L("CProfilerGuiModel::LoadPlugins - exit"));
+}
+// ---------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::addNewSamplers(CArrayFixFlat<TSamplerAttributes>& aAttributes)
+{
+    TSamplerAttributes item;
+
+    TInt count(aAttributes.Count());
+
+    // loop the attribute array and insert them into view list
+
+    QList<PluginAttributes> samplerList;
+
+    for (TInt i(0); i < count; i++) {
+        // get a TSamplerAttributes from list at a time  
+        item = aAttributes.At(i);
+
+        PluginAttributes samplerAttributes;
+        convertTSamplerAttributesToPluginAttributes(item, samplerAttributes);
+
+        samplerList.append(samplerAttributes);
+    }
+
+    emit iPublic->pluginListUpdated(samplerList);
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::convertTSamplerAttributesToPluginAttributes(
+    TSamplerAttributes &tSamplerAttributes, PluginAttributes &samplerAttributes)
+{
+
+    samplerAttributes.mUid = tSamplerAttributes.iUid;
+    samplerAttributes.mSampleRate = tSamplerAttributes.iSampleRate;
+    samplerAttributes.mEnabled = tSamplerAttributes.iEnabled;
+    samplerAttributes.mIsHidden = tSamplerAttributes.iIsHidden;
+    samplerAttributes.mItemCount = tSamplerAttributes.iItemCount;
+
+    TBuf16<8> temp8;
+    temp8.Copy(tSamplerAttributes.iShortName);
+    samplerAttributes.mShortName = QString((QChar*) temp8.Ptr(), temp8.Length());
+
+    TBuf16<64> temp64;
+    temp64.Copy(tSamplerAttributes.iName);
+    samplerAttributes.mName = QString((QChar*) temp64.Ptr(), temp64.Length());
+
+    TBuf16<256> temp256;
+    temp256.Copy(tSamplerAttributes.iDescription);
+    samplerAttributes.mDescription = QString((QChar*) temp256.Ptr(), temp256.Length());
+
+    convertTSettingItemToSettingItem(tSamplerAttributes.iSettingItem1,
+        samplerAttributes.mSettingItem1);
+    convertTSettingItemToSettingItem(tSamplerAttributes.iSettingItem2,
+        samplerAttributes.mSettingItem2);
+    convertTSettingItemToSettingItem(tSamplerAttributes.iSettingItem3,
+        samplerAttributes.mSettingItem3);
+    convertTSettingItemToSettingItem(tSamplerAttributes.iSettingItem4,
+        samplerAttributes.mSettingItem4);
+    convertTSettingItemToSettingItem(tSamplerAttributes.iSettingItem5,
+        samplerAttributes.mSettingItem5);
+    convertTSettingItemToSettingItem(tSamplerAttributes.iSettingItem6,
+        samplerAttributes.mSettingItem6);
+}
+
+// ---------------------------------------------------------------------------
+
+bool PIProfilerEnginePrivate::SavePluginSettings(const PluginAttributes &samplerAttributes)
+{
+    for (int index = 0; index < iSamplerAttributes->Count(); index++) {
+        if (samplerAttributes.mUid == this->iSamplerAttributes->At(index).iUid) {
+            iSamplerAttributes->At(index).iEnabled = samplerAttributes.mEnabled;
+            iSamplerAttributes->At(index).iSampleRate = samplerAttributes.mSampleRate;
+
+            convertSettingItemToTSettingItem(this->iSamplerAttributes->At(index).iSettingItem1,
+                samplerAttributes.mSettingItem1);
+            convertSettingItemToTSettingItem(this->iSamplerAttributes->At(index).iSettingItem2,
+                samplerAttributes.mSettingItem2);
+            convertSettingItemToTSettingItem(this->iSamplerAttributes->At(index).iSettingItem3,
+                samplerAttributes.mSettingItem3);
+            convertSettingItemToTSettingItem(this->iSamplerAttributes->At(index).iSettingItem4,
+                samplerAttributes.mSettingItem4);
+            convertSettingItemToTSettingItem(this->iSamplerAttributes->At(index).iSettingItem5,
+                samplerAttributes.mSettingItem5);
+            convertSettingItemToTSettingItem(this->iSamplerAttributes->At(index).iSettingItem6,
+                samplerAttributes.mSettingItem6);
+
+            TSamplerAttributes attr = iSamplerAttributes->At(index);
+
+            if (RProfiler::SetSamplerAttributes(this->iSamplerAttributes->At(index)) == KErrNone) {
+                return true;
+            }
+            else {
+                return false;
+            }
+        }
+    }
+    return false;
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::StartAllSamplerItemsL(TProfilingMode aProfilingMode)
+{
+    TBuf<256> activeWriterDes;
+    TBuf8<256> writer8;
+
+    //iState = MProfilerStatusObserver::EInitializing;
+
+    RProfiler::TProfilingMode profilingMode = aProfilingMode == EProfilingModeTimed
+        ? RProfiler::EProfilingModeTimed : RProfiler::EProfilingModeNormal;
+
+    // try to start profiling process through client-server interface
+    if (RProfiler::StartSampling(profilingMode) == KErrNotFound) {
+        // profiler stopped (e.g. from eshell) and must be restarted 
+        LaunchEngineL();
+        // try to launch sampling again
+        RProfiler::StartSampling(profilingMode);
+    }
+}
+
+// ---------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::StopProfiling()
+{
+    // Stop profiling process through CS session
+    RProfiler::StopSampling();
+
+}
+
+// --------------------------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::HandleProfilerStatusChange(KProfilerStatus aStatus)
+{
+    if (aStatus == EIdle || aStatus == ERunning) {
+
+        if (iGeneralAttributes.iTraceOutput == KTraceOutput) {
+
+            TBuf<256> buf;
+            // get profiler file name 
+            TBool valu = RProfiler::GetFileName(buf);
+
+            QString filename = QString((QChar*) buf.Ptr(), buf.Length());
+
+            // Let ui know that status has changed
+
+            if (aStatus == EIdle) {
+                QString text = QString("Wrote trace data to: \n");
+                text.append(filename);
+                emit iPublic->profilingStatusChanged(PI_FINISHED_SUCCEFULLY, text,
+                    PI_PROFILINGMODENORMAL, PI_FILE_OUTPUT);
+            }
+            else if (aStatus == ERunning) {
+                QString text = QString("Writing trace data to: \n");
+                text.append(filename);
+                emit iPublic->profilingStatusChanged(PI_PROFILING, text, PI_PROFILINGMODENORMAL,
+                    PI_FILE_OUTPUT);
+            }
+        }
+        else {
+            // Let ui know that status has changed
+            if (aStatus == EIdle) {
+                emit iPublic->profilingStatusChanged(PI_FINISHED_SUCCEFULLY, QString(
+                    "Wrote trace data to debug output"), PI_PROFILINGMODENORMAL, PI_DEBUG_OUTPUT);
+            }
+            else if (aStatus == ERunning) {
+                emit iPublic->profilingStatusChanged(PI_PROFILING, QString(
+                    "Writing trace data to debug output"), PI_PROFILINGMODENORMAL, PI_DEBUG_OUTPUT);
+            }
+        }
+    }
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::HandleProfilerErrorL(TInt aError)
+{
+    {
+        QString errorMsg = QString("Error: ");
+        QString KNoMemory = QString("Cannot write to file, check settings");
+
+        // message from pwr sampler
+        if (aError < -1000) {
+            errorMsg.append(QString("Stop other power measurement tools!"));
+        }
+        else if (aError == KErrAlreadyExists || aError == 11) {
+            errorMsg.append(QString("Close old Profiler before start!"));
+        }
+        else if (aError == KErrNotReady) {
+            errorMsg.append(QString("Memory card removed, failed to write!"));
+        }
+        else if (aError == KErrPathNotFound) {
+            errorMsg.append(QString("Given trace data location does not exist"));
+        }
+        else {
+            if (aError == KErrNoMemory || aError == KErrOverflow || aError == KErrDirFull || aError
+                == KErrDiskFull || aError == KErrNotReady) {
+                errorMsg.append(KNoMemory);
+            }
+            else {
+                errorMsg.append(QString("code: "));
+                errorMsg.append(aError);
+            }
+        }
+
+        emit iPublic->profilingStatusChanged(PI_ERROR, errorMsg);
+    }
+
+}
+// ---------------------------------------------------------------------------
+
+bool PIProfilerEnginePrivate::StartProfiling()
+{
+    TRAPD(error, this->StartAllSamplerItemsL(PIProfilerEnginePrivate::EProfilingModeNormal));
+    if (error == KErrNone) {
+        return true;
+    }
+    return false;
+
+}
+
+// ---------------------------------------------------------------------------
+
+bool PIProfilerEnginePrivate::StartTimedProfiling()
+{
+    TRAPD(error, this->StartAllSamplerItemsL(PIProfilerEnginePrivate::EProfilingModeTimed));
+    if (error == KErrNone) {
+        return true;
+    }
+    return false;
+}
+
+// ---------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::convertTGeneralAttributesToGeneralAttributes(
+    TGeneralAttributes &tSamplerAttributes, GeneralAttributes &samplerAttributes)
+{
+    samplerAttributes.mTimedSamplingPeriod = tSamplerAttributes.iTimedSamplingPeriod;
+    int test = tSamplerAttributes.iSaveFileDrive.Length();
+    TBuf16<KPrefixMaxLength> test2;
+    test2.Copy(tSamplerAttributes.iSaveFileDrive);
+    samplerAttributes.mSaveFileDrive = QString((QChar*) test2.Ptr(), test2.Length());
+    test2.Copy(tSamplerAttributes.iTraceFilePrefix);
+    samplerAttributes.mTraceFilePrefix = QString((QChar*) test2.Ptr(), test2.Length());
+    test2.Copy(tSamplerAttributes.iTraceOutput);
+    samplerAttributes.mTraceOutput = QString((QChar*) test2.Ptr(), test2.Length());
+}
+// ---------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::convertGeneralAttributesToTGeneralAttributes(
+    TGeneralAttributes &tSamplerAttributes, GeneralAttributes &samplerAttributes)
+{
+    tSamplerAttributes.iTimedSamplingPeriod = samplerAttributes.mTimedSamplingPeriod;
+
+    tSamplerAttributes.iTraceOutput.Copy(TBuf<KPrefixMaxLength> (
+        samplerAttributes.mTraceOutput.utf16()));
+    tSamplerAttributes.iSaveFileDrive.Copy(TBuf<KPrefixMaxLength> (
+        samplerAttributes.mSaveFileDrive.utf16()));
+    tSamplerAttributes.iTraceFilePrefix.Copy(TBuf<KPrefixMaxLength> (
+        samplerAttributes.mTraceFilePrefix.utf16()));
+
+}
+// ---------------------------------------------------------------------------
+
+TInt PIProfilerEnginePrivate::LoadGeneralSettingsL()
+{
+    // local variable for getting saved settings from profiler engine
+    TGeneralAttributes generalAttr;
+    TInt err(KErrNone);
+
+    // before loading saved settings (from settings file) set the default values 
+    iGeneralAttributes.iTraceOutput.Copy(KTraceOutput);
+    iGeneralAttributes.iTraceFilePrefix.Copy(KProfilerDefaultPrefix);
+    iGeneralAttributes.iSaveFileDrive.Copy(KProfilerDefaultDrive);
+    iGeneralAttributes.iTimedSamplingPeriod = KProfilerDefaultTimedSamplingPeriod;
+
+    // request to 
+    err = RProfiler::GetGeneralAttributes(generalAttr);
+
+    // check that request succesfull
+    if (err != KErrNone) {
+        // could not connect profiler engine, use 
+        return err;
+    }
+
+    // check if saved settings different than the default
+    if (generalAttr.iTraceOutput.MatchF(iGeneralAttributes.iTraceOutput) == KErrNotFound) {
+        iGeneralAttributes.iTraceOutput.Copy(generalAttr.iTraceOutput);
+    }
+
+    if (generalAttr.iTraceFilePrefix.MatchF(iGeneralAttributes.iTraceFilePrefix) == KErrNotFound) {
+        iGeneralAttributes.iTraceFilePrefix.Copy(generalAttr.iTraceFilePrefix);
+    }
+
+    if (generalAttr.iSaveFileDrive.MatchF(iGeneralAttributes.iSaveFileDrive) == KErrNotFound) {
+        iGeneralAttributes.iSaveFileDrive.Copy(generalAttr.iSaveFileDrive);
+    }
+
+    if (generalAttr.iTimedSamplingPeriod > 0) {
+        iGeneralAttributes.iTimedSamplingPeriod = generalAttr.iTimedSamplingPeriod;
+    }
+
+    return err;
+}
+
+// ---------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::GetGeneralSettings(GeneralAttributes &settings)
+{
+    convertTGeneralAttributesToGeneralAttributes(iGeneralAttributes, settings);
+}
+// ---------------------------------------------------------------------------
+
+bool PIProfilerEnginePrivate::SaveGeneralSettings(GeneralAttributes &settings)
+{
+    convertGeneralAttributesToTGeneralAttributes(iGeneralAttributes, settings);
+    TRAPD(error, SaveGeneralSettingsL());
+    if (error != KErrNone) {
+        return false;
+    }
+    return true;
+}
+
+// ---------------------------------------------------------------------------
+
+// --------------------------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::SaveGeneralSettingsL()
+{
+    TInt err(KErrNone);
+
+    // save general attributes to Profiler Engine
+    err = RProfiler::SetGeneralAttributes(iGeneralAttributes);
+
+    // check if save failed
+    if (err == KErrNotFound) {
+        // profiler stopped (e.g. from eshell) and must be restarted 
+        LaunchEngineL();
+
+        err = RProfiler::SetGeneralAttributes(iGeneralAttributes);
+        if (err != KErrNone) {
+            // leave no use to continue
+            User::Leave(err);
+        }
+    }
+}
+// --------------------------------------------------------------------------------------------
+
+int PIProfilerEnginePrivate::GetTimeLimit()
+{
+    return iGeneralAttributes.iTimedSamplingPeriod;
+}
+
+// --------------------------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::convertTSettingItemToSettingItem(TSettingItem &tSettingItem,
+    SettingItem &settingItem)
+{
+
+    settingItem.mType = tSettingItem.iType;
+    settingItem.mSettingDescription = QString((QChar*) tSettingItem.iSettingDescription.Ptr(),
+        tSettingItem.iSettingDescription.Length());
+    settingItem.mSettingText = QString((QChar*) tSettingItem.iSettingText.Ptr(),
+        tSettingItem.iSettingText.Length());
+    settingItem.mUIText = QString((QChar*) tSettingItem.iUIText.Ptr(),
+        tSettingItem.iUIText.Length());
+    settingItem.mValue = QString((QChar*) tSettingItem.iValue.Ptr(), tSettingItem.iValue.Length());
+
+}
+// --------------------------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::convertSettingItemToTSettingItem(TSettingItem &tSettingItem,
+    const SettingItem &settingItem)
+{
+    tSettingItem.iType = settingItem.mType;
+    tSettingItem.iSettingDescription.Copy(TBuf<256> (settingItem.mSettingDescription.utf16()));
+    tSettingItem.iSettingText.Copy(TBuf<64> (settingItem.mSettingText.utf16()));
+    tSettingItem.iUIText.Copy(TBuf<64> (settingItem.mUIText.utf16()));
+    tSettingItem.iValue.Copy(TBuf<128> (settingItem.mValue.utf16()));
+
+}
+
+// --------------------------------------------------------------------------------------------
+
+void PIProfilerEnginePrivate::LeaveProfilingOnAfterClosing()
+{
+    iLeaveProfilingOnAfterClosing = ETrue;
+}
+
+// --------------------------------------------------------------------------------------------
+
+bool PIProfilerEnginePrivate::CheckTraceLocationSanity(QString& location)
+{
+    TBool value = EFalse;
+
+    TBuf8<KPrefixMaxLength> fileLocation;
+    fileLocation.Copy(TBuf<KPrefixMaxLength> (location.utf16()));
+    TRAPD(error, value = CheckTraceLocationSanityL(fileLocation));
+    if (error != KErrNone) {
+        return false;
+    }
+    return value;
+}
+
+// --------------------------------------------------------------------------------------------
+
+TBool PIProfilerEnginePrivate::CheckTraceLocationSanityL(TBuf8<KPrefixMaxLength> &aAttr)
+{
+    RFs fs;
+    User::LeaveIfError(fs.Connect());
+
+    TBuf<32> drive;
+
+    CnvUtfConverter::ConvertToUnicodeFromUtf8(drive, aAttr);
+
+    TDriveUnit driveUnit = TDriveUnit(drive);
+
+    TBool ret(EFalse);
+
+    // check that the root folder is correct
+    if (drive.Length() > 2 && BaflUtils::CheckFolder(fs, drive.Left(3)) == KErrNone) {
+        // check then if drive has still some space
+        if (!SysUtil::DiskSpaceBelowCriticalLevelL(&fs, 0, driveUnit)) {
+            ret = ETrue;
+        }
+    }
+
+    fs.Close();
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/src/pisettingsview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,434 @@
+/*
+ * Copyright (c) 2010 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: 
+ *
+ */
+
+#include <hbmainwindow>
+#include <hbdataform>
+#include <hbdataformmodel>
+#include <hbdataformmodelitem>
+#include <hbdataformviewitem>
+#include <qgraphicslinearlayout>
+#include <qvalidator>
+#include <qintvalidator>
+#include <qmodelindex>
+#include <hblineedit>
+#include <hbvalidator>
+#include <hbeditorinterface>
+#include <hbabstractitemview.h>
+
+#include "pisettingsview.h"
+#include "pimainview.h"
+#include "notifications.h"
+#include "piprofilerengine.h"
+#include "pluginattributes.h"
+
+const QStringList OUTPUTMODES = (QStringList() << "Debug output" << "File system");
+
+PISettingsView::PISettingsView(PIProfilerEngine *engine) :
+    mEngine(engine), mGeneralAttributes(), mPluginList(0), mSettingForm(0), mModel(0),
+        mGeneralSettingsGroup(0), mPluginSettingsGroup(0), mOutputItem(0), mFileLocation(0),
+        mPrefix(0), mSamplingPeriod(0)
+
+{
+    this->setTitle("Settings");
+
+    //create setting form
+    mSettingForm = new HbDataForm(this);
+
+    //create a model class
+    mModel = new HbDataFormModel(this);
+
+    this->createGeneralSettingForms();
+
+    // Set created model model to form
+    mSettingForm->setModel(mModel);
+
+    // Set widget into view
+    setWidget(mSettingForm);
+
+    // load general settings into data form
+    loadGeneralSettings();
+
+    // Let us know when list is shown
+    connect(mSettingForm, SIGNAL(itemShown(const QModelIndex)), this,
+        SLOT(addTextValidators(const QModelIndex)));
+
+    // Set general group as expanded. 
+    /*HbDataFormViewItem *viewItem = mSettingForm->dataFormViewItem(mModel->indexFromItem( 
+        mGeneralSettingsGroup));
+    viewItem->setExpanded(true);*/
+
+}
+
+// ---------------------------------------------------------------------------
+
+PISettingsView::~PISettingsView()
+{
+    if (mSettingForm != 0) {
+        delete mSettingForm;
+        mSettingForm = 0;
+    }
+
+    if (mModel != 0) {
+        delete mModel;
+        mModel = 0;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void PISettingsView::addTextValidators(const QModelIndex index)
+{
+    HbDataFormModelItem *modelItem = mModel->itemFromIndex(index);
+
+    // Check if item is integer text box
+    if (modelItem->contentWidgetData(QString("TextboxType")) == QString("integer")) {
+
+        QString value = modelItem->contentWidgetData(QString("text")).toString();
+        // Create validator that accepts only integer values.
+        HbValidator *validator = new HbValidator(this);
+        validator->addField(new QIntValidator(0, 10000, validator), "1");
+
+        // Line editor widget from form
+        HbDataFormViewItem *viewItem = qobject_cast<HbDataFormViewItem *> (mSettingForm->itemByIndex(index));
+        HbWidget *widget = viewItem->dataItemContentWidget();
+        HbLineEdit *editor = static_cast<HbLineEdit *> (widget);
+
+        if (editor != 0) {
+            // Create interface and attach lineEdit to it.
+            HbEditorInterface editInterface(editor);
+            // set editor as phone number editor so that inserting numbers is easier
+            editor->setInputMethodHints(Qt::ImhDigitsOnly);
+            editor->setValidator(validator);
+        }
+        modelItem->setContentWidgetData(QString("text"), value);
+
+    }
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PISettingsView::createGeneralSettingForms()
+{
+
+    // Add data into setting model
+
+    // General settings group
+    mGeneralSettingsGroup = mModel->appendDataFormGroup(QString("General settings"),
+        mModel->invisibleRootItem());
+
+    // Output drop down list
+    mOutputItem = mModel->appendDataFormItem(HbDataFormModelItem::ComboBoxItem,
+        QString("Output to"), mGeneralSettingsGroup);
+    mOutputItem->setContentWidgetData(QString("items"), OUTPUTMODES);
+
+    // Data file location textbox
+    mFileLocation = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, QString(
+        "Save file in"), mGeneralSettingsGroup);
+    mFileLocation->setContentWidgetData("maxLength", 64);
+
+    // File name textbox
+    mPrefix = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, QString("File prefix"),
+        mGeneralSettingsGroup);
+    mPrefix->setContentWidgetData("maxLength", 64);
+
+    // Period that used when using timed progfiling
+    mSamplingPeriod = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, QString(
+        "Sampling period(s)"), mGeneralSettingsGroup);
+    mSamplingPeriod->setContentWidgetData(QString("TextboxType"), QString("integer"));
+    mSamplingPeriod->setContentWidgetData("maxLength", 64);
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PISettingsView::createPluginSpecificSettings()
+{
+
+    // Create plug-in specific group
+    mPluginSettingsGroup = mModel->appendDataFormGroup(QString("Plug-in specific settings"),
+        mModel->invisibleRootItem());
+
+    if (mPluginList != 0) {
+
+        for (int index = 0; index < mPluginList->size(); index++) {
+
+            // create plug-in specific settings group for each plug-in which has own settings
+            if (mPluginList->at(index).mItemCount > 0 || mPluginList->at(index).mSampleRate != -1) {
+
+                // Create settings group
+                HbDataFormModelItem *mPluginGroup = mModel->appendDataFormGroup(QString(
+                    mPluginList->at(index).mName), mPluginSettingsGroup);
+
+          
+                // get plugin attributes
+                PluginAttributes attributes = mPluginList->at(index);
+
+                // Create sample rate item if it is needed
+                if (attributes.mSampleRate != -1) {
+                    attributes.mFormItemSampleRate = mModel->appendDataFormItem(
+                        HbDataFormModelItem::TextItem, "Sample rate (ms)", mPluginGroup);
+                    attributes.mFormItemSampleRate->setContentWidgetData(QString("TextboxType"), QString(
+                        "integer"));
+
+                    attributes.mFormItemSampleRate->setContentWidgetData("text",
+                        attributes.mSampleRate);
+                }
+
+                // create other setting items
+                attributes.mFormItemSettingItem1 = createPluginSettingItem(
+                    &attributes.mSettingItem1, mPluginGroup);
+                attributes.mFormItemSettingItem2 = createPluginSettingItem(
+                    &attributes.mSettingItem2, mPluginGroup);
+                attributes.mFormItemSettingItem3 = createPluginSettingItem(
+                    &attributes.mSettingItem3, mPluginGroup);
+                attributes.mFormItemSettingItem4 = createPluginSettingItem(
+                    &attributes.mSettingItem4, mPluginGroup);
+                attributes.mFormItemSettingItem5 = createPluginSettingItem(
+                    &attributes.mSettingItem5, mPluginGroup);
+                attributes.mFormItemSettingItem6 = createPluginSettingItem(
+                    &attributes.mSettingItem6, mPluginGroup);
+                mPluginList->replace(index, attributes);
+            }
+        }
+    }
+
+}
+
+// ---------------------------------------------------------------------------
+
+HbDataFormModelItem *PISettingsView::createPluginSettingItem(const SettingItem *item,
+    HbDataFormModelItem *parentGroup)
+{
+    // create individual plug-in setting item
+
+    HbDataFormModelItem *settingItem = 0;
+    if (item->mSettingText != QString("")) {
+        switch (item->mType) {
+        case SettingItem::SettingItemTypeBool:
+            settingItem = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,
+                item->mUIText, parentGroup);
+            bool value = false;
+            if (item->mValue == "true") {
+                value = true;
+            }
+            settingItem->setContentWidgetData("tristate", value);
+
+            break;
+        case SettingItem::SettingItemTypeHex:
+            settingItem = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, item->mUIText,
+                parentGroup);
+            settingItem->setContentWidgetData("text", item->mValue);
+            settingItem->setContentWidgetData("maxLength", 64);
+
+            break;
+
+        case SettingItem::SettingItemTypeInt:
+            settingItem = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, item->mUIText,
+                parentGroup);
+            settingItem->setContentWidgetData("text", item->mValue);
+            settingItem->setContentWidgetData(QString("TextboxType"), QString("integer"));
+            settingItem->setContentWidgetData("maxLength", 64);
+
+            break;
+
+        case SettingItem::SettingItemTypeText:
+            HbDataFormModelItem *settingItem = mModel->appendDataFormItem(
+                HbDataFormModelItem::TextItem, item->mUIText, parentGroup);
+            settingItem->setContentWidgetData("text", item->mValue);
+            settingItem->setContentWidgetData("maxLength", 64);
+
+            break;
+
+        }
+    }
+    return settingItem;
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PISettingsView::loadGeneralSettings()
+{
+    // load general settings from engine
+    mEngine->getGeneralSettings(mGeneralAttributes);
+
+    // set output item correct
+    if (mGeneralAttributes.mTraceOutput == "file_system") {
+        mOutputItem->setContentWidgetData(QString("currentIndex"), OUTPUT_MODE_FILE);
+    }
+    else {
+        mOutputItem->setContentWidgetData(QString("currentIndex"), OUTPUT_MODE_DEBUG);
+    }
+
+    mFileLocation->setContentWidgetData(QString("text"), mGeneralAttributes.mSaveFileDrive);
+    mPrefix->setContentWidgetData(QString("text"), mGeneralAttributes.mTraceFilePrefix);
+    mSamplingPeriod->setContentWidgetData(QString("text"), mGeneralAttributes.mTimedSamplingPeriod);
+
+}
+
+// ---------------------------------------------------------------------------
+
+GeneralAttributes &PISettingsView::getGeneralAttributes()
+{
+    // Read items from ui elements and save them into mGeneralAttributes
+
+
+    QString fileLocation = mFileLocation->contentWidgetData(QString("text")).toString();
+    if (fileLocation.length() > 0 && mEngine->checkTraceLocationSanity(fileLocation)) {
+        mGeneralAttributes.mSaveFileDrive = fileLocation;
+    }
+    else {
+        Notifications::showErrorNote("Invalid path, check settings!");
+        mFileLocation->setContentWidgetData(QString("text"), mGeneralAttributes.mSaveFileDrive);
+    }
+    bool ok = false;
+    mGeneralAttributes.mTimedSamplingPeriod
+        = mSamplingPeriod->contentWidgetData(QString("text")).toInt(&ok);
+
+    if (!ok) {
+        // this should not happen because intvalidator is set into text box
+        qWarning("Unable to convert sampling period to integer");
+
+    }
+    mGeneralAttributes.mTraceFilePrefix = mPrefix->contentWidgetData(QString("text")).toString();
+
+    if (mOutputItem->contentWidgetData(QString("currentIndex")).toInt(&ok) == OUTPUT_MODE_FILE) {
+        mGeneralAttributes.mTraceOutput = QString("file_system");
+    }
+    else {
+        mGeneralAttributes.mTraceOutput = QString("debug_output");
+    }
+
+    return mGeneralAttributes;
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PISettingsView::setPluginSettings(QList<PluginAttributes> *pluginList)
+{
+    mPluginList = pluginList;
+    createPluginSpecificSettings();
+}
+
+// ---------------------------------------------------------------------------
+
+
+void PISettingsView::readPluginSettingItemValue(HbDataFormModelItem *dataFormItem,
+    SettingItem *settingItem)
+{
+    if (settingItem != 0 && dataFormItem != 0) {
+        // check if item type is bool, convert bool to string
+        if (settingItem->mType == SettingItem::SettingItemTypeBool) {
+            bool checkboxValue = true;
+            checkboxValue = dataFormItem->contentWidgetData(QString("tristate")).toBool();
+            
+            if(checkboxValue){
+                settingItem->mValue = QString("true");
+            }
+            else{
+                settingItem->mValue = QString("false");
+            }
+
+        }
+        // otherwise save text straight into settin item
+        else {
+            settingItem->mValue = dataFormItem->contentWidgetData("text").toString();
+        }
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void PISettingsView::readPluginSettings()
+{
+    // Read Plug-in setting item and save values into m
+    for (int index = 0; index < mPluginList->size(); index++) {
+
+        PluginAttributes attributes = mPluginList->at(index);
+
+        readPluginSettingItemValue(attributes.mFormItemSettingItem1, &attributes.mSettingItem1);
+        readPluginSettingItemValue(attributes.mFormItemSettingItem2, &attributes.mSettingItem2);
+        readPluginSettingItemValue(attributes.mFormItemSettingItem3, &attributes.mSettingItem3);
+        readPluginSettingItemValue(attributes.mFormItemSettingItem4, &attributes.mSettingItem4);
+        readPluginSettingItemValue(attributes.mFormItemSettingItem5, &attributes.mSettingItem5);
+        readPluginSettingItemValue(attributes.mFormItemSettingItem6, &attributes.mSettingItem6);
+
+        if (attributes.mFormItemSampleRate != 0) {
+            bool ok = false;
+            attributes.mSampleRate
+                = attributes.mFormItemSampleRate->contentWidgetData("text").toInt(&ok);
+            if (!ok) {
+                // this should not happen because intvalidator is set into text box
+                qWarning("Unable to convert sample rate to integer");
+            }
+        }
+
+        mPluginList->replace(index, attributes);
+
+    }
+
+}
+
+// ---------------------------------------------------------------------------
+
+void PISettingsView::expandPluginGroup(int uid)
+{
+
+    // FIXME some of the methods is deprecating fix once new methods available.
+    //collapse all group items
+    /*HbDataFormViewItem *viewItem = 0;
+    viewItem = mSettingForm->dataFormViewItem(mModel->indexFromItem(mPluginSettingsGroup));
+    if (viewItem != 0) {
+        viewItem->setExpanded(false);
+    }
+    viewItem = mSettingForm->dataFormViewItem(mModel->indexFromItem(mGeneralSettingsGroup));
+    if (viewItem != 0) {
+        viewItem->setExpanded(false);
+    }
+    // Set plugin group as expanded.
+    viewItem = mSettingForm->dataFormViewItem(mModel->indexFromItem(mPluginSettingsGroup));
+    if (viewItem != 0) {
+        viewItem->setExpanded(true);
+    }
+    // find group item which has same uid number
+    for (int index = 0; index < mPluginSettingsGroup->childCount(); index++) {
+        HbDataFormModelItem *item = mPluginSettingsGroup->childAt(index);
+        bool ok = false;
+        int groupUid = item->data(HbDataFormModelItem::KeyRole).toInt(&ok);
+        if (ok) {
+            if (uid == groupUid) {
+                // Set group as expanded
+                viewItem = mSettingForm->dataFormViewItem(mModel->indexFromItem(item));
+                if (viewItem != 0) {
+                    viewItem->setExpanded(true);
+                }
+
+                // scroll view so that group is shown
+                mSettingForm->scrollTo(mModel->indexFromItem(item),
+                    HbAbstractItemView::PositionAtTop);
+                break;
+
+            }
+        }
+
+    }*/
+
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/hb/src/pluginattributes.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2010 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: 
+*
+*/
+
+
+#include "pluginattributes.h"
+
+PluginAttributes::PluginAttributes() :
+    mFormItemSettingItem1(0), mFormItemSettingItem2(0), mFormItemSettingItem3(0),
+        mFormItemSettingItem4(0), mFormItemSettingItem5(0), mFormItemSettingItem6(0),
+        mFormItemSampleRate(0)
+{
+
+}
+
+PluginAttributes::~PluginAttributes()
+{
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/icons/qgn_menu_piprofilerui.svg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   version="1.0"
+   width="100%"
+   height="100%"
+   viewBox="0 0 88 88"
+   id="svg1926">
+  <defs
+     id="defs6909">
+    <linearGradient
+       id="linearGradient3171">
+      <stop
+         style="stop-color:#0000ff;stop-opacity:1"
+         offset="0"
+         id="stop3173" />
+      <stop
+         style="stop-color:#0000ff;stop-opacity:0.59793812"
+         offset="0.78571427"
+         id="stop4140" />
+      <stop
+         style="stop-color:#0000ff;stop-opacity:0"
+         offset="1"
+         id="stop3175" />
+    </linearGradient>
+    <radialGradient
+       cx="8"
+       cy="8"
+       r="7"
+       fx="8"
+       fy="8"
+       id="radialGradient3179"
+       xlink:href="#linearGradient3171"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(6.152284,0,0,6.152284,-5.2182712,-5.2182709)"
+       spreadMethod="pad" />
+    <linearGradient
+       id="linearGradient14494">
+      <stop
+         style="stop-color:#0000bc;stop-opacity:1"
+         offset="0"
+         id="stop14496" />
+      <stop
+         style="stop-color:#0000bc;stop-opacity:0.71134019"
+         offset="1"
+         id="stop14498" />
+    </linearGradient>
+  </defs>
+  <g
+     transform="matrix(1.00237,0,0,1.019616,-12.79656,94.92987)"
+     id="g14549" />
+  <rect
+     width="86.131981"
+     height="86.131981"
+     x="0.93400985"
+     y="0.93401051"
+     style="opacity:1;fill:url(#radialGradient3179);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+     id="rect2198" />
+  <path
+     d="M 6.4042059,58.204857 L 17.170703,33.524373 L 27.937201,71.207114 L 44.086947,17.374627 L 54.853443,49.674119 L 65.61994,60.440617 L 73.215031,28.141124 L 81.769686,60.440617 L 81.769686,60.440617"
+     style="fill:none;fill-rule:evenodd;stroke:#8fe300;stroke-width:5.38324881;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+     id="path3181" />
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/icons/qgn_prob_piprofilerui_status_disabled.svg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   baseProfile="tiny"
+   height="100%"
+   preserveAspectRatio="xMidYMid meet"
+   version="1.0"
+   viewBox="0 0 100 100"
+   width="100%"
+   zoomAndPan="magnify"
+   id="svg157473"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   sodipodi:docname="qgn_prob_piprofilerui_status_disabled.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   sodipodi:docbase="T:\BappeaProfiler\piprofiler\piprofilerui\s60ui\icons">
+  <metadata
+     id="metadata157509">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs157507" />
+  <sodipodi:namedview
+     inkscape:window-height="1174"
+     inkscape:window-width="1779"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     guidetolerance="10.0"
+     gridtolerance="10.0"
+     objecttolerance="10.0"
+     borderopacity="1.0"
+     bordercolor="#666666"
+     pagecolor="#ffffff"
+     id="base"
+     inkscape:zoom="7.54"
+     inkscape:cx="58.387496"
+     inkscape:cy="46.88482"
+     inkscape:window-x="137"
+     inkscape:window-y="-4"
+     inkscape:current-layer="svg157473" />
+  <path
+     style="fill:#aa0000;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.67105264"
+     d="M 4.7745358,23.607427 L 25.464191,6.8965515 L 47.34748,38.594164 L 77.718833,7.8249331 L 94.69496,26.657825 L 61.27321,55.835544 L 88.06366,81.697613 L 64.986737,96.949602 L 45.092838,68.700265 L 21.750663,94.960212 L 3.9787798,74.668435 L 31.962865,52.519894 L 4.7745358,23.607427 z "
+     id="path157511"
+     sodipodi:nodetypes="ccccccccccccc" />
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piprofilerui/ui/icons/qgn_prob_piprofilerui_status_enabled.svg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   version="1.0"
+   width="100%"
+   height="100%"
+   viewBox="0 0 100 100"
+   id="svg156363">
+  <defs
+     id="defs156397" />
+  <path
+     d="M 3.5809023,59.018568 L 14.986738,29.310344 L 42.307692,70.689656 L 70.954907,3.8461536 L 95.490716,16.710875 L 44.827586,95.888595 L 3.5809023,59.018568 z "
+     style="fill:#00c024;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.67105264"
+     id="path156428" />
+</svg>
--- a/screengrabber/inc/enginewrapper.h	Thu May 13 21:10:48 2010 +0300
+++ b/screengrabber/inc/enginewrapper.h	Fri May 14 15:15:12 2010 +0300
@@ -18,7 +18,7 @@
 #ifndef ENGINEWRAPPER_H
 #define ENGINEWRAPPER_H
 
-#include <S32FILE.H>
+#include <s32file.h>
 #include <hbapplication.h>
 
 
--- a/screengrabber/inc/sgengine.h	Thu May 13 21:10:48 2010 +0300
+++ b/screengrabber/inc/sgengine.h	Fri May 14 15:15:12 2010 +0300
@@ -23,8 +23,8 @@
 #include <e32std.h>
 #include <e32base.h>
 #include <f32file.h>
-#include <W32STD.H>
-#include <MdaAudioTonePlayer.h> 
+#include <w32std.h>
+#include <mdaaudiotoneplayer.h> 
 #include <qsymbianevent.h>
 
 
--- a/screengrabber/src/enginewrapper.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/screengrabber/src/enginewrapper.cpp	Fri May 14 15:15:12 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 #include <eikenv.h>
-#include <APGTASK.H>
+#include <apgtask.h>
 #include <hbdeviceprogressdialog.h>
 #include "enginewrapper.h"
 
--- a/screengrabber/src/gifanimator.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/screengrabber/src/gifanimator.cpp	Fri May 14 15:15:12 2010 +0300
@@ -19,10 +19,10 @@
 
 #include "gifanimator.h"
 
-#include <S32FILE.H>
-#include <FBS.H>
-#include <GDI.H>
-#include <ImageConversion.h>
+#include <s32file.h>
+#include <fbs.h>
+#include <gdi.h>
+#include <imageconversion.h>
 #include "enginewrapper.h"
 
     
--- a/screengrabber/src/mainview.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/screengrabber/src/mainview.cpp	Fri May 14 15:15:12 2010 +0300
@@ -25,7 +25,7 @@
 #include <hbmessagebox.h>
 #include <qgraphicslinearlayout.h>
 #include "enginewrapper.h"
-#include "settingsView.h"
+#include "settingsview.h"
 #include "mainview.h"
 #include "notifications.h"
 #include "hbtoolbar.h"
--- a/screengrabber/src/sgengine.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/screengrabber/src/sgengine.cpp	Fri May 14 15:15:12 2010 +0300
@@ -15,13 +15,13 @@
 *
 */
 
-#include <S32FILE.H> 
-#include <BAUTILS.H>
-#include <PATHINFO.H>
-#include <APPARC.H> 
-#include <IMAGECONVERSION.H>
-#include <TEXTRESOLVER.H>
-#include <APGTASK.H> 
+#include <s32file.h> 
+#include <bautils.h>
+#include <pathinfo.h>
+#include <apparc.h> 
+#include <imageconversion.h>
+#include <textresolver.h>
+#include <apgtask.h> 
 
 #include <hblabel.h>
 #include <hbmessagebox.h>
--- a/stifui/avkon/group/ReleaseNote.txt	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/avkon/group/ReleaseNote.txt	Fri May 14 15:15:12 2010 +0300
@@ -1,5 +1,5 @@
 ========================================================================
-RELEASE NOTE FOR STIF UI - STIF_201016 (7.3.31)
+RELEASE NOTE FOR STIF UI - STIF_201018 (7.3.32)
 SUPPORTING SERIES 60 3.0 ->
 ========================================================================
 
Binary file stifui/avkon/sis/Stifui_31.sis has changed
--- a/stifui/avkon/stifui/inc/version.h	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/avkon/stifui/inc/version.h	Fri May 14 15:15:12 2010 +0300
@@ -20,9 +20,9 @@
 
 #define STIFUI_MAJOR_VERSION 7
 #define STIFUI_MINOR_VERSION 3
-#define STIFUI_BUILD_VERSION 31
+#define STIFUI_BUILD_VERSION 32
 
-#define STIFUI_REL_DATE "20th Apr 2010"
+#define STIFUI_REL_DATE "5th May 2010"
 
 #define TO_UNICODE(text) _L(text) 
 
--- a/stifui/qt/ReleaseNote.txt	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/ReleaseNote.txt	Fri May 14 15:15:12 2010 +0300
@@ -1,11 +1,11 @@
 ========================================================================
-RELEASE NOTE FOR STIFQTUI - STIF_201016 (7.3.31)
+RELEASE NOTE FOR STFUI_201018 (7.3.32)
 ========================================================================
 
 Product Description:
 ====================
-STIFQTUI is Series QT UI application for STIF project.
-STIF is a test harness for testing Symbian components.
+STFUI is Series QT UI application for STF/STIF project.
+STF/STIF is a test harness for testing Symbian components.
 This widely used test framework can be used for both test case implementation and test cases execution.
 
 Features :
--- a/stifui/qt/inc/dlgoutput.h	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/inc/dlgoutput.h	Fri May 14 15:15:12 2010 +0300
@@ -51,6 +51,7 @@
 private slots:
     void on_btnPause_clicked();
     void on_btnAbort_clicked();
+    void on_btnClose_clicked();
     
     
 private:
@@ -58,12 +59,9 @@
     QTabWidget* tabMain;
     QPushButton* btnPause;
     QPushButton* btnAbort;
+    QPushButton* btnClose;
     QHash<QString , QPlainTextEdit*> tabList;
     
-private:
-    void on_btnClose_clicked();
-    
-    
 };
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/dlgsetselector.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* 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: QT C++ based Class.
+*              DlgSetSelector is a QT based dialog.
+*              Used to display available test set for select to add cases into.
+*
+*/
+#ifndef DLGSETSELECTOR_H_
+#define DLGSETSELECTOR_H_
+
+#include <QDialog>
+#include <QList>
+
+QT_BEGIN_NAMESPACE
+class QGridLayout;
+class QPushButton;
+class QRadioButton;
+class QListWidget;
+QT_END_NAMESPACE
+
+class DlgSetSelector : public QDialog {
+    Q_OBJECT
+
+public:
+    DlgSetSelector(QList<QString> setList, QWidget *parent = 0);
+    
+public:
+    inline QString SelectName(){return selectName;}
+    
+private:
+    void SetupUI();
+    
+private slots:
+    void on_btnOk_clicked();
+    void on_btnCancel_clicked();
+    void on_radio1Selection_Changed(bool checked);
+    void on_radio2Selection_Changed(bool checked);
+    
+private:
+    QString selectName;
+    
+    QRadioButton* rdoNewSet;
+    QRadioButton* rdoOldSet;
+    QListWidget* lstSet;
+    QPushButton* btnOk;
+    QPushButton* btnCancel;
+    QList<QString> setList;
+    
+    
+};
+
+
+#endif /* DLGSETSELECTOR_H_ */
--- a/stifui/qt/inc/frmmain.h	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/inc/frmmain.h	Fri May 14 15:15:12 2010 +0300
@@ -20,11 +20,14 @@
 #define FRMMAIN_H
 
 #include <QMainWindow>
+#include <QtGui>
 #include "istfqtuicontroller.h"
 #include "istfqtuimodel.h"
 #include "dlgoutput.h"
 #include "uisetting.h"
 #include "dlgsetting.h"
+#include "dlgsetselector.h"
+#include "uiversion.h"
 
 QT_BEGIN_NAMESPACE
 class QAction;
@@ -43,15 +46,15 @@
 class QFileDialog;
 QT_END_NAMESPACE
 
-const QString QtUIVersion = "StfQtUI v1.0.1";
+
 
-class frmMain : public QMainWindow, public IStfEventListener, public IStifModelEventListener
+class FrmMain : public QMainWindow, public IStfEventListener, public IStifModelEventListener
 {
     Q_OBJECT
 
 public:
-    frmMain();
-    ~frmMain();
+    FrmMain();
+    ~FrmMain();
     
     
 public: //Implement IStfEventListener
@@ -64,6 +67,9 @@
     void OnCaseStatisticChanged() ;
     void OnRunningCaseChanged() ;
     
+protected:
+    void paintEvent(QPaintEvent *event);
+    
 protected slots:
     void onTabWidgetSelectIndexChanged();
 
@@ -79,16 +85,20 @@
     QList<CSTFCase> getSelectedCases();
     void reloadStatisticItem(QString name, QTreeWidgetItem* item, TSTFCaseStatusType type);
     void setSetting();
+    void startRunning();
     
 private:
     IStfQtUIController* controller;
     IStfQtUIModel* model;
     DlgOutput* dlgOutput;
     UiSetting* uiSetting; 
-    
+    bool layoutType;
 
 private: //UI Components
-    QWidget *MainWidget;
+    QWidget* centerWidget;
+    QGridLayout *mainLayout;
+    QGroupBox *groupBox;
+    
     //menus and actions
     QMenu *operateMenu;
     //output panel
@@ -120,7 +130,7 @@
     QListWidget *lstStartedCases;
     QPushButton *btnPauseCase;
     QPushButton *btnAbortCase;
-    QPlainTextEdit *txtCaseOutput;
+    QPushButton *btnShowOutput;
 
     //menu actions
     QAction *actExit;
@@ -135,14 +145,18 @@
     QAction *actExpandAll;
     QAction *actCollapseAll;
     QAction *actSetting;
+    QMenu *menuRunCase; 
     //sets actions
     QAction *actRunSetSeq;
     QAction *actRunSetPar;
     QAction *actNewSet;
     QAction *actDelSet;
+    QMenu *menuRunSet;
     //running actions.
     QAction *actPause;
     QAction *actAbort;
+    QAction *actOutput;
+    
     //statistics actions
     QAction *actClearStatistics;
 
@@ -157,6 +171,8 @@
     void on_actSelectAll_triggered();
     void on_actExpandAll_triggered();
     void on_actCollapseAll_triggered();
+    void on_actExpand_triggered();
+    void on_actCollapse_triggered();
     void on_actSetting_triggered();
         
     void on_actRunSetSeq_triggered();
@@ -165,6 +181,7 @@
     void on_actDelSet_triggered();
     void on_actPause_triggered();
     void on_actAbort_triggered();
+    void on_actOutput_triggered();
     void on_actClearStatistics_triggered();
     void on_treeModuleList_itemClicked(QTreeWidgetItem* item, int column);
 
@@ -176,4 +193,4 @@
 
 };
 
-#endif // FRMMAIN_H
+#endif // FrmMain_H
--- a/stifui/qt/inc/istfqtuicontroller.h	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/inc/istfqtuicontroller.h	Fri May 14 15:15:12 2010 +0300
@@ -48,19 +48,20 @@
     virtual QList<QString> GetCaseListByModule(const QString& moduleName) = 0;
     virtual CSTFCase GetCase(const QString& moduleName, const int index) = 0;
     virtual void RunCases(const QList<CSTFCase>& caseList, const TSTFCaseRunningType& type) = 0;
-    virtual void AddCaseToSet(const QList<CSTFCase>& aCase, const QString& setName) = 0;
+    virtual bool AddCaseToSet(const QList<CSTFCase>& aCase, const QString& setName) = 0;
     
     //for set
     virtual QList<QString> GetSetList() = 0;
     virtual QList<QString> GetCaseListBySet(const QString& setName) = 0;
-    virtual void CreateSet(const QString& setName) = 0;
-    virtual void DeleteSet(const QString& setName) = 0;
+    virtual bool CreateSet(QString& setName) = 0;
+    virtual bool DeleteSet(const QString& setName) = 0;
     virtual void RunSets(const QString& setName, const TSTFCaseRunningType& type) = 0;
     
     //for Started
     virtual void PauseCase() = 0;
     virtual void ResumeCase() = 0;
     virtual void AbortCase() = 0;
+    virtual CSTFCase GetRunningCase(int index) = 0;
     virtual bool ShowOutput() = 0;
     virtual void SetShowOutput(bool isShow) = 0;
     
--- a/stifui/qt/inc/istfqtuimodel.h	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/inc/istfqtuimodel.h	Fri May 14 15:15:12 2010 +0300
@@ -19,7 +19,6 @@
 #ifndef ISTFQTUIMODEL_H
 #define ISTFQTUIMODEL_H
 
-//#include <TestModuleInfo.h>
 #include "cstfcase.h"
 #include "cstfmodule.h"
 #include <UIStoreIf.h>
@@ -42,6 +41,7 @@
     virtual void AddRunningCase(const CStartedTestCase* startedCase, const CSTFCase& stfCase) = 0;
     virtual void RemoveRunningCase(const CStartedTestCase* startedCase) = 0;
     virtual void AddCaseByStatus(const TSTFCaseStatusType& type, const CSTFCase& aCase) = 0;
+    virtual CSTFCase GetRunningCase(const CStartedTestCase* startedCase) = 0;
     virtual void PauseCase() = 0;
     virtual void ResumeCase() = 0;
     virtual void AbortCase() = 0;
--- a/stifui/qt/inc/stfqtuicontroller.h	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/inc/stfqtuicontroller.h	Fri May 14 15:15:12 2010 +0300
@@ -35,13 +35,13 @@
     QList<QString> GetCaseListByModule(const QString& moduleName);
     CSTFCase GetCase(const QString& moduleName, const int index);
     void RunCases(const QList<CSTFCase>& caseList, const TSTFCaseRunningType& type);
-    void AddCaseToSet(const QList<CSTFCase>& aCase, const QString& setName);
+    bool AddCaseToSet(const QList<CSTFCase>& aCase, const QString& setName);
     
     //for set
     QList<QString> GetSetList();
     QList<QString> GetCaseListBySet(const QString& setName);
-    void CreateSet(const QString& setName);
-    void DeleteSet(const QString& setName);
+    bool CreateSet(QString& setName);
+    bool DeleteSet(const QString& setName);
     void RunSets(const QString& setName, const TSTFCaseRunningType& type);
     
     //for Started
@@ -49,6 +49,7 @@
     void ResumeCase();
     void AbortCase();
     bool ShowOutput();
+    CSTFCase GetRunningCase(int index);
     void SetShowOutput(bool isShow);
     
     //for staticstic
--- a/stifui/qt/inc/stfqtuimodel.h	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/inc/stfqtuimodel.h	Fri May 14 15:15:12 2010 +0300
@@ -32,6 +32,7 @@
     void AddCaseByStatus(const TSTFCaseStatusType& type, const CSTFCase& aCase);
     void AddStifModelEventListener(IStifModelEventListener* listener);
     void RemoveStifModelEventListener(IStifModelEventListener* listener);
+    CSTFCase GetRunningCase(const CStartedTestCase* startedCase);
     void PauseCase();
     void ResumeCase();
     void AbortCase();
--- a/stifui/qt/inc/stifexecutor.h	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/inc/stifexecutor.h	Fri May 14 15:15:12 2010 +0300
@@ -19,13 +19,13 @@
 #ifndef STIFEXECUTOR_H_
 #define STIFEXECUTOR_H_
 
-//#include <TestModuleInfo.h>
 #include "cstfcase.h"
 #include "cstfmodule.h"
 #include <UIStoreIf.h>
 #include <UIStore.h>
 #include <UIEngine.h>
 #include <QList>
+#include <StifLogger.h>
 
 class IStifCaseUpdateListener
     {
@@ -49,10 +49,10 @@
     void ExecuteSingleCase(const QString& moduleName, int caseIndex);
     QList<QString> GetSetList();
     QList<CSTFCase> GetCaseListFromSet(const QString& setName);
-    void CreateSet(const QString& setName);
-    void SaveSet(QString& setName);
-    void RemoveSet(const QString& setName);
-    void AddtoSet(const QString& setName, CSTFCase& caseInfo);
+    bool CreateSet(const QString& setName);
+    bool SaveSet(QString& setName);
+    bool RemoveSet(const QString& setName);
+    bool AddtoSet(const QString& setName, CSTFCase& caseInfo);
     void ExecuteSet(const QString& SetName, const int startIndex, const TSTFCaseRunningType type);
     
 public://implement CUIStoreIf 
@@ -63,9 +63,14 @@
      TPtrC QString2TPtrC(const QString& aString);
      QString TDesC2QString(const TDesC& des);
      //CTestInfo* GetTestInfo(CSTFCase aCase);
+     
+private:
+     bool LogResult(const TInt result,const QString str);
 private:
    QList<IStifCaseUpdateListener*> *listenerList;
    HBufC*  iBuffer;
+   // Pointer to logger
+   CStifLogger * iLog;
     };
 
 
--- a/stifui/qt/inc/uisetting.h	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/inc/uisetting.h	Fri May 14 15:15:12 2010 +0300
@@ -18,6 +18,10 @@
 #define UISETTING_H_
 #include <QHash>
 
+const QString KShowOutput = "showoutput";
+const QString KStyleSheet = "StyleSheet";
+
+
 class UiSetting
     {
 public:
@@ -32,6 +36,7 @@
     bool load();
     bool save();
     void loadDefault();
+    QString getDefaultValue(const QString& item);
     
 private:
     QHash<QString, QString> settingList;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/uiversion.h	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* 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: QT C++ based Class.
+*              frmMain is a QT based Window.
+*              Used to display STF executor main GUI.
+*
+*/
+
+#ifndef UIVERSION_H_
+#define UIVERSION_H_
+
+const QString QtUIVersion = "v1.1.1";
+const QString QtUIName = "STFUI";
+
+#endif /* UIVERSION_H_ */
--- a/stifui/qt/inc/version.h	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/inc/version.h	Fri May 14 15:15:12 2010 +0300
@@ -11,18 +11,18 @@
 *
 * Contributors:
 * 
-* Description: STIF QT UI version declaration
+* Description: STIF version declaration
 *
 */
 
 #ifndef VERSION_H_
 #define VERSION_H_
 
-#define STIF_MAJOR_VERSION 7
-#define STIF_MINOR_VERSION 3
-#define STIF_BUILD_VERSION 26
+#define STIF_MAJOR_VERSION 1
+#define STIF_MINOR_VERSION 0
+#define STIF_BUILD_VERSION 0
 
-#define STIF_REL_DATE "09th Feb 2010"
+#define STIF_REL_DATE "1st Mar 2010"
 
 #define TO_UNICODE(text) _L(text) 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/qss/coffee.qss	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,326 @@
+QWidget {
+	background-color: cornsilk;
+}
+
+QMessageBox {
+	background-color: cornsilk;
+	border-width: 2px;
+	border-style: solid;
+    border-color: darkkhaki;
+    padding: 3px;
+    font-size:12px;
+    font: bold;
+}
+
+QDialog {
+	background-color: cornsilk;
+	border-width: 2px;
+	border-style: solid;
+    border-color: darkkhaki;
+    font-size:12px;
+    font: bold;
+}
+
+QInputDialog {
+	background-color: cornsilk;
+	border-width: 2px;
+	border-style: solid;
+    border-color: darkkhaki;
+    font-size:12px;
+    font: bold;
+}
+
+
+/*QPushButton*/
+QPushButton {
+    color: #0a214c;
+    background-color: palegoldenrod;
+    border-width: 2px;
+    border-color: darkkhaki;
+    border-style: solid;
+    border-radius: 5;
+    padding: 3px;
+    min-width: 100px;
+    min-height: 32px;
+    max-width: 100px;
+    max-height: 32px;
+    font-size:16px;
+    font: bold;
+}
+
+QPushButton:hover {
+   background-color: khaki;
+}
+
+QPushButton:pressed {
+    padding-left: 2px;
+    padding-top: 2px;
+    background-color: #d0d67c;
+}
+
+
+QPushButton::disabled {
+	color: #ffffff;
+}
+
+QRadioButton {
+    font: bold;
+    font-size: 14px;
+    border: none;
+    padding: 0;
+    background-color: cornsilk;
+    color: black; 
+    background-color: cornsilk;
+    selection-color: #0a214c; 
+    selection-background-color: #C19A6B;
+}
+
+QRadioButton:focus {
+	color:black;
+	background-color: cornsilk;
+}
+
+QRadioButton:selected {
+    background-color: cornsilk;
+    color:black;
+}
+
+QRadioButton:pressed {
+    background-color: cornsilk;
+    color:black;
+}
+
+
+/*QTabQWidget*/
+QTabWidget::pane { /* The tab widget frame */
+    border-top: 2px solid #C2C7CB;
+}
+
+QTabWidget::tab-bar {
+    left: 5px; /* move to the right by 5px */
+}
+
+/* Style the tab using the tab sub-control. Note that
+    it reads QTabBar _not_ QTabWidget */
+QTabBar::tab {
+    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+                                stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
+                                stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
+    border: 2px solid #C4C4C3;
+    border-bottom-color: #C2C7CB; /* same as the pane color */
+    border-top-left-radius: 4px;
+    border-top-right-radius: 4px;
+    /*min-width: 5ex;*/
+    padding: 2px;
+    color: #0a214c;
+    font-size:15px;
+}
+
+QTabBar::tab:selected, QTabBar::tab:hover {
+    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+                                stop: 0 #fafafa, stop: 0.4 #f4f4f4,
+                                stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
+}
+
+QTabBar::tab:selected {
+    border-color: #9B9B9B;
+    border-bottom-color: #C2C7CB; /* same as pane color */
+    font: bold;
+    font-size:15px;
+}
+
+QTabBar::tab:!selected {
+    margin-top: 2px; /* make non-selected tabs look smaller */
+    font: bold;
+    font-size:14px;
+}
+
+/* make use of negative margins for overlapping tabs */
+QTabBar::tab:selected {
+    /* expand/overlap to the left and right by 4px */
+    /*
+    margin-left: -4px;
+    margin-right: -4px;
+    */
+}
+
+QTabBar::tab:first:selected {
+    margin-left: 0; /* the first selected tab has nothing to overlap with on the left */
+}
+
+QTabBar::tab:last:selected {
+    margin-right: 0; /* the last selected tab has nothing to overlap with on the right */
+}
+
+QTabBar::tab:only-one {
+    margin: 0; /* if there is only one tab, we don't want overlapping margins */
+}
+
+
+/* QLabel */
+QLabel {
+    font: bold;
+    font-size: 14px;
+    border: none;
+    padding: 0;
+    background: none;
+    color: black;
+    
+}
+
+/* QLabel */
+QCheckBox {
+    font: bold;
+    font-size: 14px;
+    border: none;
+    padding: 0;
+    background-color: cornsilk;
+    color: black; 
+    background-color: cornsilk;
+    selection-color: #0a214c; 
+    selection-background-color: #C19A6B;
+}
+
+QCheckBox::focus {
+	color:black;
+	background-color: cornsilk;
+}
+
+QCheckBox:selected {
+    background-color: cornsilk;
+    color:black;
+}
+
+QCheckBox:pressed {
+    background-color: cornsilk;
+    color:black;
+}
+
+
+QFrame {
+	background-color: cornsilk;
+}
+
+QLineEdit, QPlainTextEdit {
+	background-color: cornsilk;
+    border-width: 1px;
+    padding: 1px;
+    border-style: solid;
+    border-color: darkkhaki;
+    border-radius: 3px;
+    color:black;
+    font-size:14px;
+}
+
+QLineEdit:focus, QPlainTextEdit:focus {
+    border-width: 3px;
+    padding: 0px;
+}
+
+/*QComboBox*/
+
+QComboBox {
+    background-color: cornsilk;
+    selection-color: #0a214c; 
+    selection-background-color: #C19A6B;
+    color:black;
+    font-size:20px;
+    border-width: 1px;
+    padding: 1px;
+    border-style: solid;
+    border-color: darkkhaki;
+}
+
+/*QGroupBox*/
+QGroupBox {
+	background-color: cornsilk;
+	margin-top: 2ex;
+	border: 2px solid gray;
+	border-radius: 5px;
+	
+
+}
+
+QGroupBox::title {
+	subcontrol-origin: margin;
+	padding: 0 3px;
+	color:black;
+	font-size:14px;
+	background-color: cornsilk;
+}
+
+
+/*QTreeWidget*/
+
+QTreeWidget {
+    color: brown;
+	show-decoration-selected: 1;
+	border-width: 1px;
+    padding: 1px;
+    border-style: solid;
+    border-color: darkkhaki;
+    border-radius: 3px;
+    background-color: cornsilk;
+    selection-color: #0a214c; 
+    selection-background-color: #C19A6B;
+}
+
+QHeaderView {
+	color : black;
+	border-width: 1px;
+	padding: 1px;
+    border-style: solid;
+    border-color: darkkhaki;
+    border-radius: 3px;
+    background-color: khaki;
+}
+
+QHeaderView::section {
+	color : black;
+	border-width: 0px;
+	padding: 0px;
+    border-style: none;
+    background-color: palegoldenrod;
+}
+
+
+QTreeWidget::item{
+	height:35px;
+	font-size:20px;
+}
+
+QTreeWidget::item:hover{
+	background-color: wheat;
+}
+
+QListView {
+    color: brown;
+    show-decoration-selected: 1;
+    border-width: 1px;
+    padding: 1px;
+    border-style: solid;
+    border-color: darkkhaki;
+    border-radius: 3px;
+    background-color: cornsilk;
+    selection-color: #0a214c; 
+    selection-background-color: #C19A6B;
+    font-size:16px;
+}
+
+QListView::item:hover {
+    background-color: wheat;
+}
+
+QListView::disabled {
+	color: #ffffff;
+	background-color: gray;
+}
+
+QListView::item {
+	height:30px;
+}
+
+QErrorMessage::text {
+	color: black;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/resource/StfQtUI.qrc	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,5 @@
+<RCC>
+<qresource prefix="/">
+<file>../qss/coffee.qss</file>
+</qresource>
+</RCC>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/sis/StfQtUI.pkg	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,32 @@
+; StfQtUI_template.pkg generated by qmake at 2010-02-08T13:37:27
+; This file is generated by qmake and should not be modified by the user
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"STFUI"},(0x2002BCA0),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+; Manual PKG pre-rules from PRO files
+; Default HW/platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+ 
+; Default dependency to Qt libraries
+;(0x2001E61C), , , , {"Qt"}
+
+; Executable and default resource files
+"/epoc32/release/armv5/urel/StfUI.exe"    - "!:\sys\bin\StfUI.exe"
+"/epoc32/data/z/resource/apps/StfQtUI.rsc"    - "!:\resource\apps\StfQtUI.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/StfQtUI_reg.rsc"    - "!:\private\10003a3f\import\apps\StfQtUI_reg.rsc"
+
+; Manual PKG post-rules from PRO files
--- a/stifui/qt/src/dlgoutput.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/src/dlgoutput.cpp	Fri May 14 15:15:12 2010 +0300
@@ -20,30 +20,34 @@
 DlgOutput::DlgOutput(IStfQtUIController* ctl, QWidget *parent) :
     QDialog(parent), controller(ctl)
     {
-    QSize btnSize(100,30);
     QGridLayout *mainLayout = new QGridLayout(this);
     this->setLayout(mainLayout);
     this->setContextMenuPolicy(Qt::NoContextMenu);
 
-    tabMain = new QTabWidget();
+    tabMain = new QTabWidget(this);
     tabMain->setContextMenuPolicy(Qt::NoContextMenu);
 
     QWidget *toolWidget = new QWidget(this);
     toolWidget->setContextMenuPolicy(Qt::NoContextMenu);
-    QGridLayout *toolLayout = new QGridLayout();
+    QGridLayout *toolLayout = new QGridLayout(this);
     toolWidget->setLayout(toolLayout);
     btnPause = new QPushButton(tr("Pause"), toolWidget);
     btnPause->setContextMenuPolicy(Qt::NoContextMenu);
-    btnPause->setFixedSize(btnSize);
     QObject::connect(btnPause, SIGNAL(clicked()), this,
             SLOT(on_btnPause_clicked()));
     btnAbort = new QPushButton(tr("Abort"), toolWidget);
     btnAbort->setContextMenuPolicy(Qt::NoContextMenu);
-    btnAbort->setFixedSize(btnSize);
     QObject::connect(btnAbort, SIGNAL(clicked()), this,
             SLOT(on_btnAbort_clicked()));
+    
+    btnClose = new QPushButton(tr("Hide"), toolWidget);
+    btnClose->setContextMenuPolicy(Qt::NoContextMenu);
+    QObject::connect(btnClose, SIGNAL(clicked()), this,
+            SLOT(on_btnClose_clicked()));
     toolLayout->addWidget(btnPause, 0, 0);
     toolLayout->addWidget(btnAbort, 0, 1);
+    toolLayout->addWidget(btnClose, 0, 2);
+        
 
     mainLayout->addWidget(toolWidget, 0, 0);
     mainLayout->addWidget(tabMain, 1, 0);
@@ -66,8 +70,9 @@
 void DlgOutput::CloseItem(QString index)
     {
     int u = tabList.keys().indexOf(index);
+    
+    delete tabList.value(index);
     tabList.remove(index);
-    tabMain->removeTab(u);
     if (tabMain->count() == 0)
         {
         this->close();
@@ -80,6 +85,13 @@
         {
         tabList.value(index)->setPlainText(msg);    
         }
+    else
+        {
+//        bool ok;
+//        CSTFCase acase = controller->GetRunningCase(index.toInt(&ok, 10));
+//        CreateItem(index, acase.Name());
+//        ShowMessage(index, msg);
+        }
     }
 
 void DlgOutput::on_btnPause_clicked()
@@ -101,10 +113,19 @@
     controller->AbortCase();
     }
 
+void DlgOutput::on_btnClose_clicked()
+    {
+    controller->SetShowOutput(false);
+    this->close();
+    }
+
 void DlgOutput::OnCaseOutputChanged(const IStfEventListener::CaseOutputCommand& cmd,
         const QString& index, const QString& msg)
     {
-    this->showMaximized();
+    if(controller->ShowOutput() && this->isVisible() == false)
+        {
+        this->showMaximized();
+        }
     switch (cmd)
         {
         case IStfEventListener::ECreate:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/src/dlgsetselector.cpp	Fri May 14 15:15:12 2010 +0300
@@ -0,0 +1,114 @@
+/*
+ * 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: QT C++ based Class.
+ * 
+ */
+
+#include "dlgsetselector.h"
+#include <QtGui>
+
+DlgSetSelector::DlgSetSelector(QList<QString> list, QWidget* parent):
+        QDialog(parent), setList(list), selectName("")
+    {
+    SetupUI();
+    }
+
+void DlgSetSelector::SetupUI()
+    {
+     QGridLayout *mainLayout = new QGridLayout(this);
+     this->setLayout(mainLayout);
+     this->setContextMenuPolicy(Qt::NoContextMenu);
+     
+     rdoNewSet = new QRadioButton(this);
+     rdoNewSet->setChecked(true);
+     rdoNewSet->setText(tr("Create a new Set"));
+     QObject::connect(rdoNewSet, SIGNAL(clicked(bool)), this, 
+             SLOT(on_radio1Selection_Changed(bool)));
+     rdoOldSet = new QRadioButton(this);
+     rdoOldSet->setChecked(false);
+     rdoOldSet->setText(tr("Select a exist set:"));
+     QObject::connect(rdoOldSet, SIGNAL(clicked(bool)), this, 
+             SLOT(on_radio2Selection_Changed(bool)));
+     
+     lstSet = new QListWidget(this);
+     for(int i=0;i<setList.count();i++)
+         {
+         lstSet->addItem(setList[i]);
+         }
+     lstSet->setEnabled(false);
+     
+     QWidget *toolWidget = new QWidget(this);
+     toolWidget->setContextMenuPolicy(Qt::NoContextMenu);
+     QGridLayout *toolLayout = new QGridLayout(this);
+     toolWidget->setLayout(toolLayout);
+     btnOk = new QPushButton(tr("Ok"), toolWidget);
+     btnOk->setContextMenuPolicy(Qt::NoContextMenu);
+     QObject::connect(btnOk, SIGNAL(clicked()), this,
+             SLOT(on_btnOk_clicked()));
+     btnCancel = new QPushButton(tr("Cancel"), toolWidget);
+     btnCancel->setContextMenuPolicy(Qt::NoContextMenu);
+     QObject::connect(btnCancel, SIGNAL(clicked()), this,
+             SLOT(on_btnCancel_clicked()));
+     toolLayout->addWidget(btnOk, 0, 0);
+     toolLayout->addWidget(btnCancel, 0, 1);
+         
+
+     mainLayout->addWidget(rdoNewSet, 0, 0);
+     mainLayout->addWidget(rdoOldSet, 1, 0);
+     mainLayout->addWidget(lstSet, 2, 0);
+            
+     mainLayout->addWidget(toolWidget, 3, 0);
+     this->showMaximized();
+     
+    }
+void DlgSetSelector::on_radio1Selection_Changed(bool checked)
+    {
+    lstSet->setEnabled(false);
+    }
+
+
+void DlgSetSelector::on_radio2Selection_Changed(bool checked)
+    {
+    lstSet->setEnabled(true);
+    if(checked)
+        {
+        if(setList.count() == 0)
+            {
+            rdoNewSet->setChecked(true);
+            }
+        else
+            {
+            lstSet->setCurrentRow(0);
+            }
+        }
+    
+    }
+
+void DlgSetSelector::on_btnOk_clicked()
+    {
+    if(rdoOldSet->isChecked())
+        {
+        selectName = lstSet->selectedItems()[0]->text();
+        }
+    else
+        {
+        selectName = "";
+        }
+    this->accept();
+    }
+
+void DlgSetSelector::on_btnCancel_clicked()
+    {
+    this->reject();
+    }
--- a/stifui/qt/src/dlgsetting.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/src/dlgsetting.cpp	Fri May 14 15:15:12 2010 +0300
@@ -32,36 +32,38 @@
     
     chkShowoutput = new QCheckBox(this);
     chkShowoutput->setText(tr("Show output in execution."));
-    chkShowoutput->setChecked(setting->ReadSetting("showoutput") == "true");
-    
+    chkShowoutput->setChecked(setting->ReadSetting(KShowOutput) == "true");
     QWidget *toolWidget = new QWidget(this);
-    QGridLayout *toolLayout = new QGridLayout();
+    QGridLayout *toolLayout = new QGridLayout(this);
     
     toolWidget->setLayout(toolLayout);
     btnOk = new QPushButton(tr("Ok"), toolWidget);
-    btnOk->setFixedSize(100, 30);
     QObject::connect(btnOk, SIGNAL(clicked()), this,
             SLOT(on_btnOk_clicked()));
     btnCancel = new QPushButton(tr("Cancel"), toolWidget);
-    btnCancel->setFixedSize(100, 30);
     QObject::connect(btnCancel, SIGNAL(clicked()), this,
             SLOT(on_btnCancel_clicked()));
     toolLayout->addWidget(btnOk, 0, 0);
     toolLayout->addWidget(btnCancel, 0, 1);
 
-    mainLayout->addWidget(chkShowoutput, 0, 0);
-    mainLayout->addWidget(toolWidget, 2, 0);    
+    QWidget *nullWidget = new QWidget(this);
+    nullWidget->setMinimumHeight(30);
+    
+    mainLayout->addWidget(nullWidget, 0, 0);
+    mainLayout->addWidget(chkShowoutput, 1, 0);
+    mainLayout->addWidget(toolWidget, 3, 0);    
+    
     }
 
 void DlgSetting::on_btnOk_clicked()
     {
     if(chkShowoutput->checkState() == Qt::Checked)
         {
-        setting->SetSetting("showoutput", "true");
+        setting->SetSetting(KShowOutput, "true");
         }
     else
         {
-        setting->SetSetting("showoutput", "false");    
+        setting->SetSetting(KShowOutput, "false");    
         }
     this->accept();
     }
--- a/stifui/qt/src/frmmain.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/src/frmmain.cpp	Fri May 14 15:15:12 2010 +0300
@@ -21,16 +21,26 @@
 #include <QList>
 #include "version.h"
 #include <QCursor>
+#include <QDesktopWidget>
 
 const QString SELECTITEMHEADER = " * ";
 const QString UNSELECTITEMHEADER = "   ";
 
-frmMain::frmMain()
+FrmMain::FrmMain()
     {
     uiSetting = new UiSetting();
     createMenus();
     load();
     LoadSubMenu();
+    
+    QFile file(uiSetting->ReadSetting(KStyleSheet));
+    bool rst = file.open(QFile::ReadOnly);    
+    if(rst)
+        {
+        QString styleSheet = QLatin1String(file.readAll());    
+        qApp->setStyleSheet(styleSheet);    
+        }
+        
     model = new StfQtUIModel();
     model->AddStifModelEventListener(this);
     controller = new StfQtUIController(model);
@@ -40,7 +50,7 @@
     setSetting();
     }
 
-frmMain::~frmMain()
+FrmMain::~FrmMain()
     {
     model->AbortCase();
     controller->RemoveStfEventListener(this);
@@ -52,17 +62,57 @@
     delete model;
     }
 
-void frmMain::setSetting()
+void FrmMain::paintEvent(QPaintEvent* event)
     {
-    controller->SetShowOutput(uiSetting->ReadSetting("showoutput") == "true");    
+    
+    if(mainLayout != NULL)
+        {
+        QDesktopWidget* desktop = QApplication::desktop();
+        QRect rect = desktop->screenGeometry(0);
+        bool temp = false;
+        if(rect.height() > rect.width())
+            {
+            temp = true;
+            }
+        
+        if(temp != layoutType)
+            {
+            mainLayout->removeWidget(tabWidget);
+            mainLayout->removeWidget(groupBox);
+            if(temp)
+                {
+                mainLayout->addWidget(tabWidget, 0, 0);
+                mainLayout->addWidget(groupBox, 1, 0, Qt::AlignBottom);
+                mainLayout->setRowStretch(0,4);
+                mainLayout->setRowStretch(1,1);
+                }
+            else
+                {
+                mainLayout->addWidget(tabWidget, 0, 0);
+                mainLayout->addWidget(groupBox, 0, 1);//Qt::AlignRight
+                //groupBox->setFixedSize(60,0);
+                mainLayout->setColumnStretch(0,1);
+                mainLayout->setColumnStretch(1,1);
+                }
+            layoutType = temp;
+            
+            }
+        
+        }
+    event->accept();
     }
 
-void frmMain::OnGetMessage(const QString& aMessage)
+void FrmMain::setSetting()
+    {
+    controller->SetShowOutput(uiSetting->ReadSetting(KShowOutput) == "true");    
+    }
+
+void FrmMain::OnGetMessage(const QString& aMessage)
     {
     txtOutput->appendPlainText(aMessage);
     }
 
-void frmMain::OnRunningCaseChanged()
+void FrmMain::OnRunningCaseChanged()
     {
     QList<CSTFCase> caseList = controller->GetCasesByStatus(EStatusRunning);
     lstStartedCases->clear();
@@ -74,34 +124,38 @@
         {
         btnPauseCase->setEnabled(true);
         btnAbortCase->setEnabled(true);
+        btnShowOutput->setEnabled(true);
         actPause->setEnabled(true);
         actAbort->setEnabled(true);
+        actOutput->setEnabled(true);
         }
     else
         {
         btnPauseCase->setEnabled(false);
         btnAbortCase->setEnabled(false);
+        btnShowOutput->setEnabled(false);
         actPause->setEnabled(false);
         actAbort->setEnabled(false);
+        actOutput->setEnabled(false);
         }
     }
 
-void frmMain::OnCaseOutputChanged(const IStfEventListener::CaseOutputCommand& /*cmd*/, const QString& /*index*/, const QString& /*msg*/)
+void FrmMain::OnCaseOutputChanged(const IStfEventListener::CaseOutputCommand& /*cmd*/, const QString& /*index*/, const QString& /*msg*/)
     {
     //nothing to do.
     }
 
-void frmMain::OnSetListChanged()
+void FrmMain::OnSetListChanged()
     {
     loadSetList();
     }
 
-void frmMain::OnCaseStatisticChanged()
+void FrmMain::OnCaseStatisticChanged()
     {
     loadStatistic();
     }
 
-void frmMain::createMenus()
+void FrmMain::createMenus()
     {
     //operateMenu = menuBar()->addMenu(tr("&Operation"));
     actAbout = new QAction(tr("&About"), this);
@@ -115,11 +169,13 @@
     connect(actOpenFile, SIGNAL(triggered()), this,
             SLOT(on_actOpenFile_triggered()));
 
-    actRunCaseSeq = new QAction(tr("Run Case Sequentially"), this);
+    menuRunCase = new QMenu(tr("Run Selected Case(s)"), this->menuBar());
+    
+    actRunCaseSeq = new QAction(tr("Sequentially"), this);
     connect(actRunCaseSeq, SIGNAL(triggered()), this,
             SLOT(on_actRunCaseSeq_triggered()));
 
-    actRunCasePar = new QAction(tr("Run Case Parallel"), this);
+    actRunCasePar = new QAction(tr("Parallel"), this);
     connect(actRunCasePar, SIGNAL(triggered()), this,
             SLOT(on_actRunCasePar_triggered()));
 
@@ -139,15 +195,17 @@
     connect(actCollapseAll, SIGNAL(triggered()), this,
             SLOT(on_actCollapseAll_triggered()));
 
-    actSetting = new QAction(tr("Setting"), this);
+    actSetting = new QAction(tr("Settings"), this);
     connect(actSetting, SIGNAL(triggered()), this,
             SLOT(on_actSetting_triggered()));
 
-    actRunSetSeq = new QAction(tr("Run Set Sequentially"), this);
+    menuRunSet = new QMenu(tr("Run Case(s) in Selected Set"), this->menuBar());
+    
+    actRunSetSeq = new QAction(tr("Sequentially"), this);
     connect(actRunSetSeq, SIGNAL(triggered()), this,
             SLOT(on_actRunSetSeq_triggered()));
 
-    actRunSetPar = new QAction(tr("Run Set Parallel"), this);
+    actRunSetPar = new QAction(tr("Parallel"), this);
     connect(actRunSetPar, SIGNAL(triggered()), this,
             SLOT(on_actRunSetPar_triggered()));
 
@@ -168,6 +226,11 @@
     actAbort->setEnabled(false);
     connect(actAbort, SIGNAL(triggered()), this,
             SLOT(on_actAbort_triggered()));
+    
+    actOutput = new QAction(tr("Output"), this);
+    actOutput->setEnabled(false);
+    connect(actAbort, SIGNAL(triggered()), this,
+            SLOT(on_actOutput_triggered()));
 
     actClearStatistics = new QAction(tr("Clear Statistics"), this);
     connect(actClearStatistics, SIGNAL(triggered()), this,
@@ -175,19 +238,22 @@
 
     }
 
-void frmMain::load()
+void FrmMain::load()
     {
     this->setContextMenuPolicy(Qt::NoContextMenu);
-    QSize btnSize(100,35);
-    QGridLayout *mainLayout = new QGridLayout(this);
+    
+    this->setWindowTitle(QtUIName);
+    centerWidget = new QWidget(this);
+    this->setCentralWidget(centerWidget);
+    
+    mainLayout = new QGridLayout(this);
     mainLayout->setVerticalSpacing(2);
     mainLayout->setHorizontalSpacing(2);
     mainLayout->setSpacing(2);
     mainLayout->setMargin(2);
-
-    MainWidget = new QWidget(this);
-    MainWidget->setContextMenuPolicy(Qt::NoContextMenu);
-
+    
+    this->centralWidget()->setContextMenuPolicy(Qt::NoContextMenu);
+    
     //tab control
     tabWidget = new QTabWidget(this);
     tabWidget->setContextMenuPolicy(Qt::NoContextMenu);
@@ -207,13 +273,11 @@
             SLOT(onTabWidgetSelectIndexChanged()));
 
     //output panel
-    QGroupBox *groupBox = new QGroupBox(this);
-    groupBox->setFixedHeight(150);
+    groupBox = new QGroupBox(this);
+    //groupBox->setFixedHeight(150);
     groupBox->setContextMenuPolicy(Qt::NoContextMenu);
     groupBox->setTitle(tr("Information"));
-    QFont serifFont("Times", 5, QFont::Normal);
     txtOutput = new QPlainTextEdit(groupBox);
-    txtOutput->setFont(serifFont);
     txtOutput->setContextMenuPolicy(Qt::NoContextMenu);
     txtOutput->setReadOnly(true);
     txtOutput->setFocusPolicy(Qt::NoFocus);
@@ -226,10 +290,32 @@
     groupBoxLayout->addWidget(txtOutput, 0, 0);
     groupBox->setLayout(groupBoxLayout);
 
+    QDesktopWidget* desktop = QApplication::desktop();
+    QRect rect = desktop->screenGeometry(0);
+    if(rect.height() > rect.width())
+        {
+        mainLayout->addWidget(tabWidget, 0, 0);
+        mainLayout->addWidget(groupBox, 1, 0, Qt::AlignBottom);
+        mainLayout->setRowStretch(0,4);
+        mainLayout->setRowStretch(1,1); 
+        layoutType = true;
+        }
+    else
+        {
+        mainLayout->addWidget(tabWidget, 0, 0);
+        mainLayout->addWidget(groupBox, 0, 1);//Qt::AlignRight
+        //groupBox->setFixedSize(60,0);
+        mainLayout->setColumnStretch(0,1);
+        mainLayout->setColumnStretch(1,1);    
+        layoutType = false;
+        }
+    
     //Create MainLayout and MainWidget
+    this->centralWidget()->setLayout(mainLayout);
     mainLayout->addWidget(tabWidget, 0, 0);
     mainLayout->addWidget(groupBox, 1, 0, Qt::AlignBottom);
-    MainWidget->setLayout(mainLayout);
+    mainLayout->setRowStretch(0,4);
+    mainLayout->setRowStretch(1,1);
     
 
     //Tab page: Case
@@ -249,23 +335,20 @@
 
     QWidget *caseToolWidget = new QWidget(tabCase);
     caseToolWidget->setContextMenuPolicy(Qt::NoContextMenu);
-    QGridLayout *caseToolWidgetLayout = new QGridLayout;
+    QGridLayout *caseToolWidgetLayout = new QGridLayout(this);
     QPushButton *btnRunCase = new QPushButton(tr("Run"), caseToolWidget);
     btnRunCase->setContextMenuPolicy(Qt::NoContextMenu);
-    btnRunCase->setFixedSize(btnSize);
     connect(btnRunCase, SIGNAL(clicked()), this,
             SLOT(on_actRunCaseSeq_triggered()));
     QPushButton *btnExpandAll = new QPushButton(tr("Expand"), caseToolWidget);
     btnExpandAll->setContextMenuPolicy(Qt::NoContextMenu);
-    btnExpandAll->setFixedSize(btnSize);
     connect(btnExpandAll, SIGNAL(clicked()), this,
-            SLOT(on_actExpandAll_triggered()));
+            SLOT(on_actExpand_triggered()));
     QPushButton *btnCollapseAll = new QPushButton(tr("Collapse"),
             caseToolWidget);
     btnCollapseAll->setContextMenuPolicy(Qt::NoContextMenu);
-    btnCollapseAll->setFixedSize(btnSize);
     connect(btnCollapseAll, SIGNAL(clicked()), this,
-            SLOT(on_actCollapseAll_triggered()));
+            SLOT(on_actCollapse_triggered()));
 
     caseToolWidgetLayout->addWidget(btnRunCase, 0, 0);
     caseToolWidgetLayout->addWidget(btnExpandAll, 0, 1);
@@ -318,17 +401,14 @@
     setToolWidgetLayout->setMargin(2);     
     QPushButton *btnRunSetCase = new QPushButton(tr("Run"), setToolWidget);
     btnRunSetCase->setContextMenuPolicy(Qt::NoContextMenu);
-    btnRunSetCase->setFixedSize(btnSize);
     connect(btnRunSetCase, SIGNAL(clicked()), this,
             SLOT(on_actRunSetSeq_triggered()));
     QPushButton *btnNewSet = new QPushButton(tr("New Set"), setToolWidget);
     btnNewSet->setContextMenuPolicy(Qt::NoContextMenu);
-    btnNewSet->setFixedSize(btnSize);
     connect(btnNewSet, SIGNAL(clicked()), this,
             SLOT(on_actNewSet_triggered()));
     QPushButton *btnDelSet = new QPushButton(tr("Delete Set"), setToolWidget);
     btnDelSet->setContextMenuPolicy(Qt::NoContextMenu);
-    btnDelSet->setFixedSize(btnSize);
     connect(btnDelSet, SIGNAL(clicked()), this,
             SLOT(on_actDelSet_triggered()));
 
@@ -358,26 +438,25 @@
     startedToolWidgetLayout->setMargin(2);
     btnPauseCase = new QPushButton(tr("Pause"), startedToolWidget);
     btnPauseCase->setContextMenuPolicy(Qt::NoContextMenu);
-    btnPauseCase->setFixedSize(btnSize);
     connect(btnPauseCase, SIGNAL(clicked()), this,
             SLOT(on_actPause_triggered()));
     btnPauseCase->setEnabled(false);
 
     btnAbortCase = new QPushButton(tr("Abort"), startedToolWidget);
     btnAbortCase->setContextMenuPolicy(Qt::NoContextMenu);
-    btnAbortCase->setFixedSize(btnSize);
     connect(btnAbortCase, SIGNAL(clicked()), this,
             SLOT(on_actAbort_triggered()));
     btnAbortCase->setEnabled(false);
-    //    
-    //    QPushButton *btnShowOutput = new QPushButton(tr("Output"), startedToolWidget);
-    //    connect(btnShowOutput, SIGNAL(clicked()), this,
-    //                SLOT(on_btnShowOutput_clicked()));
+        
+    btnShowOutput = new QPushButton(tr("Output"), startedToolWidget);
+    connect(btnShowOutput, SIGNAL(clicked()), this,
+                SLOT(on_actOutput_triggered()));
+    btnShowOutput->setEnabled(false);
 
 
     startedToolWidgetLayout->addWidget(btnPauseCase, 0, 0);
     startedToolWidgetLayout->addWidget(btnAbortCase, 0, 1);
-    //startedToolWidgetLayout->addWidget(btnShowOutput, 0, 2);
+    startedToolWidgetLayout->addWidget(btnShowOutput, 0, 2);
     startedToolWidget->setLayout(startedToolWidgetLayout);
 
     tabStartedLayout->addWidget(lstStartedCases, 0, 0);
@@ -408,12 +487,14 @@
     abortedItems = new QTreeWidgetItem(treeStatistic);
     abortedItems->setText(0, tr("Aborted Cases(0)"));
     
-    
-    setCentralWidget(MainWidget);
+    //this->repaint();
+
 
     }
 
-void frmMain::LoadSubMenu()
+
+
+void FrmMain::LoadSubMenu()
     {
     menuBar()->clear();
     menuBar()->setContextMenuPolicy(Qt::NoContextMenu);
@@ -421,8 +502,9 @@
         {
         //Cases Tab
         menuBar()->addAction(actOpenFile);
-        menuBar()->addAction(actRunCaseSeq);
-        menuBar()->addAction(actRunCasePar);
+        menuBar()->addMenu(menuRunCase);
+        menuRunCase->addAction(actRunCaseSeq);
+        menuRunCase->addAction(actRunCasePar);
         menuBar()->addSeparator();
         menuBar()->addAction(actAddtoSet);
         menuBar()->addSeparator();
@@ -433,8 +515,9 @@
     else if (tabWidget->currentIndex() == 1)
         {
         //Set Tab
-        menuBar()->addAction(actRunSetSeq);
-        menuBar()->addAction(actRunSetPar);
+        menuBar()->addMenu(menuRunSet);
+        menuRunSet->addAction(actRunSetSeq);
+        menuRunSet->addAction(actRunSetPar);
         menuBar()->addSeparator();
         menuBar()->addAction(actNewSet);
         menuBar()->addAction(actDelSet);
@@ -444,6 +527,7 @@
         //Started Tab
         menuBar()->addAction(actPause);
         menuBar()->addAction(actAbort);
+        menuBar()->addAction(actOutput);
         
         }
     else
@@ -458,12 +542,12 @@
 
     }
 
-void frmMain::onTabWidgetSelectIndexChanged()
+void FrmMain::onTabWidgetSelectIndexChanged()
     {
     LoadSubMenu();
     }
 
-void frmMain::loadContent()
+void FrmMain::loadContent()
     {
     //Load ModuleList
     loadModuleList();
@@ -473,7 +557,7 @@
     loadStatistic();
     }
 
-void frmMain::loadModuleList()
+void FrmMain::loadModuleList()
     {
     treeModuleList->clear();
     
@@ -498,7 +582,7 @@
         }
     }
 
-void frmMain::reloadStatisticItem(QString name, QTreeWidgetItem* item,
+void FrmMain::reloadStatisticItem(QString name, QTreeWidgetItem* item,
         TSTFCaseStatusType type)
     {
     QList<CSTFCase> caseList = controller->GetCasesByStatus(type);
@@ -514,7 +598,7 @@
             }
     }
 
-void frmMain::loadStatistic()
+void FrmMain::loadStatistic()
     {
     //executedItems;
     reloadStatisticItem("Executed Cases", executedItems, EStatusExecuted);
@@ -533,7 +617,7 @@
 
     }
 
-void frmMain::loadSetList()
+void FrmMain::loadSetList()
     {
     cboSetList->clear();
 
@@ -549,7 +633,7 @@
 //        }
     }
 
-QList<CSTFCase> frmMain::getSelectedCases()
+QList<CSTFCase> FrmMain::getSelectedCases()
     {
     int index = 0;
     QTreeWidgetItem* item = treeModuleList->topLevelItem(index);
@@ -574,7 +658,7 @@
     return caseList;
     }
 
-void frmMain::on_cboSetList_currentIndexChanged(QString item)
+void FrmMain::on_cboSetList_currentIndexChanged(QString item)
     {
     lstSetCases->clear();
     QList<QString> list = controller->GetCaseListBySet(item);
@@ -584,48 +668,97 @@
             }
     }
 
-void frmMain::on_actRunCaseSeq_triggered()
+void FrmMain::startRunning()
+    {
+    setSetting();
+    tabWidget->setCurrentWidget(tabStarted);    
+    }
+
+void FrmMain::on_actRunCaseSeq_triggered()
     {
     //run case seq
+    startRunning();
     controller->RunCases(getSelectedCases(), Sequentially);
     }
 
-void frmMain::on_actRunCasePar_triggered()
+void FrmMain::on_actRunCasePar_triggered()
     {
+    startRunning();
     controller->RunCases(getSelectedCases(), Parallel);
     }
 
-void frmMain::on_actAddtoSet_triggered()
+void FrmMain::on_actAddtoSet_triggered()
     {
 
     QList<CSTFCase> list = getSelectedCases();
     if (list.size() == 0)
         {
         QErrorMessage *errorMessageDialog = new QErrorMessage(this);
+        errorMessageDialog->setAutoFillBackground(true);
         errorMessageDialog->showMessage(tr(
-                "Please select cases you want to added to set."));
+                "<font color =black>Please select cases you want to added to set.</font>"));
         return;
         }
 
     QList<QString> setList = controller->GetSetList();
 
-    /*    
-     bool ok;
-     QString setName = QInputDialog::getItem(this, tr(
-     "Add select cases to Set"), tr("Sets:"), setList, 0, false, &ok);
-     if (ok && !setName.isEmpty())
-     {
-     controller->AddCaseToSet(list, setName);
-     }
-     */
+    DlgSetSelector dlgSet(setList, this);
+    int result = dlgSet.exec();
+    QString setName;
+    if(result == QDialog::Accepted)
+        {
+        setName = dlgSet.SelectName();
+        }
+    else
+        {
+        return;
+        }
+    bool rst = false;
+    if(setName == "")
+        {
+        setName = "temp.set";
+        rst = controller->CreateSet(setName);
+        if(!rst)
+            {
+            return;
+            }
+        }
+    controller->AddCaseToSet(list, setName);
+//
+//     bool ok;
+//     QString setName = QInputDialog::getItem(this, tr(
+//     "\r\nAdd select cases to Set"), tr("\r\n\r\nSets:"), setList, 0, false, &ok, Qt::Dialog);
+//     if (ok && !setName.isEmpty())
+//     {
+//     if(setName == newSet)
+//         {
+//         ok = controller->CreateSet(setName);
+//         if(!ok)
+//             {
+//             return;
+//             }
+//         }
+//     controller->AddCaseToSet(list, setName);
+//     }
+    tabWidget->setCurrentIndex(1);
+    int index = -1;
+    for(int i=0;i<cboSetList->count();i++)
+        {
+        if(cboSetList->itemText(i) == setName)
+            {
+            index = i;
+            break;
+            }
+        }
+    if(index != -1)
+        {
+        cboSetList->setCurrentIndex(index);
+        }
 
-    //temp code, because UIStore()->AddCaseToSet() is not support to define a set name.
-    controller->AddCaseToSet(list, "");
-    tabWidget->setCurrentIndex(1);
-
+    
     }
 
-void frmMain::on_actSelectAll_triggered()
+void FrmMain::on_actSelectAll_triggered()
     {
     QString header = UNSELECTITEMHEADER;
     if(actSelectAll->text() == "Select All")
@@ -653,17 +786,36 @@
         }
     }
 
-void frmMain::on_actExpandAll_triggered()
+void FrmMain::on_actExpandAll_triggered()
     {
+    QTreeWidgetItem* item = treeModuleList->currentItem();
     treeModuleList->expandAll();
+    if(item != NULL)
+        {
+        treeModuleList->setCurrentItem(item);
+        }
+        
     }
 
-void frmMain::on_actCollapseAll_triggered()
+void FrmMain::on_actCollapseAll_triggered()
     {
+    QTreeWidgetItem* item = treeModuleList->currentItem();
+    if(item != NULL)
+        {
+        if(item->parent() != NULL)
+            {
+            item = item->parent();
+            }
+        }
     treeModuleList->collapseAll();
+    if(item != NULL)
+        {
+        treeModuleList->setCurrentItem(item);
+        }
+    
     }
 
-void frmMain::on_actSetting_triggered()
+void FrmMain::on_actSetting_triggered()
     {
     DlgSetting dlgSet(uiSetting);
     int result = dlgSet.exec();
@@ -673,75 +825,71 @@
         }
     }
 
-void frmMain::on_actRunSetSeq_triggered()
+void FrmMain::on_actRunSetSeq_triggered()
     {
+    startRunning();
     QString setName = cboSetList->currentText();
     controller->RunSets(setName, Sequentially);
     }
 
-void frmMain::on_actRunSetPar_triggered()
+void FrmMain::on_actRunSetPar_triggered()
     {
+    startRunning();
     QString setName = cboSetList->currentText();
     controller->RunSets(setName, Parallel);
     }
 
-void frmMain::on_actNewSet_triggered()
+void FrmMain::on_actNewSet_triggered()
     {
-    //not supported.
-    QErrorMessage *errorMessageDialog = new QErrorMessage(this);
-    errorMessageDialog->showMessage(
-            tr(
-                    "The feature is not supported in this version.\r\n    \
-            If you want to Add test set.\r\n           \
-            Please switch to \"Case\" tab, Select case(s) and perform \"Add case to set\"."));
-    return;
-    /*
-     * These function is not supported in this version.
-     * Unless this function has been impelemented:
-     * UIStore()->AddSet(setName);
-     * 
-     bool ok;
-     QString text = QInputDialog::getText(this, tr("Create a new Set"), tr(
-     "Input a set name:"), QLineEdit::Normal, QDir::home().dirName(),
-     &ok);
-     if (ok && !text.isEmpty())
-     {
-     controller->CreateSet(text);
-     }
-     */
+    QString name;
+    bool rst = controller->CreateSet(name);
+    if(rst)
+        {
+        QMessageBox::information(this, 
+                tr("Create Set Successfully"), 
+                "Create a new test set, named: " + name);
+
+        int index = -1;
+        for(int i=0;i<cboSetList->count();i++)
+            {
+            if(cboSetList->itemText(i) == name)
+                {
+                index = i;
+                break;
+                }
+            }
+        if(index != -1)
+            {
+            cboSetList->setCurrentIndex(index);
+            }
+
+        
+        }
+    else
+        {
+        QMessageBox::information(this, 
+                tr("Create Set Failed"), 
+                tr("Please check the log for more information."));
+    
+        }
+    
     }
 
-void frmMain::on_actDelSet_triggered()
+void FrmMain::on_actDelSet_triggered()
     {
-    //not supported.
-    QErrorMessage *errorMessageDialog = new QErrorMessage(this);
-    errorMessageDialog->showMessage(
-            tr(
-                    "The feature is not supported in this version.\r\n    \
-            If you want to remove test set.\r\n           \
-            Please delete them under {epoc root}\\winscw\\c\\TestFramework  \
-            And restart Application"));
-    return;
-    /*
-     * These function is not supported in this version.
-     * Unless this function has been impelemented:
-     * UIStore()->RemoveSet(setName);
-     * 
-     QString setName = cboSetList->currentText();
-     QMessageBox msgBox(QMessageBox::Warning, tr("Delete a Set"), tr(
-     "Do you really want to delete the set?"), 0, this);
-     msgBox.addButton(tr("&Delete"), QMessageBox::AcceptRole);
-     msgBox.addButton(tr("&Cancel"), QMessageBox::RejectRole);
-     if (msgBox.exec() == QMessageBox::AcceptRole)
-     {
-     controller->DeleteSet(setName);
-     }
-     
-     
-     */
+        QString setName = cboSetList->currentText();
+        QMessageBox msgBox(QMessageBox::Warning, tr("Delete a Set"), tr(
+        "Do you really want to delete the set?"), 0, this);
+        msgBox.addButton(tr("&Delete"), QMessageBox::AcceptRole);
+        msgBox.addButton(tr("&Cancel"), QMessageBox::RejectRole);
+        if (msgBox.exec() == QMessageBox::AcceptRole)
+        {
+        controller->DeleteSet(setName);
+        }
+
     }
 
-void frmMain::on_actPause_triggered()
+void FrmMain::on_actPause_triggered()
     {
     if (btnPauseCase->text() == "Pause")
         {
@@ -757,12 +905,12 @@
         }
     }
 
-void frmMain::on_actAbort_triggered()
+void FrmMain::on_actAbort_triggered()
     {
     controller->AbortCase();
     }
 
-void frmMain::on_treeModuleList_itemClicked(QTreeWidgetItem* item, int /*column*/)
+void FrmMain::on_treeModuleList_itemClicked(QTreeWidgetItem* item, int /*column*/)
     {
     QString header = UNSELECTITEMHEADER;
     if(item->text(0).startsWith(UNSELECTITEMHEADER))
@@ -776,34 +924,72 @@
         }
     }
 
-void frmMain::on_actAbout_triggered()
+void FrmMain::on_actAbout_triggered()
     {
-    QString str = QtUIVersion;
-    str.append("\r\n").append("STF version:");
+    QString str = QtUIName + "<&nbsp;>" + QtUIVersion;
+    str.append("<br>").append("engine version:");
     
     str.append(QString::number(STIF_MAJOR_VERSION, 10)).append(".");
     str.append(QString::number(STIF_MINOR_VERSION, 10)).append(".");
     str.append(QString::number(STIF_BUILD_VERSION, 10));
-    str.append("  --").append(STIF_REL_DATE).append("\r\n");
+    str.append("  --").append(STIF_REL_DATE).append("<br>");
     str.append("---");
-    str.append("\r\nCopyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. ");
+    str.append("Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. ");
 
-    QMessageBox::information(this, tr("About"), str);
+    QErrorMessage *errorMessageDialog = new QErrorMessage(this);
+    errorMessageDialog->showMessage("<font color =black size=12px><b>" + str + "</b></font>");
+    
     }
 
-void frmMain::on_actOpenFile_triggered()
+void FrmMain::on_actOpenFile_triggered()
     {
     QString fileName = QFileDialog::getOpenFileName(this, tr(
             "Select ini file"), tr("c:\\"), tr(
             "Ini Files (*.ini);;All Files (*)"));
     if (!fileName.isEmpty())
         {
-        controller->OpenEngineIniFile(fileName);
-        this->loadModuleList();
+        bool result = controller->OpenEngineIniFile(fileName);
+        if(result)
+            {
+            this->loadModuleList();   
+            QMessageBox::information(this, tr("Open INI File"), "Load Engine INI file successfully!");
+            }
+        else
+            {
+            QMessageBox::warning(this, tr("Open INI File"),"Failed to Load Engine INI file. Please check the file format and its path.");
+            }
+        
         }
     }
 
-void frmMain::on_actClearStatistics_triggered()
+void FrmMain::on_actClearStatistics_triggered()
     {
     model->ClearCasesStatus();
     }
+
+
+void FrmMain::on_actExpand_triggered()
+    {
+    QTreeWidgetItem* item = treeModuleList->currentItem();
+    if(item != NULL)
+        {
+        item->setExpanded(true);
+        }
+    }
+
+void FrmMain::on_actCollapse_triggered()
+    {
+
+    QTreeWidgetItem* item = treeModuleList->currentItem();
+    if(item != NULL)
+        {
+        item->setExpanded(false);
+        }
+    }
+
+void FrmMain::on_actOutput_triggered()
+    {
+    controller->SetShowOutput(true);
+    }
+
+
--- a/stifui/qt/src/main.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/src/main.cpp	Fri May 14 15:15:12 2010 +0300
@@ -20,8 +20,9 @@
 
 int main(int argc, char* argv[])
 {
+    Q_INIT_RESOURCE(StfQtUI);
     QApplication app(argc, argv);
-    frmMain win;
+    FrmMain win;
     win.showMaximized();
     return app.exec();
 }
--- a/stifui/qt/src/stfqtuicontroller.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/src/stfqtuicontroller.cpp	Fri May 14 15:15:12 2010 +0300
@@ -18,18 +18,16 @@
 #include "stfqtuicontroller.h"
 #include <stifinternal/UIStoreIf.h>
 #include <stifinternal/UIStoreContainer.h>
-//#include "stiflogger.h"
 #include <QDateTime>
 
 const QString TEMPSETNAME = "TEMPSET";
 const QString DEFAULTINI = "c:\\testframework\\testframework.ini";
 
-//__DECLARE_LOG
+
 
 StfQtUIController::StfQtUIController(IStfQtUIModel* aModel) :
     model(aModel), isShowOutput(false)
     {
-//    __OPENLOGL ("\\STFQtUI\\", "StifQtUi.log" );
     executor = new CStifExecutor();
     executor->OpenIniFile(DEFAULTINI);
     executor->AddStifCaseUpdateListener(this);
@@ -40,15 +38,20 @@
     executor->RemoveStifCaseUpdateListener(this);
     delete executor;
     executor = NULL;
-//    __CLOSELOG;
     }
 //for cases
 
 bool StfQtUIController::OpenEngineIniFile(const QString& fileName)
     {
+    QString path = fileName;
+    if(path.contains('/'))
+        {
+        path = path.replace('/', '\\');
+        }
+    executor->RemoveStifCaseUpdateListener(this);
     delete executor;
     executor = new CStifExecutor();
-    bool rst = executor->OpenIniFile(fileName);
+    bool rst = executor->OpenIniFile(path);
     executor->AddStifCaseUpdateListener(this);
     return rst;
     }
@@ -132,19 +135,26 @@
         }
     }
 
-void StfQtUIController::AddCaseToSet(const QList<CSTFCase>& caseList,
-        const QString& /*setName*/)
+bool StfQtUIController::AddCaseToSet(const QList<CSTFCase>& caseList,
+        const QString& setName)
     {
-    QString setName = QDateTime::currentDateTime().toString("hh_mm_ss");
-    setName.append(".set");
-    executor->CreateSet(setName);
+    QString name = setName;
+    bool rst = true;
     foreach(CSTFCase aCase, caseList)
             {
-            executor->AddtoSet(setName, aCase);
+            rst = executor->AddtoSet(name, aCase);
+            if(!rst)
+                {
+                break;
+                }
             }
-    executor->SaveSet(setName);
-    executor->RemoveSet(setName);
+    if(!rst)
+        {
+        return false;
+        }
+    rst = executor->SaveSet(name);
     FireOnSetListChanged();
+    return rst;
     }
 
 //for set
@@ -164,18 +174,29 @@
     return caseList;
     }
 
-void StfQtUIController::CreateSet(const QString& setName)
+bool StfQtUIController::CreateSet(QString& setName)
     {
-    executor->CreateSet(setName);
-    //executor->SaveSet(setName);
+    bool rst = executor->CreateSet(setName);
+    if(!rst)
+        {
+        return rst;
+        }
+    rst = executor->SaveSet(setName);
     FireOnSetListChanged();
+    return rst;
     }
 
-void StfQtUIController::DeleteSet(const QString& setName)
+bool StfQtUIController::DeleteSet(const QString& setName)
     {
-    executor->RemoveSet(setName);
-    //executor->SaveSet(setName);
+    bool rst = executor->RemoveSet(setName);
+    if(!rst)
+        {
+        return false;
+        }
+    QString name = setName;
+    rst = executor->SaveSet(name);
     FireOnSetListChanged();
+    return rst;
     }
 
 void StfQtUIController::RunSets(const QString& setName, const TSTFCaseRunningType& type)
@@ -203,6 +224,12 @@
     FireOnGetOutput("Case Aborted");
     }
 
+CSTFCase StfQtUIController::GetRunningCase(int index)
+    {
+    CStartedTestCase* startedCase = (CStartedTestCase*) index;
+    return model->GetRunningCase(startedCase);
+    }
+
 bool StfQtUIController::ShowOutput()
     {
     return isShowOutput;
@@ -297,7 +324,7 @@
 void StfQtUIController::FireOnCaseOutputChanged(
         IStfEventListener::CaseOutputCommand cmd, int index, QString msg)
     {
-    if (ShowOutput())
+    if (true)//ShowOutput
         {
         foreach(IStfEventListener* listener, listenerList)
                 {
--- a/stifui/qt/src/stfqtuimodel.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/src/stfqtuimodel.cpp	Fri May 14 15:15:12 2010 +0300
@@ -65,6 +65,11 @@
     FireOnRunningCaseChangedEvent();
     }
 
+CSTFCase StfQtUIModel::GetRunningCase(const CStartedTestCase* startedCase)
+    {
+    return runningCaseList.value(startedCase);
+    }
+
 void StfQtUIModel::AddCaseByStatus(const TSTFCaseStatusType& type, const CSTFCase& aCase)
     {
     switch (type)
--- a/stifui/qt/src/stifexecutor.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/src/stifexecutor.cpp	Fri May 14 15:15:12 2010 +0300
@@ -21,25 +21,41 @@
 #include <f32file.h>
 #include <HAL.h>
 #include <hal_data.h>
-#include <stiflogger.h>
+#include "stiflogger.h"
 #include <QString>
 #include "stifexecutor.h"
 #include "StifTFwIf.h"
 
+_LIT( KLogPath, "\\Logs\\STFUI\\" ); 
+// Log file
+_LIT( KLogFile, "StifUi.log" ); 
 
 CStifExecutor::CStifExecutor() :
     listenerList(NULL)
     {
-//    __LOG(_L("started"));
+    iLog = CStifLogger::NewL( KLogPath, 
+            KLogFile,
+            CStifLogger::ETxt,
+            CStifLogger::EFile,
+            ETrue,
+            ETrue,
+            ETrue,
+            EFalse,
+            ETrue,
+            EFalse,
+            100 );
+
+
+    iLog->Log(_L("started"));
     TInt result;
     TRAP(result, CUIStoreIf::ConstructL());
-//    __LOG1(_L("CUIStoreIf ConstructL, result=%d"), result);
+    iLog->Log(_L("CUIStoreIf ConstructL, result=%d"), result);
     if (result != KErrNone)
         {
         return;
         }
     TRAP(result, iBuffer = HBufC::NewL(500));
-//    __LOG1(_L("Create Case Execution output buffer, result=%d"), result);
+    iLog->Log(_L("Create Case Execution output buffer, result=%d"), result);
 
     }
 
@@ -52,13 +68,13 @@
         delete listenerList;
         listenerList = NULL;
         }
-//    __LOG(_L("finished"));
+    iLog->Log(_L("finished"));
     }
 
 bool CStifExecutor::OpenIniFile(const QString& filename)
     {
     TInt result = UIStore().Open(QString2TPtrC(filename));
-//    __LOG2(_L("Open ini file %s.result=%d"),QString2TPtrC(filename).Ptr(),result);
+    iLog->Log(_L("Open ini file %s.result=%d"),QString2TPtrC(filename).Ptr(),result);
     return (result == KErrNone);
     }
 
@@ -78,10 +94,22 @@
     //#endif
     }
 
+bool CStifExecutor::LogResult(const TInt result,const QString str)
+    {
+    QString tmp = str + " result=%d";
+    iLog->Log(QString2TPtrC(tmp), result);
+    bool rst = true;
+    if(result != KErrNone)
+        {
+        rst = false;
+        }
+    return rst;
+    }
+
 void CStifExecutor::AddStifCaseUpdateListener(
         IStifCaseUpdateListener* listener)
     {
-//    __LOG(_L("AddStifCaseUpdateListener"));
+    iLog->Log(_L("AddStifCaseUpdateListener"));
     if (!listenerList)
         {
         listenerList = new QList<IStifCaseUpdateListener*> ();
@@ -95,7 +123,7 @@
 void CStifExecutor::RemoveStifCaseUpdateListener(
         IStifCaseUpdateListener* listener)
     {
-//    __LOG(_L("RemoveStifCaseUpdateListener"));
+    iLog->Log(_L("RemoveStifCaseUpdateListener"));
     if (!listenerList)
         {
         return;
@@ -112,13 +140,15 @@
     {
     QList<CSTFModule> list;
     RRefArray<TDesC> modules;
-//    __LOG(_L("GetModuleList"));
+    iLog->Log(_L("GetModuleList"));
     TInt ret = UIStore().Modules(modules);
-//    __LOG1(_L("LoadAllModules %d"), ret);
-//    __LOG1(_L("Modules number=%d"), modules.Count());
+    iLog->Log(_L("LoadAllModules %d"), ret);
+    iLog->Log(_L("Modules number=%d"), modules.Count());
     for (TInt i = 0; i < modules.Count(); i++)
         {
-//        __LOG1(_L("Get Module Names %d"), i);
+        iLog->Log(_L("Get Module Names %d"), i);
+        iLog->Log(_L("Get Module Name = %d .=%s"),i,modules[i].Ptr());
+            
         CSTFModule module;
         module.SetName(QString::fromUtf16(modules[i].Ptr(),
                 modules[i].Length()));
@@ -136,10 +166,11 @@
     QList<CSTFCase> list;
     RRefArray<CTestInfo> testCases;
     TInt ret = UIStore().TestCases(testCases, name, KNullDesC);
-//    __LOG1(_L("Get TestCases: %d"), ret);
+    iLog->Log(_L("Get TestCases: %d"), ret);
     for (TInt i = 0; i < testCases.Count(); i++)
         {
-//       __LOG1(_L("Case Number: %d"),testCases[i].TestCaseNum());
+        iLog->Log(_L("Case Number: %d"),testCases[i].TestCaseNum());
+        iLog->Log(_L("Case Name: %s"),testCases[i].TestCaseTitle().Ptr());
         CSTFCase testcase;
         testcase.SetName(TDesC2QString(testCases[i].TestCaseTitle()));
         testcase.SetIndex(i);
@@ -152,20 +183,20 @@
 
 void CStifExecutor::ExecuteSingleCase(const QString& moduleName, const int caseIndex)
     {
-//    __LOG(_L("ExecuteCase start"));
+    iLog->Log(_L("ExecuteCase start"));
     TPtrC name = QString2TPtrC(moduleName);
     RRefArray<CTestInfo> testCases;
     TInt ret = UIStore().TestCases(testCases, name, KNullDesC);
-//    __LOG1(_L("Get TestCases return code=%d"), ret);
+    iLog->Log(_L("Get TestCases return code=%d"), ret);
     if (testCases.Count() > caseIndex)
         {
         TInt index;
         UIStore().StartTestCase(testCases[caseIndex], index);
-//        __LOG1(_L("start test case index=%d"), index);
+        iLog->Log(_L("start test case index=%d"), index);
         }
     testCases.Reset();
     testCases.Close();
-//    __LOG(_L("ExecuteCase end"));
+    iLog->Log(_L("ExecuteCase end"));
 
     }
 
@@ -174,7 +205,7 @@
     QList<QString> list;
     RRefArray<TDesC> aArray;
     TInt ret = UIStore().GetTestSetsList(aArray);
-//    __LOG1(_L("Get TestSet list return code=%d"), ret);
+    iLog->Log(_L("Get TestSet list return code=%d"), ret);
     if (ret != KErrNone) //setInfos.Count() != 1
         {
         return list;
@@ -190,28 +221,28 @@
 
 QList<CSTFCase> CStifExecutor::GetCaseListFromSet(const QString& setName)
     {
-//    __LOG(_L("GetCaseListFromSet start."));
+    iLog->Log(_L("GetCaseListFromSet start."));
     QList<CSTFCase> list;
     TPtrC name = QString2TPtrC(setName);
 
-    //__LOG(name);
+    //iLog->Log(name);
     if (name.Length() == 0)
         {
         return list;
         }
 
-//    __LOG1(_L("name.Length()=%d"), name.Length());
+    iLog->Log(_L("name.Length()=%d"), name.Length());
     TInt ret = UIStore().LoadTestSet(name);
-//    __LOG1(_L("Load Test Set return=%d"),ret);
+    iLog->Log(_L("Load Test Set return=%d"),ret);
     const CTestSetInfo* set = NULL;
     TRAP(ret , set = &UIStore().TestSetL(name));
-//    __LOG(_L("GetCaseListFromSet TestSetL."));
+    iLog->Log(_L("GetCaseListFromSet TestSetL."));
     if(ret != KErrNone)
         {
         return list;
         }
     const RRefArray<const CTestInfo>& testCases = set->TestCases();
-//    __LOG(_L("GetCaseListFromSet TestCases."));
+    iLog->Log(_L("GetCaseListFromSet TestCases."));
     TInt count = testCases.Count();
     for (TInt i = 0; i < count; i++)
         {
@@ -221,58 +252,73 @@
         testcase.SetModuleName(TDesC2QString(testCases[i].ModuleName()));
         list.append(testcase);
         }
-//    __LOG(_L("GetCaseListFromSet end."));
+    iLog->Log(_L("GetCaseListFromSet end."));
     return list;
     }
 
-void CStifExecutor::CreateSet(const QString& setName)
+bool CStifExecutor::CreateSet(const QString& setName)
     {
     TPtrC name = QString2TPtrC(setName);
     TInt ret = UIStore().CreateTestSet(name);
-//    __LOG1(_L("CreateSet return: %d"), ret);
-//    ret = UIStore().LoadTestSet(name);
-//    __LOG1(_L("Load Set after CreateSet return: %d"), ret);
-        
-        
+    return LogResult(ret, "CreateSet");
     }
 
-void CStifExecutor::SaveSet(QString& setName)
+bool CStifExecutor::SaveSet(QString& setName)
     {
     TPtrC name = QString2TPtrC(setName);
     TFileName testSetName;
     testSetName.Copy(name);
-    TInt ret = UIStore().SaveTestSet(testSetName);
+    TInt ret = UIStore().SaveTestSet2(testSetName);
     setName = TDesC2QString(testSetName);
-//    __LOG1(_L("SaveSet return: %d"),ret);
+    return LogResult(ret, "SaveSet");
     }
 
-void CStifExecutor::RemoveSet(const QString& setName)
+bool CStifExecutor::RemoveSet(const QString& setName)
     {
     //This method wil not work at this stage.
     TPtrC name = QString2TPtrC(setName);
-    UIStore().RemoveTestSet(name);
+    TInt ret = UIStore().RemoveTestSet(name);
+    return LogResult(ret, "RemoveSet");
     }
 
-void CStifExecutor::AddtoSet(const QString& setName, CSTFCase& caseInfo)
+bool CStifExecutor::AddtoSet(const QString& setName, CSTFCase& caseInfo)
     {
+    iLog->Log(_L("AddToSet Start"));
+        
     //IMPORT_C TInt AddToTestSet( const TDesC& aSetName, const CTestInfo& aTestInfo );
     TPtrC modulename = QString2TPtrC(caseInfo.ModuleName());
+    iLog->Log(_L("AddToSet dealwith module: %s"), modulename.Ptr());
+    iLog->Log(_L("Case name: %s"),QString2TPtrC(caseInfo.Name()).Ptr());
+    iLog->Log(_L("Case index: %d"),caseInfo.Index());
+    TInt caseIndex = caseInfo.Index();
+    if(caseInfo.ModuleName().toLower() == "testscripter"
+            ||caseInfo.ModuleName().toLower() == "teftestmodule")
+        {
+        caseIndex++;
+        }
     RRefArray<CTestInfo> testCases;
     TInt ret = UIStore().TestCases(testCases, modulename, KNullDesC);
-//    __LOG1(_L("Get TestCases: %d"), ret);
+    if(!LogResult(ret, "AddToSet, GetTestCases"))
+        {
+        return false;
+        }
+    
+    ret = -1;
     for (TInt i = 0; i < testCases.Count(); i++)
         {
-//        __LOG1(_L("Case Number: %d"),testCases[i].TestCaseNum());
-        if (TDesC2QString(testCases[i].TestCaseTitle()) == caseInfo.Name()
-                && testCases[i].TestCaseNum() == caseInfo.Index())
+        iLog->Log(_L("Case Number: %d"),testCases[i].TestCaseNum());
+        iLog->Log(_L("Case Title: %s"),testCases[i].TestCaseTitle().Ptr());        
+        
+        if (testCases[i].TestCaseNum() == caseIndex)
             {
             ret = UIStore().AddToTestSet(QString2TPtrC(setName), testCases[i]);
-//            __LOG1(_L("AddToTestSet: %d"), ret);
+            iLog->Log(_L("AddToTestSet: %d"), ret);
             break;
             }
         }
     testCases.Reset();
     testCases.Close();
+    return LogResult(ret, "AddToSet");
     }
 
 void CStifExecutor::ExecuteSet(const QString& SetName, const int startIndex,
@@ -287,25 +333,25 @@
     TInt ret;
     TBuf<30> test;
     test.Append(QString2TPtrC(SetName));
-//    __LOG(_L("StartTestSet GetSetName:"));
-//    __LOG(test);
+    iLog->Log(_L("StartTestSet GetSetName:"));
+    iLog->Log(test);
     TRAP(ret, set = &UIStore().TestSetL(test));
             
     //const CTestSetInfo& set = UIStore().TestSetL(QString2TPtrC(SetName));
     if(ret != KErrNone)
         {
-//        __LOG1(_L("StartTestSet GetTestSet Error return=%d"),ret);
+        iLog->Log(_L("StartTestSet GetTestSet Error return=%d"),ret);
         return;
         }
     int a = startIndex;
     ret = UIStore().StartTestSet(*set, a, setType);
-//    __LOG1(_L("StartTestSet return=%d"),ret);
+    iLog->Log(_L("StartTestSet return=%d"),ret);
     }
 
 void CStifExecutor::Update(CStartedTestCase* aCase, int flags)
     {
-//    __LOG1(_L("CStifExecutor::Update return case=%d"),aCase);
-//    __LOG1(_L("CStifExecutor::Update return status=%d"),flags);
+    iLog->Log(_L("CStifExecutor::Update return case=%d"),aCase);
+    iLog->Log(_L("CStifExecutor::Update return status=%d"),flags);
     
     if(aCase == NULL)
         {
@@ -328,8 +374,8 @@
             buffer.Append(_L("\r\n"));
             }
         QString msg = TDesC2QString(buffer);
-//        __LOG(_L("Get output msg:"));
-//        __LOG(buffer);
+        iLog->Log(_L("Get output msg:"));
+        iLog->Log(buffer);
         if (listenerList)
             {
             for (int i = 0; i < listenerList->size(); i++)
--- a/stifui/qt/src/uisetting.cpp	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/src/uisetting.cpp	Fri May 14 15:15:12 2010 +0300
@@ -40,6 +40,11 @@
         {
         value = settingList.value(item);
         }
+    else
+        {
+        value = getDefaultValue(item);
+        settingList.insert(item, value);
+        }
     return value;
     }
 
@@ -58,10 +63,24 @@
 void UiSetting::loadDefault()
     {
     settingList.clear();
-    settingList.insert("showoutput", "true");
+    settingList.insert(KShowOutput, getDefaultValue(KShowOutput));
+    settingList.insert(KStyleSheet, getDefaultValue(KStyleSheet));
     //add mor default setting here.
     }
 
+QString UiSetting::getDefaultValue(const QString& item)
+    {
+    QString result = "";
+    if(item == KShowOutput)
+        {
+        result = "true";
+        }
+    else if(item == KStyleSheet)
+        {
+        result = ":/qss/coffee.qss";
+        }
+    return result;
+    }
 
 bool UiSetting::load()
     {
@@ -75,7 +94,7 @@
     int index;
     while(!in.atEnd())
         {
-        line = in.readLine().trimmed().toLower();
+        line = in.readLine().trimmed();
         if(!line.startsWith("//"))
             {
             index = line.indexOf("=");
--- a/stifui/qt/stifqtui.pro	Thu May 13 21:10:48 2010 +0300
+++ b/stifui/qt/stifqtui.pro	Fri May 14 15:15:12 2010 +0300
@@ -1,20 +1,16 @@
-#
 # 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: QT project file.              
-#
-
-HEADERS += inc\version.h \
+# Description: QT project file.
+TARGET = STFUI
+HEADERS += inc/dlgsetselector.h \
+    inc\version.h \
     inc\frmmain.h \
     inc\istfqtuicontroller.h \
     inc\stfqtuicontroller.h \
@@ -25,16 +21,16 @@
     inc\dlgoutput.h \
     inc\uisetting.h \
     inc\dlgsetting.h \
-   
-SOURCES += src\frmmain.cpp \
+    inc\uiversion.h
+SOURCES += src\dlgsetselector.cpp \
+    src\frmmain.cpp \
     src\main.cpp \
     src\stfqtuimodel.cpp \
     src\stfqtuicontroller.cpp \
     src\dlgoutput.cpp \
     src\uisetting.cpp \
-    src\dlgsetting.cpp \
-    
-RESOURCES += 
+    src\dlgsetting.cpp
+RESOURCES += resource\StfQtUI.qrc
 symbian { 
     TARGET.UID3 = 0x2002BCA0
     TARGET.EPOCALLOWDLLDATA = 1
@@ -46,21 +42,15 @@
     INCLUDEPATH += /epoc32/include/domain/osextensions/stif
     HEADERS += inc\stifexecutor.h
     SOURCES += src\stifexecutor.cpp
-    LIBS += -leuser \
-        -lefsrv \
-        -lstiftestinterface \
-        -lstiftfwif \
-        -lstiftestengine \
-        -lecons \
-        -lhal \
-        -lflogger
+    LIBS += -lstiftfwif \
+        -lstiftestinterface
     TARGET.CAPABILITY = AllFiles \
         CommDD
     
     # Export headers to SDK Epoc32/include directory
     deploy.path = $$EPOCROOT
-    exportheaders.sources = $$PUBLIC_HEADERS
-    exportheaders.path = epoc32/include
-    for(header, exportheaders.sources)
-    :BLD_INF_RULES.prj_exports += "$$header $$deploy.path$$exportheaders.path/$$basename(header)"
+    #exportheaders.sources = $$PUBLIC_HEADERS
+    #exportheaders.path = epoc32/include
+    #for(header, exportheaders.sources)
+    #:BLD_INF_RULES.prj_exports += "$$header $$deploy.path$$exportheaders.path/$$basename(header)"
 }