void ConfigWidget::makeConnections()
{
    // networkPage Connections
    connect(networkPage, SIGNAL(ipChanged(QString)), udpClient, SLOT(setOtherNodeAddress(QString)));
    connect(networkPage, SIGNAL(portChanged(int)), udpClient, SLOT(setOtherNodePort(int)));

    // settingsPage Connections
    connect(settingsPage, SIGNAL(connectClicked()), udpClient, SLOT(startSocket()));
    connect(settingsPage, SIGNAL(sendClicked(QString)), udpClient, SLOT(sendUserCommand(QString)));
    connect(settingsPage, SIGNAL(disconnectClicked()), udpClient, SLOT(stopSocket()));
    connect(settingsPage, SIGNAL(configFileSelected(QString)), ConfigFileHandler::instance(), SLOT(handleFile(QString)));

    // consolePage Connections
    connect(consolePage, SIGNAL(startClicked()), this, SLOT(startConsoleStream()));
    connect(consolePage, SIGNAL(stopClicked()), this, SLOT(stopConsoleStream()));

    // ConfigFileHandler Connections
    connect(ConfigFileHandler::instance(), SIGNAL(commandFromFile(QString)), udpClient, SLOT(sendUserCommand(QString)));

    // udpClient Connection
    connect(udpClient, SIGNAL(dataReplyReceived(QString)), settingsPage, SLOT(addToViewer(QString)));
    connect(udpClient, SIGNAL(connectionChanged(bool)), networkPage, SLOT(adjustToConnection(bool)));
    connect(udpClient, SIGNAL(connectionChanged(bool)), settingsPage, SLOT(adjustToConnection(bool)));
    connect(udpClient, SIGNAL(connectionChanged(bool)), consolePage, SLOT(adjustToConnection(bool)));
}
Exemplo n.º 2
0
void NetworkDevice::setIp(const QString &ip)
{
    if (m_ip != ip) {
        m_ip = ip;
        emit ipChanged();
    }
}
Exemplo n.º 3
0
void OSCSender::setIp(const QString &ip)
{
    try {
        ip_ = ip.toStdString();
        socket_ .Connect(IpEndpointName(ip_.c_str(), port_));
        emit ipChanged();
    } catch (const std::exception& e) {
        emit error(e.what());
    }
}
Exemplo n.º 4
0
void TabbedWebView::setIp(const QHostInfo &info)
{
    if (info.addresses().isEmpty()) {
        return;
    }

    m_currentIp = info.hostName() + " (" + info.addresses().at(0).toString() + ")";

    if (isCurrent()) {
        emit ipChanged(m_currentIp);
    }
}
/*!
  Constructor.
*/
WlanConnection::WlanConnection(QObject *parent)
    : ConnectionIf(parent),
      mServerPort(13001),
      mBroadcastPort(13002),
      mServer(0),
      mClient(0),
      mDiscoveryMgr(0)
{
    WlanNetworkMgr& mgr = Network::networkManager();

    QObject::connect(&mgr, SIGNAL(ipChanged(QString)),
                     this, SLOT(onIpChanged(QString)));

    QObject::connect(&mgr, SIGNAL(stateChanged(QNetworkSession::State)),
                     this, SLOT(onNetworkStateChanged(QNetworkSession::State)));

    mgr.connectToNetwork();
}
/*!
  Creates and connects server and its signals
*/
void WlanConnection::startServer()
{
    if (!mServer) {
        mServer = new WlanServer(this);

        QObject::connect(mServer, SIGNAL(read(QByteArray)),
                         this, SLOT(onRead(QByteArray)));
        QObject::connect(mServer, SIGNAL(clientConnected(QString)),
                         this, SLOT(onClientConnected(QString)));
        QObject::connect(mServer, SIGNAL(clientDisconnected(int)),
                         this, SLOT(onClientDisconnected(int)));
        QObject::connect(mServer, SIGNAL(reconnectToNetwork()),
                         this, SLOT(onReconnect()));
        QObject::connect(mServer, SIGNAL(socketError(int)),
                         this, SLOT(onSocketError(int)));

        WlanNetworkMgr& mgr = Network::networkManager();
        QObject::connect(&mgr, SIGNAL(stateChanged(QNetworkSession::State)),
                         mServer, SLOT(onNetworkStateChanged(QNetworkSession::State)));
        QObject::connect(&mgr, SIGNAL(ipChanged(QString)),
                         mServer, SLOT(onIpChanged(QString)));

    }
Exemplo n.º 7
0
void Client::setIp(QString ip) {
	this->ip = ip;
    emit ipChanged();
}