示例#1
0
void ServerConnection::gotDisconnected()
{
  kDebug() << "got disconnected";
  m_connected = false;
  m_connection->deleteLater();
  m_connection = 0;
  emit sigDisconnect();
}
示例#2
0
/**
 * @brief Client was disconnected from the server.
 *
 * Start a new session for the actor.
 */
void CTblMngrClient::clientDisConnected()
{
    QMessageBox::information(0, tr("ZBridge"), tr("Client disconnected."));

    cleanTableManager();
    emit sigDisconnect();

    //Enable new session action.
    QApplication::postEvent(parent(), new UPDATE_UI_ACTION_Event(UPDATE_UI_NEW_SESSION , true));
}
示例#3
0
/**
 * @brief There was a socket error on the tcp/ip connection.
 * @param err
 *
 *  Reset table manager and enable new session action.
 */
void CTblMngrClient::sSocketError(QString err)
{
    QMessageBox::information(0, tr("ZBridge"), err);

    cleanTableManager();
    emit sigDisconnect();

    //Enable new session action.
    QApplication::postEvent(parent(), new UPDATE_UI_ACTION_Event(UPDATE_UI_NEW_SESSION , true));
}
示例#4
0
void StartUi::loadMenuTabFrame()
{
    if( menuTabFrame )
        delete menuTabFrame;
    menuTabFrame = new MenuTabFrame(settings, &ipStats, &playerListWidget, music);
    connect(menuTabFrame->MainUi.maxPlayersBox, SIGNAL(valueChanged(int)), this, SLOT(slotMaxPlayersValueChanged(int)));
    connect(menuTabFrame->MainUi.maxWinsBox, SIGNAL(valueChanged(int)), this, SLOT(slotMaxWinsValueChanged(int)));
    connect(menuTabFrame->MainUi.serverButton,SIGNAL(clicked()),this,SLOT(slotStartServer()));
    connect(menuTabFrame->MainUi.mapRightButton, SIGNAL(clicked()), this, SLOT(slotMapRightButton()));
    connect(menuTabFrame->MainUi.mapLeftButton, SIGNAL(clicked()), this, SLOT(slotMapLeftButton()));
    connect(menuTabFrame->MainUi.randomMapCheck, SIGNAL(stateChanged(int)), this, SLOT(randomMapCheckedChanged(int)));
    connect(menuTabFrame->MainUi.addLocalPlayerButton, SIGNAL(clicked()), this, SLOT(slotAddLocalPlayer()));
    connect(menuTabFrame, SIGNAL(sigStart(int)),this,SLOT(slotStartGame(int)));
    connect(menuTabFrame, SIGNAL(sigDisconnect()),this,SLOT(slotDisconnectGame()));
    connect(menuTabFrame, SIGNAL(sigKickPlayer(qint8)), this, SLOT(slotKickPlayer(qint8)));
    gridLayout->addWidget(menuTabFrame);
}
示例#5
0
文件: spawnui.cpp 项目: gaf90/Tesi
void SpawnUI::onConnectButtonClicked()
{
    if(ui->connectButton->text().compare(CONNECT) == 0){
        //Collect data to install a connection
        QString usarAddress = ui->usarAddressLine->text();
        uint usarPort = ui->usarPortLine->text().toInt();
        QString upisAddress = ui->upisAddressLine->text();
        uint upisPort = ui->upisPortLine->text().toInt();
        QString wssAddress = ui->wssAddressLine->text();
        uint wssPort = ui->wssPortLine->text().toInt();
        emit sigUSARConnect(usarAddress, usarPort);
        emit siglUPISConnect(upisAddress, upisPort);
        //onSpawnBS();
        emit siglWSSConnect(wssAddress, wssPort);
    } else if (ui->connectButton->text().compare(DISCONNECT) == 0){
        emit sigDisconnect();
    }
}