Revision: 201023 RCL_3 PDK_3.0.1
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 15:41:16 +0300
branchRCL_3
changeset 17 65b472535a0d
parent 13 822c625f7adc
child 19 d40e813b23c0
Revision: 201023 Kit: 2010125
htiui/HtiAdminQt/mainview.cpp
htiui/HtiAdminQt/mainview.h
htiui/HtiServicePlugins/HtiAppServicePlugin/group/HtiAppControl.mmp
htiui/HtiServicePlugins/HtiAppServicePlugin/inc/HtiAppControl.h
htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp
htiui/HtiServicePlugins/HtiCameraServicePlugin/src/HtiCameraServicePlugin.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
stifui/avkon/group/ReleaseNote.txt
stifui/avkon/sis/Stifui_31.sis
stifui/avkon/stifui/inc/version.h
stifui/qt/ReleaseNote.txt
stifui/qt/inc/dlgrepeatrun.h
stifui/qt/inc/frmmain.h
stifui/qt/inc/istfqtuicontroller.h
stifui/qt/inc/stfqtuicontroller.h
stifui/qt/inc/version.h
stifui/qt/rom/stfui.iby
stifui/qt/sis/StfQtUI.pkg
stifui/qt/sis/stifqtui.pkg
stifui/qt/sis/stifqtui.sis
stifui/qt/sis/stifqtui.sisx
stifui/qt/src/dlgrepeatrun.cpp
stifui/qt/src/dlgsetselector.cpp
stifui/qt/src/frmmain.cpp
stifui/qt/src/stfqtuicontroller.cpp
stifui/qt/src/stifexecutor.cpp
stifui/qt/stifqtui.pro
--- a/htiui/HtiAdminQt/mainview.cpp	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/HtiAdminQt/mainview.cpp	Mon Jun 21 15:41:16 2010 +0300
@@ -23,7 +23,7 @@
 #include <hblabel.h>
 #include <hbinputdialog.h>
 #include <qgraphicslinearlayout.h>
-//#include <HbListDialog.h>
+#include <hbselectiondialog.h>
 #include <hbmessagebox.h>
 
 
@@ -260,200 +260,231 @@
 	mEngineWrapper.stopHti();
 }
 
+
 // ---------------------------------------------------------------------------
 void MainView::enableComm()
 {
     //Get current selection
-//	QString currentComm;
-//	mEngineWrapper.getSelectedComm(currentComm);
-//	int curSelection = mPluginList.indexOf(currentComm, 0);
-//	
-//	QStringList selection;
-//	bool ok = false;
-//	selection = HbListDialog::getStringItems("Select Comm", mPluginList, curSelection, &ok, HbAbstractItemView::SingleSelection);
-//		
-//	if(ok){
-//			if(selection[0] == QString("Bt serial comm")){
-//				enableBTComm();
-//			}
-//			else if(selection[0] == QString("IP comm")){
-//				enableIPComm();
-//			}
-//			else if(selection[0] == QString("SERIAL comm")){
-//				enableSerialComm();
-//			}
-//			else{
-//				//All other comm plugins
-//				mEngineWrapper.enableOtherComm(selection[0]);
-//			}	
-//		}
+	QString currentComm;
+	mEngineWrapper.getSelectedComm(currentComm);
+	int curSelection = mPluginList.indexOf(currentComm, 0);
+	openListDialog(mPluginList, curSelection, QString("Select Comm"), this, SLOT(doSelectComm(HbAction*)));
 }
 
+void MainView::doSelectComm(HbAction* action)
+{
+    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
+    if(dlg && dlg->selectedModelIndexes().count() &&
+            (!action || action == dlg->actions().at(0)))
+    {
+        int selectionIndex = dlg->selectedModelIndexes().at(0).row();
+
+        if (mPluginList[selectionIndex] == QString("Bt serial comm"))
+        {
+            enableBTComm();
+        }
+        else if (mPluginList[selectionIndex] == QString("IP comm"))
+        {
+            enableIPComm();
+        }
+        else if (mPluginList[selectionIndex] == QString("SERIAL comm"))
+        {
+            enableSerialComm();
+        }
+        else
+        {
+            //All other comm plugins
+            mEngineWrapper.enableOtherComm(mPluginList[selectionIndex]);
+        }   
+    }    
+}
 // ---------------------------------------------------------------------------
 void MainView::enableSerialComm()
 {
-//	bool ok = false;
-//    QString str = HbInputDialog::getText(
-//					"Set Comm Port number ",
-//					"",
-//					&ok);
-//    
-//    if(ok){
-//    	mEngineWrapper.enableSerial(str);
-//    }
+    QString heading = QString("Set Comm Port number");
+    HbInputDialog::getInteger(heading, this, SLOT(doEnableSerialComm(HbAction*)), 0, scene());
 }
 
-
+void MainView::doEnableSerialComm(HbAction* action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->actions().at(0))
+    {
+        QString strPortNumber = dlg->value().toString();
+        mEngineWrapper.enableSerial(strPortNumber);
+    }
+}
 // ---------------------------------------------------------------------------
 void MainView::enableIPComm()
 {
     // Get IAPs list
-//    QStringList iapsList;
-//    mEngineWrapper.listIAPs(iapsList); 
-//    if(iapsList.count() == 0)
-//    {
-//        HbMessageBox msg("No IAPs for selection!", HbMessageBox::MessageTypeWarning);
-//        msg.exec();
-//        return;
-//    }
-//    
-//    // Get current selection
-//    QString curIapName;
-//    QString param = "IAPName";
-//    mEngineWrapper.getIPCfgParam(param, curIapName);
-//    int curSelction = iapsList.indexOf(curIapName, 0);
-//    
-//    QString iap;
-//	QStringList selection;
-//	bool ok = false;
-//	selection = HbListDialog::getStringItems("Select IAP:", iapsList, curSelction, &ok, HbAbstractItemView::SingleSelection);
-//	
-//	if(ok)
-//	{
-//        iap = selection[0];
-//	}
-//	else
-//	{
-//        return;
-//	}
-//	
-//	QStringList srcList;
-//	srcList <<"Listen" <<"Connect";
-//	
-//	selection = HbListDialog::getStringItems("Select IP Comm", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
-//	
-//	if(ok){
-//		if(selection[0] == srcList[0]){
-//			QString port = HbInputDialog::getText(
-//								"Local port",
-//								"",
-//								&ok);	
-//		
-//			if(ok){
-//				mEngineWrapper.ipListen(port, iap);
-//			}
-//			
-//		}
-//		else{
-//			QString host = HbInputDialog::getText(
-//								"Remote Host",
-//								"",
-//								&ok);	
-//					
-//			if(ok){
-//				QString port = HbInputDialog::getText(
-//												"Remote port",
-//												"",
-//												&ok);	
-//			
-//				if(ok){
-//					mEngineWrapper.ipConnect(host, port, iap);
-//				}
-//			}
-//		}
-//			
-//	}
+    QStringList iapsList;
+    mEngineWrapper.listIAPs(iapsList); 
+    if(iapsList.count() == 0)
+    {
+        HbMessageBox::warning(QString("No IAPs for selection!"));
+        return;
+    }
+    
+    // Get current selection
+    QString curIapName;
+    QString param = "IAPName";
+    mEngineWrapper.getIPCfgParam(param, curIapName);
+    int curSelection = iapsList.indexOf(curIapName, 0);
+    
+    openListDialog(iapsList, curSelection, QString("Select IAP:"), this, SLOT(doSelectIAP(HbAction*)));
+}
+
+void MainView::doSelectIAP(HbAction* action)
+{
+    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
+    if(dlg && dlg->selectedModelIndexes().count() &&
+            (!action || action == dlg->actions().at(0)))
+    {
+        int selectionIndex = dlg->selectedModelIndexes().at(0).row();
+        mIapSelection = dlg->stringItems()[selectionIndex];
+        
+        QStringList items;
+        items <<"Listen" <<"Connect";
+        openListDialog(items, 0, QString("Select IP Comm"), this, SLOT(doSelectIpComm(HbAction*)));
+    }  
+}
+
+void MainView::doSelectIpComm(HbAction* action)
+{
+    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
+    if(dlg && dlg->selectedModelIndexes().count() &&
+            (!action || action == dlg->actions().at(0)))
+    {
+        int selectionIndex = dlg->selectedModelIndexes().at(0).row();
+        if(selectionIndex == 0) //Listen
+        {
+            HbInputDialog::getInteger(QString("Local port"), this, SLOT(doListenOnPort(HbAction*)), 0, scene());
+        }
+        else //Connect
+        {
+            openIPAddressDialog(QString("Remote Host"), this, SLOT(doConnectRemoteHost(HbAction*)));
+        }
+    }
+}
+
+void MainView::doListenOnPort(HbAction* action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->actions().at(0))
+    {
+        QString port = dlg->value().toString();
+        mEngineWrapper.ipListen(port, mIapSelection);
+    }
+}
+
+void MainView::doConnectRemoteHost(HbAction* action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->actions().at(0))
+    {
+        QString host = dlg->value(0).toString();
+        QString port = dlg->value(1).toString();
+        mEngineWrapper.ipConnect(host, port, mIapSelection);
+    }
 }
 
 // ---------------------------------------------------------------------------
 void MainView::enableBTComm()
 {
-//	QStringList srcList;
-//	QStringList selection;
-//	 
-//	srcList <<"BT address" <<"BT name" <<"Search when starting" ;
-//	
-//	bool ok = false;
-//	selection = HbListDialog::getStringItems("", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
-//	
-//	if(ok){
-//		if(selection[0] == srcList[0]){
-//			QString address = HbInputDialog::getText(
-//						"BT address",
-//						"",
-//						&ok);
-//		
-//			if(ok){
-//				mEngineWrapper.enableBtByAddress(address);	
-//			}
-//		}
-//		else if(selection[0] == srcList[1]){
-//			QString name = HbInputDialog::getText(
-//								"BT name",
-//								"",
-//								&ok);
-//				
-//					if(ok){
-//						mEngineWrapper.enableBtByName(name);	
-//					}
-//		}
-//		else if(selection[0] == srcList[2]){
-//			mEngineWrapper.btSearch();
-//		}
-//	}
+	QStringList items;
+	items <<"BT address" <<"BT name" <<"Search when starting" ;
+	openListDialog(items, 0, QString("Bluetooth Comm"), this, SLOT(doSelectBTComm(HbAction*)));
 }
 
