void CTTGPSLoggerSelectMemorySettingItem::EditItemL(TBool aCalledFromMenu) // edit text
    {
    CDesC16Array *itemArray = CCoeEnv::Static()->ReadDesCArrayResourceL(R_TTGP_ARRAY_DIALOG_MEMORY1);
    CleanupStack::PushL(itemArray);
	if(!TTGPSLoggerCommon::CheckDiskL(EDriveF, EFalse))
		itemArray->Delete(3);
	if(!TTGPSLoggerCommon::CheckDiskL(EDriveE, EFalse))
		itemArray->Delete(2);
	if(!TTGPSLoggerCommon::CheckDiskL(EDriveC, EFalse))
		itemArray->Delete(1);
    TInt selectIndex;
    selectIndex=iMemory;
    HBufC* title = NULL;
	title = CEikonEnv::Static()->AllocReadResourceLC(R_TTGP_TBUF32_DIALOG_MEMORY_TITLE);
    CAknListQueryDialog* dialog = new (ELeave) CAknListQueryDialog(&selectIndex);
    dialog->PrepareLC(R_TTGP_DIALOG_LISTQUERY);
    dialog->QueryHeading()->SetTextL(*title);
    dialog->SetItemTextArray(itemArray);
    dialog->SetOwnershipType(ELbmDoesNotOwnItemArray);
    TInt answer = dialog->RunLD();
    CleanupStack::PopAndDestroy(); // title
    if (answer)
		switch (selectIndex)
			{
			case 0: // (Drive info)
				{
				// drive info
				TTGPSLoggerCommon::CheckDiskL(-1, ETrue);
				break;
				}
			case 1: // Phone Memory
				if(TTGPSLoggerCommon::CheckDiskL(EDriveC, ETrue))
					iMemory=selectIndex;
				break;
			case 2: // Memory Card
				if(TTGPSLoggerCommon::CheckDiskL(EDriveE, ETrue))
					iMemory=selectIndex;
				break;
			case 3: // Mass Memory
				if(TTGPSLoggerCommon::CheckDiskL(EDriveF, ETrue))
					iMemory=selectIndex;
				break;
			}
	UpdateListBoxTextL();
    CleanupStack::PopAndDestroy(); // itemArray
    }
void CTTGPSLoggerCheckBoxSettingItem::EditItemL(TBool aCalledFromMenu)
    {
    TInt res = SettingPageResourceId();
    
	CAknCheckBoxSettingPage* settingPage = new (ELeave) CAknCheckBoxSettingPage(SettingPageResourceId(), iSelectionItemList);
	CleanupStack::PushL(settingPage);
	SetSettingPage(settingPage);
	SettingPage()->SetSettingPageObserver(this);
	//SettingPage()->SetSettingPageObserver(static_cast<MAknSettingPageObserver*>(this));
	SetUpStandardSettingPageL();
	CleanupStack::Pop(settingPage);
	TBool err = SettingPage()->ExecuteLD(CAknSettingPage::EUpdateWhenAccepted);
	SetSettingPage(NULL);
	if (err)
		{
		UpdateListBoxTextL();
		}
    }
