This commit is contained in:
Gangphon 2023-05-05 17:22:54 +08:00
parent e7a5c0cf8d
commit 0bff10348c
4 changed files with 33 additions and 37 deletions

View File

@ -49,7 +49,10 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) {
hhh->addWidget(labelIpAddress = new QLabel);
fdIP = new QLineEdit;
fdIP->setInputMask("000.000.000.000;_");
auto ft = fdIP->font();
ft.setFamilies({"Monaco", "Consolas", "Mono-space"});
fdIP->setFont(ft);
fdIP->setInputMask("000.000.000.000");
fdIP->setAlignment(Qt::AlignCenter);
fdIP->setFixedWidth(160);
hhh->addWidget(fdIP);
@ -59,7 +62,8 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) {
hhh->addWidget(labelMaskAddress = new QLabel);
fdMask = new QLineEdit;
fdMask->setInputMask("000.000.000.000;_");
fdMask->setFont(ft);
fdMask->setInputMask("000.000.000.000");
fdMask->setAlignment(Qt::AlignCenter);
fdMask->setFixedWidth(160);
hhh->addWidget(fdMask);
@ -69,7 +73,8 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) {
hhh->addWidget(labelGateway = new QLabel);
fdGateWay = new QLineEdit;
fdGateWay->setInputMask("000.000.000.000;_");
fdGateWay->setFont(ft);
fdGateWay->setInputMask("000.000.000.000");
fdGateWay->setAlignment(Qt::AlignCenter);
fdGateWay->setFixedWidth(160);
hhh->addWidget(fdGateWay);
@ -79,7 +84,8 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) {
hhh->addWidget(labelDnsAddress = new QLabel);
fdDns = new QLineEdit;
fdDns->setInputMask("000.000.000.000;_");
fdDns->setFont(ft);
fdDns->setInputMask("000.000.000.000");
fdDns->setAlignment(Qt::AlignCenter);
fdDns->setFixedWidth(160);
hhh->addWidget(fdDns);

View File

@ -1,26 +1,24 @@
#include "passwordindlg.h"
#include "base/changepasswordform.h"
#include <QVBoxLayout>
#include "gutil/qgui.h"
#include <QLabel>
#include <QPushButton>
PasswordInChDlg::PasswordInChDlg(QWidget *parent) : BaseDlg(parent) {
resize(213, 136);
setStyleSheet("QDialog{background-color: #eeeeee;} QLabel{background-color: transparent;}");
auto vBox = new QVBoxLayout(this);
PasswordInChDlg::PasswordInChDlg(QWidget *parent) : QDialog(parent) {
resize(240, 150);
auto vBox = new VBox(this);
vBox->addStretch();
auto hBox = new QHBoxLayout();
auto hBox = new HBox(vBox);
hBox->addWidget(new QLabel(tr("Input password")));
fdPassword = new QLineEdit();
fdPassword->setEchoMode(QLineEdit::Password);
fdPassword->setFocus();
hBox->addWidget(fdPassword);
vBox->addLayout(hBox);
btnChangePassword = new QPushButton(tr("Change Password"));
btnChangePassword->setProperty("ssType", "progManageTool");
vBox->addWidget(btnChangePassword, 0, Qt::AlignRight);
connect(btnChangePassword, &QPushButton::clicked, this, [this]() {
ChangePasswordForm dlg(this);
@ -28,10 +26,7 @@ PasswordInChDlg::PasswordInChDlg(QWidget *parent) : BaseDlg(parent) {
});
vBox->addStretch();
btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
btnBox->button(QDialogButtonBox::Ok)->setProperty("ssType", "progManageTool");
btnBox->button(QDialogButtonBox::Cancel)->setProperty("ssType", "progManageTool");
vBox->addWidget(btnBox, 0, Qt::AlignHCenter);
btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
vBox->addWidget(btnBox);
connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
vBox->addStretch();
}

View File

@ -1,14 +1,14 @@
#ifndef PASSWORDINDLG_H
#define PASSWORDINDLG_H
#include "basedlg.h"
#include <QDialog>
#include <QLineEdit>
#include <QDialogButtonBox>
class PasswordInChDlg : public BaseDlg {
class PasswordInChDlg : public QDialog {
Q_OBJECT
public:
explicit PasswordInChDlg(QWidget *parent = nullptr);
explicit PasswordInChDlg(QWidget *parent = 0);
QLineEdit *fdPassword;
QPushButton *btnChangePassword;

View File

@ -1,17 +1,21 @@
#include "sendprogramdialog.h"
#include "tools.h"
#include "cfg.h"
#include "gutil/qgui.h"
#include <QAction>
#include <QLineEdit>
#include <QHeaderView>
#include <QVBoxLayout>
#include <QDialogButtonBox>
SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialog(parent), mProgName(progName) {
#ifdef Q_OS_WINDOWS
setWindowFlag(Qt::WindowMaximizeButtonHint);
#endif
setWindowTitle(tr("Publish")+" "+mProgName);
resize(1024, 700);
auto vBox = new QVBoxLayout(this);
auto hBox = new QHBoxLayout();
auto vBox = new VBox(this);
auto hBox = new HBox(vBox);
label = new QLabel(tr("success info"));
hBox->addWidget(label);
@ -31,7 +35,6 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo
connect(txtSearch,SIGNAL(textChanged(const QString &)),this,SLOT(FilterProgram(const QString &)));
hBox->addWidget(txtSearch);
vBox->addLayout(hBox);
wDevicePublishList = new LoQTreeWidget();
wDevicePublishList->setProperty("ssType", "topList");
@ -68,11 +71,11 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo
wDevicePublishList->setColumnWidth(ENUM_DEVICE_PUBLISH_HEADE_PROGRESS, 120);
vBox->addWidget(wDevicePublishList);
hBox = new QHBoxLayout();
hBox->addStretch();
auto btnPublish = new QPushButton(tr("Publish"));
connect(btnPublish, &QPushButton::clicked, this, [this] {
auto btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
btnBox->button(QDialogButtonBox::Ok)->setText(tr("Publish"));
connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(btnBox, &QDialogButtonBox::accepted, this, [this] {
if(mWaitCnt > 0) return;
int cnt = wDevicePublishList->topLevelItemCount();
int sentCnt{0};
@ -114,15 +117,7 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo
sentCnt++;
}
});
btnPublish->setProperty("ssType", "progManageTool");
hBox->addWidget(btnPublish);
auto btnCancel = new QPushButton(tr("Cancel"));
connect(btnCancel, &QPushButton::clicked, this, &QWidget::close);
btnCancel->setProperty("ssType", "progManageTool");
hBox->addWidget(btnCancel);
vBox->addLayout(hBox);
vBox->addWidget(btnBox);
onRefresh();