+void MainView::doSelectBTComm(HbAction* action)
+{
+    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
+    if(dlg && dlg->selectedModelIndexes().count() &&
+            (!action || action == dlg->actions().at(0)))
+    {
+        int selectionIndex = dlg->selectedModelIndexes().at(0).row();
+        if(selectionIndex == 0)
+        {
+            HbInputDialog::getText(QString("BT address"), this, SLOT(doEnableByBTAddress(HbAction*)));
+        }
+        else if(selectionIndex == 1)
+        {
+            HbInputDialog::getText(QString("BT name"), this, SLOT(doEnableByBTName(HbAction*)));
+        }
+        else if(selectionIndex == 2)
+        {
+            mEngineWrapper.btSearch();
+        }
+    }
+}
+
+void MainView::doEnableByBTAddress(HbAction* action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->actions().at(0))
+    {
+        QString address = dlg->value().toString();
+        mEngineWrapper.enableBtByAddress(address);
+    }
+}
+void MainView::doEnableByBTName(HbAction* action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->actions().at(0))
+    {
+        QString name = dlg->value().toString();
+        mEngineWrapper.enableBtByName(name);
+    }
+}
 
 // ---------------------------------------------------------------------------
 void MainView::setPriority()
 {
     // Get current priority
-//    bool ok = false;
-//    QString curPriority;
-//    QString param = "Priority";
-//    mEngineWrapper.getHtiCfgParam(param, curPriority);
-//    int curSelection = curPriority.toInt(&ok);
-//    if(ok){
-//        curSelection--;
-//    }
-//    else{
-//    curSelection = 2;
-//    }
-//    
-//	QStringList srcList;
-//	QStringList selection;
-//	 
-//	srcList <<"Backgroung" <<"Foregound" <<"High" << "Absolute High";
-//	
-//	
-//	selection = HbListDialog::getStringItems("Select Hti Priority", srcList, curSelection, &ok, HbAbstractItemView::SingleSelection);
-//	
-//	if(ok){
-//		if(selection[0] == srcList[0]){
-//			mEngineWrapper.setPriorityBackground();
-//		}
-//		else if(selection[0] == srcList[1]){
-//					mEngineWrapper.setPriorityForeground();
-//		}
-//		else if(selection[0] == srcList[2]){
-//			mEngineWrapper.setPriorityHigh();
-//		}
-//		else{
-//			mEngineWrapper.setPriorityAbsoluteHigh();
-//		}	
-//	}
+    bool ok = false;
+    QString curPriority;
+    QString param = "Priority";
+    mEngineWrapper.getHtiCfgParam(param, curPriority);
+    int curSelection = curPriority.toInt(&ok);
+    if(ok){
+        curSelection--;
+    }
+    else{
+    curSelection = 2;
+    }
+    
+	QStringList items;
+	items <<"Backgroung" <<"Foregound" <<"High" << "Absolute High";
+	openListDialog(items, curSelection, QString("Select Hti Priority"), 
+	        this, SLOT(doSetPriority(HbAction*)));
 }
 
+void MainView::doSetPriority(HbAction* action)
+{
+    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
+    if(dlg && dlg->selectedModelIndexes().count() &&
+            (!action || action == dlg->actions().at(0)))
+    {
+        int selectionIndex = dlg->selectedModelIndexes().at(0).row();
+        if(selectionIndex == 0)
+        {
+            mEngineWrapper.setPriorityBackground();
+        }
+        else if(selectionIndex == 1)
+        {
+            mEngineWrapper.setPriorityForeground();
+        }
+        else if(selectionIndex == 2)
+        {
+            mEngineWrapper.setPriorityHigh();
+        }
+        else
+        {
+            mEngineWrapper.setPriorityAbsoluteHigh();
+        }
+    }
+}
 // ---------------------------------------------------------------------------
 void MainView::enableAutoStart()
 {
@@ -493,62 +524,203 @@
 // ---------------------------------------------------------------------------
 void MainView::showParamList()
 {
-//	QStringList srcList;
-//	QStringList selection;
-//	QString value;
-//	QString name;
-//	QString cfgSelection;
-//	QString paramSelection;
-//	QString cfgHti = "Hti.cfg";
-//	QString cfgBtComm ="HtiBtComm.cfg";
-//	QString cfgSerialComm = "HtiSerialComm.cfg";
-//	QString cfgIPComm = "HtiIPComm.cfg";
-//	 
-//	srcList <<cfgHti <<cfgBtComm <<cfgSerialComm << cfgIPComm;
-//	
-//	bool ok = false;
-//	selection = HbListDialog::getStringItems("Select cfg file to modify", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
-//	
-//	if(ok){
-//        cfgSelection = selection[0];
-//        srcList.clear();
-//	    if(cfgSelection == cfgHti){
-//	    srcList <<"CommPlugin" <<"MaxMsgSize" <<"MaxQueueSize" <<"MaxHeapSize"<<"Priority"
-//	            <<"ShowConsole"<<"MaxWaitTime"<<"StartUpDelay"<<"EnableHtiWatchDog"
-//	            <<"EnableHtiAutoStart"<<"ShowErrorDialogs"<<"ReconnectDelay";
-//	    }
-//	    else if(cfgSelection == cfgBtComm){
-//	        srcList <<"BtDeviceName" <<"BtDeviceName";
-//	    }
-//	    else if(cfgSelection == cfgSerialComm){
-//            srcList <<"CommPort" <<"DataRate"<<"Parity"<<"DataBits"<<"StopBits"<<"SendDelay"<<"Handshake";
-//	    }
-//	    else{
-//	    srcList <<"IAPName"<<"LocalPort"<<"RemoteHost"<<"RemotePort"<<"ConnectTimeout";
-//	    }
-//	    
-//	    selection = HbListDialog::getStringItems("Select a parameter name in" + cfgSelection, srcList, 0, &ok, HbAbstractItemView::SingleSelection);
-//	}
-//    
-//    if(ok){
-//        name = selection[0];
-//        value = HbInputDialog::getText("Value for paramater " + name, "", &ok);
-//    }
-//    
-//    if(ok){
-//       if(cfgSelection == cfgHti){
-//            mEngineWrapper.setHtiCfgParam(name, value);
-//        }
-//        else if(cfgSelection == cfgBtComm){
-//            mEngineWrapper.setBtCfgParam(name, value);
-//        }
-//        else if(cfgSelection == cfgSerialComm){
-//            mEngineWrapper.setSerialCfgParam(name, value);
-//        }
-//        else{
-//            mEngineWrapper.setIPCfgParam(name, value);
-//        }   
-//    }
+    QStringList items;
+    items << "Hti.cfg" << "HtiBtComm.cfg" << "HtiSerialComm.cfg" << "HtiIPComm.cfg";
+    openListDialog(items, 0, QString("Select cfg file to modify"), 
+            this, SLOT(doSelectCfgFile(HbAction*)));
+}
+
+void MainView::doSelectCfgFile(HbAction* action)
+{
+    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
+    if(dlg && dlg->selectedModelIndexes().count() &&
+            (!action || action == dlg->actions().at(0)))
+    {
+        int selectionIndex = dlg->selectedModelIndexes().at(0).row();
+        QStringList items;
+        if(selectionIndex == 0)
+        {
+            items <<"CommPlugin" <<"MaxMsgSize" <<"MaxQueueSize" <<"MaxHeapSize"<<"Priority"
+                    <<"ShowConsole"<<"MaxWaitTime"<<"StartUpDelay"<<"EnableHtiWatchDog"
+                    <<"EnableHtiAutoStart"<<"ShowErrorDialogs"<<"ReconnectDelay";
+            openListDialog(items, 0, QString("Hti.cfg"), this, SLOT(doModifyHtiCfgFile(HbAction*)));
+        }
+        else if(selectionIndex == 1)
+        {
+            items <<"BtDeviceName" <<"BtDeviceName";
+            openListDialog(items, 0, QString("HtiBtComm.cfg"), this, SLOT(doModifyBtCfgFile(HbAction*)));
+        }
+        else if(selectionIndex == 2)
+        {
+            items <<"CommPort" <<"DataRate"<<"Parity"<<"DataBits"<<"StopBits"<<"SendDelay"<<"Handshake";
+            openListDialog(items, 0, QString("HtiSerialComm.cfg"), this, SLOT(doModifySerialCfgFile(HbAction*)));
+        }
+        else
+        {
+            items <<"IAPName"<<"LocalPort"<<"RemoteHost"<<"RemotePort"<<"ConnectTimeout";
+            openListDialog(items, 0, QString("HtiIPComm.cfg"), this, SLOT(doModifyIPCfgFile(HbAction*)));
+        }
+    }
+}
+
+void MainView::doModifyHtiCfgFile(HbAction* action)
+{
+    HbSelectionDialog *dlgSelection = static_cast<HbSelectionDialog*>(sender());
+    if(dlgSelection && dlgSelection->selectedModelIndexes().count() &&
+            (!action || action == dlgSelection->actions().at(0)))
+    {
+        int selectionIndex = dlgSelection->selectedModelIndexes().at(0).row();
+        HbInputDialog* dlgInput = new HbInputDialog();
+        dlgInput->setAttribute(Qt::WA_DeleteOnClose);
+        dlgInput->setPromptText(dlgSelection->stringItems()[selectionIndex]);
+        dlgInput->setInputMode(HbInputDialog::TextInput);
+        
+        HbLabel *title = new HbLabel(dlgInput);
+        title->setPlainText(QString("Set parameter value"));
+        dlgInput->setHeadingWidget(title);
+        
+        dlgInput->open(this, SLOT(doSetHtiCfgParameter(HbAction*)));
+    }
+}
+
+void MainView::doSetHtiCfgParameter(HbAction* action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->actions().at(0))
+    {
+        QString parameter = dlg->promptText();
+        QString value = dlg->value().toString();
+        mEngineWrapper.setHtiCfgParam(parameter, value);
+    }
+}
+
+void MainView::doModifyBtCfgFile(HbAction* action)
+{
+    HbSelectionDialog *dlgSelection = static_cast<HbSelectionDialog*>(sender());
+    if(dlgSelection && dlgSelection->selectedModelIndexes().count() &&
+            (!action || action == dlgSelection->actions().at(0)))
+    {
+        int selectionIndex = dlgSelection->selectedModelIndexes().at(0).row();
+        HbInputDialog* dlgInput = new HbInputDialog();
+        dlgInput->setAttribute(Qt::WA_DeleteOnClose);
+        dlgInput->setPromptText(dlgSelection->stringItems()[selectionIndex]);
+        dlgInput->setInputMode(HbInputDialog::TextInput);
+        
+        HbLabel *title = new HbLabel(dlgInput);
+        title->setPlainText(QString("Set parameter value"));
+        dlgInput->setHeadingWidget(title);
+        
+        dlgInput->open(this, SLOT(doSetBtCfgParameter(HbAction*)));
+    }
 }
 
