2022-09-30 18:08:39 +08:00
|
|
|
#include "progcreatedlg.h"
|
2023-04-18 14:14:46 +08:00
|
|
|
#include "gutil/qgui.h"
|
2022-10-27 15:07:45 +08:00
|
|
|
#include "globaldefine.h"
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QPushButton>
|
2023-05-15 16:06:10 +08:00
|
|
|
#include <QDialogButtonBox>
|
2022-09-30 18:08:39 +08:00
|
|
|
|
2023-04-25 16:30:58 +08:00
|
|
|
ProgCreateDlg::ProgCreateDlg(QString name, int width, int height, QString remarks, QString widths, QWidget *parent) : QDialog(parent) {
|
2023-05-15 16:06:10 +08:00
|
|
|
#ifdef Q_OS_WIN
|
2023-04-25 16:30:58 +08:00
|
|
|
setWindowFlag(Qt::WindowContextHelpButtonHint, 0);
|
2023-05-08 09:59:15 +08:00
|
|
|
#endif
|
2023-04-25 16:30:58 +08:00
|
|
|
setWindowTitle(tr("Solution Information"));
|
2022-09-30 18:08:39 +08:00
|
|
|
auto vBox = new VBox(this);
|
|
|
|
auto hBox = new HBox(vBox);
|
|
|
|
|
2023-04-25 16:30:58 +08:00
|
|
|
auto label = new QLabel(tr("Solution Name"));
|
2022-09-30 18:08:39 +08:00
|
|
|
label->setMinimumWidth(90);
|
|
|
|
label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
hBox->addWidget(label);
|
|
|
|
hBox->addSpacing(6);
|
|
|
|
|
2023-04-18 14:14:46 +08:00
|
|
|
fdName = new QLineEdit;
|
|
|
|
if(name.isEmpty()) name = QDateTime::currentDateTime().toString("yyyyMMddhhmmsszzz");
|
|
|
|
else fdName->setDisabled(true);
|
|
|
|
fdName->setText(name);
|
2022-09-30 18:08:39 +08:00
|
|
|
hBox->addWidget(fdName);
|
|
|
|
|
|
|
|
hBox = new HBox(vBox);
|
|
|
|
hBox->setSpacing(12);
|
|
|
|
|
|
|
|
label = new QLabel(tr("Resolution"));
|
|
|
|
label->setMinimumWidth(90);
|
|
|
|
label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
hBox->addWidget(label);
|
|
|
|
hBox->addSpacing(6);
|
|
|
|
|
|
|
|
auto label_4 = new QLabel(tr("Width"));
|
|
|
|
hBox->addWidget(label_4);
|
|
|
|
|
|
|
|
fdWidth = new QSpinBox;
|
|
|
|
fdWidth->setMaximum(99999);
|
|
|
|
fdWidth->setValue(width);
|
|
|
|
hBox->addWidget(fdWidth);
|
|
|
|
|
|
|
|
auto label_5 = new QLabel(tr("Height"));
|
|
|
|
hBox->addWidget(label_5);
|
|
|
|
|
|
|
|
fdHeight = new QSpinBox;
|
|
|
|
fdHeight->setMaximum(99999);
|
|
|
|
fdHeight->setValue(height);
|
|
|
|
hBox->addWidget(fdHeight);
|
|
|
|
hBox->addStretch();
|
|
|
|
|
|
|
|
hBox = new HBox(vBox);
|
|
|
|
|
|
|
|
label = new QLabel(tr("Remarks"));
|
|
|
|
label->setMinimumWidth(90);
|
|
|
|
label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
hBox->addWidget(label);
|
|
|
|
hBox->addSpacing(6);
|
|
|
|
|
|
|
|
fdRemark = new QTextEdit(remarks);
|
|
|
|
fdRemark->setFixedSize(300, 80);
|
|
|
|
hBox->addWidget(fdRemark);
|
|
|
|
|
|
|
|
hBox = new HBox(vBox);
|
|
|
|
|
2023-04-18 14:14:46 +08:00
|
|
|
auto lbSplitWidth = new QLabel(tr("每段打折宽度 (用空格分隔)"));
|
2022-09-30 18:08:39 +08:00
|
|
|
hBox->addWidget(lbSplitWidth);
|
|
|
|
|
2023-04-18 14:14:46 +08:00
|
|
|
fdSplitWidths = new QLineEdit(widths);
|
|
|
|
fdSplitWidths->setPlaceholderText("256 256 256 ...");
|
|
|
|
hBox->addWidget(fdSplitWidths);
|
|
|
|
if(! gWidthSplit) {
|
|
|
|
lbSplitWidth->setVisible(false);
|
|
|
|
fdSplitWidths->setVisible(false);
|
|
|
|
}
|
2022-09-30 18:08:39 +08:00
|
|
|
|
2023-04-25 16:30:58 +08:00
|
|
|
vBox->addSpacing(6);
|
|
|
|
|
2023-05-15 16:06:10 +08:00
|
|
|
auto btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
|
|
|
connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
|
|
|
connect(btnBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
|
|
|
vBox->addWidget(btnBox);
|
2022-09-30 18:08:39 +08:00
|
|
|
}
|