Пример #1
0
void CConverterDialog::PreLayoutDynInitL()
	{
	// set choice list with destination types
	CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(4);
	CleanupStack::PushL(array);
	// get array of conversion types
	iMediaClientEngine.DestinationTypesL(iFileName, *array);
	// set choicelist
    CEikChoiceList* typesList = static_cast<CEikChoiceList*>(Control(ECvtTypeField));
	typesList->SetArrayL(array);
	CleanupStack::Pop(array);
	}
Пример #2
0
TBool CConverterDialog::OkToExitL(TInt aKeycode)
	{
	CEikChoiceList* typesList = static_cast<CEikChoiceList*>(Control(ECvtTypeField));
	iTargetType = typesList->Array()->MdcaPoint(typesList->CurrentItem());

	// if format options button pressed, show dialog
	if (aKeycode == EFormatOptions)
		{
		if (CFormatOptionsDialog::RunDlgLD(iFileName, iTargetType, iMediaClientEngine, iFormatOptions)) 
			iOptionsSetFor = typesList->CurrentItem();
		return EFalse;
		}
	
	return ETrue;
    }
Пример #3
0
TBool CRecordDialog::OkToExitL(TInt aKeycode)
	{
	_LIT(KRecordFile, "c:\\record-output");
	CEikChoiceList* typesList = static_cast<CEikChoiceList*>(Control(ECvtTypeField));
	iFileName = KRecordFile;
	TPtrC type = typesList->Array()->MdcaPoint(typesList->CurrentItem());
	iFileName.Append(type);

	// if format options button pressed, show dialog
	if (aKeycode == EFormatOptions)
		{
		if (CRecordFormatOptionsDialog::RunDlgLD(type, iMediaClientEngine, iRecordFormatOptions)) 
			iOptionsSetFor = typesList->CurrentItem();
		return EFalse;
		}
	
	return ETrue;
    }
Пример #4
0
void CFormatOptionsDialog::TUintChoiceList(TInt aResourceId, const RArray<TUint>& aArray)
	{
	CEikChoiceList* list = static_cast<CEikChoiceList*>(Control(aResourceId));
	if (aArray.Count()==0) 
		{
		list->MakeVisible(EFalse);
		return;
		}
	TBuf <10> buf;
	CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(4);
	CleanupStack::PushL(array);
	for (TInt i=0; i<aArray.Count(); i++)
		{
		buf.Num(aArray[i]);
		array->AppendL(buf);
		}
	list->SetArrayL(array);	
	CleanupStack::Pop(); //array
	}
Пример #5
0
TBool CFormatOptionsDialog::OkToExitL(TInt /*aKeycode*/)
	{
	CEikChoiceList* list = static_cast<CEikChoiceList*>(Control(ECodecs));
	if (list->IsVisible()) 
		{iFormatOptions.i4CC = iDataTypes[list->CurrentItem()]; iFormatOptions.i4CCSet = ETrue; }
	list = static_cast<CEikChoiceList*>(Control(EBitRates));
	if (list->IsVisible()) 
		{iFormatOptions.iBitRate = iBitRates[list->CurrentItem()]; iFormatOptions.iBitRateSet = ETrue; }
	list = static_cast<CEikChoiceList*>(Control(ESampleRates));
	if (list->IsVisible()) 
		{iFormatOptions.iSampleRate = iSampleRates[list->CurrentItem()]; iFormatOptions.iSampleRateSet = ETrue; }
	list = static_cast<CEikChoiceList*>(Control(EChannels));
	if (list->IsVisible()) 
		{iFormatOptions.iChannel = iChannels[list->CurrentItem()]; iFormatOptions.iChannelSet = ETrue; }
	return ETrue;
	}