+void MainView::doSetBtCfgParameter(HbAction* action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->actions().at(0))
+    {
+        QString parameter = dlg->promptText();
+        QString value = dlg->value().toString();
+        mEngineWrapper.setBtCfgParam(parameter, value);
+    }
+}
 
+void MainView::doModifySerialCfgFile(HbAction* action)
+{
+    HbSelectionDialog *dlgSelection = static_cast<HbSelectionDialog*>(sender());
+    if(dlgSelection && dlgSelection->selectedModelIndexes().count() &&
+            (!action || action == dlgSelection->actions().at(0)))
+    {
+        int selectionIndex = dlgSelection->selectedModelIndexes().at(0).row();
+        HbInputDialog* dlgInput = new HbInputDialog();
+        dlgInput->setAttribute(Qt::WA_DeleteOnClose);
+        dlgInput->setPromptText(dlgSelection->stringItems()[selectionIndex]);
+        dlgInput->setInputMode(HbInputDialog::TextInput);
+        
+        HbLabel *title = new HbLabel(dlgInput);
+        title->setPlainText(QString("Set parameter value"));
+        dlgInput->setHeadingWidget(title);
+        
+        dlgInput->open(this, SLOT(doSetSerialCfgParameter(HbAction*)));
+    }
+}
+
+void MainView::doSetSerialCfgParameter(HbAction* action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->actions().at(0))
+    {
+        QString parameter = dlg->promptText();
+        QString value = dlg->value().toString();
+        mEngineWrapper.setSerialCfgParam(parameter, value);
+    }
+}
+
+void MainView::doModifyIPCfgFile(HbAction* action)
+{
+    HbSelectionDialog *dlgSelection = static_cast<HbSelectionDialog*>(sender());
+    if(dlgSelection && dlgSelection->selectedModelIndexes().count() &&
+            (!action || action == dlgSelection->actions().at(0)))
+    {
+        int selectionIndex = dlgSelection->selectedModelIndexes().at(0).row();
+        HbInputDialog* dlgInput = new HbInputDialog();
+        dlgInput->setAttribute(Qt::WA_DeleteOnClose);
+        dlgInput->setPromptText(dlgSelection->stringItems()[selectionIndex]);
+        dlgInput->setInputMode(HbInputDialog::TextInput);
+        
+        HbLabel *title = new HbLabel(dlgInput);
+        title->setPlainText(QString("Set parameter value"));
+        dlgInput->setHeadingWidget(title);
+        
+        dlgInput->open(this, SLOT(doSetIPCfgParameter(HbAction*)));
+    }
+}
+
+void MainView::doSetIPCfgParameter(HbAction* action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->actions().at(0))
+    {
+        QString parameter = dlg->promptText();
+        QString value = dlg->value().toString();
+        mEngineWrapper.setIPCfgParam(parameter, value);
+    }
+}
+
+void MainView::openListDialog(const QStringList& items, const int currentSelection,
+        const QString &titleText, QObject* receiver, const char* member)
+{
+    // Create a list and some simple content for it
+    HbSelectionDialog *dlg = new HbSelectionDialog();
+    dlg->setAttribute(Qt::WA_DeleteOnClose);
+    // Set items to be popup's content
+    dlg->setStringItems(items);
+    dlg->setSelectionMode(HbAbstractItemView::SingleSelection);
+    QList<QVariant> current;
+    current.append(QVariant(currentSelection));
+    dlg->setSelectedItems(current);
+    
+    HbLabel *title = new HbLabel(dlg);
+    title->setPlainText(titleText);
+    dlg->setHeadingWidget(title);
+
+    // Launch popup and handle the user response:
+    dlg->open(receiver, member);
+}
+
+void MainView::openIPAddressDialog(const QString &titleText, QObject* receiver, const char* member)
+{
+    HbInputDialog* dlg = new HbInputDialog();
+    dlg->setAttribute(Qt::WA_DeleteOnClose);
+    dlg->setAdditionalRowVisible(true);
+    dlg->setPromptText(QString("IP Address:"), 0);
+    dlg->setInputMode(HbInputDialog::IpInput, 0);
+    dlg->setPromptText(QString("Port:"), 1);
+    dlg->setInputMode(HbInputDialog::IntInput, 1);
+    
+    HbLabel *title = new HbLabel(dlg);
+    title->setPlainText(titleText);
+    dlg->setHeadingWidget(title);
+    
+    dlg->open(receiver, member);
+}
--- a/htiui/HtiAdminQt/mainview.h	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/HtiAdminQt/mainview.h	Mon Jun 21 15:41:16 2010 +0300
@@ -84,8 +84,26 @@
 	void enableConsole();
 	void disableConsole();
 	void showParamList ();
-	
 