// --------------------------------------------------------------------------
// CMSStoreServersSetting::EditItemL( TBool aCalledFromMenu )
// --------------------------------------------------------------------------
//
void CMSStoreServersSetting::EditItemL( TBool /*aCalledFromMenu*/ )
{
    LOG(_L("[MediaServant]\t CMSStoreServersSetting::EditItemL"));

    // Create setting page
    CAknSettingPage* dlg = CMSMultiselectionSettingPage::NewL(
                               R_MS_STORE_SETTINGS_LOCATION_SETTING_PAGE,
                               *iItemArray, EFalse );
    // launch setting page
    if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
    {
        DeleteAllServersFromRuleL();

        for ( TInt index = 0; index < iItemArray->Count(); index++ )
        {
            CSelectableItem* item = iItemArray->At( index );
            TBool selected = item->SelectionStatus();

            CCmMediaServerFull* server = (*iServers)[index];
            // get server UDN
            TPtrC8 serverUDN = server->MediaServer();

            // add server
            if ( item->SelectionStatus() )
            {
                // set server for rule
                iRule->AddMediaServerL( serverUDN );
            }
        }

        SetSettingItemTextL();
        LoadL();
        // show value on screen
        UpdateListBoxTextL();
    }
}
void CTTGPSLoggerPositioningMethod::EditItemL(TBool aCalledFromMenu) // edit text
    {
	CDesC16ArrayFlat *itemArray = new (ELeave) CDesC16ArrayFlat(20);
	CDesC16ArrayFlat *itemArrayDetails = new (ELeave) CDesC16ArrayFlat(20);
	CleanupStack::PushL(itemArray); // in case the appends leave
	CleanupStack::PushL(itemArrayDetails); // in case the appends leave
	RPositionServer iPositionServer;
	RPositioner iPositioner;
	User::LeaveIfError(iPositionServer.Connect());
	User::LeaveIfError(iPositioner.Open(iPositionServer));
	itemArray->AppendL(_L("(Info on all modules)"));
	itemArray->AppendL(_L("(Default)"));
	TUint aModules = 0;
	TInt defaultModule=-1;

	// Get the available numbers of modules
	User::LeaveIfError(iPositionServer.GetNumModules(aModules));
    TPositionModuleInfo info;
	TPositionModuleId aModuleId;
	iPositionServer.GetDefaultModuleId(aModuleId);

	// Prepare itemArray and itemArrayDetails
    for(TUint i = 0; i < aModules; i++)
    	{
    	if ((iPositionServer.GetModuleInfoByIndex(i,info) == KErrNone) && (info.IsAvailable()))
    		{
    		TBuf<200> smallBuffer;
    		smallBuffer.Zero();
    		info.GetModuleName(smallBuffer);
    		itemArray->AppendL(smallBuffer);

			TBuf<200> buffer;
			buffer.Zero();
			info.GetModuleName(buffer);
			buffer.Append(_L(" ("));
			if (info.DeviceLocation() & TPositionModuleInfo::EDeviceExternal)
				buffer.Append(_L("External "));
			if (info.DeviceLocation() & TPositionModuleInfo::EDeviceInternal)
				buffer.Append(_L("Internal "));
			if (info.DeviceLocation() & TPositionModuleInfo::EDeviceUnknown)
				buffer.Append(_L("Unknown "));
			if (info.TechnologyType()& TPositionModuleInfo::ETechnologyAssisted)
				buffer.Append(_L("Assisted "));
			if (info.TechnologyType()& TPositionModuleInfo::ETechnologyTerminal)
				buffer.Append(_L("GPS, "));
			if (info.TechnologyType()& TPositionModuleInfo::ETechnologyNetwork)
				buffer.Append(_L("Network, "));
			if (info.TechnologyType()& TPositionModuleInfo::ETechnologyUnknown)
				buffer.Append(_L("Unknown tech, "));
			if (buffer.Mid(buffer.Length()-2, 2).Compare( _L(", ")) == KErrNone)
				buffer.Replace(buffer.Length()-2, 2, _L(")"));
			if (buffer.Mid(buffer.Length()-1, 1).Compare( _L(" "))  == KErrNone)
				buffer.Replace(buffer.Length()-1, 1, _L(")"));
			if ( info.ModuleId() == aModuleId)
				{
				buffer.Append(_L(" [Default]"));
				defaultModule=i;
				}
    		itemArrayDetails->AppendL(buffer);    		
    		}
    	}	
	iPositioner.Close();
	iPositionServer.Close();

	// Present list of positioning methods
	TInt selectIndex;
    selectIndex=iPosMethod+1;
    HBufC* title = NULL;
	title = CEikonEnv::Static()->AllocReadResourceLC(R_TTGP_TBUF32_DIALOG_POSITIONING_TITLE); // Select positioning method:
    CAknListQueryDialog* dialog = new (ELeave) CAknListQueryDialog(&selectIndex);
    dialog->PrepareLC(R_TTGP_DIALOG_LISTQUERY);
    dialog->QueryHeading()->SetTextL(*title);
    dialog->SetItemTextArray(itemArray);
    dialog->SetOwnershipType(ELbmDoesNotOwnItemArray);
    TInt answer = dialog->RunLD();
    CleanupStack::PopAndDestroy(); // title
    // Check answer
    if (answer)
    	{
        if (selectIndex==0) // (Info on all modules)
    		{
    		TBuf<1000> aText;
    		aText.Zero();
    		for (TInt i=0;i<itemArrayDetails->Count();i++)
    			{
    			aText.AppendFormat(_L("%d. "), i+1);
    			aText.Append(itemArrayDetails->MdcaPoint(i));
    			if (i<itemArrayDetails->Count()-1)
    				aText.Append(_L("\n"));
    			}
    		HBufC* title = CEikonEnv::Static()->AllocReadResourceLC(R_TTGP_TBUF32_AVAILABLEPOSITIONING_TITLE); // Available modules:
    		CAknMessageQueryDialog* dialog = new (ELeave) CAknMessageQueryDialog();
    		CleanupStack::PushL(dialog);
    		dialog->PrepareLC(R_TTGP_DIALOG_MESSAGEQUERY_OK);
    		dialog->QueryHeading()->SetTextL(*title);
    		dialog->SetMessageTextL(aText);
    		CleanupStack::Pop(); // dialog
    		dialog->RunLD();
    		CleanupStack::PopAndDestroy(); // title
    		}
        else
        if (selectIndex==1) // Default module
        	{
        	if (defaultModule>-1)
        		{
        		// Present default module name
        		HBufC* title = CEikonEnv::Static()->AllocReadResourceLC(R_TTGP_TBUF32_SELECTEDPOSITIONING_TITLE); // Selected module:
        		CAknMessageQueryDialog* dialog = new (ELeave) CAknMessageQueryDialog();
        		CleanupStack::PushL(dialog);
        		dialog->PrepareLC(R_TTGP_DIALOG_MESSAGEQUERY_OK);
        		dialog->QueryHeading()->SetTextL(*title);
        		dialog->SetMessageTextL(itemArrayDetails->MdcaPoint(defaultModule));
        		CleanupStack::Pop(); // dialog
        		dialog->RunLD();
        		CleanupStack::PopAndDestroy(); // title
        		}
    		iPosMethod=0; // default module selected
    		C_APPUI->Engine()->Requester()->SetPositioningMethod(iPosMethod);
    		C_APPUI->Engine()->Requester()->StartL();
        	}
        else
        if (selectIndex>1) // Custom selection of the module
        	{
    		HBufC* title = CEikonEnv::Static()->AllocReadResourceLC(R_TTGP_TBUF32_SELECTEDPOSITIONING_TITLE); // Selected module:
    		CAknMessageQueryDialog* dialog = new (ELeave) CAknMessageQueryDialog();
    		CleanupStack::PushL(dialog);
    		dialog->PrepareLC(R_TTGP_DIALOG_MESSAGEQUERY_OK);
    		dialog->QueryHeading()->SetTextL(*title);
    		dialog->SetMessageTextL(itemArrayDetails->MdcaPoint(selectIndex-2));
    		CleanupStack::Pop(); // dialog
    		dialog->RunLD();
    		CleanupStack::PopAndDestroy(); // title
    		iPosMethod=selectIndex-1;
    		C_APPUI->Engine()->Requester()->SetPositioningMethod(iPosMethod);
    		C_APPUI->Engine()->Requester()->StartL();
    		}
    	UpdateListBoxTextL();
    	}
    CleanupStack::PopAndDestroy(); // itemArrayDetails
    CleanupStack::PopAndDestroy(); // itemArray
    }