示例#1
0
TBool CTestSwitchDialog::OkToExitL(TInt aButtonId)
	{
	if (aButtonId!=EEikBidOk)
		return EFalse;

	switch (ChoiceListCurrentItem(ESwitchDlg_ViewChoice))
		{
		case 0:
			iAppUi.iViewToActivate.iViewUid=KUidViewOne;
			break;
		case 1:
			iAppUi.iViewToActivate.iViewUid=KUidViewTwo;
			break;
		default:
			break;
		}

	if (ChoiceListCurrentItem(ESwitchDlg_AppChoice)==0)
		{
		iAppUi.iViewToActivate.iAppUid=KUidViewAppOne;
		}
	else if (ChoiceListCurrentItem(ESwitchDlg_AppChoice)==1)
		{
		iAppUi.iViewToActivate.iAppUid=KUidViewAppTwo;
		}

	delete iAppUi.iCustomMsg;
	iAppUi.iCustomMsg=HBufC::NewL(STATIC_CAST(CEikEdwin*,Control(ESwitchDlg_CustomMsg))->TextLength());
	TPtr des=iAppUi.iCustomMsg->Des();
	GetEdwinText(des,ESwitchDlg_CustomMsg);
	return ETrue;
	}
// ----------------------------------------------------------------------------
// CNewDestDialog::SaveFormDataL()
// Save form data.
// ----------------------------------------------------------------------------
//
TBool CNewDestDialog::SaveFormDataL()
{
   if( ControlOrNull( EWayFinderCtrlNewDestCountryEdwin ) ){
      GetEdwinText( iCountry, EWayFinderCtrlNewDestCountryEdwin );
   }
   if( ControlOrNull( EWayFinderCtrlNewDestHouseNumEdwin ) ){
      GetEdwinText( iHouseNum, EWayFinderCtrlNewDestHouseNumEdwin );
   }
   if( ControlOrNull( EWayFinderCtrlNewDestCityEdwin ) ){
      GetEdwinText( iCity, EWayFinderCtrlNewDestCityEdwin );
   }
   if( ControlOrNull( EWayFinderCtrlNewDestStringEdwin ) ){
      GetEdwinText( iSearchString, EWayFinderCtrlNewDestStringEdwin );
   }
   iView->SetSearchStrings( iCountry, iCity, iHouseNum, iSearchString );
   return ETrue;
}
TBool CNickForm::SaveFormDataL()
{
	CALLSTACKITEM(_L("CNickForm::SaveFormDataL"));

	GetEdwinText(iNick, 2);

	iData.SetJabberNickL(iContactId, iNick);

	if (iBook) iBook->ReRead();

	return true;
}
示例#4
0
// Checks if data entered by user is correct
TBool COptionsDialog::OkToExitL(TInt)
{
    if (CheckBoxState(EPingNumPackCheckBox)==CEikButtonBase::ESet)
    {
        iPingModel->iTotalPackets=NumberEditorValue(EPingNumPackNum);
        iPingModel->iPackLimit=ETrue;
    }
    else
        iPingModel->iPackLimit=EFalse;  //Indicates Unlimited Packets

    // This option is disabled by now. Code is commented pingmodel.cpp
    /* DO NOT REMOVE!!!
    if (CheckBoxState(EPingHopLimitCheckBox)==CEikButtonBase::ESet)
        iPingModel->iHopLimit=NumberEditorValue(EPingHopLimitNum);
    else
        iPingModel->iHopLimit=0;    //Indicates Hop Limit won't be set
    
    iPingModel->iNumericOutput=(CheckBoxState(EPingNoResolvCheckBox)==CEikButtonBase::ESet);
    */
    iPingModel->iQuiet=(CheckBoxState(EPingQuietCheckBox)== CEikButtonBase::ESet);
    iPingModel->iVerbose=(CheckBoxState(EPingVerboseCheckBox)== CEikButtonBase::ESet);
    iPingModel->iDebug=(CheckBoxState(EPingDebugCheckBox)== CEikButtonBase::ESet);

    iPingModel->iSecWait=NumberEditorValue(EPingSecNum);    //Time between packets
    iPingModel->iLastSecWait=NumberEditorValue(EPingLastSecNum);    //Time between packets  
    iPingModel->iPacketDataSize=NumberEditorValue(EPingPackSizeNum);
    GetEdwinText(iPingModel->iPattern,EPingPatternNum);
    //Check the pattern is hexadecimal
    TLex lex(iPingModel->iPattern);
    while (!lex.Eos())
    {
        if (!lex.Get().IsHexDigit())
        {
            CEikonEnv::Static()->InfoMsg(_L("Bad Pattern (Must be Hexadecimal)"));
            TryChangeFocusToL(EPingPatternNum);
            return EFalse;
        }

    }
    return ETrue;
}
示例#5
0
TBool CHostNameDialog::OkToExitL(TInt aButton)
{   
    
    TBuf<KHostNameLimit> hostname(_L(""));
    if (aButton==EEikBidCancel) //CANCEL BUTTON
    {
        iOKPressed=EFalse;
        return ETrue;
    }
    
    GetEdwinText(hostname,EPingHostName);
    
    if (hostname.Length()!=0)
    {
        iPingModel->SetHostName(hostname);
        return ETrue;
    }
    else
        return EFalse;  //If no hostname specified can't continue
    
}
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;
	}