+	void doSelectComm(HbAction*);
+	void doEnableSerialComm(HbAction* );
+	void doSelectIAP(HbAction* );
+	void doSelectIpComm(HbAction* );
+	void doListenOnPort(HbAction* );
+	void doConnectRemoteHost(HbAction*);
+	void doSelectBTComm(HbAction*);
+	void doEnableByBTAddress(HbAction*);
+	void doEnableByBTName(HbAction*);
+	void doSetPriority(HbAction*);
+	void doSelectCfgFile(HbAction*);
+	void doModifyHtiCfgFile(HbAction*);
+	void doModifyBtCfgFile(HbAction*);
+	void doModifySerialCfgFile(HbAction*);
+	void doModifyIPCfgFile(HbAction*);
+	void doSetHtiCfgParameter(HbAction*);
+	void doSetBtCfgParameter(HbAction*);
+	void doSetSerialCfgParameter(HbAction*);
+	void doSetIPCfgParameter(HbAction*);
 private:
     
     /**
@@ -99,6 +117,10 @@
     void createToolbar();
     
     void createTexts();
+    
+    void openListDialog(const QStringList& items, const int currentSelection, 
+            const QString &titleText, QObject* receiver, const char* member);
+    void openIPAddressDialog(const QString &titleText, QObject* receiver, const char* member);
 	
 public:
     
@@ -130,6 +152,8 @@
     HbLabel* mCommDetailsTxt;
     
     QStringList mPluginList;
+    
+    QString mIapSelection;
 
 };
 
--- a/htiui/HtiServicePlugins/HtiAppServicePlugin/group/HtiAppControl.mmp	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiAppServicePlugin/group/HtiAppControl.mmp	Mon Jun 21 15:41:16 2010 +0300
@@ -43,7 +43,12 @@
 LIBRARY     apparc.lib
 LIBRARY     apmime.lib
 LIBRARY     ws32.lib
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
 LIBRARY     swinstcli.lib
+#else
+LIBRARY     sif.lib       // USIF
+LIBRARY     scrclient.lib // SCR
+#endif
 LIBRARY     sisregistryclient.lib
 LIBRARY     javaregistryclient.lib
 LIBRARY     widgetregistryclient.lib
--- a/htiui/HtiServicePlugins/HtiAppServicePlugin/inc/HtiAppControl.h	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiAppServicePlugin/inc/HtiAppControl.h	Mon Jun 21 15:41:16 2010 +0300
@@ -22,11 +22,17 @@
 #define HTIAPPSERVICEPLUGIN_H__
 
 //  INCLUDES
+#include "../../../symbian_version.hrh"
+
 #include <e32base.h>
 #include <apgcli.h>
 #include <w32std.h>
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
 #include <SWInstDefs.h>
 #include <swi/sisregistryentry.h>
+#else
+#include <usif/usifcommon.h>
+#endif
 #include <HtiServicePluginInterface.h>
 
 // CONSTANTS
@@ -155,8 +161,14 @@
     TInt OpenProcessL( RProcess& aProcess, const TDesC& aMatch );
     TInt OpenProcessL( RProcess& aProcess, const TUint32 aProcessId );
 
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
     SwiUI::TPolicy ConvertToPolicy( const TInt8 aValue );
     TInt GetPackageUidL( const TDesC& aPackageName, TInt aMimeIndex );
+#else
+    Usif::TSifPolicy ConvertToSifPolicy( const TInt8 aValue );
+    TInt GetComponentIdFromUid(const TInt32 aUid);
+    TInt GetComponentIdFromPackageName(const TDesC& aPackageName);
+#endif
 
     TBool ValidateInstallParams( const TDesC8& aParams, TBool aIsUnicode );
 
@@ -199,12 +211,14 @@
     // possible mimetypes for silent software uninstallation
     CDesC8ArrayFlat* iMimeTypes;
 
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
     SwiUI::TInstallOptions iInstOpts;
     SwiUI::TInstallOptionsPckg iInstOptsPckg;
     SwiUI::TUninstallOptions iUnInstOpts;
     SwiUI::TUninstallOptionsPckg iUnInstOptsPckg;
     RPointerArray<Swi::CSisRegistryPackage> iAugmentations;
     TInt iAugmentationIndex;
+#endif
     };
 
 #endif
--- a/htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp	Mon Jun 21 15:41:16 2010 +0300
@@ -17,8 +17,6 @@
 
 
 // INCLUDE FILES
-#include "../../../symbian_version.hrh"
-
 #include <apacmdln.h>
 #include <apgtask.h>
 #include <apgwgnam.h>
@@ -31,13 +29,27 @@
 #include <HtiDispatcherInterface.h>
 #include <HtiLogging.h>
 
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
 #include <SWInstApi.h>
 #include <swi/sisregistrysession.h>
 #include <swi/sisregistrypackage.h>
+#else
+#include <usif/sif/sif.h>
+#include <usif/scr/scr.h>    //RSoftwareComponentRegistry
+#endif
 #include <javaregistryincludes.h>
 #include <WidgetRegistryClient.h>
 
 using namespace Java;
+#if ( SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4 )
+_LIT8( KSisxMimeType, "x-epoc/x-sisx-app" );
+_LIT8( KSisMimeType, "application/vnd.symbian.install" );
+_LIT8( KPipMimeType, "application/x-pip" );
+_LIT8( KJadMIMEType, "text/vnd.sun.j2me.app-descriptor" );
+_LIT8( KJarMIMEType, "application/java-archive" );
+_LIT8( KJavaMIMEType, "application/java");
+_LIT8( KJarxMIMEType, "application/x-java-archive");
+#endif
 
 // CONSTANTS
 const static TUid KAppServiceUid = { 0x1020DEC7 }; //This is Uid of AppServiceOS
@@ -57,7 +69,9 @@
 _LIT8( KErrDescrFailedInstall, "Failed to install" );
 _LIT8( KErrDescrFailedUnInstall, "Failed to uninstall" );
 _LIT8( KErrDescrFailedFindPackage, "Failed to find the package" );
-
+#if ( SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4 )
+_LIT8( KErrDescrBadComponentId, "Bad component id");
+#endif
 _LIT8( KErrDescrFailedListInstApps, "Failed to list installed apps" );
 
 const static TUint8 KUnicodeMask = 0x01;
@@ -114,7 +128,9 @@
         delete iMimeTypes;
         }
 
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
     iAugmentations.ResetAndDestroy();
+#endif
 
     HTI_LOG_FUNC_OUT( "~CHtiAppControl" );
     }
@@ -124,6 +140,7 @@
     {
     HTI_LOG_FUNC_IN( "CHtiAppControl::ConstructL" );
     iMimeTypes = new (ELeave) CDesC8ArrayFlat( 8 );
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
     iMimeTypes->AppendL( SwiUI::KSisxMimeType() );
     iMimeTypes->AppendL( SwiUI::KSisMimeType() );
     iMimeTypes->AppendL( SwiUI::KPipMimeType() );
@@ -131,8 +148,19 @@
     iMimeTypes->AppendL( SwiUI::KJarMIMEType() );
     iMimeTypes->AppendL( SwiUI::KJavaMIMEType() );
     iMimeTypes->AppendL( SwiUI::KJarxMIMEType() );
+#else
+    iMimeTypes->AppendL( KSisxMimeType() );
+    iMimeTypes->AppendL( KSisMimeType() );
+    iMimeTypes->AppendL( KPipMimeType() );
+    iMimeTypes->AppendL( KJadMIMEType() );
+    iMimeTypes->AppendL( KJarMIMEType() );
+    iMimeTypes->AppendL( KJavaMIMEType() );
+    iMimeTypes->AppendL( KJarxMIMEType() );
+#endif
     iMimeTypes->AppendL( KWidgetMime() ); // from widgetregistryconstants.h
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
     iAugmentationIndex = 0;
+#endif
 
     TInt err = iAppServer.Connect();
     if ( err == KErrNone )
@@ -566,8 +594,10 @@
     HTI_LOG_FORMAT( "Unicode flag: %d", unicode );
 
     TFileName path;
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
     TBuf<SwiUI::KSWInstMaxPasswordLength> login;
     TBuf<SwiUI::KSWInstMaxPasswordLength> password;
+#endif
 
     switch ( aMessage[0] )
         {
@@ -584,6 +614,7 @@
 
                 if ( offset >= 0)
                     {
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
                     iInstOpts = SwiUI::TInstallOptions();
 
                     iInstOpts.iUpgrade =            ConvertToPolicy( parameters[offset] ); offset++;
@@ -670,6 +701,156 @@
 
                     launcher.Close();
                     SendMessageL( EOk );
+#else
+                    HTI_LOG_TEXT( "============RSoftwareInstall::Install=============" );
+                    Usif::RSoftwareInstall installer;
+                    TInt err = installer.Connect();
+                    if(err)
+                        {
+                        SendErrorMsg( err , KErrDescrFailedConnectSilentInstaller );
+                        HTI_LOG_FORMAT("cannot connect to SIF server, err %d", err);
+                        User::Leave(err);
+                        }
+                    CleanupClosePushL(installer);
+                    TRequestStatus status;
+                    Usif::COpaqueNamedParams *arguments = Usif::COpaqueNamedParams::NewL();
+                    CleanupStack::PushL(arguments);
+                    Usif::COpaqueNamedParams *results = Usif::COpaqueNamedParams::NewL();
+                    CleanupStack::PushL(results);
+                    
+                    arguments->AddIntL(Usif::KSifInParam_InstallSilently, ETrue);
+                    
+                    TInt intValue = ConvertToSifPolicy(parameters[offset]); offset++;
+                    if(intValue != Usif::EAllowed)
+                        arguments->AddIntL(Usif::KSifInParam_AllowUpgrade, intValue);
+                    HTI_LOG_FORMAT( "iUpgrade: %d", intValue );
+                    intValue = ConvertToSifPolicy(parameters[offset]); offset++; 
+                    if(intValue != Usif::EAllowed)
+                        arguments->AddIntL(Usif::KSifInParam_InstallOptionalItems, intValue);
+                    HTI_LOG_FORMAT( "iOptionalItems: %d", intValue );
+                    intValue = ConvertToSifPolicy(parameters[offset]); offset++;
+                    if(intValue != Usif::EAllowed)
+                        arguments->AddIntL(Usif::KSifInParam_PerformOCSP, intValue);
+                    HTI_LOG_FORMAT( "iOCSP: %d", intValue );
+                    intValue = ConvertToSifPolicy(parameters[offset]); offset++;
+                    if(intValue != Usif::EAllowed)
+                        arguments->AddIntL(Usif::KSifInParam_IgnoreOCSPWarnings, intValue);
+                    HTI_LOG_FORMAT( "iIgnoreOCSPWarnings: %d", intValue );
+                    intValue = ConvertToSifPolicy(parameters[offset]); offset++;
+                    if(intValue != Usif::ENotAllowed)
+                        arguments->AddIntL(Usif::KSifInParam_AllowUntrusted, intValue);
+                    HTI_LOG_FORMAT( "iUntrusted: %d", intValue );
+                    intValue = ConvertToSifPolicy(parameters[offset]); offset++;
+                    if(intValue != Usif::EAllowed)
+						arguments->AddIntL(Usif::KSifInParam_PackageInfo, intValue);
+                    HTI_LOG_FORMAT( "iPackageInfo: %d", intValue );
+                    intValue = ConvertToSifPolicy(parameters[offset]); offset++;
+                    if(intValue != Usif::EAllowed)
+                        arguments->AddIntL(Usif::KSifInParam_GrantCapabilities,intValue);
+                    HTI_LOG_FORMAT( "iCapabilities: %d", intValue );
+                    intValue = ConvertToSifPolicy(parameters[offset]); offset++;
+                    if(intValue != Usif::EAllowed)
+                        arguments->AddIntL(Usif::KSifInParam_AllowAppShutdown,intValue);
+                    HTI_LOG_FORMAT( "iKillApp: %d", intValue );
+                    intValue = ConvertToSifPolicy(parameters[offset]); offset++;
+                    if(intValue != Usif::EAllowed)
+                        arguments->AddIntL(Usif::KSifInParam_AllowOverwrite,intValue);
+                    HTI_LOG_FORMAT( "iOverwrite: %d", intValue );
+                    intValue = ConvertToSifPolicy(parameters[offset]); offset++;
+                    if(intValue != Usif::EAllowed)
+                        arguments->AddIntL(Usif::KSifInParam_AllowDownload, intValue);
+                    HTI_LOG_FORMAT( "iDownload: %d", intValue );
+
+                    TBuf<32> login;
+                    offset = ParseString( parameters, offset, unicode, login );
+                    HTI_LOG_FORMAT( "login length: %d", login.Length() );
+                    if(login != KNullDesC)
+                        {
+                        arguments->AddStringL(Usif::KSifInParam_UserName, login);
+                        }
+                    HTI_LOG_TEXT( "Parsed login:" );
+                    HTI_LOG_DES( login )
+
+                    TBuf<32> password;
+                    offset = ParseString( parameters, offset, unicode, password );
+                    HTI_LOG_FORMAT( "password length: %d", password.Length() );
+                    if(password != KNullDesC)
+                        {
+                        arguments->AddStringL(Usif::KSifInParam_Password, password );
+                        }
+                    HTI_LOG_TEXT( "Parsed password:" );
+                    HTI_LOG_DES( password )
+
+                    TChar driver = (TChar) parameters[offset]; offset++;
+                    if(driver >= 'A' && driver <= 'Z')
+                        {
+                        intValue = driver - (TChar)'A';
+                        arguments->AddIntL(Usif::KSifInParam_Drive, intValue);
+                        HTI_LOG_FORMAT( "iDrive: %c", intValue + 'a' );
+                        }
+                    else if(driver >= 'a' && driver <= 'z')
+                        {
+                        intValue = driver - (TChar)'a';
+                        arguments->AddIntL(Usif::KSifInParam_Drive, intValue);
+                        HTI_LOG_FORMAT( "iDrive: %c", intValue + 'a' );
+                        }
+
+                    TLanguage oldFormatLanuage = (TLanguage)parameters[offset]; offset++;
+
+                    TBool usePhoneLang = (TBool)parameters[offset]; offset++;
+                    HTI_LOG_FORMAT( "iUsePhoneLang: %d", usePhoneLang );
+
+                    intValue =  ConvertToSifPolicy( parameters[offset] );offset++;
+                    /*if(intValue != Usif::EAllowed)
+                        arguments->AddIntL(Usif::KSifInParam_AllowUpgrade, intValue);*/
+                    HTI_LOG_FORMAT( "iUpgradeData: %d",  intValue ); 
+                    
+                    HTI_LOG_FORMAT( "parameters length: %d", parameters.Length());
+                    HTI_LOG_FORMAT( "next offset: %d", offset);
+
+                    if(usePhoneLang == EFalse)
+                        {
+                        if(parameters.Length() > offset)
+                            {
+                            TLanguage language = ELangTest;
+                            if (parameters.Length() == offset+2)
+                                {
+                                language = (TLanguage)(parameters[offset] + (parameters[offset+1]<<8));
+                                }
+                            else if (parameters.Length() == offset+1)
+                                {
+                                language = (TLanguage)(parameters[offset]);
+                                }
+                            if ((language > ELangTest) && (language < ELangMaximum))
+                                {
+                                arguments->AddIntL(Usif::KSifInParam_Languages, language);
+                                HTI_LOG_FORMAT( "iLang: %d", language );
+                                }
+                            }
+                        else
+                            {
+                            arguments->AddIntL(Usif::KSifInParam_Languages, oldFormatLanuage);
+                            HTI_LOG_FORMAT( "iLang0: %d", oldFormatLanuage );
+                            }
+                        }
+
+                    installer.Install(path, *arguments, *results, status);
+                    User::WaitForRequest(status);
+                    HTI_LOG_FORMAT("install status: %d", status.Int());
+                    TInt componentId = 0;
+                    TBool idExisted = results->GetIntByNameL(Usif::KSifOutParam_ComponentId, componentId);
+                    if ( idExisted )
+                        {
+                        HTI_LOG_FORMAT( "componentId:%d", componentId);
+                        }
+                    CleanupStack::PopAndDestroy(3);
+                    if (status != KErrNone)
+                        {
+                        SendErrorMsg( status.Int(), KErrDescrFailedInstall );
+                        break;
+                        }
+                    SendMessageL( EOk );
+#endif
                     }
                 else
                     {
@@ -704,11 +885,39 @@
             TInt offset = 0;
             TInt32 uid = KErrNotFound;
             HBufC* packageName = NULL;
+#if ( SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4 )
+            Usif::TComponentId cid = KErrNotFound; 
+            HTI_LOG_TEXT( "============RSoftwareInstall::Uninstall=============" );
+            Usif::RSoftwareInstall installer;
+            TInt err = installer.Connect();
+            if(err)
+                {
+                SendErrorMsg( err , KErrDescrFailedConnectSilentInstaller );
+                HTI_LOG_FORMAT("cannot connect to SIF server, err %d", err);
+                User::Leave(err);
+                }
+            CleanupClosePushL(installer);
+            TRequestStatus status;
+            Usif::COpaqueNamedParams *arguments = Usif::COpaqueNamedParams::NewL();
+            CleanupStack::PushL(arguments);
+            Usif::COpaqueNamedParams *results = Usif::COpaqueNamedParams::NewL();
+            CleanupStack::PushL(results);
+#endif
             if ( aMessage[0] == EUnInstall )
                 {
                 uid = Parse32<TInt32>( parameters );
                 offset += 4;
                 HTI_LOG_FORMAT( "Uninstall by uid: %d", uid );
+#if ( SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4 )
+                cid = GetComponentIdFromUid(uid);
+                if ( cid == KErrNotFound )
+                    {
+                    HTI_LOG_FORMAT( "cid: %d", cid );
+                    SendErrorMsg( KErrNotFound, KErrDescrBadComponentId );
+                    CleanupStack::PopAndDestroy(3); //results, arguments, installer
+                    break;
+                    }
+#endif
                 }
             else
                 {
@@ -716,7 +925,19 @@
                 TPtr namePtr = packageName->Des();
                 offset = ParseString( parameters, offset, unicode, namePtr );
                 HTI_LOG_FORMAT( "Uninstall by name: %S", packageName );
+#if ( SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4 )
+                cid = GetComponentIdFromPackageName(*packageName);
+                CleanupStack::PopAndDestroy(); // packageName
+                if ( cid == KErrNotFound )
+                    {
+                    HTI_LOG_FORMAT( "cid: %d", cid );
+                    SendErrorMsg( KErrNotFound, KErrDescrFailedFindPackage );
+                    CleanupStack::PopAndDestroy(3); //results, arguments, installer
+                    break;
+                    }
+#endif
                 }
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
             iUnInstOpts = SwiUI::TUninstallOptions();
             iUnInstOpts.iKillApp = ConvertToPolicy( parameters[offset] );
             offset++;
@@ -788,6 +1009,48 @@
                 }
 
             launcher.Close();
