新增网页效果图
This commit is contained in:
@@ -35,31 +35,7 @@ void frmTcpServer::initForm()
|
||||
void frmTcpServer::initIP()
|
||||
{
|
||||
//获取本机所有IP
|
||||
QStringList ips;
|
||||
QList<QNetworkInterface> netInterfaces = QNetworkInterface::allInterfaces();
|
||||
foreach(const QNetworkInterface &netInterface, netInterfaces) {
|
||||
//移除虚拟机和抓包工具的虚拟网卡
|
||||
QString humanReadableName = netInterface.humanReadableName().toLower();
|
||||
if(humanReadableName.startsWith("vmware network adapter") || humanReadableName.startsWith("npcap loopback adapter")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//过滤当前网络接口
|
||||
bool flag = (netInterface.flags() == (QNetworkInterface::IsUp | QNetworkInterface::IsRunning | QNetworkInterface::CanBroadcast | QNetworkInterface::CanMulticast));
|
||||
if(flag) {
|
||||
QList<QNetworkAddressEntry> addrs = netInterface.addressEntries();
|
||||
foreach(QNetworkAddressEntry addr, addrs) {
|
||||
//只取出IPV4的地址
|
||||
if(addr.ip().protocol() == QAbstractSocket::IPv4Protocol) {
|
||||
QString ip4 = addr.ip().toString();
|
||||
if(ip4 != "127.0.0.1") {
|
||||
ips.append(ip4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QStringList ips = QUIHelper::getLocalIPs();
|
||||
ui->cboxListenIP->addItems(ips);
|
||||
ui->cboxListenIP->addItem("127.0.0.1");
|
||||
}
|
||||
@@ -79,7 +55,7 @@ void frmTcpServer::initConfig()
|
||||
connect(ui->ckDebug, SIGNAL(stateChanged(int)), this, SLOT(saveConfig()));
|
||||
|
||||
ui->ckAutoSend->setChecked(App::AutoSendTcpServer);
|
||||
connect(ui->ckAutoSend, SIGNAL(stateChanged(int)), this, SLOT(saveConfig()));
|
||||
connect(ui->ckAutoSend, SIGNAL(stateChanged(int)), this, SLOT(saveConfig()));
|
||||
|
||||
ui->cboxInterval->setCurrentIndex(ui->cboxInterval->findText(QString::number(App::IntervalTcpServer)));
|
||||
connect(ui->cboxInterval, SIGNAL(currentIndexChanged(int)), this, SLOT(saveConfig()));
|
||||
@@ -102,7 +78,7 @@ void frmTcpServer::saveConfig()
|
||||
App::HexReceiveTcpServer = ui->ckHexReceive->isChecked();
|
||||
App::AsciiTcpServer = ui->ckAscii->isChecked();
|
||||
App::DebugTcpServer = ui->ckDebug->isChecked();
|
||||
App::AutoSendTcpServer = ui->ckAutoSend->isChecked();
|
||||
App::AutoSendTcpServer = ui->ckAutoSend->isChecked();
|
||||
App::IntervalTcpServer = ui->cboxInterval->currentText().toInt();
|
||||
App::TcpListenIP = ui->cboxListenIP->currentText();
|
||||
App::TcpListenPort = ui->txtListenPort->text().trimmed().toInt();
|
||||
|
||||
Reference in New Issue
Block a user