Exemple #1
0
void TcpSocket::close()
{
    if(!isAvaliable())
        return;

    ::close(m_fd);
    onClosed(this);
    m_fd = -1;
}
Exemple #2
0
SyncProcess::SyncProcess(const QString & folder1, const QString & folder2, ProgressWidget * progress):
  folder1(folder1),
  folder2(folder2),
  progress(progress),
  index(0),
  count(0),
  closed(false)
{
  connect(progress, SIGNAL(stopped()),this, SLOT(onClosed()));
}
Exemple #3
0
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
void
GameObjectType::destroyDocument(Zen::Memory::managed_weak_ptr<Zen::Studio::Workbench::I_Document> _wpDoc)
{
    GameObjectTypeDocument* pDoc = dynamic_cast<GameObjectTypeDocument*>(_wpDoc.get());

    if (pDoc)
    {
        onClosed(pDoc);
        delete pDoc;
    }
    else 
    {
        // TODO Error?
    }
}
Exemple #4
0
void RWHandler::doWrite()
{
    auto self(shared_from_this());
    boost::asio::async_write(m_socket, boost::asio::buffer(m_write_buffer.front().data(), m_write_buffer.front().size()),
        [this, self](boost::system::error_code ec, std::size_t length)
        {
            (void)length;
            if (ec) {
                FAKE_LOG(ERROR) << "RWHandlerBase::doWrite error: " << ec.value() << ":" << ec.message();
                onClosed();
                return;
            }
            m_write_buffer.pop_front();
            if (!m_write_buffer.empty()) {
                doWrite();
            }
        });
}
Exemple #5
0
NetworkControl::NetworkControl() {
    client = new Client();

    QObject::connect(client, SIGNAL(connected()), this, SLOT(onConnected()));
    QObject::connect(client, SIGNAL(hostFound()), this, SLOT(onHostFound()));
    QObject::connect(client, SIGNAL(loggingIn()), this, SLOT(onLoggingIn()));
    QObject::connect(client, SIGNAL(successfullJoin()), this, SLOT(onConnectionAccepted()));
    QObject::connect(client, SIGNAL(disconnected()), this, SLOT(onDisconnected()));
    QObject::connect(client, SIGNAL(presentationReceived(QString, QList<QImage>)), this, SLOT(onPresentationReceived(QString, QList<QImage>)));

    server = new Server();
    QObject::connect(server, SIGNAL(listening()), this, SLOT(onStarted()));
    QObject::connect(server, SIGNAL(connectionAccepted()), this, SLOT(onClientConnected()));
    QObject::connect(server, SIGNAL(clientVerified()), this, SLOT(onClientVerified()));
    QObject::connect(server, SIGNAL(clientLeft()), this, SLOT(onClientLeft()));
    QObject::connect(server, SIGNAL(closing()), this, SLOT(onClosed()));

}
Exemple #6
0
void Window::frame(const float& dTime) {
	window.clear();

	//get input
	sf::Event event;

	while (window.pollEvent(event)) {
		switch (event.type) {
		case sf::Event::Closed: //x button clicked
			onClosed();
			break;
		default:
			activeScene->processInput(event);
			break;
		}
	}

	activeScene->draw(window); //draw active node

	window.display();
}
Exemple #7
0
NetworkControl::NetworkControl(PresentationControl* p) {
    pc = p;
    QObject::connect(pc, SIGNAL(presentationChanged()), this, SLOT(onPresentationChanged()));
    QThread* networkThread = new QThread();

    client = new Client();
    QObject::connect(client, SIGNAL(currentPageReceived(qint64)), pc, SLOT(onCurrenPageChanged(qint64)));
    QObject::connect(client, SIGNAL(connected()), this, SLOT(onConnected()));
    QObject::connect(client, SIGNAL(hostFound()), this, SLOT(onHostFound()));
    QObject::connect(client, SIGNAL(loggingIn()), this, SLOT(onLoggingIn()));
    QObject::connect(client, SIGNAL(successfullJoin()), this, SLOT(onConnectionAccepted()));
    QObject::connect(client, SIGNAL(disconnected()), this, SLOT(onDisconnected()));
    QObject::connect(client, SIGNAL(presentationReceived(QString, QList<QImage>)), this, SLOT(onPresentationReceived(QString, QList<QImage>)));

    server = new Server();

    server->setPresentation(p->getPresentation());
    QObject::connect(server, SIGNAL(listening()), this, SLOT(onStarted()));
    QObject::connect(server, SIGNAL(connectionAccepted()), this, SLOT(onClientConnected()));
    QObject::connect(server, SIGNAL(clientVerified()), this, SLOT(onClientVerified()));
    QObject::connect(server, SIGNAL(clientLeft()), this, SLOT(onClientLeft()));
    QObject::connect(server, SIGNAL(closing()), this, SLOT(onClosed()));
}
Exemple #8
0
void BOSHSessionStream::fakeStreamFooterReceipt(BOSHError::ref error) {
    std::string footer("</stream:stream>");
    xmppLayer->handleDataRead(createSafeByteArray(footer));
    onClosed(error);
}
Exemple #9
0
void BOSHSessionStream::handleXMPPError() {
    available = false;
    onClosed(std::make_shared<SessionStreamError>(SessionStreamError::ParseError));
}
void ClosableDockWidget::closeEvent( QCloseEvent* event )
{
   emit onClosed( this );
   __super::closeEvent( event );
}
Exemple #11
0
void QtChatWindow::closeEvent(QCloseEvent* event) {
	event->accept();
	emit windowClosing();
	onClosed();
}
Exemple #12
0
void ClientController::fire_onClosed() {
	onClosed();
}