+#else
+            
+            TInt intValue = ConvertToSifPolicy( parameters[offset] );
+            offset++;
+            arguments->AddIntL(Usif::KSifInParam_AllowAppShutdown, intValue);
+            HTI_LOG_FORMAT( "iKillApp: %d", intValue );
+            intValue = ConvertToSifPolicy( parameters[offset] );
+            offset++;
+            arguments->AddIntL(Usif::KSifInParam_AllowAppBreakDependency, intValue);
+            HTI_LOG_FORMAT( "iBreakDependency: %d", intValue );
+
+            TInt mimeIndex = parameters[offset];
+            if ( mimeIndex > iMimeTypes->Count() - 1 )
+                {
+                HTI_LOG_FORMAT( "Invalid mime type: %d", mimeIndex );
+                SendErrorMsg( KErrArgument, KErrDescrInvalidCmd );
+                break;
+                }
+
+            HTI_LOG_TEXT( "Uninstall mime type:" );
+            HTI_LOG_DES( (*iMimeTypes)[mimeIndex] );
+
+            HBufC* buf = HBufC::NewLC((*iMimeTypes)[mimeIndex].Length());
+            TPtr ptr = buf->Des();
+            ptr.Copy((*iMimeTypes)[mimeIndex]);
+            arguments->AddStringL(Usif::KSifInParam_MimeType, *buf);
+            CleanupStack::PopAndDestroy(); // buf
+      
+            HTI_LOG_FORMAT( "Component ID = %d", cid );
+            
+            arguments->AddIntL(Usif::KSifInParam_InstallSilently, ETrue);
+            
+            installer.Uninstall(cid, *arguments, *results, status, EFalse);
+            User::WaitForRequest(status);
+            HTI_LOG_FORMAT("uninstall status:%d", status.Int());
+            CleanupStack::PopAndDestroy(3); //results, arguments, installer
+            if (status != KErrNone)
+                {
+                SendErrorMsg(status.Int(), KErrDescrFailedUnInstall);
+                break;
+                }            
+#endif
             SendMessageL( EOk );
             }
             break;
@@ -1524,15 +1787,25 @@
                                                KAppServiceUid );
     }
 
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
 SwiUI::TPolicy CHtiAppControl::ConvertToPolicy( const TInt8 aValue )
     {
     if ( aValue == 0 ) return SwiUI::EPolicyNotAllowed;
 
     return  SwiUI::EPolicyAllowed;
     }
