* Refactor network package.
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
|
||||
|
||||
#include "src/dialogs/SelectDialog.h"
|
||||
#include "network/networkcfgdialog.h"
|
||||
#include "network/dicomcfgdialog.h"
|
||||
#include "network/getadminpsw.h"
|
||||
#include "network/NetworkCfgDialog.h"
|
||||
#include "network/DicomCfgDialog.h"
|
||||
#include "network/GetAdminPsw.h"
|
||||
|
||||
#include "json/jsonobject.h"
|
||||
#include "event/EventCenter.h"
|
||||
@@ -19,36 +19,36 @@
|
||||
#include "json/cmdhelper.h"
|
||||
|
||||
systemSettingForm::systemSettingForm(QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::systemSettingForm)
|
||||
QWidget(parent),
|
||||
ui(new Ui::systemSettingForm)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->lbl_size->setText(tr("Loading..."));
|
||||
ui->lbl_used->setText(tr("Loading..."));
|
||||
ui->lbl_size->setText(tr("Loading..."));
|
||||
ui->lbl_used->setText(tr("Loading..."));
|
||||
|
||||
//style init
|
||||
//ui->btn_dicom->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
ui->btn_dicom->setIcon(QIcon(":/icons/dicomsettings.png"));
|
||||
//ui->btn_dicom->setText(tr("DICOM"));
|
||||
ui->btn_dicom->setIconSize(QSize(80, 80));
|
||||
//style init
|
||||
//ui->btn_dicom->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
ui->btn_dicom->setIcon(QIcon(":/icons/dicomsettings.png"));
|
||||
//ui->btn_dicom->setText(tr("DICOM"));
|
||||
ui->btn_dicom->setIconSize(QSize(80, 80));
|
||||
|
||||
//ui->btn_network->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
ui->btn_network->setIcon(QIcon(":/icons/networksettings.png"));
|
||||
//ui->btn_network->setText(tr("IP"));
|
||||
ui->btn_network->setIconSize(QSize(80, 80));
|
||||
//ui->btn_network->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
ui->btn_network->setIcon(QIcon(":/icons/networksettings.png"));
|
||||
//ui->btn_network->setText(tr("IP"));
|
||||
ui->btn_network->setIconSize(QSize(80, 80));
|
||||
|
||||
ui->swt_verify->setChecked(true);
|
||||
//ui->btnFlt->setFixedWidth(200);
|
||||
//ui->btnPro->setFixedWidth(200);
|
||||
//ui->lbl_protocal->setFixedWidth(100);
|
||||
ui->lbl_verify->setFixedWidth(100);
|
||||
ui->swt_verify->setChecked(true);
|
||||
//ui->btnFlt->setFixedWidth(200);
|
||||
//ui->btnPro->setFixedWidth(200);
|
||||
//ui->lbl_protocal->setFixedWidth(100);
|
||||
ui->lbl_verify->setFixedWidth(100);
|
||||
|
||||
//data init
|
||||
ui->btnPro->setText(JsonObject::Instance()->defaultProtocal());
|
||||
ui->btnPro->setObjectName("BigBtn");
|
||||
ui->btnFlt->setText(JsonObject::Instance()->defaultFilter());
|
||||
ui->btnFlt->setObjectName("BigBtn");
|
||||
//data init
|
||||
ui->btnPro->setText(JsonObject::Instance()->defaultProtocal());
|
||||
ui->btnPro->setObjectName("BigBtn");
|
||||
ui->btnFlt->setText(JsonObject::Instance()->defaultFilter());
|
||||
ui->btnFlt->setObjectName("BigBtn");
|
||||
|
||||
QGridLayout* gridLayout = (QGridLayout*)ui->block10->layout();
|
||||
auto btn_scanConfirm = new ImageSwitch(this);
|
||||
@@ -57,10 +57,10 @@ systemSettingForm::systemSettingForm(QWidget* parent) :
|
||||
gridLayout->addWidget(btn_scanConfirm, 4, 2, 1, 1);
|
||||
gridLayout->addWidget(lbl_scanConfirm, 4, 0, 1, 1);
|
||||
btn_scanConfirm->setChecked(JsonObject::Instance()->getScanConfirm());
|
||||
QFrame* line5 = new QFrame(this);
|
||||
QFrame* line5 = new QFrame(this);
|
||||
line5->setFrameShape(QFrame::HLine);
|
||||
line5->setFrameShadow(QFrame::Sunken);
|
||||
gridLayout->addWidget(line5,5,0);
|
||||
gridLayout->addWidget(line5, 5, 0);
|
||||
|
||||
auto btn_scanComplete = new ImageSwitch(this);
|
||||
auto lbl_scanComplete = new QLabel(this);
|
||||
@@ -68,153 +68,155 @@ systemSettingForm::systemSettingForm(QWidget* parent) :
|
||||
gridLayout->addWidget(btn_scanComplete, 6, 2, 1, 1);
|
||||
gridLayout->addWidget(lbl_scanComplete, 6, 0, 1, 1);
|
||||
btn_scanComplete->setChecked(JsonObject::Instance()->getCompleteNotify());
|
||||
QFrame* line6 = new QFrame(this);
|
||||
QFrame* line6 = new QFrame(this);
|
||||
line6->setFrameShape(QFrame::HLine);
|
||||
line6->setFrameShadow(QFrame::Sunken);
|
||||
gridLayout->addWidget(line6,7,0);
|
||||
gridLayout->addWidget(line6, 7, 0);
|
||||
|
||||
////test begin
|
||||
//flag_disksize = true;
|
||||
//m_disksize = 75.0;
|
||||
////test end
|
||||
//updateStorageSize();
|
||||
////test begin
|
||||
//flag_diskuse = true;
|
||||
//m_diskuse = 23.0;
|
||||
////test end
|
||||
//updateStorageUsed();
|
||||
//flag_disksize = true;
|
||||
//m_disksize = 75.0;
|
||||
////test end
|
||||
//updateStorageSize();
|
||||
////test begin
|
||||
//flag_diskuse = true;
|
||||
//m_diskuse = 23.0;
|
||||
////test end
|
||||
//updateStorageUsed();
|
||||
|
||||
|
||||
diskInfoCaller = QThread::create([=]() {
|
||||
diskInfoCaller = QThread::create([=]() {
|
||||
|
||||
double disksize = 0;
|
||||
flag_disksize = cmdHelper::Instance()->getDiskSize(disksize);
|
||||
m_disksize = disksize;
|
||||
updateStorageSize();
|
||||
double disksize = 0;
|
||||
flag_disksize = cmdHelper::Instance()->getDiskSize(disksize);
|
||||
m_disksize = disksize;
|
||||
updateStorageSize();
|
||||
|
||||
while (true)
|
||||
{
|
||||
double duse = 0;
|
||||
flag_diskuse = cmdHelper::Instance()->getDiskUsed(duse);
|
||||
m_diskuse = duse;
|
||||
updateStorageUsed();
|
||||
QMetaObject::invokeMethod(ui->batIcon, "startAnimation", Qt::QueuedConnection);
|
||||
QThread::msleep(30000);
|
||||
}
|
||||
});
|
||||
diskInfoCaller->start();
|
||||
while (true)
|
||||
{
|
||||
double duse = 0;
|
||||
flag_diskuse = cmdHelper::Instance()->getDiskUsed(duse);
|
||||
m_diskuse = duse;
|
||||
updateStorageUsed();
|
||||
QMetaObject::invokeMethod(ui->batIcon, "startAnimation", Qt::QueuedConnection);
|
||||
QThread::msleep(30000);
|
||||
}
|
||||
});
|
||||
diskInfoCaller->start();
|
||||
|
||||
//connection
|
||||
connect(ui->swt_verify, &ImageSwitch::clicked, [=]() {
|
||||
if (ui->swt_verify->getChecked())
|
||||
{
|
||||
////
|
||||
}
|
||||
});
|
||||
//connection
|
||||
connect(ui->swt_verify, &ImageSwitch::clicked, [=]() {
|
||||
if (ui->swt_verify->getChecked())
|
||||
{
|
||||
////
|
||||
}
|
||||
});
|
||||
connect(btn_scanConfirm, &ImageSwitch::clicked, [=]() {
|
||||
JsonObject::Instance()->setScanConfirm(btn_scanConfirm->getChecked());
|
||||
});
|
||||
});
|
||||
connect(btn_scanComplete, &ImageSwitch::clicked, [=]() {
|
||||
JsonObject::Instance()->setCompleteNotify(btn_scanComplete->getChecked());
|
||||
});
|
||||
connect(ui->btn_network, &QToolButton::clicked, [=]() {
|
||||
GetAdminPsw dialog(this);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
JsonObject::Instance()->setPassword(dialog.getPsw());
|
||||
networkCfgDialog dia(this);
|
||||
dia.setWindowModality(Qt::WindowModal);
|
||||
dia.exec();
|
||||
}
|
||||
});
|
||||
});
|
||||
connect(ui->btn_network, &QToolButton::clicked, [=]() {
|
||||
GetAdminPsw dialog(this);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
JsonObject::Instance()->setPassword(dialog.getPsw());
|
||||
NetworkCfgDialog dia(this);
|
||||
dia.setWindowModality(Qt::WindowModal);
|
||||
dia.exec();
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->btn_dicom, &QToolButton::clicked, [=]() {
|
||||
dicomCfgDialog dia(this);
|
||||
dia.setWindowModality(Qt::WindowModal);
|
||||
dia.exec();
|
||||
});
|
||||
connect(ui->btn_dicom, &QToolButton::clicked, [=]() {
|
||||
DicomCfgDialog dia(this);
|
||||
dia.setWindowModality(Qt::WindowModal);
|
||||
dia.exec();
|
||||
});
|
||||
|
||||
|
||||
|
||||
connect(ui->btnPro, &QPushButton::clicked, [=]() {
|
||||
if (!sd_protocal) {
|
||||
sd_protocal = new SelectDialog(this);
|
||||
sd_protocal->setWindowModality(Qt::WindowModal);
|
||||
}
|
||||
connect(ui->btnPro, &QPushButton::clicked, [=]() {
|
||||
if (!sd_protocal)
|
||||
{
|
||||
sd_protocal = new SelectDialog(this);
|
||||
sd_protocal->setWindowModality(Qt::WindowModal);
|
||||
}
|
||||
sd_protocal->setValues(JsonObject::Instance()->protocals());
|
||||
sd_protocal->setSelectedValue(JsonObject::Instance()->defaultProtocal());
|
||||
if (sd_protocal->exec() == QDialog::Accepted)
|
||||
{
|
||||
QString pro = sd_protocal->getSelectedValue();
|
||||
//take effect
|
||||
JsonObject::Instance()->setDefaultProtocal(pro);
|
||||
ui->btnPro->setText(JsonObject::Instance()->defaultProtocal());
|
||||
}
|
||||
});
|
||||
sd_protocal->setSelectedValue(JsonObject::Instance()->defaultProtocal());
|
||||
if (sd_protocal->exec() == QDialog::Accepted)
|
||||
{
|
||||
QString pro = sd_protocal->getSelectedValue();
|
||||
//take effect
|
||||
JsonObject::Instance()->setDefaultProtocal(pro);
|
||||
ui->btnPro->setText(JsonObject::Instance()->defaultProtocal());
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->btnFlt, &QPushButton::clicked, [=]() {
|
||||
if (!sd_filter) {
|
||||
sd_filter = new SelectDialog(this);
|
||||
sd_filter->setWindowModality(Qt::WindowModal);
|
||||
}
|
||||
connect(ui->btnFlt, &QPushButton::clicked, [=]() {
|
||||
if (!sd_filter)
|
||||
{
|
||||
sd_filter = new SelectDialog(this);
|
||||
sd_filter->setWindowModality(Qt::WindowModal);
|
||||
}
|
||||
sd_filter->setValues(JsonObject::Instance()->worklistFilters());
|
||||
sd_filter->setSelectedValue(JsonObject::Instance()->defaultFilter());
|
||||
if (sd_filter->exec() == QDialog::Accepted)
|
||||
{
|
||||
QString flt = sd_filter->getSelectedValue();
|
||||
//take effect
|
||||
JsonObject::Instance()->setDefaultFilter(flt);
|
||||
ui->btnFlt->setText(JsonObject::Instance()->defaultFilter());
|
||||
}
|
||||
});
|
||||
sd_filter->setSelectedValue(JsonObject::Instance()->defaultFilter());
|
||||
if (sd_filter->exec() == QDialog::Accepted)
|
||||
{
|
||||
QString flt = sd_filter->getSelectedValue();
|
||||
//take effect
|
||||
JsonObject::Instance()->setDefaultFilter(flt);
|
||||
ui->btnFlt->setText(JsonObject::Instance()->defaultFilter());
|
||||
}
|
||||
});
|
||||
|
||||
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
|
||||
ui->retranslateUi(this);
|
||||
ui->btnPro->setText(JsonObject::Instance()->defaultProtocal());
|
||||
ui->btnFlt->setText(JsonObject::Instance()->defaultFilter());
|
||||
ui->swt_verify->setChecked(true);
|
||||
updateStorageSize();
|
||||
updateStorageUsed();
|
||||
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
|
||||
ui->retranslateUi(this);
|
||||
ui->btnPro->setText(JsonObject::Instance()->defaultProtocal());
|
||||
ui->btnFlt->setText(JsonObject::Instance()->defaultFilter());
|
||||
ui->swt_verify->setChecked(true);
|
||||
updateStorageSize();
|
||||
updateStorageUsed();
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
systemSettingForm::~systemSettingForm()
|
||||
{
|
||||
diskInfoCaller->terminate();
|
||||
// diskInfoCaller->quit();
|
||||
// diskInfoCaller->wait();
|
||||
// diskInfoCaller->quit();
|
||||
// diskInfoCaller->wait();
|
||||
delete diskInfoCaller;
|
||||
}
|
||||
|
||||
void systemSettingForm::updateStorageUsed()
|
||||
{
|
||||
|
||||
if (flag_diskuse)
|
||||
{
|
||||
ui->batIcon->setValue(m_diskuse);
|
||||
ui->lbl_used->setText(tr("used:\t%1G").arg(m_diskuse));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->lbl_used->setText(tr("Get disk used size fail!"));
|
||||
}
|
||||
if (flag_diskuse)
|
||||
{
|
||||
ui->batIcon->setValue(m_diskuse);
|
||||
ui->lbl_used->setText(tr("used:\t%1G").arg(m_diskuse));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->lbl_used->setText(tr("Get disk used size fail!"));
|
||||
}
|
||||
|
||||
}
|
||||
void systemSettingForm::updateStorageSize()
|
||||
{
|
||||
//bool flag = AppGlobalValues::StorageFlag();
|
||||
if (flag_disksize)
|
||||
{
|
||||
//double total_size = AppGlobalValues::StorageSize();
|
||||
ui->batIcon->setMaxValue(m_disksize);
|
||||
double aValue = (m_disksize - JsonObject::Instance()->storageAlarmSize().toDouble()) / m_disksize;
|
||||
ui->batIcon->setAlarmValue(aValue);
|
||||
ui->lbl_size->setText(tr("total:\t%1G").arg(m_disksize));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->lbl_size->setText(tr("Get disk total size fail!"));
|
||||
}
|
||||
//bool flag = AppGlobalValues::StorageFlag();
|
||||
if (flag_disksize)
|
||||
{
|
||||
//double total_size = AppGlobalValues::StorageSize();
|
||||
ui->batIcon->setMaxValue(m_disksize);
|
||||
double aValue = (m_disksize - JsonObject::Instance()->storageAlarmSize().toDouble()) / m_disksize;
|
||||
ui->batIcon->setAlarmValue(aValue);
|
||||
ui->lbl_size->setText(tr("total:\t%1G").arg(m_disksize));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->lbl_size->setText(tr("Get disk total size fail!"));
|
||||
}
|
||||
}
|
||||
|
||||
82
src/network/DicomCfgDialog.cpp
Normal file
82
src/network/DicomCfgDialog.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
#include "DicomCfgDialog.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "json/jsonobject.h"
|
||||
#include "ui_DicomCfgDialog.h"
|
||||
|
||||
DicomCfgDialog::DicomCfgDialog(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, mUi(new Ui::DicomCfgDialog)
|
||||
{
|
||||
mUi->setupUi(this);
|
||||
this->setObjectName("formDialog");
|
||||
this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
|
||||
|
||||
mUi->mButtonGroup->button(QDialogButtonBox::Apply)->setText(tr("Apply"));
|
||||
mUi->mButtonGroup->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
|
||||
|
||||
loadServersInfo();
|
||||
|
||||
connect(mUi->mButtonGroup->button(QDialogButtonBox::Apply), &QPushButton::clicked, [=]()
|
||||
{
|
||||
saveServersInfo();
|
||||
accept();
|
||||
});
|
||||
connect(mUi->mButtonGroup->button(QDialogButtonBox::Cancel), &QPushButton::clicked, [=]()
|
||||
{
|
||||
reject();
|
||||
});
|
||||
}
|
||||
|
||||
DicomCfgDialog::~DicomCfgDialog()
|
||||
{
|
||||
delete mUi;
|
||||
}
|
||||
|
||||
|
||||
void DicomCfgDialog::loadServersInfo()
|
||||
{
|
||||
host serverInfo;
|
||||
serverInfo = JsonObject::Instance()->getServer(JsonObject::RECON);
|
||||
mUi->recon_AE->setText(serverInfo.ae);
|
||||
mUi->recon_IP->setText(serverInfo.ip);
|
||||
mUi->recon_Name->setText(serverInfo.name);
|
||||
mUi->recon_Port->setText(serverInfo.port);
|
||||
|
||||
serverInfo = JsonObject::Instance()->getServer(JsonObject::PACS);
|
||||
mUi->pacs_AE->setText(serverInfo.ae);
|
||||
mUi->pacs_IP->setText(serverInfo.ip);
|
||||
mUi->pacs_Name->setText(serverInfo.name);
|
||||
mUi->pacs_Port->setText(serverInfo.port);
|
||||
|
||||
serverInfo = JsonObject::Instance()->getServer(JsonObject::WORKLIST);
|
||||
mUi->wl_AE->setText(serverInfo.ae);
|
||||
mUi->wl_IP->setText(serverInfo.ip);
|
||||
mUi->wl_Name->setText(serverInfo.name);
|
||||
mUi->wl_Port->setText(serverInfo.port);
|
||||
}
|
||||
|
||||
|
||||
void DicomCfgDialog::saveServersInfo()
|
||||
{
|
||||
host serverInfo;
|
||||
serverInfo.ae = mUi->recon_AE->text();
|
||||
serverInfo.ip = mUi->recon_IP->text();
|
||||
serverInfo.name = mUi->recon_Name->text();
|
||||
serverInfo.port = mUi->recon_Port->text();
|
||||
JsonObject::Instance()->setServer(JsonObject::RECON, serverInfo);
|
||||
|
||||
serverInfo.ae = mUi->pacs_AE->text();
|
||||
serverInfo.ip = mUi->pacs_IP->text();
|
||||
serverInfo.name = mUi->pacs_Name->text();
|
||||
serverInfo.port = mUi->pacs_Port->text();
|
||||
JsonObject::Instance()->setServer(JsonObject::PACS, serverInfo);
|
||||
|
||||
serverInfo.ip = mUi->wl_IP->text();
|
||||
serverInfo.ae = mUi->wl_AE->text();
|
||||
serverInfo.name = mUi->wl_Name->text();
|
||||
serverInfo.port = mUi->wl_Port->text();
|
||||
JsonObject::Instance()->setServer(JsonObject::WORKLIST, serverInfo);
|
||||
}
|
||||
26
src/network/DicomCfgDialog.h
Normal file
26
src/network/DicomCfgDialog.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef DICOMCFGDIALOG_H
|
||||
#define DICOMCFGDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class DicomCfgDialog;
|
||||
}
|
||||
|
||||
class DicomCfgDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DicomCfgDialog(QWidget* aParent = nullptr);
|
||||
~DicomCfgDialog();
|
||||
|
||||
private:
|
||||
Ui::DicomCfgDialog* mUi;
|
||||
|
||||
void loadServersInfo();
|
||||
void saveServersInfo();
|
||||
};
|
||||
|
||||
#endif // DICOMCFGDIALOG_H
|
||||
385
src/network/DicomCfgDialog.ui
Normal file
385
src/network/DicomCfgDialog.ui
Normal file
@@ -0,0 +1,385 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DicomCfgDialog</class>
|
||||
<widget class="QDialog" name="DicomCfgDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>601</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
|
||||
QTabBar::tab {
|
||||
font-size:25px;
|
||||
height:40px;
|
||||
width:180px;
|
||||
border: 0px;
|
||||
border-top-left-radius: 0%;
|
||||
border-top-right-radius: 0%;
|
||||
border-bottom-left-radius:0%;
|
||||
border-bottom-right-radius:0%;
|
||||
background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #505050, stop: 1.0 #333333);
|
||||
}
|
||||
|
||||
QTabBar::tab:selected, QTabBar::tab:hover {
|
||||
background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #ABABAB, stop: 1.0 #CDCDCD);
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QWidget" name="formWidget" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="text">
|
||||
<string>DICOM Settings</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_wl">
|
||||
<attribute name="title">
|
||||
<string>Worklist</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="wl_IP"/>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="wl_Port"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="wl_AE"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lbl_IP">
|
||||
<property name="text">
|
||||
<string>IP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbl_AE">
|
||||
<property name="text">
|
||||
<string>AE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="lbl_Port">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_Name">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>165</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="wl_Name"/>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QToolButton" name="toolButton_2">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="res.qrc">
|
||||
<normaloff>:/icons/dicom/echo_fail.png</normaloff>:/icons/dicom/echo_fail.png
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_pacs">
|
||||
<attribute name="title">
|
||||
<string>PACS</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="pacs_IP"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="pacs_AE"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_Name_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>165</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbl_IP_2">
|
||||
<property name="text">
|
||||
<string>IP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbl_AE_2">
|
||||
<property name="text">
|
||||
<string>AE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="pacs_Port"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="pacs_Name"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lbl_Port_2">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="res.qrc">
|
||||
<normaloff>:/icons/dicom/echo_ing.png</normaloff>:/icons/dicom/echo_ing.png
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_recon">
|
||||
<attribute name="title">
|
||||
<string>3D Recon</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="recon_Name"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="lbl_Port_3">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lbl_IP_3">
|
||||
<property name="text">
|
||||
<string>IP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="recon_IP"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_Name_3">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>165</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="recon_Port"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbl_AE_3">
|
||||
<property name="text">
|
||||
<string>AE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="recon_AE"/>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QToolButton" name="toolButton_3">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="res.qrc">
|
||||
<normaloff>:/icons/dicom/echo_suc.png</normaloff>:/icons/dicom/echo_suc.png
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="mButtonGroup">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="res.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>mButtonGroup</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>DicomCfgDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>mButtonGroup</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>DicomCfgDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
51
src/network/GetAdminPsw.cpp
Normal file
51
src/network/GetAdminPsw.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
#include "GetAdminPsw.h"
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <src/device/networkmanager.h>
|
||||
#endif
|
||||
|
||||
GetAdminPsw::GetAdminPsw(QWidget* parent, Qt::WindowFlags f)
|
||||
: GUIFormBaseDialog(parent, f)
|
||||
, mPsw(new QLineEdit(this))
|
||||
, mLabelError(new QLabel(this))
|
||||
{
|
||||
setWindowModality(Qt::WindowModal);
|
||||
QFormLayout* formLayout = new QFormLayout(formWidget);
|
||||
QString value1 = QString(tr("Admin Password"));
|
||||
mPsw->setEchoMode(QLineEdit::Password);
|
||||
formLayout->addRow(value1, mPsw);
|
||||
|
||||
mLabelError->setObjectName(QString::fromUtf8("warn"));
|
||||
formLayout->addRow("", mLabelError);
|
||||
}
|
||||
|
||||
GetAdminPsw::~GetAdminPsw()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString GetAdminPsw::getPsw()const
|
||||
{
|
||||
return mPsw->text();
|
||||
}
|
||||
|
||||
bool GetAdminPsw::updateReferenceData()
|
||||
{
|
||||
#ifndef WIN32
|
||||
//verify the password
|
||||
QString errorMsg;
|
||||
if (!NetworkManager::checkPassWord(mPsw->text(), errorMsg))
|
||||
{
|
||||
mLabelError->setText(errorMsg);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
30
src/network/GetAdminPsw.h
Normal file
30
src/network/GetAdminPsw.h
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#ifndef GUI_GETADMINPSW_H
|
||||
#define GUI_GETADMINPSW_H
|
||||
|
||||
#include "src/dialogs/GUIFormBaseDialog.h"
|
||||
|
||||
class QLineEdit;
|
||||
class QLabel;
|
||||
|
||||
class GetAdminPsw : public GUIFormBaseDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GetAdminPsw(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
~GetAdminPsw();
|
||||
QString getPsw()const;
|
||||
|
||||
protected:
|
||||
bool updateReferenceData();
|
||||
|
||||
private:
|
||||
QLineEdit* mPsw = nullptr;
|
||||
QLabel* mLabelError = nullptr;
|
||||
};
|
||||
|
||||
|
||||
#endif //GUI_GETADMINPSW_H
|
||||
62
src/network/GetIPDialog.cpp
Normal file
62
src/network/GetIPDialog.cpp
Normal file
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#include "GetIPDialog.h"
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
|
||||
#include "device/networkmanager.h"
|
||||
|
||||
GetIPDialog::GetIPDialog(QWidget* parent, Qt::WindowFlags f)
|
||||
: GUIFormBaseDialog(parent, f)
|
||||
, mIp(new QLineEdit(this))
|
||||
, mMask(new QLineEdit(this))
|
||||
, mLabelError(new QLabel(this))
|
||||
{
|
||||
setWindowModality(Qt::WindowModal);
|
||||
QFormLayout* formLayout = new QFormLayout(formWidget);
|
||||
QLabel* IpValue = new QLabel(tr("IP Address"));
|
||||
formLayout->addRow(IpValue, mIp);
|
||||
|
||||
QLabel* maskValue = new QLabel(tr("Netmask"));
|
||||
formLayout->addRow(maskValue, mMask);
|
||||
|
||||
mLabelError->setObjectName(QString::fromUtf8("warn"));
|
||||
formLayout->addRow("", mLabelError);
|
||||
}
|
||||
|
||||
GetIPDialog::~GetIPDialog()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QStringList GetIPDialog::getList()const
|
||||
{
|
||||
return QStringList() << mIp->text() << mMask->text();
|
||||
}
|
||||
void GetIPDialog::setList(const QStringList& list)
|
||||
{
|
||||
if (!list.empty())
|
||||
{
|
||||
mIp->setText(list[0]);
|
||||
mMask->setText(list[1]);
|
||||
}
|
||||
}
|
||||
|
||||
bool GetIPDialog::updateReferenceData()
|
||||
{
|
||||
if (!NetworkManager::validate(mIp->text()))
|
||||
{
|
||||
mLabelError->setText(tr("Wrong IP!"));
|
||||
return false;
|
||||
}
|
||||
if (!NetworkManager::validate(mMask->text()))
|
||||
{
|
||||
mLabelError->setText(tr("Wrong Netmask!"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
33
src/network/GetIPDialog.h
Normal file
33
src/network/GetIPDialog.h
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#ifndef GUI_GETIPDIALOG_H
|
||||
#define GUI_GETIPDIALOG_H
|
||||
|
||||
#include "src/dialogs/GUIFormBaseDialog.h"
|
||||
|
||||
class QLineEdit;
|
||||
class QLabel;
|
||||
|
||||
class GetIPDialog :public GUIFormBaseDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GetIPDialog(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
~GetIPDialog();
|
||||
QStringList getList()const;
|
||||
void setList(const QStringList& list);
|
||||
|
||||
protected:
|
||||
bool updateReferenceData();
|
||||
|
||||
private:
|
||||
QLineEdit* mIp = nullptr;
|
||||
QLineEdit* mMask = nullptr;
|
||||
QLabel* mLabelError = nullptr;
|
||||
};
|
||||
|
||||
|
||||
#endif //GUI_GETIPDIALOG_H
|
||||
66
src/network/GetRouteDialog.cpp
Normal file
66
src/network/GetRouteDialog.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#include "GetRouteDialog.h"
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
|
||||
#include "device/networkmanager.h"
|
||||
|
||||
GetRouteDialog::GetRouteDialog(QWidget* parent, Qt::WindowFlags f)
|
||||
: GUIFormBaseDialog(parent, f)
|
||||
, mDestination(new QLineEdit(this))
|
||||
, mNetmask(new QLineEdit(this))
|
||||
, mGateway(new QLineEdit(this))
|
||||
, mLabelError(new QLabel(this))
|
||||
{
|
||||
setWindowModality(Qt::WindowModal);
|
||||
QFormLayout* formLayout = new QFormLayout(formWidget);
|
||||
formLayout->addRow(QString(tr("Destination")), mDestination);
|
||||
formLayout->addRow(QString(tr("Netmask")), mNetmask);
|
||||
formLayout->addRow(QString(tr("Gateway")), mGateway);
|
||||
mLabelError->setObjectName("warn");
|
||||
formLayout->addRow("", mLabelError);
|
||||
}
|
||||
|
||||
GetRouteDialog::~GetRouteDialog()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QStringList GetRouteDialog::getList()const
|
||||
{
|
||||
return QStringList() << mDestination->text() << mNetmask->text() << mGateway->text();;
|
||||
}
|
||||
void GetRouteDialog::setList(const QStringList& list)
|
||||
{
|
||||
if (!list.empty())
|
||||
{
|
||||
mDestination->setText(list[0]);
|
||||
mNetmask->setText(list[1]);
|
||||
mGateway->setText(list[2]);
|
||||
}
|
||||
}
|
||||
|
||||
bool GetRouteDialog::updateReferenceData()
|
||||
{
|
||||
if (!NetworkManager::validate(mDestination->text()))
|
||||
{
|
||||
mLabelError->setText(tr("Wrong Destination!"));
|
||||
return false;
|
||||
}
|
||||
if (!NetworkManager::validate(mNetmask->text()))
|
||||
{
|
||||
mLabelError->setText(tr("Wrong Netmask!"));
|
||||
return false;
|
||||
}
|
||||
if (!NetworkManager::validate(mGateway->text()))
|
||||
{
|
||||
mLabelError->setText(tr("Wrong Gateway!"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
34
src/network/GetRouteDialog.h
Normal file
34
src/network/GetRouteDialog.h
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#ifndef GUI_GETROUTEDIALOG_H
|
||||
#define GUI_GETROUTEDIALOG_H
|
||||
|
||||
#include "src/dialogs/GUIFormBaseDialog.h"
|
||||
|
||||
class QLineEdit;
|
||||
class QLabel;
|
||||
|
||||
class GetRouteDialog :public GUIFormBaseDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GetRouteDialog(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
~GetRouteDialog();
|
||||
QStringList getList()const;
|
||||
void setList(const QStringList& list);
|
||||
|
||||
protected:
|
||||
bool updateReferenceData();
|
||||
|
||||
private:
|
||||
QLineEdit* mDestination = nullptr;
|
||||
QLineEdit* mNetmask = nullptr;
|
||||
QLineEdit* mGateway = nullptr;
|
||||
QLabel* mLabelError = nullptr;
|
||||
};
|
||||
|
||||
|
||||
#endif //GUI_GETROUTEDIALOG_H
|
||||
129
src/network/NetCfgTableModel.cpp
Normal file
129
src/network/NetCfgTableModel.cpp
Normal file
@@ -0,0 +1,129 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/23.
|
||||
//
|
||||
|
||||
#include "NetCfgTableModel.h"
|
||||
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
NetCfgTableModel::NetCfgTableModel(QObject* parent)
|
||||
: QAbstractTableModel(parent)
|
||||
{
|
||||
|
||||
}
|
||||
/*!
|
||||
Sets the \a role data for the item at \a index to \a value.
|
||||
Returns \c{true} if successful; otherwise returns \c{false}.
|
||||
The dataChanged() signal should be emitted if the data was successfully
|
||||
set.
|
||||
The base class implementation returns \c{false}. This function and data() must
|
||||
be reimplemented for editable models.
|
||||
\sa Qt::ItemDataRole, data(), itemData()
|
||||
*/
|
||||
|
||||
//bool NetCfgTableModel::setData(const QModelIndex& index, const QVariant& value, int role){}
|
||||
|
||||
QList<QStringList> NetCfgTableModel::getData()
|
||||
{
|
||||
return mTableData;
|
||||
}
|
||||
|
||||
void NetCfgTableModel::setHeader(const QStringList& header)
|
||||
{
|
||||
mHeaderStrings = header;
|
||||
}
|
||||
|
||||
bool NetCfgTableModel::loadData(const QList<QStringList>& list)
|
||||
{
|
||||
mTableData = list;
|
||||
|
||||
QModelIndex tl = index(0, 0);
|
||||
QModelIndex br = index(list.size() - 1, list.begin()->size() - 1);
|
||||
emit dataChanged(tl, br);
|
||||
return true;
|
||||
}
|
||||
bool NetCfgTableModel::addRow(const QStringList& value)
|
||||
{
|
||||
int index = rowCount(QModelIndex());
|
||||
QAbstractTableModel::beginInsertRows(QModelIndex(), index, index);
|
||||
mTableData.insert(index, value);
|
||||
QAbstractTableModel::endInsertRows();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NetCfgTableModel::insertRow(int index, const QStringList& value)
|
||||
{
|
||||
QAbstractTableModel::beginInsertRows(QModelIndex(), index, index);
|
||||
mTableData.insert(index, value);
|
||||
QAbstractTableModel::endInsertRows();
|
||||
return true;
|
||||
}
|
||||
bool NetCfgTableModel::removeRow(int index)
|
||||
{
|
||||
QAbstractTableModel::beginRemoveRows(QModelIndex(), index, index);
|
||||
mTableData.removeAt(index);
|
||||
QAbstractTableModel::endRemoveRows();
|
||||
return true;
|
||||
}
|
||||
|
||||
QStringList NetCfgTableModel::rowData(const QModelIndex& index)
|
||||
{
|
||||
if (!index.isValid())
|
||||
{
|
||||
return QStringList();
|
||||
}
|
||||
if (index.row() < mTableData.size())
|
||||
{
|
||||
return mTableData[index.row()];
|
||||
}
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QVariant NetCfgTableModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
if (role == Qt::TextAlignmentRole)
|
||||
{
|
||||
return Qt::AlignCenter;
|
||||
}
|
||||
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
||||
{
|
||||
return mTableData[index.row()][index.column()];
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
int NetCfgTableModel::rowCount(const QModelIndex& parent) const
|
||||
{
|
||||
if (!mTableData.isEmpty())
|
||||
{
|
||||
return mTableData.count();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int NetCfgTableModel::columnCount(const QModelIndex& parent) const
|
||||
{
|
||||
if (!mTableData.isEmpty())
|
||||
{
|
||||
return mTableData[0].count();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
QVariant NetCfgTableModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole)
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
if (orientation == Qt::Horizontal)
|
||||
{
|
||||
return mHeaderStrings.at(section);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
45
src/network/NetCfgTableModel.h
Normal file
45
src/network/NetCfgTableModel.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/23.
|
||||
//
|
||||
|
||||
#ifndef GUI_LOGFILETABLEMODEL_H
|
||||
#define GUI_LOGFILETABLEMODEL_H
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include <QList>
|
||||
#include <QStringList>
|
||||
|
||||
class NetCfgTableModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
NetCfgTableModel(QObject* parent = nullptr);
|
||||
~NetCfgTableModel() {}
|
||||
|
||||
bool loadData(const QList<QStringList>& list);
|
||||
QList<QStringList> getData();
|
||||
|
||||
QStringList rowData(const QModelIndex& index);
|
||||
bool addRow(const QStringList& value);
|
||||
bool removeRow(int index);
|
||||
bool insertRow(int index, const QStringList& value);
|
||||
void setHeader(const QStringList& header);
|
||||
|
||||
protected:
|
||||
|
||||
//数据展示用
|
||||
QVariant data(const QModelIndex& index, int role) const;
|
||||
//行数,重新实现
|
||||
int rowCount(const QModelIndex& parent) const;
|
||||
//列数,重新实现
|
||||
int columnCount(const QModelIndex& parent) const;
|
||||
//标头
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
|
||||
private:
|
||||
QList<QStringList> mTableData;
|
||||
QStringList mHeaderStrings;
|
||||
};
|
||||
|
||||
#endif //GUI_LOGFILETABLEMODEL_H
|
||||
343
src/network/NetworkCfgDialog.cpp
Normal file
343
src/network/NetworkCfgDialog.cpp
Normal file
@@ -0,0 +1,343 @@
|
||||
#include "NetworkCfgDialog.h"
|
||||
|
||||
#include <QItemSelectionModel>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
#include <QThread>
|
||||
|
||||
#include "ui_NetworkCfgDialog.h"
|
||||
#include "device/networkmanager.h"
|
||||
#include "NetCfgTableModel.h"
|
||||
#include "GetIPDialog.h"
|
||||
#include "GetRouteDialog.h"
|
||||
#include "src/dialogs/guimessagedialog.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
const char* boolToStr(bool b)
|
||||
{
|
||||
return b ? "sucess" : "failed";
|
||||
}
|
||||
}
|
||||
|
||||
NetworkCfgDialog::NetworkCfgDialog(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, mUi(new Ui::NetworkCfgDialog)
|
||||
, mModelAddress(new NetCfgTableModel(this))
|
||||
, mModelRoute(new NetCfgTableModel(this))
|
||||
, mMessageDialog(new GUIMessageDialog(this))
|
||||
|
||||
{
|
||||
mUi->setupUi(this);
|
||||
this->setObjectName("formDialog");
|
||||
this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
|
||||
|
||||
mMessageDialog->hide();
|
||||
|
||||
mUi->sw_dhcp->setChecked(true);
|
||||
//ui->sw_dhcp->setButtonStyle(ImageSwitch::ButtonStyle_1);
|
||||
|
||||
QStringList headerAddr;
|
||||
headerAddr << tr("IP Address") << tr("Netmask");
|
||||
mModelAddress->setHeader(headerAddr);
|
||||
QStringList routeAddr;
|
||||
routeAddr << tr("Destination") << tr("Gateway") << tr("Netmask");
|
||||
mModelRoute->setHeader(routeAddr);
|
||||
|
||||
mUi->mButtonGroup->button(QDialogButtonBox::Apply)->setText(tr("Apply"));
|
||||
mUi->mButtonGroup->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
|
||||
|
||||
loadData();
|
||||
|
||||
mUi->tbl_addr->setModel(mModelAddress);
|
||||
mUi->tbl_route->setModel(mModelRoute);
|
||||
|
||||
//ui->tbl_addr->setAlternatingRowColors(true);
|
||||
mUi->tbl_addr->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
mUi->tbl_addr->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
mUi->tbl_addr->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
//ui->tbl_addr->verticalHeader()->setDefaultSectionSize(38);
|
||||
mUi->tbl_addr->horizontalHeader()->setStretchLastSection(true);
|
||||
mUi->tbl_addr->setColumnWidth(0, 345);
|
||||
mUi->tbl_addr->setColumnWidth(1, 345);
|
||||
mUi->tbl_addr->horizontalHeader()->setFixedHeight(38);
|
||||
|
||||
//ui->tbl_route->setAlternatingRowColors(true);
|
||||
mUi->tbl_route->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
mUi->tbl_route->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
mUi->tbl_route->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
mUi->tbl_route->verticalHeader()->setDefaultSectionSize(38);
|
||||
mUi->tbl_route->horizontalHeader()->setStretchLastSection(true);
|
||||
mUi->tbl_route->setColumnWidth(0, 230);
|
||||
mUi->tbl_route->setColumnWidth(1, 230);
|
||||
mUi->tbl_route->setColumnWidth(2, 230);
|
||||
mUi->tbl_route->horizontalHeader()->setFixedHeight(38);
|
||||
|
||||
connect(mUi->btn_addr_add, &QPushButton::clicked, [=]()
|
||||
{
|
||||
//GetIPDialog* dialog = new GetIPDialog(this);
|
||||
GetIPDialog dialog(this);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
mModelAddress->addRow(dialog.getList());
|
||||
//ui->tbl_addr->selectRow(0);
|
||||
}
|
||||
});
|
||||
|
||||
connect(mUi->btn_addr_edit, &QPushButton::clicked, [=]()
|
||||
{
|
||||
QItemSelectionModel* select = mUi->tbl_addr->selectionModel();
|
||||
if (select->hasSelection())
|
||||
{
|
||||
QModelIndexList index = select->selectedRows();
|
||||
if (!index.empty())
|
||||
{
|
||||
const QStringList ipdata = mModelAddress->rowData(index.at(0));
|
||||
|
||||
//GetIPDialog* dialog = new GetIPDialog(this);
|
||||
GetIPDialog dialog(this);
|
||||
dialog.setList(ipdata);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
mModelAddress->removeRow(index.at(0).row());
|
||||
mModelAddress->insertRow(index.at(0).row(), dialog.getList());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
connect(mUi->btn_addr_del, &QPushButton::clicked, [=]()
|
||||
{
|
||||
QItemSelectionModel* select = mUi->tbl_addr->selectionModel();
|
||||
if (select->hasSelection())
|
||||
{
|
||||
QModelIndexList index = select->selectedRows();
|
||||
if (!index.empty())
|
||||
{
|
||||
mModelAddress->removeRow(index.at(0).row());
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
connect(mUi->btn_route_add, &QPushButton::clicked, [=]()
|
||||
{
|
||||
//GetRouteDialog* dialog = new GetRouteDialog(this);
|
||||
GetRouteDialog dialog(this);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
mModelRoute->addRow(dialog.getList());
|
||||
}
|
||||
|
||||
});
|
||||
connect(mUi->btn_route_edit, &QPushButton::clicked, [=]()
|
||||
{
|
||||
|
||||
QItemSelectionModel* select = mUi->tbl_route->selectionModel();
|
||||
if (select->hasSelection())
|
||||
{
|
||||
QModelIndexList index = select->selectedRows();
|
||||
if (!index.empty())
|
||||
{
|
||||
const QStringList ipdata = mModelRoute->rowData(index.at(0));
|
||||
|
||||
//GetRouteDialog* dialog = new GetRouteDialog(this);
|
||||
GetRouteDialog dialog(this);
|
||||
dialog.setList(ipdata);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
mModelRoute->removeRow(index.at(0).row());
|
||||
mModelRoute->insertRow(index.at(0).row(), dialog.getList());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
connect(mUi->btn_route_del, &QPushButton::clicked, [=]()
|
||||
{
|
||||
QItemSelectionModel* select = mUi->tbl_route->selectionModel();
|
||||
if (select->hasSelection())
|
||||
{
|
||||
QModelIndexList index = select->selectedRows();
|
||||
if (!index.empty())
|
||||
{
|
||||
mModelRoute->removeRow(index.at(0).row());
|
||||
}
|
||||
}
|
||||
});
|
||||
connect(mUi->mButtonGroup->button(QDialogButtonBox::Apply), &QPushButton::clicked, [=]()
|
||||
{
|
||||
applyData();
|
||||
});
|
||||
connect(mUi->mButtonGroup->button(QDialogButtonBox::Cancel), &QPushButton::clicked, [=]()
|
||||
{
|
||||
reject();
|
||||
});
|
||||
mUi->tabWidget->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
NetworkCfgDialog::~NetworkCfgDialog()
|
||||
{
|
||||
delete mUi;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void NetworkCfgDialog::loadData()
|
||||
{
|
||||
mUi->led_inface->setText(NetworkManager::interfaceName());
|
||||
//ui->led_inface->setDisabled(true);
|
||||
mUi->sw_dhcp->setChecked(NetworkManager::isDHCP());
|
||||
const IpAddr& defaultIpAddress = NetworkManager::getDefaultIpAddr();
|
||||
mUi->addr_ip->setText(defaultIpAddress.ip);
|
||||
mUi->addr_mask->setText(defaultIpAddress.mask);
|
||||
mUi->led_gw->setText(NetworkManager::getDefaultGateway());
|
||||
mModelAddress->loadData(NetworkManager::getIpAddrList());
|
||||
mModelRoute->loadData(NetworkManager::getIpRouteList());
|
||||
|
||||
loadJsonData();
|
||||
}
|
||||
|
||||
bool NetworkCfgDialog::isJsonModified()
|
||||
{
|
||||
const host& hostInfo = NetworkManager::getLocalHost();
|
||||
if (mUi->daq_AE->text() != hostInfo.ae)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (mUi->daq_Name->text() != hostInfo.name)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (mUi->daq_Port->text() != hostInfo.port)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void NetworkCfgDialog::loadJsonData()
|
||||
{
|
||||
const host& hostInfo = NetworkManager::getLocalHost();
|
||||
mUi->daq_AE->setText(hostInfo.ae);
|
||||
mUi->daq_IP->setText(hostInfo.ip);
|
||||
mUi->daq_Name->setText(hostInfo.name);
|
||||
mUi->daq_Port->setText(hostInfo.port);
|
||||
}
|
||||
|
||||
void NetworkCfgDialog::saveJsonData()
|
||||
{
|
||||
host hostInfo;
|
||||
hostInfo.ip = mUi->daq_IP->text();
|
||||
hostInfo.ae = mUi->daq_AE->text();
|
||||
hostInfo.name = mUi->daq_Name->text();
|
||||
hostInfo.port = mUi->daq_Port->text();
|
||||
NetworkManager::setLocalHost(hostInfo);
|
||||
}
|
||||
|
||||
bool NetworkCfgDialog::isNetModified()
|
||||
{
|
||||
if (mUi->sw_dhcp->getChecked() != NetworkManager::isDHCP())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const IpAddr& defaultIpAddress = NetworkManager::getDefaultIpAddr();
|
||||
if (mUi->addr_ip->text() != defaultIpAddress.ip)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (mUi->addr_mask->text() != defaultIpAddress.mask)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (mUi->led_gw->text() != NetworkManager::getDefaultGateway())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mModelAddress->getData() != NetworkManager::getIpAddrList())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (mModelRoute->getData() != NetworkManager::getIpRouteList())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void NetworkCfgDialog::handleThreadStart()
|
||||
{
|
||||
mMessageDialog->showMessage("Saving Network Configuration...");
|
||||
mMessageDialog->show();
|
||||
}
|
||||
void NetworkCfgDialog::handleThreadExit()
|
||||
{
|
||||
mMessageDialog->hide();
|
||||
mUi->output->setPlainText(mError);
|
||||
if (0 != mThread)
|
||||
{
|
||||
mThread->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkCfgDialog::applyData()
|
||||
{
|
||||
if (isJsonModified())
|
||||
{
|
||||
saveJsonData();
|
||||
}
|
||||
//if it is the same as the old, just exit
|
||||
if (!isNetModified())
|
||||
{
|
||||
accept();
|
||||
return;
|
||||
}
|
||||
mUi->tabWidget->setCurrentIndex(2);
|
||||
|
||||
mThread = QThread::create([=]()
|
||||
{
|
||||
mError.clear();
|
||||
mError.append("restart\t\t");
|
||||
|
||||
bool result = NetworkManager::restart(mError);
|
||||
//bool ret =true;
|
||||
//err.append(boolToStr(ret));
|
||||
|
||||
mError.append("\n");
|
||||
if (mUi->sw_dhcp->getChecked())
|
||||
{
|
||||
NetworkManager::setJsonDHCP(true);
|
||||
mError.append("network setting\t");
|
||||
mError.append(boolToStr(result));
|
||||
}
|
||||
else
|
||||
{
|
||||
NetworkManager::setJsonDHCP(false);
|
||||
|
||||
IpAddr deIpAddress;
|
||||
deIpAddress.ip = mUi->addr_ip->text();
|
||||
deIpAddress.mask = mUi->addr_mask->text();
|
||||
mError.append("setDefaultIpAddr\t");
|
||||
result = result & NetworkManager::setDefaultIpAddr(deIpAddress, mError);
|
||||
mError.append("setDefaultGateway\t");
|
||||
result = result & NetworkManager::setDefaultGateway(mUi->led_gw->text(), mError);
|
||||
mError.append("setIpAddrList\t");
|
||||
result = result & NetworkManager::setIpAddrList(mModelAddress->getData(), mError);
|
||||
mError.append("setIpRouteList\t");
|
||||
result = result & NetworkManager::setIpRouteList(mModelRoute->getData(), mError);
|
||||
mError.append("\n").append("network settings\t");
|
||||
mError.append(boolToStr(result));
|
||||
}
|
||||
});
|
||||
|
||||
connect(mThread, SIGNAL(started()), this, SLOT(handleThreadStart()));
|
||||
connect(mThread, SIGNAL(finished()), this, SLOT(handleThreadExit()));
|
||||
|
||||
mThread->start();
|
||||
}
|
||||
47
src/network/NetworkCfgDialog.h
Normal file
47
src/network/NetworkCfgDialog.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef NETWORKCFGDIALOG_H
|
||||
#define NETWORKCFGDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class NetworkCfgDialog;
|
||||
}
|
||||
|
||||
class NetCfgTableModel;
|
||||
class GUIMessageDialog;
|
||||
class QThread;
|
||||
|
||||
class NetworkCfgDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//static void setShadow(QDialog* dialog);
|
||||
explicit NetworkCfgDialog(QWidget* parent = nullptr);
|
||||
~NetworkCfgDialog();
|
||||
|
||||
void loadData();
|
||||
void applyData();
|
||||
|
||||
public slots:
|
||||
void handleThreadStart();
|
||||
void handleThreadExit();
|
||||
|
||||
private:
|
||||
bool isJsonModified();
|
||||
bool isNetModified();
|
||||
void loadJsonData();
|
||||
void saveJsonData();
|
||||
|
||||
private:
|
||||
Ui::NetworkCfgDialog* mUi;
|
||||
NetCfgTableModel* mModelAddress = nullptr;
|
||||
NetCfgTableModel* mModelRoute = nullptr;
|
||||
GUIMessageDialog* mMessageDialog = nullptr;
|
||||
QThread* mThread = nullptr;
|
||||
QString mError;
|
||||
QString mAdminPsw;
|
||||
};
|
||||
|
||||
#endif // NETWORKCFGDIALOG_H
|
||||
569
src/network/NetworkCfgDialog.ui
Normal file
569
src/network/NetworkCfgDialog.ui
Normal file
@@ -0,0 +1,569 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>NetworkCfgDialog</class>
|
||||
<widget class="QDialog" name="NetworkCfgDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>820</width>
|
||||
<height>671</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Network Settings</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
QTabBar::tab {
|
||||
font-size:25px;
|
||||
height:40px;
|
||||
width:190px;
|
||||
border: 0px;
|
||||
border-top-left-radius: 0%;
|
||||
border-top-right-radius: 0%;
|
||||
border-bottom-left-radius:0%;
|
||||
border-bottom-right-radius:0%;
|
||||
background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #505050, stop: 1.0 #333333);
|
||||
}
|
||||
|
||||
QTabBar::tab:selected, QTabBar::tab:hover {
|
||||
background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #ABABAB, stop: 1.0 #CDCDCD);
|
||||
}
|
||||
|
||||
QLineEdit#led_inface{font-size:15px;border: 0px;}
|
||||
</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QWidget" name="formWidget" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="text">
|
||||
<string>Network Settings</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::North</enum>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Rounded</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="elideMode">
|
||||
<enum>Qt::ElideLeft</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Address</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>IP Address</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLineEdit" name="addr_ip"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>DHCP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Dev</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="ImageSwitch" name="sw_dhcp" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>87</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>87</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #232629;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="led_inface">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>87</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>87</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Subnet Mask</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="addr_mask"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Additional Address</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="topMargin">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="SlideTableView" name="tbl_addr"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_addr_add">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_addr_edit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_addr_del">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>321</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Routing</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_4" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="led_gw">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>190</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>190</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>373</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Default IPv4 Gateway</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Routing Table</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="SlideTableView" name="tbl_route">
|
||||
<property name="gridStyle">
|
||||
<enum>Qt::DashLine</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_5" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_route_add">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_route_edit">
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_route_del">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>321</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_dicom">
|
||||
<attribute name="title">
|
||||
<string>DICOM</string>
|
||||
</attribute>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QWidget" name="block2" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_Name">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="daq_AE"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="daq_Name"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="daq_Port"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbl_Port">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_AE">
|
||||
<property name="text">
|
||||
<string>AE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_IP">
|
||||
<property name="text">
|
||||
<string>IP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="daq_IP">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>Result</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="output">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="mButtonGroup">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ImageSwitch</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">components/imageswitch.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>SlideTableView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header location="global">components/SlideTableView.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,95 +0,0 @@
|
||||
#include "dicomcfgdialog.h"
|
||||
#include "ui_dicomcfgdialog.h"
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "json/jsonobject.h"
|
||||
dicomCfgDialog::dicomCfgDialog(QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::dicomCfgDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
//this->setFixedWidth(500);
|
||||
this->setObjectName("formDialog");
|
||||
this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
|
||||
|
||||
ui->btn_group->button(QDialogButtonBox::Apply)->setText(tr("Apply"));
|
||||
ui->btn_group->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
|
||||
|
||||
loadServersInfo();
|
||||
|
||||
connect(ui->btn_group->button(QDialogButtonBox::Apply), &QPushButton::clicked, [=]()
|
||||
{
|
||||
saveServersInfo();
|
||||
accept();
|
||||
});
|
||||
connect(ui->btn_group->button(QDialogButtonBox::Cancel), &QPushButton::clicked, [=]()
|
||||
{
|
||||
reject();
|
||||
});
|
||||
ui->tabWidget->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
dicomCfgDialog::~dicomCfgDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
void dicomCfgDialog::loadServersInfo()
|
||||
{
|
||||
host h;
|
||||
h = JsonObject::Instance()->getServer(JsonObject::RECON);
|
||||
ui->recon_AE->setText(h.ae);
|
||||
ui->recon_IP->setText(h.ip);
|
||||
ui->recon_Name->setText(h.name);
|
||||
ui->recon_Port->setText(h.port);
|
||||
|
||||
h = JsonObject::Instance()->getServer(JsonObject::PACS);
|
||||
ui->pacs_AE->setText(h.ae);
|
||||
ui->pacs_IP->setText(h.ip);
|
||||
ui->pacs_Name->setText(h.name);
|
||||
ui->pacs_Port->setText(h.port);
|
||||
|
||||
|
||||
h = JsonObject::Instance()->getServer(JsonObject::WORKLIST);
|
||||
ui->wl_AE->setText(h.ae);
|
||||
ui->wl_IP->setText(h.ip);
|
||||
ui->wl_Name->setText(h.name);
|
||||
ui->wl_Port->setText(h.port);
|
||||
|
||||
|
||||
|
||||
//qIfConfig(lhost);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void dicomCfgDialog::saveServersInfo()
|
||||
{
|
||||
|
||||
host h;
|
||||
h.ae = ui->recon_AE->text();
|
||||
h.ip = ui->recon_IP->text();
|
||||
h.name = ui->recon_Name->text();
|
||||
h.port = ui->recon_Port->text();
|
||||
JsonObject::Instance()->setServer(JsonObject::RECON, h);
|
||||
|
||||
h.ae = ui->pacs_AE->text();
|
||||
h.ip = ui->pacs_IP->text();
|
||||
h.name = ui->pacs_Name->text();
|
||||
h.port = ui->pacs_Port->text();
|
||||
JsonObject::Instance()->setServer(JsonObject::PACS, h);
|
||||
|
||||
h.ip = ui->wl_IP->text();
|
||||
h.ae = ui->wl_AE->text();
|
||||
h.name = ui->wl_Name->text();
|
||||
h.port = ui->wl_Port->text();
|
||||
JsonObject::Instance()->setServer(JsonObject::WORKLIST, h);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#ifndef DICOMCFGDIALOG_H
|
||||
#define DICOMCFGDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class dicomCfgDialog;
|
||||
}
|
||||
|
||||
class dicomCfgDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit dicomCfgDialog(QWidget* parent = nullptr);
|
||||
~dicomCfgDialog();
|
||||
|
||||
private:
|
||||
Ui::dicomCfgDialog* ui;
|
||||
|
||||
void loadServersInfo();
|
||||
void saveServersInfo();
|
||||
};
|
||||
|
||||
#endif // DICOMCFGDIALOG_H
|
||||
@@ -1,381 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>dicomCfgDialog</class>
|
||||
<widget class="QDialog" name="dicomCfgDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>601</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
|
||||
QTabBar::tab {
|
||||
font-size:25px;
|
||||
height:40px;
|
||||
width:180px;
|
||||
border: 0px;
|
||||
border-top-left-radius: 0%;
|
||||
border-top-right-radius: 0%;
|
||||
border-bottom-left-radius:0%;
|
||||
border-bottom-right-radius:0%;
|
||||
background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #505050, stop: 1.0 #333333);
|
||||
}
|
||||
|
||||
QTabBar::tab:selected, QTabBar::tab:hover {
|
||||
background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #ABABAB, stop: 1.0 #CDCDCD);
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QWidget" name="formWidget" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="text">
|
||||
<string>DICOM Settings</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_wl">
|
||||
<attribute name="title">
|
||||
<string>Worklist</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="wl_IP"/>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="wl_Port"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="wl_AE"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lbl_IP">
|
||||
<property name="text">
|
||||
<string>IP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbl_AE">
|
||||
<property name="text">
|
||||
<string>AE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="lbl_Port">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_Name">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>165</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="wl_Name"/>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QToolButton" name="toolButton_2">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="res.qrc">
|
||||
<normaloff>:/icons/dicom/echo_fail.png</normaloff>:/icons/dicom/echo_fail.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_pacs">
|
||||
<attribute name="title">
|
||||
<string>PACS</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="pacs_IP"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="pacs_AE"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_Name_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>165</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbl_IP_2">
|
||||
<property name="text">
|
||||
<string>IP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbl_AE_2">
|
||||
<property name="text">
|
||||
<string>AE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="pacs_Port"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="pacs_Name"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lbl_Port_2">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="res.qrc">
|
||||
<normaloff>:/icons/dicom/echo_ing.png</normaloff>:/icons/dicom/echo_ing.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_recon">
|
||||
<attribute name="title">
|
||||
<string>3D Recon</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="recon_Name"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="lbl_Port_3">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lbl_IP_3">
|
||||
<property name="text">
|
||||
<string>IP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="recon_IP"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_Name_3">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>165</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="recon_Port"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbl_AE_3">
|
||||
<property name="text">
|
||||
<string>AE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="recon_AE"/>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QToolButton" name="toolButton_3">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="res.qrc">
|
||||
<normaloff>:/icons/dicom/echo_suc.png</normaloff>:/icons/dicom/echo_suc.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="btn_group">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="res.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>btn_group</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>dicomCfgDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>btn_group</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>dicomCfgDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -1,49 +0,0 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include "getadminpsw.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#include <src/device/networkmanager.h>
|
||||
#endif
|
||||
|
||||
GetAdminPsw::GetAdminPsw(QWidget* parent, Qt::WindowFlags f) : GUIFormBaseDialog(parent, f) {
|
||||
|
||||
setWindowModality(Qt::WindowModal);
|
||||
QFormLayout* form = new QFormLayout(formWidget);
|
||||
QString value1 = QString(tr("Admin Password"));
|
||||
_psw = new QLineEdit(this);
|
||||
_psw->setEchoMode(QLineEdit::Password);
|
||||
form->addRow(value1, _psw);
|
||||
|
||||
lbl_error = new QLabel(this);
|
||||
lbl_error->setObjectName(QString::fromUtf8("warn"));
|
||||
form->addRow("", lbl_error);
|
||||
|
||||
}
|
||||
|
||||
GetAdminPsw::~GetAdminPsw() {
|
||||
|
||||
}
|
||||
|
||||
QString GetAdminPsw::getPsw()const
|
||||
{
|
||||
return _psw->text();
|
||||
}
|
||||
|
||||
bool GetAdminPsw::updateReferenceData() {
|
||||
#ifndef WIN32
|
||||
//verify the password
|
||||
QString err;
|
||||
if (!NetworkManager::checkPassWord(_psw->text(),err))
|
||||
{
|
||||
lbl_error->setText(err);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#ifndef GUI_GETADMINPSW_H
|
||||
#define GUI_GETADMINPSW_H
|
||||
|
||||
#include "src/dialogs/GUIFormBaseDialog.h"
|
||||
class QLineEdit;
|
||||
class QLabel;
|
||||
class GetAdminPsw :public GUIFormBaseDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GetAdminPsw(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
~GetAdminPsw();
|
||||
QString getPsw()const;
|
||||
protected:
|
||||
bool updateReferenceData();
|
||||
private:
|
||||
QLineEdit* _psw = nullptr;
|
||||
QLabel* lbl_error = nullptr;
|
||||
};
|
||||
|
||||
|
||||
#endif //GUI_GETADMINPSW_H
|
||||
@@ -1,58 +0,0 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include "getipdialog.h"
|
||||
#include "device/networkmanager.h"
|
||||
|
||||
GetIPDialog::GetIPDialog(QWidget* parent, Qt::WindowFlags f) : GUIFormBaseDialog(parent, f) {
|
||||
|
||||
setWindowModality(Qt::WindowModal);
|
||||
QFormLayout* form = new QFormLayout(formWidget);
|
||||
QLabel* value1 = new QLabel(tr("IP Address"));
|
||||
_ip = new QLineEdit(this);
|
||||
form->addRow(value1, _ip);
|
||||
|
||||
QLabel* value2 = new QLabel(tr("Netmask"));
|
||||
_mask = new QLineEdit(this);
|
||||
form->addRow(value2, _mask);
|
||||
|
||||
lbl_error = new QLabel(this);
|
||||
lbl_error->setObjectName(QString::fromUtf8("warn"));
|
||||
form->addRow("", lbl_error);
|
||||
|
||||
}
|
||||
|
||||
GetIPDialog::~GetIPDialog() {
|
||||
|
||||
}
|
||||
|
||||
QStringList GetIPDialog::getList()const
|
||||
{
|
||||
QStringList tmp;
|
||||
tmp << _ip->text() << _mask->text();
|
||||
return tmp;
|
||||
}
|
||||
void GetIPDialog::setList(const QStringList& list)
|
||||
{
|
||||
if (!list.empty()) {
|
||||
_ip->setText(list[0]);
|
||||
_mask->setText(list[1]);
|
||||
}
|
||||
}
|
||||
|
||||
bool GetIPDialog::updateReferenceData() {
|
||||
|
||||
if (!NetworkManager::validate(_ip->text())) {
|
||||
lbl_error->setText(tr("Wrong IP!"));
|
||||
return false;
|
||||
}
|
||||
if (!NetworkManager::validate(_mask->text())) {
|
||||
lbl_error->setText(tr("Wrong Netmask!"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#ifndef GUI_GETIPDIALOG_H
|
||||
#define GUI_GETIPDIALOG_H
|
||||
|
||||
#include "src/dialogs/GUIFormBaseDialog.h"
|
||||
class QLineEdit;
|
||||
class QLabel;
|
||||
class GetIPDialog :public GUIFormBaseDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GetIPDialog(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
~GetIPDialog();
|
||||
QStringList getList()const;
|
||||
void setList(const QStringList& list);
|
||||
protected:
|
||||
bool updateReferenceData();
|
||||
private:
|
||||
QLineEdit* _ip = nullptr;
|
||||
QLineEdit* _mask = nullptr;
|
||||
QLabel* lbl_error = nullptr;
|
||||
};
|
||||
|
||||
|
||||
#endif //GUI_GetIPDialog_H
|
||||
@@ -1,64 +0,0 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include "getroutedialog.h"
|
||||
#include "device/networkmanager.h"
|
||||
|
||||
GetRouteDialog::GetRouteDialog(QWidget* parent, Qt::WindowFlags f) : GUIFormBaseDialog(parent, f) {
|
||||
|
||||
setWindowModality(Qt::WindowModal);
|
||||
QFormLayout* form = new QFormLayout(formWidget);
|
||||
QString value1 = QString(tr("Destination"));
|
||||
_des = new QLineEdit(this);
|
||||
form->addRow(value1, _des);
|
||||
QString value2 = QString(tr("Netmask"));
|
||||
_mask = new QLineEdit(this);
|
||||
form->addRow(value2, _mask);
|
||||
QString value3 = QString(tr("Gateway"));
|
||||
_gw = new QLineEdit(this);
|
||||
form->addRow(value3, _gw);
|
||||
|
||||
lbl_error = new QLabel(this);
|
||||
lbl_error->setObjectName("warn");
|
||||
form->addRow("", lbl_error);
|
||||
}
|
||||
|
||||
GetRouteDialog::~GetRouteDialog() {
|
||||
|
||||
}
|
||||
|
||||
QStringList GetRouteDialog::getList()const
|
||||
{
|
||||
QStringList tmp;
|
||||
tmp << _des->text() << _mask->text() << _gw->text();
|
||||
return tmp;
|
||||
}
|
||||
void GetRouteDialog::setList(const QStringList& list)
|
||||
{
|
||||
if (!list.empty()) {
|
||||
_des->setText(list[0]);
|
||||
_mask->setText(list[1]);
|
||||
_gw->setText(list[2]);
|
||||
}
|
||||
}
|
||||
|
||||
bool GetRouteDialog::updateReferenceData() {
|
||||
|
||||
if (!NetworkManager::validate(_des->text())) {
|
||||
lbl_error->setText(tr("Wrong Destination!"));
|
||||
return false;
|
||||
}
|
||||
if (!NetworkManager::validate(_des->text())) {
|
||||
lbl_error->setText(tr("Wrong Netmask!"));
|
||||
return false;
|
||||
}
|
||||
if (!NetworkManager::validate(_des->text())) {
|
||||
lbl_error->setText(tr("Wrong Gateway!"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/11.
|
||||
//
|
||||
|
||||
#ifndef GUI_GetRouteDialog_H
|
||||
#define GUI_GETROUTEDIALOG_H
|
||||
|
||||
#include "src/dialogs/GUIFormBaseDialog.h"
|
||||
class QLineEdit;
|
||||
class QLabel;
|
||||
class GetRouteDialog :public GUIFormBaseDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GetRouteDialog(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
~GetRouteDialog();
|
||||
QStringList getList()const;
|
||||
void setList(const QStringList& list);
|
||||
protected:
|
||||
bool updateReferenceData();
|
||||
private:
|
||||
QLineEdit* _des = nullptr;
|
||||
QLineEdit* _mask = nullptr;
|
||||
QLineEdit* _gw = nullptr;
|
||||
QLabel* lbl_error = nullptr;
|
||||
};
|
||||
|
||||
|
||||
#endif //GUI_GetRouteDialog_H
|
||||
@@ -1,101 +0,0 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/23.
|
||||
//
|
||||
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QTextStream>
|
||||
#include "network/netcfgtablemodel.h"
|
||||
#include <QDebug>
|
||||
|
||||
NetCfgTableModel::NetCfgTableModel(QObject* parent) : QAbstractTableModel(parent) {
|
||||
|
||||
}
|
||||
/*!
|
||||
Sets the \a role data for the item at \a index to \a value.
|
||||
Returns \c{true} if successful; otherwise returns \c{false}.
|
||||
The dataChanged() signal should be emitted if the data was successfully
|
||||
set.
|
||||
The base class implementation returns \c{false}. This function and data() must
|
||||
be reimplemented for editable models.
|
||||
\sa Qt::ItemDataRole, data(), itemData()
|
||||
*/
|
||||
|
||||
//bool NetCfgTableModel::setData(const QModelIndex& index, const QVariant& value, int role){}
|
||||
|
||||
QList<QStringList> NetCfgTableModel::getData()
|
||||
{
|
||||
return mydata;
|
||||
}
|
||||
bool NetCfgTableModel::loadData(const QList<QStringList>& list)
|
||||
{
|
||||
this->mydata = list;
|
||||
|
||||
QModelIndex tl = this->index(0, 0);
|
||||
QModelIndex br = this->index(list.size() - 1, list.begin()->size() - 1);
|
||||
emit dataChanged(tl, br);
|
||||
return true;
|
||||
}
|
||||
bool NetCfgTableModel::addRow(const QStringList& value)
|
||||
{
|
||||
int index = rowCount(QModelIndex());
|
||||
QAbstractTableModel::beginInsertRows(QModelIndex(), index, index);
|
||||
mydata.insert(index, value);
|
||||
QAbstractTableModel::endInsertRows();
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
bool NetCfgTableModel::insertRow(int index, const QStringList& value)
|
||||
{
|
||||
QAbstractTableModel::beginInsertRows(QModelIndex(), index, index);
|
||||
mydata.insert(index, value);
|
||||
QAbstractTableModel::endInsertRows();
|
||||
return true;
|
||||
}
|
||||
bool NetCfgTableModel::removeRow(int index)
|
||||
{
|
||||
QAbstractTableModel::beginRemoveRows(QModelIndex(), index, index);
|
||||
mydata.removeAt(index);
|
||||
QAbstractTableModel::endRemoveRows();
|
||||
return true;
|
||||
}
|
||||
|
||||
QStringList NetCfgTableModel::rowData(QModelIndex index)
|
||||
{
|
||||
if (!index.isValid()) return QStringList();
|
||||
if (index.row() < mydata.size())
|
||||
{
|
||||
return mydata[index.row()];
|
||||
}
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QVariant NetCfgTableModel::data(const QModelIndex& index, int role) const {
|
||||
if (!index.isValid()) return QVariant();
|
||||
if (role == Qt::TextAlignmentRole) {
|
||||
return Qt::AlignCenter;
|
||||
}
|
||||
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
||||
{
|
||||
return mydata[index.row()][index.column()];
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
int NetCfgTableModel::rowCount(const QModelIndex& parent) const {
|
||||
if (!mydata.isEmpty()) return mydata.count();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int NetCfgTableModel::columnCount(const QModelIndex& parent) const {
|
||||
if (!mydata.isEmpty()) return mydata[0].count();
|
||||
return 0;
|
||||
}
|
||||
|
||||
QVariant NetCfgTableModel::headerData(int section, Qt::Orientation orientation, int role) const {
|
||||
if (role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
if (orientation == Qt::Horizontal)
|
||||
return headerStrings.at(section);
|
||||
return QVariant();
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// Created by Krad on 2021/11/23.
|
||||
//
|
||||
|
||||
#ifndef GUI_LOGFILETABLEMODEL_H
|
||||
#define GUI_LOGFILETABLEMODEL_H
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include <QList>
|
||||
#include <QStringList>
|
||||
|
||||
class NetCfgTableModel : public QAbstractTableModel {
|
||||
public:
|
||||
NetCfgTableModel(QObject* parent = nullptr);
|
||||
~NetCfgTableModel() {}
|
||||
|
||||
//bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
|
||||
|
||||
bool loadData(const QList<QStringList>& list);
|
||||
QList<QStringList> getData();
|
||||
|
||||
QStringList rowData(QModelIndex index);
|
||||
bool addRow(const QStringList& value);
|
||||
bool removeRow(int index);
|
||||
bool insertRow(int index, const QStringList& value);
|
||||
|
||||
|
||||
void setHeader(QStringList header) {
|
||||
headerStrings = header;
|
||||
}
|
||||
protected:
|
||||
|
||||
//数据展示用
|
||||
QVariant data(const QModelIndex& index, int role) const;
|
||||
//行数,重新实现
|
||||
int rowCount(const QModelIndex& parent) const;
|
||||
//列数,重新实现
|
||||
int columnCount(const QModelIndex& parent) const;
|
||||
//标头
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
private:
|
||||
QList<QStringList> mydata;
|
||||
QStringList headerStrings;
|
||||
};
|
||||
|
||||
|
||||
#endif //GUI_LOGFILETABLEMODEL_H
|
||||
@@ -1,320 +0,0 @@
|
||||
#include "networkcfgdialog.h"
|
||||
#include "ui_networkcfgdialog.h"
|
||||
#include "device/networkmanager.h"
|
||||
#include "network/netcfgtablemodel.h"
|
||||
#include "network/getipdialog.h"
|
||||
#include "network/getroutedialog.h"
|
||||
|
||||
#include <QItemSelectionModel>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
|
||||
#include "src/dialogs/guimessagedialog.h"
|
||||
|
||||
#include <QThread>
|
||||
networkCfgDialog::networkCfgDialog(QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::networkCfgDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setObjectName("formDialog");
|
||||
this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
|
||||
|
||||
msgDialog = new GUIMessageDialog(this);
|
||||
msgDialog->hide();
|
||||
|
||||
ui->sw_dhcp->setChecked(true);
|
||||
//ui->sw_dhcp->setButtonStyle(ImageSwitch::ButtonStyle_1);
|
||||
|
||||
|
||||
model_addr = new NetCfgTableModel(this);
|
||||
model_route = new NetCfgTableModel(this);
|
||||
|
||||
QStringList header_addr;
|
||||
header_addr << tr("IP Address") << tr("Netmask");
|
||||
model_addr->setHeader(header_addr);
|
||||
QStringList route_addr;
|
||||
route_addr << tr("Destination") << tr("Gateway") << tr("Netmask");
|
||||
model_route->setHeader(route_addr);
|
||||
|
||||
ui->btn_group->button(QDialogButtonBox::Apply)->setText(tr("Apply"));
|
||||
ui->btn_group->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
|
||||
|
||||
loadData();
|
||||
|
||||
ui->tbl_addr->setModel(model_addr);
|
||||
ui->tbl_route->setModel(model_route);
|
||||
|
||||
//ui->tbl_addr->setAlternatingRowColors(true);
|
||||
ui->tbl_addr->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
ui->tbl_addr->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
ui->tbl_addr->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
//ui->tbl_addr->verticalHeader()->setDefaultSectionSize(38);
|
||||
ui->tbl_addr->horizontalHeader()->setStretchLastSection(true);
|
||||
ui->tbl_addr->setColumnWidth(0, 345);
|
||||
ui->tbl_addr->setColumnWidth(1, 345);
|
||||
ui->tbl_addr->horizontalHeader()->setFixedHeight(38);
|
||||
|
||||
//ui->tbl_route->setAlternatingRowColors(true);
|
||||
ui->tbl_route->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
ui->tbl_route->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
ui->tbl_route->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
ui->tbl_route->verticalHeader()->setDefaultSectionSize(38);
|
||||
ui->tbl_route->horizontalHeader()->setStretchLastSection(true);
|
||||
ui->tbl_route->setColumnWidth(0, 230);
|
||||
ui->tbl_route->setColumnWidth(1, 230);
|
||||
ui->tbl_route->setColumnWidth(2, 230);
|
||||
ui->tbl_route->horizontalHeader()->setFixedHeight(38);
|
||||
|
||||
|
||||
connect(ui->btn_addr_add, &QPushButton::clicked, [=]()
|
||||
{
|
||||
//GetIPDialog* dialog = new GetIPDialog(this);
|
||||
GetIPDialog dialog(this);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
model_addr->addRow(dialog.getList());
|
||||
//ui->tbl_addr->selectRow(0);
|
||||
}
|
||||
});
|
||||
connect(ui->btn_addr_edit, &QPushButton::clicked, [=]()
|
||||
{
|
||||
|
||||
QItemSelectionModel* select = ui->tbl_addr->selectionModel();
|
||||
if (select->hasSelection())
|
||||
{
|
||||
QModelIndexList index = select->selectedRows();
|
||||
if (!index.empty()) {
|
||||
const QStringList ipdata = model_addr->rowData(index.at(0));
|
||||
|
||||
//GetIPDialog* dialog = new GetIPDialog(this);
|
||||
GetIPDialog dialog(this);
|
||||
dialog.setList(ipdata);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
model_addr->removeRow(index.at(0).row());
|
||||
model_addr->insertRow(index.at(0).row(), dialog.getList());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->btn_addr_del, &QPushButton::clicked, [=]()
|
||||
{
|
||||
QItemSelectionModel* select = ui->tbl_addr->selectionModel();
|
||||
if (select->hasSelection())
|
||||
{
|
||||
QModelIndexList index = select->selectedRows();
|
||||
if (!index.empty()) {
|
||||
model_addr->removeRow(index.at(0).row());
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
connect(ui->btn_route_add, &QPushButton::clicked, [=]()
|
||||
{
|
||||
//GetRouteDialog* dialog = new GetRouteDialog(this);
|
||||
GetRouteDialog dialog(this);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
model_route->addRow(dialog.getList());
|
||||
}
|
||||
|
||||
});
|
||||
connect(ui->btn_route_edit, &QPushButton::clicked, [=]()
|
||||
{
|
||||
|
||||
QItemSelectionModel* select = ui->tbl_route->selectionModel();
|
||||
if (select->hasSelection())
|
||||
{
|
||||
QModelIndexList index = select->selectedRows();
|
||||
if (!index.empty()) {
|
||||
const QStringList ipdata = model_route->rowData(index.at(0));
|
||||
|
||||
//GetRouteDialog* dialog = new GetRouteDialog(this);
|
||||
GetRouteDialog dialog(this);
|
||||
dialog.setList(ipdata);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
model_route->removeRow(index.at(0).row());
|
||||
model_route->insertRow(index.at(0).row(), dialog.getList());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->btn_route_del, &QPushButton::clicked, [=]()
|
||||
{
|
||||
QItemSelectionModel* select = ui->tbl_route->selectionModel();
|
||||
if (select->hasSelection())
|
||||
{
|
||||
QModelIndexList index = select->selectedRows();
|
||||
if (!index.empty()) {
|
||||
model_route->removeRow(index.at(0).row());
|
||||
}
|
||||
}
|
||||
});
|
||||
connect(ui->btn_group->button(QDialogButtonBox::Apply), &QPushButton::clicked, [=]()
|
||||
{
|
||||
applyData();
|
||||
});
|
||||
connect(ui->btn_group->button(QDialogButtonBox::Cancel), &QPushButton::clicked, [=]()
|
||||
{
|
||||
reject();
|
||||
});
|
||||
ui->tabWidget->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
networkCfgDialog::~networkCfgDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void networkCfgDialog::loadData()
|
||||
{
|
||||
|
||||
ui->led_inface->setText(NetworkManager::interfaceName());
|
||||
//ui->led_inface->setDisabled(true);
|
||||
ui->sw_dhcp->setChecked(NetworkManager::isDHCP());
|
||||
const IpAddr& default_addr = NetworkManager::getDefaultIpAddr();
|
||||
ui->addr_ip->setText(default_addr.ip);
|
||||
ui->addr_mask->setText(default_addr.mask);
|
||||
ui->led_gw->setText(NetworkManager::getDefaultGateway());
|
||||
model_addr->loadData(NetworkManager::getIpAddrList());
|
||||
model_route->loadData(NetworkManager::getIpRouteList());
|
||||
|
||||
loadJsonData();
|
||||
}
|
||||
|
||||
bool networkCfgDialog::isJsonModified()
|
||||
{
|
||||
const host& h = NetworkManager::getLocalHost();
|
||||
if (ui->daq_AE->text() != h.ae) return true;
|
||||
if (ui->daq_Name->text() != h.name) return true;
|
||||
if (ui->daq_Port->text() != h.port)return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void networkCfgDialog::loadJsonData()
|
||||
{
|
||||
|
||||
const host& h = NetworkManager::getLocalHost();
|
||||
ui->daq_AE->setText(h.ae);
|
||||
ui->daq_IP->setText(h.ip);
|
||||
ui->daq_Name->setText(h.name);
|
||||
ui->daq_Port->setText(h.port);
|
||||
}
|
||||
|
||||
void networkCfgDialog::saveJsonData()
|
||||
{
|
||||
host h;
|
||||
h.ip = ui->daq_IP->text();
|
||||
h.ae = ui->daq_AE->text();
|
||||
h.name = ui->daq_Name->text();
|
||||
h.port = ui->daq_Port->text();
|
||||
NetworkManager::setLocalHost(h);
|
||||
}
|
||||
|
||||
bool networkCfgDialog::isNetModified()
|
||||
{
|
||||
if (ui->sw_dhcp->getChecked() != NetworkManager::isDHCP()) return true;
|
||||
|
||||
const IpAddr& default_addr = NetworkManager::getDefaultIpAddr();
|
||||
if (ui->addr_ip->text() != default_addr.ip) return true;
|
||||
if (ui->addr_mask->text() != default_addr.mask) return true;
|
||||
if (ui->led_gw->text() != NetworkManager::getDefaultGateway())return true;
|
||||
|
||||
if (model_addr->getData() != NetworkManager::getIpAddrList())return true;
|
||||
if (model_route->getData() != NetworkManager::getIpRouteList()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void networkCfgDialog::afterThreadStart()
|
||||
{
|
||||
msgDialog->showMessage("Saving Network Configuration...");
|
||||
msgDialog->show();
|
||||
}
|
||||
void networkCfgDialog::beforeThreadExit()
|
||||
{
|
||||
msgDialog->hide();
|
||||
ui->output->setPlainText(err);
|
||||
myThread->deleteLater();
|
||||
}
|
||||
|
||||
void networkCfgDialog::applyData()
|
||||
{
|
||||
if (isJsonModified())
|
||||
{
|
||||
saveJsonData();
|
||||
}
|
||||
//if it is the same as the old, just exit
|
||||
if (!isNetModified())
|
||||
{
|
||||
accept();
|
||||
return;
|
||||
}
|
||||
ui->tabWidget->setCurrentIndex(2);
|
||||
|
||||
|
||||
|
||||
myThread = QThread::create([=]()
|
||||
{
|
||||
err.clear();
|
||||
err.append("restart\t\t");
|
||||
|
||||
bool ret = NetworkManager::restart(err);
|
||||
//bool ret =true;
|
||||
//err.append(boolToStr(ret));
|
||||
|
||||
err.append("\n");
|
||||
if (ui->sw_dhcp->getChecked())
|
||||
{
|
||||
NetworkManager::setJsonDHCP(true);
|
||||
err.append("network setting\t");
|
||||
err.append(boolToStr(ret));
|
||||
}
|
||||
else
|
||||
{
|
||||
NetworkManager::setJsonDHCP(false);
|
||||
|
||||
IpAddr de_ipa;
|
||||
de_ipa.ip = ui->addr_ip->text();
|
||||
de_ipa.mask = ui->addr_mask->text();
|
||||
err.append("setDefaultIpAddr\t");
|
||||
bool ret1 = NetworkManager::setDefaultIpAddr(de_ipa, err);
|
||||
err.append("setDefaultGateway\t");
|
||||
bool ret2 = NetworkManager::setDefaultGateway(ui->led_gw->text(), err);
|
||||
err.append("setIpAddrList\t");
|
||||
bool ret3 = NetworkManager::setIpAddrList(model_addr->getData(), err);
|
||||
err.append("setIpRouteList\t");
|
||||
bool ret4 = NetworkManager::setIpRouteList(model_route->getData(), err);
|
||||
err.append("\n").append("network settings\t");
|
||||
|
||||
bool retAll = ret & ret1 & ret2 & ret3 & ret4;
|
||||
err.append(boolToStr(retAll));
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
connect(myThread, SIGNAL(started()), this, SLOT(afterThreadStart()));
|
||||
connect(myThread, SIGNAL(finished()), this, SLOT(beforeThreadExit()));
|
||||
|
||||
myThread->start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#ifndef NETWORKCFGDIALOG_H
|
||||
#define NETWORKCFGDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class networkCfgDialog;
|
||||
}
|
||||
|
||||
class NetCfgTableModel;
|
||||
class GUIMessageDialog;
|
||||
class QThread;
|
||||
|
||||
class networkCfgDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//static void setShadow(QDialog* dialog);
|
||||
explicit networkCfgDialog(QWidget* parent = nullptr);
|
||||
~networkCfgDialog();
|
||||
|
||||
void loadData();
|
||||
void applyData();
|
||||
|
||||
|
||||
public slots:
|
||||
void afterThreadStart();
|
||||
void beforeThreadExit();
|
||||
|
||||
private:
|
||||
bool isJsonModified();
|
||||
bool isNetModified();
|
||||
void loadJsonData();
|
||||
void saveJsonData();
|
||||
|
||||
|
||||
const char* boolToStr(bool b)
|
||||
{
|
||||
return b ? "sucess" : "failed";
|
||||
}
|
||||
NetCfgTableModel* model_addr = nullptr;
|
||||
NetCfgTableModel* model_route = nullptr;
|
||||
GUIMessageDialog* msgDialog = nullptr;
|
||||
Ui::networkCfgDialog* ui;
|
||||
QThread* myThread = nullptr;
|
||||
QString err;
|
||||
QString admin_psw;
|
||||
};
|
||||
|
||||
#endif // NetworkCfgDialog_H
|
||||
@@ -1,567 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>networkCfgDialog</class>
|
||||
<widget class="QDialog" name="networkCfgDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>820</width>
|
||||
<height>671</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Network Settings</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTabBar::tab {
|
||||
font-size:25px;
|
||||
height:40px;
|
||||
width:190px;
|
||||
border: 0px;
|
||||
border-top-left-radius: 0%;
|
||||
border-top-right-radius: 0%;
|
||||
border-bottom-left-radius:0%;
|
||||
border-bottom-right-radius:0%;
|
||||
background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #505050, stop: 1.0 #333333);
|
||||
}
|
||||
|
||||
QTabBar::tab:selected, QTabBar::tab:hover {
|
||||
background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #ABABAB, stop: 1.0 #CDCDCD);
|
||||
}
|
||||
|
||||
QLineEdit#led_inface{font-size:15px;border: 0px;}</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QWidget" name="formWidget" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="text">
|
||||
<string>Network Settings</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::North</enum>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Rounded</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="elideMode">
|
||||
<enum>Qt::ElideLeft</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Address</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>IP Address</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLineEdit" name="addr_ip"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>DHCP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Dev</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="ImageSwitch" name="sw_dhcp" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>87</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>87</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #232629;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="led_inface">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>87</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>87</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Subnet Mask</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="addr_mask"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Additional Address</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="topMargin">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="SlideTableView" name="tbl_addr"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_addr_add">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_addr_edit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_addr_del">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>321</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Routing</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_4" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="led_gw">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>190</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>190</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>373</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Default IPv4 Gateway</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Routing Table</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="SlideTableView" name="tbl_route">
|
||||
<property name="gridStyle">
|
||||
<enum>Qt::DashLine</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_5" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_route_add">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_route_edit">
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_route_del">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>321</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_dicom">
|
||||
<attribute name="title">
|
||||
<string>DICOM</string>
|
||||
</attribute>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QWidget" name="block2" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_Name">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="daq_AE"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="daq_Name"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="daq_Port"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbl_Port">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_AE">
|
||||
<property name="text">
|
||||
<string>AE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_IP">
|
||||
<property name="text">
|
||||
<string>IP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="daq_IP">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>Result</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="output">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="btn_group">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ImageSwitch</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">components/imageswitch.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>SlideTableView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header location="global">components/SlideTableView.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user