mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: update files of project
This commit is contained in:
parent
1ebcda28c7
commit
5e2f9f624d
@ -18,25 +18,25 @@ xToolsCheckBox::xToolsCheckBox(QWidget* parent)
|
|||||||
|
|
||||||
void xToolsCheckBox::setGroupKey(const QString& group, const QString& key)
|
void xToolsCheckBox::setGroupKey(const QString& group, const QString& key)
|
||||||
{
|
{
|
||||||
mKey = group + "/" + key;
|
m_key = group + "/" + key;
|
||||||
readFromSettingsFile();
|
readFromSettingsFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
void xToolsCheckBox::readFromSettingsFile()
|
void xToolsCheckBox::readFromSettingsFile()
|
||||||
{
|
{
|
||||||
if (mKey.isEmpty()) {
|
if (m_key.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ret = xToolsSettings::instance()->value(mKey).toBool();
|
bool ret = xToolsSettings::instance()->value(m_key).toBool();
|
||||||
setChecked(ret);
|
setChecked(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xToolsCheckBox::writeToSettingsFile()
|
void xToolsCheckBox::writeToSettingsFile()
|
||||||
{
|
{
|
||||||
if (mKey.isEmpty()) {
|
if (m_key.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
xToolsSettings::instance()->setValue(mKey, isChecked());
|
xToolsSettings::instance()->setValue(m_key, isChecked());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public:
|
|||||||
void setGroupKey(const QString &group, const QString &key);
|
void setGroupKey(const QString &group, const QString &key);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mKey;
|
QString m_key;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void readFromSettingsFile();
|
void readFromSettingsFile();
|
||||||
|
|||||||
@ -36,7 +36,6 @@
|
|||||||
#include "xToolsToolBoxUiOutputMenu.h"
|
#include "xToolsToolBoxUiOutputMenu.h"
|
||||||
#include "xToolsToolFactory.h"
|
#include "xToolsToolFactory.h"
|
||||||
#include "xToolsUdpTransmitterToolUi.h"
|
#include "xToolsUdpTransmitterToolUi.h"
|
||||||
#include "xToolsApplication.h"
|
|
||||||
#include "xToolsWebSocketTransmitterToolUi.h"
|
#include "xToolsWebSocketTransmitterToolUi.h"
|
||||||
|
|
||||||
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
|
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
|
||||||
@ -68,7 +67,7 @@ xToolsToolBoxUi::~xToolsToolBoxUi()
|
|||||||
QList<int> xToolsToolBoxUi::supportedCommunicationTools()
|
QList<int> xToolsToolBoxUi::supportedCommunicationTools()
|
||||||
{
|
{
|
||||||
QList<int> list;
|
QList<int> list;
|
||||||
list << xToolsToolFactory::SerialportTool
|
list << xToolsToolFactory::SerialPortTool
|
||||||
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
|
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
|
||||||
<< xToolsToolFactory::BleCentralTool
|
<< xToolsToolFactory::BleCentralTool
|
||||||
#endif
|
#endif
|
||||||
@ -80,7 +79,7 @@ QList<int> xToolsToolBoxUi::supportedCommunicationTools()
|
|||||||
|
|
||||||
QString xToolsToolBoxUi::communicationToolName(int type)
|
QString xToolsToolBoxUi::communicationToolName(int type)
|
||||||
{
|
{
|
||||||
if (type == xToolsToolFactory::SerialportTool) {
|
if (type == xToolsToolFactory::SerialPortTool) {
|
||||||
return tr("SerialPort");
|
return tr("SerialPort");
|
||||||
} else if (type == xToolsToolFactory::UdpClientTool) {
|
} else if (type == xToolsToolFactory::UdpClientTool) {
|
||||||
return tr("UDP Client");
|
return tr("UDP Client");
|
||||||
@ -104,7 +103,7 @@ QString xToolsToolBoxUi::communicationToolName(int type)
|
|||||||
QIcon xToolsToolBoxUi::communicationToolIcon(int type)
|
QIcon xToolsToolBoxUi::communicationToolIcon(int type)
|
||||||
{
|
{
|
||||||
QString fileName;
|
QString fileName;
|
||||||
if (type == xToolsToolFactory::SerialportTool) {
|
if (type == xToolsToolFactory::SerialPortTool) {
|
||||||
fileName = ":/Resources/Icons/IconSerialPort.svg";
|
fileName = ":/Resources/Icons/IconSerialPort.svg";
|
||||||
} else if (type == xToolsToolFactory::UdpClientTool) {
|
} else if (type == xToolsToolFactory::UdpClientTool) {
|
||||||
fileName = ":/Resources/Icons/IconUdpClient.svg";
|
fileName = ":/Resources/Icons/IconUdpClient.svg";
|
||||||
@ -154,7 +153,7 @@ void xToolsToolBoxUi::initialize(int type)
|
|||||||
xToolsCommunicationToolUi* xToolsToolBoxUi::communicationToolUi(int type)
|
xToolsCommunicationToolUi* xToolsToolBoxUi::communicationToolUi(int type)
|
||||||
{
|
{
|
||||||
xToolsCommunicationToolUi* w = nullptr;
|
xToolsCommunicationToolUi* w = nullptr;
|
||||||
if (type == xToolsToolFactory::SerialportTool) {
|
if (type == xToolsToolFactory::SerialPortTool) {
|
||||||
w = new xToolsSerialPortToolUi();
|
w = new xToolsSerialPortToolUi();
|
||||||
} else if (type == xToolsToolFactory::UdpClientTool) {
|
} else if (type == xToolsToolFactory::UdpClientTool) {
|
||||||
w = new xToolsSocketClientToolUi();
|
w = new xToolsSocketClientToolUi();
|
||||||
@ -265,7 +264,7 @@ void xToolsToolBoxUi::output2ui(const QByteArray& bytes, const QString& flag, bo
|
|||||||
|
|
||||||
QString xToolsToolBoxUi::settingsGroup()
|
QString xToolsToolBoxUi::settingsGroup()
|
||||||
{
|
{
|
||||||
if (m_communicationType == xToolsToolFactory::SerialportTool) {
|
if (m_communicationType == xToolsToolFactory::SerialPortTool) {
|
||||||
return "SerialportToolBox";
|
return "SerialportToolBox";
|
||||||
} else if (m_communicationType == xToolsToolFactory::UdpClientTool) {
|
} else if (m_communicationType == xToolsToolFactory::UdpClientTool) {
|
||||||
return "UdpClientToolBox";
|
return "UdpClientToolBox";
|
||||||
@ -295,7 +294,7 @@ QByteArray xToolsToolBoxUi::calculateCrc(const QByteArray& bytes, bool fixedOrig
|
|||||||
int format = ui->comboBoxInputFormat->currentData().toInt();
|
int format = ui->comboBoxInputFormat->currentData().toInt();
|
||||||
QString input = ui->comboBoxInputText->currentText();
|
QString input = ui->comboBoxInputText->currentText();
|
||||||
int esc = ctx.escapeCharacter;
|
int esc = ctx.escapeCharacter;
|
||||||
|
|
||||||
input = xToolsDataStructure::cookEscapeCharacter(esc, input);
|
input = xToolsDataStructure::cookEscapeCharacter(esc, input);
|
||||||
inputBytes = xToolsDataStructure::stringToByteArray(input, format);
|
inputBytes = xToolsDataStructure::stringToByteArray(input, format);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,3 +81,36 @@ void xToolsSocketClientTool::setMessageType(int type)
|
|||||||
m_messageType = type;
|
m_messageType = type;
|
||||||
emit messageTypeChanged();
|
emit messageTypeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool xToolsSocketClientTool::authentication()
|
||||||
|
{
|
||||||
|
return m_authentication;
|
||||||
|
}
|
||||||
|
|
||||||
|
void xToolsSocketClientTool::setAuthentication(bool authentication)
|
||||||
|
{
|
||||||
|
m_authentication = authentication;
|
||||||
|
emit authenticationChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString xToolsSocketClientTool::userName()
|
||||||
|
{
|
||||||
|
return m_userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void xToolsSocketClientTool::setUserName(const QString &userName)
|
||||||
|
{
|
||||||
|
m_userName = userName;
|
||||||
|
emit userNameChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString xToolsSocketClientTool::password()
|
||||||
|
{
|
||||||
|
return m_password;
|
||||||
|
}
|
||||||
|
|
||||||
|
void xToolsSocketClientTool::setPassword(const QString &password)
|
||||||
|
{
|
||||||
|
m_password = password;
|
||||||
|
emit passwordChanged();
|
||||||
|
}
|
||||||
|
|||||||
@ -22,6 +22,9 @@ class xToolsSocketClientTool : public xToolsCommunicationTool
|
|||||||
Q_PROPERTY(QString bindingIpPort READ bindingIpPort NOTIFY bindingIpPortChanged)
|
Q_PROPERTY(QString bindingIpPort READ bindingIpPort NOTIFY bindingIpPortChanged)
|
||||||
// Just for web socket client.
|
// Just for web socket client.
|
||||||
Q_PROPERTY(int messageType READ messageType WRITE setMessageType NOTIFY messageTypeChanged)
|
Q_PROPERTY(int messageType READ messageType WRITE setMessageType NOTIFY messageTypeChanged)
|
||||||
|
Q_PROPERTY(bool authentication READ authentication WRITE setAuthentication NOTIFY authenticationChanged)
|
||||||
|
Q_PROPERTY(QString userName READ userName WRITE setUserName NOTIFY userNameChanged)
|
||||||
|
Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)
|
||||||
// clang-format on
|
// clang-format on
|
||||||
public:
|
public:
|
||||||
explicit xToolsSocketClientTool(QObject *parent = nullptr);
|
explicit xToolsSocketClientTool(QObject *parent = nullptr);
|
||||||
@ -40,6 +43,12 @@ public:
|
|||||||
QString bindingIpPort();
|
QString bindingIpPort();
|
||||||
int messageType();
|
int messageType();
|
||||||
void setMessageType(int type);
|
void setMessageType(int type);
|
||||||
|
bool authentication();
|
||||||
|
void setAuthentication(bool authentication);
|
||||||
|
QString userName();
|
||||||
|
void setUserName(const QString &userName);
|
||||||
|
QString password();
|
||||||
|
void setPassword(const QString &password);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString m_clientIp;
|
QString m_clientIp;
|
||||||
@ -49,6 +58,10 @@ protected:
|
|||||||
int m_serverPort;
|
int m_serverPort;
|
||||||
QString m_bindingIpPort;
|
QString m_bindingIpPort;
|
||||||
qint8 m_messageType;
|
qint8 m_messageType;
|
||||||
|
QString m_peerInfo;
|
||||||
|
QString m_userName;
|
||||||
|
QString m_password;
|
||||||
|
bool m_authentication;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void clientIpChanged();
|
void clientIpChanged();
|
||||||
@ -58,4 +71,7 @@ signals:
|
|||||||
void serverPortChanged();
|
void serverPortChanged();
|
||||||
void bindingIpPortChanged();
|
void bindingIpPortChanged();
|
||||||
void messageTypeChanged();
|
void messageTypeChanged();
|
||||||
|
void authenticationChanged();
|
||||||
|
void userNameChanged();
|
||||||
|
void passwordChanged();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -50,7 +50,7 @@ xToolsBaseTool *xToolsToolFactory::createTool(int type)
|
|||||||
xToolsBaseTool *tool{nullptr};
|
xToolsBaseTool *tool{nullptr};
|
||||||
if (AnalyzerTool == type) {
|
if (AnalyzerTool == type) {
|
||||||
tool = new xToolsAnalyzerTool();
|
tool = new xToolsAnalyzerTool();
|
||||||
} else if (SerialportTool == type) {
|
} else if (SerialPortTool == type) {
|
||||||
tool = new xToolsSerialPortTool();
|
tool = new xToolsSerialPortTool();
|
||||||
} else if (EmitterTool == type) {
|
} else if (EmitterTool == type) {
|
||||||
tool = new xToolsEmitterTool();
|
tool = new xToolsEmitterTool();
|
||||||
@ -119,7 +119,7 @@ QString xToolsToolFactory::toolName(int type)
|
|||||||
static QMap<int, QString> map;
|
static QMap<int, QString> map;
|
||||||
if (map.isEmpty()) {
|
if (map.isEmpty()) {
|
||||||
map.insert(AnalyzerTool, tr("Analyzer"));
|
map.insert(AnalyzerTool, tr("Analyzer"));
|
||||||
map.insert(SerialportTool, tr("Serialport"));
|
map.insert(SerialPortTool, tr("Serialport"));
|
||||||
map.insert(EmitterTool, tr("Emitter"));
|
map.insert(EmitterTool, tr("Emitter"));
|
||||||
map.insert(MaskerTool, tr("Masker"));
|
map.insert(MaskerTool, tr("Masker"));
|
||||||
map.insert(ResponserTool, tr("Responser"));
|
map.insert(ResponserTool, tr("Responser"));
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class xToolsToolFactory : public QObject
|
|||||||
public:
|
public:
|
||||||
enum ToolsType {
|
enum ToolsType {
|
||||||
AnalyzerTool,
|
AnalyzerTool,
|
||||||
SerialportTool,
|
SerialPortTool,
|
||||||
EmitterTool,
|
EmitterTool,
|
||||||
MaskerTool,
|
MaskerTool,
|
||||||
ResponserTool,
|
ResponserTool,
|
||||||
|
|||||||
@ -58,10 +58,21 @@ bool xToolsWebSocketClientTool::initialize(QString &errStr)
|
|||||||
QString errStr = m_webSocket->errorString();
|
QString errStr = m_webSocket->errorString();
|
||||||
emit errorOccurred(errStr);
|
emit errorOccurred(errStr);
|
||||||
});
|
});
|
||||||
|
|
||||||
QString address = "ws://" + m_serverIp + ":" + QString::number(m_serverPort);
|
QString address = "ws://" + m_serverIp + ":" + QString::number(m_serverPort);
|
||||||
qDebug() << "Server url: " + address;
|
qInfo() << "Server url: " + address;
|
||||||
m_webSocket->open(address);
|
if (m_authentication) {
|
||||||
|
QNetworkRequest request(address);
|
||||||
|
QString username = m_userName;
|
||||||
|
QString password = m_password;
|
||||||
|
QString concatenated = username + ":" + password;
|
||||||
|
QByteArray data = concatenated.toLocal8Bit().toBase64();
|
||||||
|
QString headerData = "Basic " + data;
|
||||||
|
request.setRawHeader("Authorization", headerData.toLocal8Bit());
|
||||||
|
m_webSocket->open(request);
|
||||||
|
} else {
|
||||||
|
m_webSocket->open(address);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -70,6 +81,7 @@ void xToolsWebSocketClientTool::writeBytes(const QByteArray &bytes)
|
|||||||
{
|
{
|
||||||
qint64 ret = -1;
|
qint64 ret = -1;
|
||||||
QString hex;
|
QString hex;
|
||||||
|
|
||||||
if (m_messageType == 0) {
|
if (m_messageType == 0) {
|
||||||
hex = QString::fromLatin1(xToolsByteArrayToHex(bytes, ' '));
|
hex = QString::fromLatin1(xToolsByteArrayToHex(bytes, ' '));
|
||||||
ret = m_webSocket->sendBinaryMessage(bytes);
|
ret = m_webSocket->sendBinaryMessage(bytes);
|
||||||
|
|||||||
@ -25,5 +25,4 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QWebSocket *m_webSocket{Q_NULLPTR};
|
QWebSocket *m_webSocket{Q_NULLPTR};
|
||||||
QString m_peerInfo;
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -18,6 +18,7 @@ xToolsSocketClientToolUi::xToolsSocketClientToolUi(QWidget *parent)
|
|||||||
, ui(new Ui::xToolsSocketClientToolUi)
|
, ui(new Ui::xToolsSocketClientToolUi)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
ui->widgetAuthentication->hide();
|
||||||
|
|
||||||
connect(ui->comboBoxClientAddress,
|
connect(ui->comboBoxClientAddress,
|
||||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
||||||
@ -39,6 +40,19 @@ xToolsSocketClientToolUi::xToolsSocketClientToolUi(QWidget *parent)
|
|||||||
&QCheckBox::clicked,
|
&QCheckBox::clicked,
|
||||||
this,
|
this,
|
||||||
&xToolsSocketClientToolUi::onCheckBoxSpecifyIpAndPortClicked);
|
&xToolsSocketClientToolUi::onCheckBoxSpecifyIpAndPortClicked);
|
||||||
|
connect(ui->checkBoxAuthentication,
|
||||||
|
&QCheckBox::clicked,
|
||||||
|
this,
|
||||||
|
&xToolsSocketClientToolUi::onAuthenticationCheckBoxClicked);
|
||||||
|
connect(ui->lineEditUserName,
|
||||||
|
&QLineEdit::textChanged,
|
||||||
|
this,
|
||||||
|
&xToolsSocketClientToolUi::onUserNameLineEditTextChanged);
|
||||||
|
|
||||||
|
connect(ui->lineEditPassword,
|
||||||
|
&QLineEdit::textChanged,
|
||||||
|
this,
|
||||||
|
&xToolsSocketClientToolUi::onPasswordLineEditTextChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
xToolsSocketClientToolUi::~xToolsSocketClientToolUi()
|
xToolsSocketClientToolUi::~xToolsSocketClientToolUi()
|
||||||
@ -53,7 +67,8 @@ void xToolsSocketClientToolUi::onIsWorkingChanged(bool isWorking)
|
|||||||
ui->checkBoxSpecifyIpAndPort->setEnabled(!isWorking);
|
ui->checkBoxSpecifyIpAndPort->setEnabled(!isWorking);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xToolsSocketClientToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool, const QString &settingsGroup)
|
void xToolsSocketClientToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool,
|
||||||
|
const QString &settingsGroup)
|
||||||
{
|
{
|
||||||
if (!tool) {
|
if (!tool) {
|
||||||
return;
|
return;
|
||||||
@ -67,6 +82,8 @@ void xToolsSocketClientToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool, con
|
|||||||
if (!tool->inherits("xToolsWebSocketClientTool")) {
|
if (!tool->inherits("xToolsWebSocketClientTool")) {
|
||||||
ui->labelMessageType->hide();
|
ui->labelMessageType->hide();
|
||||||
ui->comboBoxMessageType->hide();
|
ui->comboBoxMessageType->hide();
|
||||||
|
} else {
|
||||||
|
ui->widgetAuthentication->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
mTool = qobject_cast<xToolsSocketClientTool *>(tool);
|
mTool = qobject_cast<xToolsSocketClientTool *>(tool);
|
||||||
@ -81,6 +98,9 @@ void xToolsSocketClientToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool, con
|
|||||||
ui->comboBoxServerAddress->setGroupKey(settingsGroup, "serverAddress");
|
ui->comboBoxServerAddress->setGroupKey(settingsGroup, "serverAddress");
|
||||||
ui->spinBoxServerPort->setGroupKey(settingsGroup, "serverPort");
|
ui->spinBoxServerPort->setGroupKey(settingsGroup, "serverPort");
|
||||||
ui->comboBoxMessageType->setGroupKey(settingsGroup, "messageType");
|
ui->comboBoxMessageType->setGroupKey(settingsGroup, "messageType");
|
||||||
|
ui->checkBoxAuthentication->setGroupKey(settingsGroup, "authentication");
|
||||||
|
ui->lineEditUserName->setGroupKey(settingsGroup, "username");
|
||||||
|
ui->lineEditPassword->setGroupKey(settingsGroup, "password");
|
||||||
|
|
||||||
mTool->setClientIp(ui->comboBoxClientAddress->currentText().trimmed());
|
mTool->setClientIp(ui->comboBoxClientAddress->currentText().trimmed());
|
||||||
mTool->setClientPort(ui->spinBoxClientPort->value());
|
mTool->setClientPort(ui->spinBoxClientPort->value());
|
||||||
@ -97,7 +117,7 @@ void xToolsSocketClientToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool, con
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void xToolsSocketClientToolUi::onComboBoxClientAddressActived()
|
void xToolsSocketClientToolUi::onComboBoxClientAddressActivated()
|
||||||
{
|
{
|
||||||
if (mTool) {
|
if (mTool) {
|
||||||
QString ip = ui->comboBoxClientAddress->currentText().trimmed();
|
QString ip = ui->comboBoxClientAddress->currentText().trimmed();
|
||||||
@ -134,3 +154,25 @@ void xToolsSocketClientToolUi::onCheckBoxSpecifyIpAndPortClicked()
|
|||||||
mTool->setSpecifyClientIpPort(checked);
|
mTool->setSpecifyClientIpPort(checked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void xToolsSocketClientToolUi::onAuthenticationCheckBoxClicked()
|
||||||
|
{
|
||||||
|
if (mTool) {
|
||||||
|
bool checked = ui->checkBoxAuthentication->isChecked();
|
||||||
|
mTool->setAuthentication(checked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void xToolsSocketClientToolUi::onUserNameLineEditTextChanged(const QString &text)
|
||||||
|
{
|
||||||
|
if (mTool) {
|
||||||
|
mTool->setUserName(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void xToolsSocketClientToolUi::onPasswordLineEditTextChanged(const QString &text)
|
||||||
|
{
|
||||||
|
if (mTool) {
|
||||||
|
mTool->setPassword(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -32,9 +32,13 @@ private:
|
|||||||
private:
|
private:
|
||||||
Ui::xToolsSocketClientToolUi *ui{nullptr};
|
Ui::xToolsSocketClientToolUi *ui{nullptr};
|
||||||
|
|
||||||
void onComboBoxClientAddressActived();
|
public slots:
|
||||||
|
void onComboBoxClientAddressActivated();
|
||||||
void onSpinBoxClientPortValueChanged(int value);
|
void onSpinBoxClientPortValueChanged(int value);
|
||||||
void onComboBoxServerAddressCurrentTextChanged();
|
void onComboBoxServerAddressCurrentTextChanged();
|
||||||
void onSpinBoxServerPortValueChanged(int value);
|
void onSpinBoxServerPortValueChanged(int value);
|
||||||
void onCheckBoxSpecifyIpAndPortClicked();
|
void onCheckBoxSpecifyIpAndPortClicked();
|
||||||
|
void onAuthenticationCheckBoxClicked();
|
||||||
|
void onUserNameLineEditTextChanged(const QString &text);
|
||||||
|
void onPasswordLineEditTextChanged(const QString &text);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>165</width>
|
<width>141</width>
|
||||||
<height>217</height>
|
<height>247</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -26,17 +26,7 @@
|
|||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="2" column="1">
|
<item row="11" column="1">
|
||||||
<widget class="xToolsSpinBox" name="spinBoxClientPort">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>65535</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>44444</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="1">
|
|
||||||
<widget class="xToolsIpComboBox" name="comboBoxServerAddress">
|
<widget class="xToolsIpComboBox" name="comboBoxServerAddress">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
|
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
|
||||||
@ -49,13 +39,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0" colspan="2">
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -69,39 +52,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QLabel" name="labelContext">
|
|
||||||
<property name="text">
|
|
||||||
<string>(closed)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Server IP</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0">
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Server port</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -111,17 +61,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Context</string>
|
<string>Binding info</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="xToolsIpComboBox" name="comboBoxClientAddress">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -138,6 +78,19 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="11" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Server IP</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -151,10 +104,43 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="xToolsSpinBox" name="spinBoxClientPort">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>65535</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>44444</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="xToolsIpComboBox" name="comboBoxClientAddress">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Server port</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="xToolsWebSocketMessageTypeComboBox" name="comboBoxMessageType"/>
|
<widget class="xToolsWebSocketMessageTypeComboBox" name="comboBoxMessageType"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="1">
|
<item row="12" column="1">
|
||||||
<widget class="xToolsSpinBox" name="spinBoxServerPort">
|
<widget class="xToolsSpinBox" name="spinBoxServerPort">
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>65535</number>
|
<number>65535</number>
|
||||||
@ -167,6 +153,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QLabel" name="labelContext">
|
||||||
|
<property name="text">
|
||||||
|
<string>(closed)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="0" colspan="2">
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="4" column="0" colspan="2">
|
<item row="4" column="0" colspan="2">
|
||||||
<widget class="xToolsCheckBox" name="checkBoxSpecifyIpAndPort">
|
<widget class="xToolsCheckBox" name="checkBoxSpecifyIpAndPort">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -174,6 +174,65 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="6" column="0" colspan="2">
|
||||||
|
<widget class="QWidget" name="widgetAuthentication" native="true">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="1" colspan="2">
|
||||||
|
<widget class="xToolsCheckBox" name="checkBoxAuthentication">
|
||||||
|
<property name="text">
|
||||||
|
<string>Authentication</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="xToolsLineEdit" name="lineEditUserName">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>User name</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="text">
|
||||||
|
<string>Password</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="xToolsLineEdit" name="lineEditPassword">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
@ -197,6 +256,11 @@
|
|||||||
<extends>QComboBox</extends>
|
<extends>QComboBox</extends>
|
||||||
<header location="global">xToolsWebSocketMessageTypeComboBox.h</header>
|
<header location="global">xToolsWebSocketMessageTypeComboBox.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>xToolsLineEdit</class>
|
||||||
|
<extends>QLineEdit</extends>
|
||||||
|
<header>xToolsLineEdit.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@ -52,7 +52,7 @@ xToolsBaseToolUi *xToolsToolUiFactory::createToolUi(int type)
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case xToolsToolFactory::AnalyzerTool:
|
case xToolsToolFactory::AnalyzerTool:
|
||||||
return new xToolsAnalyzerToolUi();
|
return new xToolsAnalyzerToolUi();
|
||||||
case xToolsToolFactory::SerialportTool:
|
case xToolsToolFactory::SerialPortTool:
|
||||||
return new xToolsSerialPortToolUi();
|
return new xToolsSerialPortToolUi();
|
||||||
case xToolsToolFactory::EmitterTool:
|
case xToolsToolFactory::EmitterTool:
|
||||||
return new xToolsEmitterToolUi();
|
return new xToolsEmitterToolUi();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user