void CTcSettingsDialog::PreLayoutDynInitL()
	{
	CEikChoiceList* iapList =
		reinterpret_cast< CEikChoiceList* >( Control( ECtrlIAPName ) );

	CDesCArray* names = iapList->DesCArray();
	names->Delete( 0 );	// delete dummy item from array

	TInt count = iIAPManager->MdcaCount();
	for( TInt i = 0; i < count; i++ )
		{
		TBuf< KCommsDbSvrMaxFieldLength > name16;
		name16.Copy( iIAPManager->MdcaPoint( i ) );
		names->AppendL( name16 );
		if( (TInt)iIAPManager->Id( i ) == iSettings.iIAPId )
			{
			iapList->SetCurrentItem( i );
			}
		}

	SetChoiceListCurrentItem( ECtrlConnection, iSettings.iBearerType );
	
	TBuf<40> remoteAddrText;
	iSettings.iTCPRemoteAddr.Output( remoteAddrText );
	SetEdwinTextL(ECtrlRemoteAddr, &remoteAddrText);
	
	SetNumberEditorValue( ECtrlTcpPort, iSettings.iTCPPort );

    SetChoiceListCurrentItem( ECtrlCSYName, iSettings.iCSYName );
    SetChoiceListCurrentItem( ECtrlCommPort, iSettings.iCommPort );
    SetNumberEditorValue( ECtrlBaudrate, iSettings.iBaudrate );
    
	TInt autoconnect( 1 );
	if( !iSettings.iAutoConnect )
		{
		autoconnect = 0;	// no autoconnect
		}
	SetChoiceListCurrentItem( ECtrlAutoConnect, autoconnect );
	}
Пример #7
0
void CFormatOptionsDialog::PreLayoutDynInitL()
	{
	// Set dialog fields - these 3 are all TUint lists
	TUintChoiceList(EBitRates, iBitRates);
	TUintChoiceList(ESampleRates, iSampleRates);
	TUintChoiceList(EChannels, iChannels);
	// Codecs list is more complicated
	CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(4);
	CleanupStack::PushL(array);
	HBufC8* buf8 = HBufC8::NewLC(10);
	TPtr8 ptr = buf8->Des();
	TBuf<5> buf;
	for (TInt i=0; i<iDataTypes.Count(); i++)
		{
		iDataTypes[i].FourCC(&ptr);
		buf.Copy(ptr);
		array->AppendL(buf);
		}
    CEikChoiceList* list = static_cast<CEikChoiceList*>(Control(ECodecs));
	list->SetArrayL(array);	
	CleanupStack::PopAndDestroy(); //buf8
	CleanupStack::Pop(); //array
	}
TBool CTcSettingsDialog::OkToExitL( TInt /*aKeycode*/ )
	{
	CEikChoiceList* iapList =
		reinterpret_cast< CEikChoiceList* >( Control( ECtrlIAPName ) );
	iSettings.iIAPId = iIAPManager->Id( iapList->CurrentItem() );

	iSettings.iBearerType = ChoiceListCurrentItem( ECtrlConnection );
	
	TBuf<40> remoteAddrText;
	GetEdwinText(remoteAddrText, ECtrlRemoteAddr);
	if (KErrNone != iSettings.iTCPRemoteAddr.Input(remoteAddrText))
		{
		_LIT(KInvalidAddressText, "Invalid remote IP");
		CEikonEnv::Static()->AlertWin(KInvalidAddressText);
		return EFalse;
		}

	iSettings.iTCPPort = NumberEditorValue( ECtrlTcpPort );
	
	iSettings.iCSYName = ChoiceListCurrentItem( ECtrlCSYName );
	                            
	iSettings.iCommPort = ChoiceListCurrentItem( ECtrlCommPort );
	                            
	iSettings.iBaudrate = NumberEditorValue( ECtrlBaudrate );

	if( ChoiceListCurrentItem( ECtrlAutoConnect ) == 1 )
		{
		iSettings.iAutoConnect = ETrue;
		}
	else
		{
		iSettings.iAutoConnect = EFalse;
		}

	iSettings.Store();
	return ETrue;
	}