+#else
+Usif::TSifPolicy CHtiAppControl::ConvertToSifPolicy( const TInt8 aValue )
+    {
+    if ( aValue == 0 ) return Usif::ENotAllowed;
+
+    return  Usif::EAllowed;    
+    }
+#endif
 
 TBool CHtiAppControl::ValidateInstallParams( const TDesC8& aParams, TBool aIsUnicode )
     {
+    HTI_LOG_FORMAT( "ValidateInstallParams => length: %d", aParams.Length() );
     if ( aParams.Length() > 0 )
         {
         TInt offset = 0;
@@ -1589,6 +1862,7 @@
     return EFalse;
     }
 
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
 TInt CHtiAppControl::GetPackageUidL( const TDesC& aPackageName,
                                           TInt aMimeIndex )
     {
@@ -1733,6 +2007,88 @@
 
     return KErrNone; // never returns from here
     }
-
+#else
+TInt CHtiAppControl::GetComponentIdFromUid(const TInt32 aUid)
+    {
+    TInt cid = KErrNotFound;
+    Usif::RSoftwareComponentRegistry registry;
+    User::LeaveIfError(registry.Connect());
+    CleanupClosePushL(registry);
+    RArray<TUid> uidList;
+    CleanupClosePushL(uidList);
+    RArray<Usif::TComponentId> componentIdList;
+    CleanupClosePushL(componentIdList);
+    registry.GetComponentIdsL(componentIdList);
+    for(TInt i = 0; i < componentIdList.Count(); i++)
+        {
+        Usif::TComponentId compId = componentIdList[i];
+        Usif::CComponentEntry *compEntry = Usif::CComponentEntry::NewLC();
+        if(registry.GetComponentL(compId, *compEntry))
+            {
+            /*if(compEntry->IsRemovable() && 
+                 compEntry->SoftwareType() == Usif::KSoftwareTypeNative)*/
+            if(compEntry->IsRemovable())
+                {
+                _LIT(KCompUid, "CompUid");
+                Usif::CPropertyEntry *property = 
+                    registry.GetComponentPropertyL(compId, KCompUid);
+                CleanupStack::PushL(property);
+                Usif::CIntPropertyEntry* intProperty = 
+                    dynamic_cast<Usif::CIntPropertyEntry*>(property);
+                uidList.AppendL(TUid::Uid(intProperty->IntValue()));
+                CleanupStack::PopAndDestroy(property);
+                }
+            else
+                {
+                uidList.AppendL(KNullUid);
+                }
+            }
+        CleanupStack::PopAndDestroy( compEntry );
+        }
+    TUid tuid(TUid::Uid(aUid));
+    if(tuid != KNullUid)
+        {
+        TInt index = uidList.Find(tuid);
+        if(index >= 0 && index < componentIdList.Count())
+            {
+            cid = componentIdList[index];
+            }
+        }
+        CleanupStack::PopAndDestroy( 3, &registry );// componentIdList, uidList, registry
+        return cid;
+    }
 
+TInt CHtiAppControl::GetComponentIdFromPackageName(const TDesC& aPackageName)
+    {
+    TInt cid = KErrNotFound;
+    Usif::RSoftwareComponentRegistry registry;
+    User::LeaveIfError(registry.Connect());
+    CleanupClosePushL(registry);
+    RArray<Usif::TComponentId> componentIdList;
+    CleanupClosePushL(componentIdList);
+    registry.GetComponentIdsL(componentIdList);
+    TInt count = componentIdList.Count();    
+    for(TInt i = 0; i < count; i++)
+        {
+        Usif::TComponentId compId = componentIdList[i];
+        Usif::CComponentEntry *compEntry = Usif::CComponentEntry::NewLC();
+        if(registry.GetComponentL(compId, *compEntry))
+            {
+            if(compEntry->IsRemovable())
+                {
+                if ( aPackageName.Compare( compEntry->Name() ) == 0 )
+                    {
+                    cid = compId;
+                    CleanupStack::PopAndDestroy( compEntry );
+                    break;
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy( compEntry );
+        }
+        CleanupStack::PopAndDestroy( 2, &registry );// componentIdList, registry
+        return cid;
+    }
+
+#endif
 // End of File
--- a/htiui/HtiServicePlugins/HtiCameraServicePlugin/src/HtiCameraServicePlugin.cpp	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/src/HtiCameraServicePlugin.cpp	Mon Jun 21 15:41:16 2010 +0300
@@ -515,6 +515,7 @@
     {
     HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::MevroInitComplete" );
     HTI_LOG_FORMAT("aError = %d", aError);
+    iError = aError;
     iWaiter->AsyncStop();
     HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::MevroInitComplete" );
     }
@@ -523,6 +524,7 @@
     {
     HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::MevroVideoPrepareComplete" );
     HTI_LOG_FORMAT("aError = %d", aError);
+    iError = aError;
     iWaiter->AsyncStop();
     HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::MevroVideoPrepareComplete" );
     }
@@ -531,6 +533,7 @@
     {
     HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::MevroVideoRecordingOn" );
     HTI_LOG_FORMAT("aError = %d", aError);
+    iError = aError;
     HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::MevroVideoRecordingOn" );
     }
 
@@ -538,6 +541,7 @@
     {
     HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::MevroVideoRecordingPaused" );
     HTI_LOG_FORMAT("aError = %d", aError);
+    iError = aError;
     HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::MevroVideoRecordingPaused" );
     }
 
@@ -545,6 +549,7 @@
     {
     HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::MevroVideoRecordingComplete" );
     HTI_LOG_FORMAT("aError = %d", aError);
+    iError = aError;
     HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::MevroVideoRecordingComplete" );
     }
 //  End of File
--- a/htiui/sis/HTI_S60-10_1.pkg	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/sis/HTI_S60-10_1.pkg	Mon Jun 21 15:41:16 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,23,0
+#{"HTI"},(0x1020DEB6),2,24,0
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- a/htiui/sis/HTI_S60-52.pkg	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/sis/HTI_S60-52.pkg	Mon Jun 21 15:41:16 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,23,0
+#{"HTI"},(0x1020DEB6),2,24,0
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- a/htiui/sis/HTI_S60_Upgrade-10_1.pkg	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/sis/HTI_S60_Upgrade-10_1.pkg	Mon Jun 21 15:41:16 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,23,0,TYPE=SA,RU
+#{"HTI"},(0x1020DEB6),2,24,0,TYPE=SA,RU
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- a/htiui/sis/HTI_S60_Upgrade-52.pkg	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/sis/HTI_S60_Upgrade-52.pkg	Mon Jun 21 15:41:16 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,23,0,TYPE=SA,RU
+#{"HTI"},(0x1020DEB6),2,24,0,TYPE=SA,RU
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- a/htiui/sis/HTI_stub.pkg	Wed Jun 09 09:42:37 2010 +0300
+++ b/htiui/sis/HTI_stub.pkg	Mon Jun 21 15:41:16 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,23,0
+#{"HTI"},(0x1020DEB6),2,24,0
 
 ; Localised Vendor name
 %{"Nokia"}
--- a/stifui/avkon/group/ReleaseNote.txt	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/avkon/group/ReleaseNote.txt	Mon Jun 21 15:41:16 2010 +0300
@@ -1,5 +1,5 @@
 ========================================================================
-RELEASE NOTE FOR STIF UI - STIF_201020 (7.3.33)
+RELEASE NOTE FOR STIF UI - STIF_201022 (7.3.34)
 SUPPORTING SERIES 60 3.0 ->
 ========================================================================
 
Binary file stifui/avkon/sis/Stifui_31.sis has changed
--- a/stifui/avkon/stifui/inc/version.h	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/avkon/stifui/inc/version.h	Mon Jun 21 15:41:16 2010 +0300
@@ -20,9 +20,9 @@
 
 #define STIFUI_MAJOR_VERSION 7
 #define STIFUI_MINOR_VERSION 3
-#define STIFUI_BUILD_VERSION 33
+#define STIFUI_BUILD_VERSION 34
 
-#define STIFUI_REL_DATE "18th May 2010"
+#define STIFUI_REL_DATE "1st June 2010"
 
 #define TO_UNICODE(text) _L(text) 
 
--- a/stifui/qt/ReleaseNote.txt	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/qt/ReleaseNote.txt	Mon Jun 21 15:41:16 2010 +0300
@@ -1,5 +1,5 @@
 ========================================================================
-RELEASE NOTE FOR STFUI_201020 (7.3.33)
+RELEASE NOTE FOR STFUI_201022 (7.3.34)
 ========================================================================
 
 Product Description:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/dlgrepeatrun.h	Mon Jun 21 15:41:16 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* 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.
+*/
+
+#ifndef DLGREPEATRUN_H_
+#define DLGREPEATRUN_H_
+#include <QDialog>
+#include <QLineEdit>
+
+QT_BEGIN_NAMESPACE
+class QTabWidget;
+class QGridLayout;
+class QRadioButton;
+class QPushButton;
+QT_END_NAMESPACE
+
+class DlgRepeatRun : public QDialog {    
+    Q_OBJECT
+    
+public:
+    DlgRepeatRun(QWidget *parent = 0);
+    inline bool isRepeatInfinitely() {return isInfinite;};
+    inline int  GetLoopTimes() {return loopTimes;};
+    
+    
+private:
+    void SetupUI();
+    
+private:
+    QPushButton* btnOk;
+    QPushButton* btnCancel;
+    QLineEdit* lineEdit;
+    QRadioButton* rdoLoopInfinitely;
+    QRadioButton* rdoGiveLoopTimes;
+    
+    int loopTimes;
+    bool isInfinite;
+    
+private slots:
+    //on button clicked
+    void on_btnOk_clicked();
+    void on_btnCancel_clicked();
+    
+    //on check box state changed
+    void on_rdoLoopInfinitely_stateChanged(bool checked);
+    void on_rdoGiveLoopTimes_stateChanged(bool checked);
+    
+    };
+
+#endif /* DLGREPEATRUN_H_ */
--- a/stifui/qt/inc/frmmain.h	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/qt/inc/frmmain.h	Mon Jun 21 15:41:16 2010 +0300
@@ -28,6 +28,7 @@
 #include "dlgsetting.h"
 #include "dlgsetselector.h"
 #include "uiversion.h"
+#include "dlgrepeatrun.h"
 
 QT_BEGIN_NAMESPACE
 class QAction;
@@ -86,6 +87,7 @@
     void reloadStatisticItem(QString name, QTreeWidgetItem* item, TSTFCaseStatusType type);
     void setSetting();
     void startRunning();
+    void setItemClicked(QTreeWidgetItem* item);
     
 private:
     IStfQtUIController* controller;
@@ -93,6 +95,7 @@
     DlgOutput* dlgOutput;
     UiSetting* uiSetting; 
     bool layoutType;
+    QTreeWidgetItem* lastItemSelected;
 
 private: //UI Components
     QWidget* centerWidget;
@@ -140,6 +143,7 @@
     QAction *actOpenFile;
     QAction *actRunCaseSeq;
     QAction *actRunCasePar;
+    QAction *actReapeatRunSeq;
     QAction *actAddtoSet;
     QAction *actSelectAll;
     QAction *actExpandAll;
@@ -167,6 +171,7 @@
     void on_actOpenFile_triggered();
     void on_actRunCaseSeq_triggered();
     void on_actRunCasePar_triggered();
+    void on_actReapeatRunSeq_triggered();
     void on_actAddtoSet_triggered();
     void on_actSelectAll_triggered();
     void on_actExpandAll_triggered();
--- a/stifui/qt/inc/istfqtuicontroller.h	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/qt/inc/istfqtuicontroller.h	Mon Jun 21 15:41:16 2010 +0300
@@ -48,6 +48,7 @@
     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 RepeatRunCases(const QList<CSTFCase>& aCaseList, const bool aIsLoopInfinitely, const int aLoopTimes = 1) = 0;
     virtual bool AddCaseToSet(const QList<CSTFCase>& aCase, const QString& setName) = 0;
     
     //for set
@@ -72,6 +73,9 @@
     virtual void AddStfEventListener(IStfEventListener* listener) = 0;
     virtual void RemoveStfEventListener(IStfEventListener* listener) = 0;
     
+    //for repeat execution setting
+    virtual void InitRepeatSetting(const bool aIsLoopInfinitely, const int aLoopTimes) = 0;
+    virtual void ResetRepeatSetting() = 0;
 
 };
 
--- a/stifui/qt/inc/stfqtuicontroller.h	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/qt/inc/stfqtuicontroller.h	Mon Jun 21 15:41:16 2010 +0300
@@ -35,6 +35,7 @@
     QList<QString> GetCaseListByModule(const QString& moduleName);
     CSTFCase GetCase(const QString& moduleName, const int index);
     void RunCases(const QList<CSTFCase>& caseList, const TSTFCaseRunningType& type);
+    void RepeatRunCases(const QList<CSTFCase>& aCaseList, const bool aIsLoopInfinitely, const int aLoopTimes = 1);
     bool AddCaseToSet(const QList<CSTFCase>& aCase, const QString& setName);
     
     //for set
@@ -58,6 +59,10 @@
     //listener
     void AddStfEventListener(IStfEventListener* listener);
     void RemoveStfEventListener(IStfEventListener* listener);
+    
+    //for repeat execution setting
+    void InitRepeatSetting(const bool aIsLoopInfinitely, const int aLoopTimes);
+    void ResetRepeatSetting();
 
 public://implement IStifCaseUpdateListener
     void OnGetCaseUpdated(CStartedTestCase* aCase, CSTFCase& stfcase, int flags);
@@ -68,8 +73,11 @@
     void FireOnSetListChanged();
     void FireOnCaseOutputChanged(IStfEventListener::CaseOutputCommand cmd, int index, QString msg);
     
-private://help methods
+private:
+    // help methods
     CSTFModule GetModuleByName(const QString& moduleName);
+    // Repeat execution cases
+    void Execution();
     
 private:
     CStifExecutor* executor;
@@ -77,8 +85,16 @@
     QList<IStfEventListener*> listenerList;
     bool isShowOutput;
     
+    // repeat run case related member 
+    // repeat execution case list   
+    QList<CSTFCase> repeatRunCaseList;
+    // current position of the case list
+    int iCurrentRunPos;
+    // is loop infinitely
+    bool isLoopInfinitely;
+    // loop times
+    int loopTimes;
     
-        
     };
 
 
--- a/stifui/qt/inc/version.h	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/qt/inc/version.h	Mon Jun 21 15:41:16 2010 +0300
@@ -18,11 +18,11 @@
 #ifndef VERSION_H_
 #define VERSION_H_
 
-#define STIF_MAJOR_VERSION 1
-#define STIF_MINOR_VERSION 0
-#define STIF_BUILD_VERSION 0
+#define STIF_MAJOR_VERSION 7
+#define STIF_MINOR_VERSION 3
+#define STIF_BUILD_VERSION 34
 
-#define STIF_REL_DATE "1st Mar 2010"
+#define STIF_REL_DATE "1st June 2010"
 
 #define TO_UNICODE(text) _L(text) 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/rom/stfui.iby	Mon Jun 21 15:41:16 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: Stifui.iby file specifies needed STIF and STIF UI 
+* and UITetsServerstarter components for ROM image
+*
+*/
+
+#ifndef __STIF_UI_IBY__
+#define __STIF_UI_IBY__
+
+S60_APP_EXE(Stifqtui)
+
+#ifdef S60_UPGRADABLE_APP_REG_RSC
+  S60_UPGRADABLE_APP_REG_RSC(Stifqtui)
+#else
+  S60_APP_AIF_RSC(Stifqtui)
+#endif
+
+S60_APP_RESOURCE(Stifqtui)
+
+#endif
+// End of File
\ No newline at end of file
--- a/stifui/qt/sis/StfQtUI.pkg	Wed Jun 09 09:42:37 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-; 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/sis/stifqtui.pkg	Mon Jun 21 15:41:16 2010 +0300
@@ -0,0 +1,27 @@
+; stifqtui_armv5_urel.pkg generated by qmake at 2010-05-31T09:56:39
+; 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
+%{"Nokia, Qt Software"}
+
+; Unique Vendor name
+:"Nokia, Qt Software"
+
+; Dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+(0x2001E61C), 4, 5, 2, {"QtLibs pre-release"}
+
+; Executable and default resource files
+"/S60/non_public/S60_5_0_200906/epoc32/release/armv5/urel/STFUI.exe"    - "!:\sys\bin\STFUI.exe"
+"/S60/non_public/S60_5_0_200906/epoc32/data/z/resource/apps/STFUI.rsc"    - "!:\resource\apps\STFUI.rsc"
+"/S60/non_public/S60_5_0_200906/epoc32/data/z/private/10003a3f/import/apps/STFUI_reg.rsc"    - "!:\private\10003a3f\import\apps\STFUI_reg.rsc"
Binary file stifui/qt/sis/stifqtui.sis has changed
Binary file stifui/qt/sis/stifqtui.sisx has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/src/dlgrepeatrun.cpp	Mon Jun 21 15:41:16 2010 +0300
@@ -0,0 +1,131 @@
+/*
+ * 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 "dlgrepeatrun.h"
+#include <QtGui>
+
+DlgRepeatRun::DlgRepeatRun(QWidget *parent)
+    : QDialog(parent),
+      loopTimes(0),
+      isInfinite(true)
+    {
+    SetupUI();
+    }
+
+void DlgRepeatRun::SetupUI()
+    {
+    this->setContextMenuPolicy(Qt::NoContextMenu);
+    QGridLayout *mainLayout = new QGridLayout(this);
+    this->setLayout(mainLayout);
+    
+    //nullWidget is just place holder for better looking.
+    QWidget *nullWidget = new QWidget(this);
+    nullWidget->setMinimumHeight(30);
+    mainLayout->addWidget(nullWidget, 0, 0);
+    
+    // check box LoopInfinitely
+    rdoLoopInfinitely = new QRadioButton(this);
+    rdoLoopInfinitely->setMinimumHeight(40);
+    rdoLoopInfinitely->setText(tr("Repeat infinitely."));
+    rdoLoopInfinitely->setChecked(Qt::Checked);
+    QObject::connect(rdoLoopInfinitely, SIGNAL(clicked(bool)), this,
+                SLOT(on_rdoLoopInfinitely_stateChanged(bool)));
+    
+
+    // check box LoopTime
+    rdoGiveLoopTimes = new QRadioButton(this);
+    rdoGiveLoopTimes->setMinimumHeight(40);
+    rdoGiveLoopTimes->setText(tr("Give loop times:"));
+    rdoGiveLoopTimes->setChecked(Qt::Unchecked);
+    QObject::connect(rdoGiveLoopTimes, SIGNAL(clicked(bool)), this,
+                SLOT(on_rdoGiveLoopTimes_stateChanged(bool)));
+    
+    // lineEdit, 
+    QValidator *validator = new QIntValidator(1, 999999, this); 
+    lineEdit = new QLineEdit(this);
+    lineEdit->setValidator(validator);
+    lineEdit->setMinimumHeight(40);
+    lineEdit->setMaxLength(6);
+    lineEdit->setMaximumWidth(60);
+    lineEdit->setEchoMode(QLineEdit::NoEcho);
+    lineEdit->setReadOnly(true);
+    
+    // add check box and lineEdit to layout. 
+    QWidget *toolWidgetForLoopTimes = new QWidget(this);
+    QGridLayout *toolLayoutForLoopTimes = new QGridLayout(this);
+    toolWidgetForLoopTimes->setLayout(toolLayoutForLoopTimes);
+    toolLayoutForLoopTimes->addWidget(rdoLoopInfinitely, 0, 0);
+    toolLayoutForLoopTimes->addWidget(rdoGiveLoopTimes, 1, 0);
+    toolLayoutForLoopTimes->addWidget(lineEdit, 1, 1);
+    mainLayout->addWidget(toolWidgetForLoopTimes, 1, 0);
+    
+    // add button
+    QWidget *toolWidgetForButtons = new QWidget(this);
+    QGridLayout *toolLayoutForButtons = new QGridLayout(this);
+    toolWidgetForButtons->setLayout(toolLayoutForButtons);
+    btnOk = new QPushButton(tr("Ok"), toolWidgetForButtons);
+    QObject::connect(btnOk, SIGNAL(clicked()), this,
+            SLOT(on_btnOk_clicked()));
+    btnCancel = new QPushButton(tr("Cancel"), toolWidgetForButtons);
+    QObject::connect(btnCancel, SIGNAL(clicked()), this,
+            SLOT(on_btnCancel_clicked()));
+    toolLayoutForButtons->addWidget(btnOk, 0, 0);
+    toolLayoutForButtons->addWidget(btnCancel, 0, 1);
+    mainLayout->addWidget(toolWidgetForButtons, 2, 0);
+    }
+
+void DlgRepeatRun::on_btnOk_clicked()
+    {
+    if(!isRepeatInfinitely())
+        {
+        loopTimes = lineEdit->text().toInt();
+        if (loopTimes < 0)
+            {
+            loopTimes = 0;
+            }
+        }
+    else
+        {
+        loopTimes = 0;
+        }
+    this->accept();
+    }
+
+void DlgRepeatRun::on_btnCancel_clicked()
+    {
+    this->reject();    
+    }
+
+void DlgRepeatRun::on_rdoLoopInfinitely_stateChanged(bool checked)
+    {
+    if(checked)
+        {
+        isInfinite = true;
+        lineEdit->setEchoMode(QLineEdit::NoEcho);
+        lineEdit->setReadOnly(true);
+        }
+    }
+
+void DlgRepeatRun::on_rdoGiveLoopTimes_stateChanged(bool checked)
+    {
+    if(checked)
+        {
+        isInfinite = false;
+        lineEdit->setEchoMode(QLineEdit::Normal); 
+        lineEdit->setReadOnly(false);
+        }
+    }
--- a/stifui/qt/src/dlgsetselector.cpp	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/qt/src/dlgsetselector.cpp	Mon Jun 21 15:41:16 2010 +0300
@@ -19,7 +19,7 @@
 #include <QtGui>
 
 DlgSetSelector::DlgSetSelector(QList<QString> list, QWidget* parent):
-        QDialog(parent), setList(list), selectName("")
+        QDialog(parent), selectName(""), setList(list)
     {
     SetupUI();
     }
@@ -72,7 +72,7 @@
      this->showMaximized();
      
     }
-void DlgSetSelector::on_radio1Selection_Changed(bool checked)
+void DlgSetSelector::on_radio1Selection_Changed(bool /* checked */)
     {
     lstSet->setEnabled(false);
     }
--- a/stifui/qt/src/frmmain.cpp	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/qt/src/frmmain.cpp	Mon Jun 21 15:41:16 2010 +0300
@@ -28,6 +28,7 @@
 
 FrmMain::FrmMain()
     {
+    lastItemSelected = NULL;
     uiSetting = new UiSetting();
     createMenus();
     load();
@@ -56,6 +57,8 @@
     controller->RemoveStfEventListener(this);
     model->RemoveStifModelEventListener(this);
     
+    //lastItemSelected does not own any memory, don't need to delete.
+    lastItemSelected = NULL;
     delete uiSetting;
     delete dlgOutput;
     delete controller;
@@ -179,6 +182,11 @@
     connect(actRunCasePar, SIGNAL(triggered()), this,
             SLOT(on_actRunCasePar_triggered()));
 
+    ////////////////////
+    actReapeatRunSeq = new QAction(tr("Repeat run sequentially"), this);
+    connect(actReapeatRunSeq, SIGNAL(triggered()), this,
+            SLOT(on_actReapeatRunSeq_triggered()));
+    
     actAddtoSet = new QAction(tr("Add cases to Set"), this);
     connect(actAddtoSet, SIGNAL(triggered()), this,
             SLOT(on_actAddtoSet_triggered()));
@@ -505,6 +513,7 @@
         menuBar()->addMenu(menuRunCase);
         menuRunCase->addAction(actRunCaseSeq);
         menuRunCase->addAction(actRunCasePar);
+        menuBar()->addAction(actReapeatRunSeq);
         menuBar()->addSeparator();
         menuBar()->addAction(actAddtoSet);
         menuBar()->addSeparator();
@@ -687,9 +696,26 @@
     controller->RunCases(getSelectedCases(), Parallel);
     }
 
+void FrmMain::on_actReapeatRunSeq_triggered()
+    {
+    DlgRepeatRun dlgRepeatRun(this);
+    int result = dlgRepeatRun.exec();
+    if(result == QDialog::Accepted)
+        {
+        QList<CSTFCase> selectedCases = getSelectedCases();
+        if(selectedCases.count() > 0)
+            {
+            startRunning();
+            controller->RepeatRunCases( selectedCases, 
+                                        dlgRepeatRun.isRepeatInfinitely(),
+                                        dlgRepeatRun.GetLoopTimes() );
+            }
+        
+        }
+    }
+
 void FrmMain::on_actAddtoSet_triggered()
     {
-
     QList<CSTFCase> list = getSelectedCases();
     if (list.size() == 0)
         {
@@ -912,6 +938,96 @@
 
 void FrmMain::on_treeModuleList_itemClicked(QTreeWidgetItem* item, int /*column*/)
     {
+    //Check if shift key is pressed
+    bool isShiftPressed = false;
+    Qt::KeyboardModifiers keyMod = QApplication::keyboardModifiers();
+    isShiftPressed=keyMod.testFlag(Qt::ShiftModifier);
+    
+    //Handle shift key.
+    //Shift not pressed.
+    if(!isShiftPressed)
+        {
+        setItemClicked(item);
+        }
+    //Shift pressed.
+    else
+        {
+        enum Direction
+            {
+            Item_NoDirection,
+            Item_Above,
+            Item_Below
+            };
+        Direction direction = Item_NoDirection;
+        QTreeWidgetItem* tempItem = item;
+        //check direction of last selected item comparing current one.
+        while(tempItem)
+            {
+            tempItem = treeModuleList->itemAbove(tempItem);
+            if(tempItem == lastItemSelected)
+                {
+                direction = Item_Above;
+                break;
+                }
+            }
+        if (direction != Item_Above)
+            {
+            tempItem = item;
+            while(tempItem)
+                {
+                tempItem = treeModuleList->itemBelow(tempItem);
+                if(tempItem == lastItemSelected)
+                    {
+                    direction = Item_Below;
+                    break;
+                    }
+                }
+            }
+        
+        // Select all items between current item and last selected item.
+        tempItem = item;
+        if(direction != Item_NoDirection)
+            {
+            while(tempItem)
+                {
+                //check if this item been selected.
+                bool isItemSelected = false;
+                if ( tempItem->text(0).left(3).compare(SELECTITEMHEADER)==0 )
+                    {
+                    isItemSelected = true;
+                    }
+                // If not selected, set to selected.
+                if (!isItemSelected )
+                    {
+                    setItemClicked(tempItem);
+                    }
+                
+                //Go above/below
+                if (direction == Item_Above)
+                    {
+                    tempItem = treeModuleList->itemAbove(tempItem);             
+                    }
+                if (direction == Item_Below)
+                    {
+                    tempItem = treeModuleList->itemBelow(tempItem);             
+                    }
+                
+                if (tempItem == lastItemSelected)
+                    {
+                    break;
+                    }
+                }
+            }
+        }
+    
+    // Set current clicked item to last selected item.
+    lastItemSelected = item;
+
+      
+    }
+
+void FrmMain::setItemClicked(QTreeWidgetItem* item)
+    {
     QString header = UNSELECTITEMHEADER;
     if(item->text(0).startsWith(UNSELECTITEMHEADER))
         {
--- a/stifui/qt/src/stfqtuicontroller.cpp	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/qt/src/stfqtuicontroller.cpp	Mon Jun 21 15:41:16 2010 +0300
@@ -26,7 +26,12 @@
 
 
 StfQtUIController::StfQtUIController(IStfQtUIModel* aModel) :
-    model(aModel), isShowOutput(false)
+    model(aModel), 
+    isShowOutput(false), 
+    iCurrentRunPos(0),
+    isLoopInfinitely(false),
+    loopTimes(0)
+       
     {
     executor = new CStifExecutor();
     executor->OpenIniFile(DEFAULTINI);
@@ -135,6 +140,51 @@
         }
     }
 
+// run cases repeatly. 
+// By default, loopTimes = -1 means loop infinitely util user stop it.
+void StfQtUIController::RepeatRunCases(const QList<CSTFCase>& aCaseList, const bool aIsLoopInfinitely, const int aLoopTimes)
+    {
+    InitRepeatSetting(aIsLoopInfinitely, aLoopTimes);
+    repeatRunCaseList = aCaseList;
+    
+    Execution();
+    
+    }
+
+void StfQtUIController::InitRepeatSetting(const bool aIsLoopInfinitely, const int aLoopTimes)
+    {
+    loopTimes = aLoopTimes;
+    isLoopInfinitely = aIsLoopInfinitely;
+    iCurrentRunPos = 0;
+    }
+
+void StfQtUIController::ResetRepeatSetting()
+    {
+    iCurrentRunPos = 0;
+    isLoopInfinitely = false;
+    loopTimes = 0;
+    }
+
+// Repeat execution cases
+void StfQtUIController::Execution()
+    {
+    if(loopTimes > 0  || isLoopInfinitely)
+        {
+        int count = repeatRunCaseList.count();
+        CSTFCase aCase = repeatRunCaseList.at(iCurrentRunPos);
+        QString msg = "Start execute case:" + aCase.Name();
+        FireOnGetOutput(msg);
+        executor->ExecuteSingleCase(aCase.ModuleName(), aCase.Index());
+        
+        iCurrentRunPos++;
+        if( iCurrentRunPos >= count )
+            {
+            iCurrentRunPos = 0;
+            loopTimes --;
+            }    
+        }
+    }
+
 bool StfQtUIController::AddCaseToSet(const QList<CSTFCase>& caseList,
         const QString& setName)
     {
@@ -283,6 +333,9 @@
         model->RemoveRunningCase(aCase);
         model->AddCaseByStatus(EStatusAborted, stfcase);
         msg += "aborted";
+        
+        //reset repeat execution information
+        ResetRepeatSetting();
 
         }
     else if (flags & CUIStoreIf::EStatusExecuted)
@@ -306,7 +359,12 @@
             model->AddCaseByStatus(EStatusPassed, stfcase);
             msg += "passed";
             }
-
+        
+        // if repeat execution is choosed, start to execution again.
+        if(loopTimes > 0 || isLoopInfinitely)
+            {
+            Execution();
+            }
         }
     else
         {
--- a/stifui/qt/src/stifexecutor.cpp	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/qt/src/stifexecutor.cpp	Mon Jun 21 15:41:16 2010 +0300
@@ -268,7 +268,7 @@
     TPtrC name = QString2TPtrC(setName);
     TFileName testSetName;
     testSetName.Copy(name);
-    TInt ret = UIStore().SaveTestSet2(testSetName);
+    TInt ret = UIStore().SaveTestSet(testSetName);
     setName = TDesC2QString(testSetName);
     return LogResult(ret, "SaveSet");
     }
--- a/stifui/qt/stifqtui.pro	Wed Jun 09 09:42:37 2010 +0300
+++ b/stifui/qt/stifqtui.pro	Mon Jun 21 15:41:16 2010 +0300
@@ -9,7 +9,8 @@
 # Contributors:
 # Description: QT project file.
 TARGET = STFUI
-HEADERS += inc/dlgsetselector.h \
+HEADERS += inc/dlgrepeatrun.h \
+    inc/dlgsetselector.h \
     inc\version.h \
     inc\frmmain.h \
     inc\istfqtuicontroller.h \
@@ -22,7 +23,8 @@
     inc\uisetting.h \
     inc\dlgsetting.h \
     inc\uiversion.h
-SOURCES += src\dlgsetselector.cpp \
+SOURCES += src/dlgrepeatrun.cpp \
+    src\dlgsetselector.cpp \
     src\frmmain.cpp \
     src\main.cpp \
     src\stfqtuimodel.cpp \
@@ -49,8 +51,4 @@
     
     # 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)"
 }