##// END OF EJS Templates
Sync
jeandet -
r21:4db1f259222a default
parent child
Show More
@@ -34,6 +34,7 SpwTcpPacketServer::SpwTcpPacketServer(Q
34 34 connect(this->ui->startServeQpb,SIGNAL(clicked(bool)),SLOT(toggleServer()));
35 35 updateHostIP();
36 36 this->ui->PortLineEdit->setText("2200");
37 connect(this->p_server,SIGNAL(newConnection()),this,SLOT(newConnection()));
37 38 }
38 39
39 40 SpwTcpPacketServer::~SpwTcpPacketServer()
@@ -105,9 +106,15 void SpwTcpPacketServer::setServerPort(q
105 106 this->ui->PortLineEdit->setText(QString("%1").arg(port));
106 107 }
107 108
109 void SpwTcpPacketServer::setServerSetIP(QString ip)
110 {
111 this->ui->IPLineEdit->setText(ip);
112 }
113
108 114 void SpwTcpPacketServer::newConnection()
109 115 {
110 116 this->connectedClients.append(this->p_server->nextPendingConnection());
117 this->ui->listWidget->addItem(this->connectedClients.last()->peerAddress().toString());
111 118 }
112 119
113 120 void SpwTcpPacketServer::updateHostIP()
@@ -48,6 +48,7 public slots:
48 48 void connectServer();
49 49 void disconnectServer();
50 50 void setServerPort(qint32 port);
51 void setServerSetIP(QString ip);
51 52 void newConnection();
52 53 private:
53 54 void updateHostIP();
@@ -49,6 +49,7 spwplugin::spwplugin(QWidget *parent):so
49 49 connect(((spwPyWrapper*)this->pyObject),SIGNAL(TCPServerConnect()),this->tcpServer,SLOT(connectServer()));
50 50 connect(((spwPyWrapper*)this->pyObject),SIGNAL(TCPServerDisconnect()),this->tcpServer,SLOT(disconnectServer()));
51 51 connect(((spwPyWrapper*)this->pyObject),SIGNAL(TCPServerSetPort(qint32)),this->tcpServer,SLOT(setServerPort(qint32)));
52 connect(((spwPyWrapper*)this->pyObject),SIGNAL(TCPServerSetIP(QString)),this->tcpServer,SLOT(setServerSetIP(QString)));
52 53 }
53 54
54 55
@@ -22,6 +22,7 signals:
22 22 void TCPServerConnect();
23 23 void TCPServerDisconnect();
24 24 void TCPServerSetPort(qint32 port);
25 void TCPServerSetIP(QString ip);
25 26 public slots:
26 27
27 28 };
General Comments 0
You need to be logged in to leave comments. Login now