Ejemplo n.º 1
0
	//------------------------------------------------------------
	void PedalFilter::SetReleaseTime( float time )
	{
		releaseTime = ((time < timeLimit) ? timeLimit : time);
		releaseSpeed = calcSpeed( time );
	}
Ejemplo n.º 2
0
	void Ball::calcVector()
	{
		calcAngle();
		calcSpeed();
	}
Ejemplo n.º 3
0
	//------------------------------------------------------------
	void SteerFilter::SetPressTime(float time)
	{
		pressTime = ((time < timeLimit) ? timeLimit : time);
		pressSpeed = calcSpeed( time );
	}
Ejemplo n.º 4
0
void FileTransferDlg::process()
{
    if (m_msg->m_transfer == NULL)
        return;
    if ((m_msg->m_transfer->state() != m_state) || (m_msg->m_transfer->file() != m_file)){
        m_state = m_msg->m_transfer->state();
        m_file  = m_msg->m_transfer->file();
        QString status;
        bool bName = false;
        switch (m_state){
        case FileTransfer::Listen:
            status = i18n("Listen");
            break;
        case FileTransfer::Connect:
            status = i18n("Connect");
            break;
        case FileTransfer::Negotiation:
            status = i18n("Negotiation");
            break;
        case FileTransfer::Read:
            status = i18n("Receive");
            bName = true;
            break;
        case FileTransfer::Write:
            status = i18n("Send");
            bName = true;
            break;
        case FileTransfer::Done:
            status = i18n("Transfer done");
			if (!m_dir.isEmpty())
				btnGo->show();
            break;
        case FileTransfer::Error:
            if (m_msg->getError())
                status = i18n(m_msg->getError());
            break;
        default:
            break;
        }
        if (bName && (m_files > 1)){
            FileMessage::Iterator it(*m_msg);
            status += " ";
            const QString *n = it[m_file];
            if (n){
				QString shortName = *n;
				shortName = shortName.replace(QRegExp("\\\\"), "/");
				int n = shortName.findRev("/");
				if (n >= 0)
					shortName = shortName.mid(n + 1);
                status += shortName;
                status += QString(" %1/%2")
                          .arg(m_file + 1)
                          .arg(m_msg->m_transfer->files());
            }
        }
        lblState->setText(status);
        setBars();
    }
    calcSpeed();
    if ((int)(m_msg->m_transfer->speed()) != sldSpeed->value())
        sldSpeed->setValue(m_msg->m_transfer->speed());
    if (m_msg->m_transfer->files() != m_files){
        m_files = m_msg->m_transfer->files();
        if (m_files > 1){
            if (!barFile->isVisible())
                barFile->show();
        }else{
            if (barFile->isVisible())
                barFile->hide();
        }
    }
}