ui: Added plugin ports to preferences

bug id = 145
This commit is contained in:
Eberhard Graether
2016-08-26 14:41:39 +02:00
parent 401c23f572
commit ca0a1ffb89
12 changed files with 134 additions and 19 deletions
+11 -4
View File
@@ -8,22 +8,29 @@ QtTcpWrapper::QtTcpWrapper(QObject* parent, const std::string& ip, const quint16
, m_clientPort(clientPort)
, m_ip(ip)
{
m_tcpServer = new QTcpServer(this);
connect(m_tcpServer, SIGNAL(newConnection()), this, SLOT(acceptConnection()));
}
void QtTcpWrapper::startListening()
{
QHostAddress address(m_ip.c_str());
m_tcpServer = new QTcpServer(this);
connect(m_tcpServer, SIGNAL(newConnection()), this, SLOT(acceptConnection()));
if (!m_tcpServer->listen(QHostAddress::LocalHost, m_serverPort))
{
LOG_ERROR_STREAM(<< "TCP server failed to start with error: \"" + m_tcpServer->errorString().toStdString() + "\". Unable to listen for IDE plugin messages.");
}
}
void QtTcpWrapper::stopListening()
{
if (isListening())
{
m_tcpServer->close();
}
}
QtTcpWrapper::~QtTcpWrapper()
{
if (m_tcpServer != NULL)