Ejemplo n.º 1
0
MyIrcSession::MyIrcSession(const std::string &user, IRCNetworkPlugin *np, const std::string &suffix, QObject* parent) : IrcSession(parent)
{
	this->np = np;
	this->user = user;
	this->suffix = suffix;
	m_connected = false;
	rooms = 0;
	connect(this, SIGNAL(disconnected()), SLOT(on_disconnected()));
	connect(this, SIGNAL(socketError(QAbstractSocket::SocketError)), SLOT(on_socketError(QAbstractSocket::SocketError)));
	connect(this, SIGNAL(connected()), SLOT(on_connected()));
	connect(this, SIGNAL(messageReceived(IrcMessage*)), this, SLOT(onMessageReceived(IrcMessage*)));

	m_awayTimer = new QTimer(this);
	connect(m_awayTimer, SIGNAL(timeout()), this, SLOT(awayTimeout()));
	m_awayTimer->start(5*1000);
}
Ejemplo n.º 2
0
void Dialog::on_pushButtonSend_clicked()
{
	cleanQuit = false;
	sendBytes = 0;
	blockNumber = 0;
	maxBytes = 0;
	if(ui->lineEditTag->text().isEmpty() || ui->lineEditFile->text().isEmpty())
	{
		QMessageBox::information(this, tr("Error"), tr("Tag and File can not be empty."));
		return;
	}
	ui->pushButtonSend->setEnabled(false);
	nfClient* client = new nfClient(this);
	connect(client, SIGNAL(disconnected()), client, SLOT(deleteLater()));
	connect(client, SIGNAL(disconnected()), this, SLOT(on_socketDisconnected()));
	connect(client, SIGNAL(fileSize(qint64)), this, SLOT(setProccessBar(qint64)));
	connect(client, SIGNAL(bytesWritten(qint64)), this, SLOT(updateProccessBar(qint64)));
	connect(client, SIGNAL(message(QString)), this, SLOT(updateStatusLabel(QString)));
	connect(client, SIGNAL(onError(qint32)), this, SLOT(on_socketError(qint32)));
	client->sendFile(ui->lineEditFile->text(), ui->lineEditTag->text());
}