qt/LedOK/LoUIClass/softconfigdialog.cpp

60 lines
2.1 KiB
C++
Raw Normal View History

2022-01-04 18:11:48 +08:00
#include "softconfigdialog.h"
2022-08-25 18:37:24 +08:00
#include "cfg.h"
#include "globaldefine.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>
2022-01-04 18:11:48 +08:00
#include <QSettings>
2022-08-25 18:37:24 +08:00
SoftConfigDialog::SoftConfigDialog(QWidget *parent) : BaseDlg(parent) {
setAttribute(Qt::WA_DeleteOnClose);
resize(400, 300);
setWindowTitle(tr("Software Configuration"));
auto vbox = new QVBoxLayout(this);
auto pushButton = new QPushButton("X");
pushButton->setFixedSize(30, 24);
connect(pushButton, &QPushButton::clicked, this, &QWidget::close);
vbox->addWidget(pushButton, 0, Qt::AlignRight);
press_fd = new QCheckBox(tr("Video compress to")+" 720p");
vbox->addWidget(press_fd);
trans_fd = new QCheckBox(tr("Video transcoding to")+" h264");
vbox->addWidget(trans_fd);
auto hbox = new QHBoxLayout();
hbox->setContentsMargins(-1, 0, -1, -1);
anti_fd = new QCheckBox(tr("Text antialiasing"));
hbox->addWidget(anti_fd, 0, Qt::AlignTop);
auto anti_tip = new QLabel(tr("TextAntilaTip"));
anti_tip->setStyleSheet("color:#FF0000;");
anti_tip->setWordWrap(true);
hbox->addWidget(anti_tip);
vbox->addLayout(hbox);
vbox->addWidget(guangying_fd = new QCheckBox(tr("GuangYinPin")));
QSettings settings;
press_fd->setChecked(settings.value("VideoCompress", true).toBool());
trans_fd->setChecked(settings.value("VideoTranscoding", true).toBool());
anti_fd->setChecked(settings.value("TextAntialiasing", false).toBool());
guangying_fd->setChecked(settings.value("GuangYingPin", false).toBool());
auto ok_btn = new QPushButton(tr("OK"));
vbox->addWidget(ok_btn, 0, Qt::AlignCenter);
connect(ok_btn, &QPushButton::clicked, this, [this]() {
QSettings settings;
settings.setValue("VideoCompress", press_fd->isChecked());
settings.setValue("VideoTranscoding", trans_fd->isChecked());
gTextAntialiasing = anti_fd->isChecked();
settings.setValue("TextAntialiasing", gTextAntialiasing);
gShowLoraScreen = guangying_fd->isChecked();
settings.setValue("GuangYingPin",gShowLoraScreen);
accept();
});
2022-01-04 18:11:48 +08:00
}