TBool CWebForm::SaveFormDataL()
{
	bool value[2]={ false, false };
	TBuf<MAX_ADDRESS_LEN> points[2];
	TInt text_ids[]={ CL_WEB_FROM_TEXT_ID, CL_WEB_TO_TEXT_ID };
	TInt list_ids[]={ CL_WEB_FROM_LIST_ID, CL_WEB_TO_LIST_ID };

	for (int i=0; i<2; i++) {
		CSavedPoints::TEndPoint p=(CSavedPoints::TEndPoint)i;
		GetEdwinText(points[i], text_ids[i]);
		points[i].TrimAll();
		if (points[i].Length()>3) {
			iPoints->AddPoint(p, points[i]);
			value[i]=true;
		} else {
			if (iSaved[i]) {
				TInt idx=GetCurrentItem(list_ids[i]);
				iPoints->IncUsage(p, idx);
				points[i]=iPoints->Points(p)[idx];
				value[i]=true;
			}
		}
	}
	TTime time; time.HomeTime();

	TDateTime dt=time.DateTime();

    
	_LIT(KUrlFormat, "http://aikataulut.ytv.fi/reittiopas-pda/en/?test=1&keya=%S&keyb=%S&hour=%d&min=%d&vm=1&day=%d&month=%d&year=%d");

	if (value[0] && value[1]) {
		TBuf<MAX_ADDRESS_LEN*3> enc_points[2];
		for (int p=0; p<2; p++) {
			CHttp::AppendUrlEncoded(enc_points[p], points[p]);
		}
		auto_ptr<HBufC> addr(HBufC::NewL(KUrlFormat().Length()+enc_points[0].Length()+enc_points[1].Length()+10));
		addr->Des().Format(KUrlFormat, &enc_points[0], &enc_points[1],
			(TInt)dt.Hour(), (TInt)dt.Minute(), 
			(TInt)(dt.Day()+1), (TInt)(dt.Month()+1),
			(TInt)(dt.Year()));

		auto_ptr<CBBString> msg(CBBString::NewL(KWeb, points[0].Length()+points[1].Length()+20));
		msg->iBuf->Des().Format(_L("HKL search from %S to %S"), &(points[0]), &(points[1]));
		iLog.post_new_value(msg.get());
#ifndef __WINS__
#  ifndef __S60V2__
		auto_ptr<CDorisBrowserInterface> ido(CDorisBrowserInterface::NewL());
		ido->AppendL(CDorisBrowserInterface::EOpenURL_STRING, *addr);
		ido->ExecuteL();
#  else
		auto_ptr<HBufC8> addr8(HBufC8::NewL(addr->Length()));
		TPtr8 addrp=addr8->Des();
		CC()->ConvertFromUnicode(addrp, *addr);
		TUid KUidOperaBrowserUid = {0x101F4DED};
		TUid KUidOperaRenderViewUid = {0};
		TVwsViewId viewId(KUidOperaBrowserUid, KUidOperaRenderViewUid);
		auto_ptr<CVwsSessionWrapper> vws(CVwsSessionWrapper::NewL());
		vws->ActivateView(viewId, TUid::Uid(0), *addr8);
#  endif
#endif
	} else {
#ifndef __WINS__
		//iLog.post_new_value(_L("form closed"));
		iOpener.CloseConnection();
#endif
	}

	return true;
}