예제 #1
0
파일: UserWin.cpp 프로젝트: Lickid/Babel
void                    UserWin::acceptedCall()
{
    QLabel              _logo;
    QLabel              _text;
    QPushButton         _hangup;
    QVBoxLayout         _mainLayout;
    QHBoxLayout         _logoLayout;
    QHBoxLayout         _buttonLayout;
    QHBoxLayout         _textLayout;

    this->_acceptedWin.setFixedSize(300, 350);
    _hangup.setText("Raccrocher");
    _logo.setPixmap(QPixmap(QCoreApplication::applicationDirPath() + "/ressources/Lphone.png"));
    _logoLayout.setAlignment(Qt::AlignCenter);
    _logoLayout.addWidget(&_logo);
    this->_connectedContact.append(": Connecté !!");
    _text.setText(this->_connectedContact);
    _text.setAlignment(Qt::AlignCenter);
    _textLayout.addWidget(&_text);
    _hangup.setCursor(Qt::PointingHandCursor);
    _buttonLayout.setAlignment(Qt::AlignBottom);
    _buttonLayout.addWidget(&_hangup);
    _mainLayout.addLayout(&_logoLayout);
    _mainLayout.addLayout(&_textLayout);
    _mainLayout.addLayout(&_buttonLayout);
    this->_acceptedWin.setLayout(&_mainLayout);
    this->_acceptedWin.setWindowTitle("Connecté !!");
    this->_acceptedWin.setWindowIcon(QIcon(QCoreApplication::applicationDirPath() + "/ressources/babybel.png"));
    connect(&_hangup, SIGNAL(clicked()), this, SLOT(finishCall()));
    disconnect(this->getUdpSocket(), SIGNAL(readyRead()), this, SLOT(receivedUdpData()));
    connect(&this->timer, SIGNAL(timeout()), this, SLOT(receivedVoiceData()));
    connect(&this->timer, SIGNAL(timeout()), this, SLOT(sendVoiceData()));
    this->timer.start(1000);
    this->_acceptedWin.exec();
}
void SimpleBackend::processCall () {
	RK_TRACE (PHP);

	int next_token = current_template.indexOf ("$$$", template_pos);
	if (next_token < 0) next_token = template_sep;
	if (next_token > template_sep) next_token = template_sep;

	if (next_token < template_sep) {
		int token_end = current_template.indexOf ("$$$", next_token + 3);
		RK_ASSERT (token_end >= 0);
		QString token = current_template.mid (next_token + 3, token_end - (next_token + 3));
		template_pos = token_end + 3;
		emit (requestValue (token));
		return;
	}

	// all values are fetched. Now generate the return string
	finishCall (current_template.mid (template_sep + 3));
}