1.0 finish
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
#include "ui_frmsetting.h"
|
||||
#include <QDebug>
|
||||
|
||||
FrmSetting::FrmSetting(FileConfigDecode* fileConfig, QWidget *parent)
|
||||
FrmSetting::FrmSetting(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::FrmSetting)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->fileConfig = fileConfig;
|
||||
initForm();
|
||||
initWidget();
|
||||
}
|
||||
@@ -43,13 +42,21 @@ void FrmSetting::initForm()
|
||||
|
||||
|
||||
serversetting = new ServerSetting();
|
||||
connect(serversetting, &ServerSetting::signal_updateServerConfig, this, &FrmSetting::slot_updateServerConfig);
|
||||
serversetting->hide();
|
||||
|
||||
QString address = FileConfigDecode::getInstance()->getAddress();
|
||||
QString username = FileConfigDecode::getInstance()->getUserName();
|
||||
QString password = FileConfigDecode::getInstance()->getPassword();
|
||||
|
||||
serversetting->setAddress(address);
|
||||
serversetting->setPassword(password);
|
||||
serversetting->setUserName(username);
|
||||
}
|
||||
|
||||
void FrmSetting::initWidget()
|
||||
{
|
||||
if (fileConfig->getRename()) {
|
||||
if (FileConfigDecode::getInstance()->getRename()) {
|
||||
ui->labRenameOpen->setStyleSheet(OPENQSS);
|
||||
ui->labRenameClose->setStyleSheet(CLOSEQSS);
|
||||
}
|
||||
@@ -57,7 +64,7 @@ void FrmSetting::initWidget()
|
||||
ui->labRenameOpen->setStyleSheet(CLOSEQSS);
|
||||
ui->labRenameClose->setStyleSheet(OPENQSS);
|
||||
}
|
||||
if (fileConfig->getAutoSetup()) {
|
||||
if (FileConfigDecode::getInstance()->getAutoSetup()) {
|
||||
ui->labAutoSetupOpen->setStyleSheet(OPENQSS);
|
||||
ui->labAutoSetupClose->setStyleSheet(CLOSEQSS);
|
||||
}
|
||||
@@ -65,7 +72,7 @@ void FrmSetting::initWidget()
|
||||
ui->labAutoSetupOpen->setStyleSheet(CLOSEQSS);
|
||||
ui->labAutoSetupClose->setStyleSheet(OPENQSS);
|
||||
}
|
||||
if (fileConfig->getTimeRename()) {
|
||||
if (FileConfigDecode::getInstance()->getTimeRename()) {
|
||||
ui->labTimeRenameOpen->setStyleSheet(OPENQSS);
|
||||
ui->labTimeRenameClose->setStyleSheet(CLOSEQSS);
|
||||
}
|
||||
@@ -73,7 +80,7 @@ void FrmSetting::initWidget()
|
||||
ui->labTimeRenameOpen->setStyleSheet(CLOSEQSS);
|
||||
ui->labTimeRenameClose->setStyleSheet(OPENQSS);
|
||||
}
|
||||
if (fileConfig->getAutoCopy()) {
|
||||
if (FileConfigDecode::getInstance()->getAutoCopy()) {
|
||||
ui->labEnableSsl->setStyleSheet(OPENQSS);
|
||||
ui->labEnableSsl->setStyleSheet(CLOSEQSS);
|
||||
}
|
||||
@@ -82,10 +89,10 @@ void FrmSetting::initWidget()
|
||||
ui->labEnableSsl->setStyleSheet(OPENQSS);
|
||||
}
|
||||
|
||||
ui->schRename->setChecked(fileConfig->getRename());
|
||||
ui->schAutoSetup->setChecked(fileConfig->getAutoSetup());
|
||||
ui->schTimeRename->setChecked(fileConfig->getTimeRename());
|
||||
ui->schEnableSsl->setChecked(fileConfig->getAutoCopy());
|
||||
ui->schRename->setChecked(FileConfigDecode::getInstance()->getRename());
|
||||
ui->schAutoSetup->setChecked(FileConfigDecode::getInstance()->getAutoSetup());
|
||||
ui->schTimeRename->setChecked(FileConfigDecode::getInstance()->getTimeRename());
|
||||
ui->schEnableSsl->setChecked(FileConfigDecode::getInstance()->getAutoCopy());
|
||||
|
||||
connect(ui->schRename, &SwitchButton::checkedChanged, this, &FrmSetting::schRenameSlot);
|
||||
connect(ui->schAutoSetup, &SwitchButton::checkedChanged, this, &FrmSetting::schAutoSetup);
|
||||
@@ -97,28 +104,31 @@ void FrmSetting::initWidget()
|
||||
|
||||
void FrmSetting::schRenameSlot(bool checked)
|
||||
{
|
||||
fileConfig->setRename(checked);
|
||||
FileConfigDecode::getInstance()->setRename(checked);
|
||||
ui->labRenameOpen->setStyleSheet(checked?OPENQSS:CLOSEQSS);
|
||||
ui->labRenameClose->setStyleSheet(checked?CLOSEQSS:OPENQSS);
|
||||
}
|
||||
|
||||
void FrmSetting::schAutoSetup(bool checked)
|
||||
{
|
||||
fileConfig->setAutoSetup(checked);
|
||||
FileConfigDecode::getInstance()->setAutoSetup(checked);
|
||||
ui->labAutoSetupOpen->setStyleSheet(checked?OPENQSS:CLOSEQSS);
|
||||
ui->labAutoSetupClose->setStyleSheet(checked?CLOSEQSS:OPENQSS);
|
||||
}
|
||||
|
||||
void FrmSetting::schTimeRename(bool checked)
|
||||
{
|
||||
fileConfig->setTimeRename(checked);
|
||||
if (ui->schRename->getChecked())
|
||||
FileConfigDecode::getInstance()->setTimeRename(checked, 1);
|
||||
else
|
||||
FileConfigDecode::getInstance()->setTimeRename(checked, 0);
|
||||
ui->labTimeRenameOpen->setStyleSheet(checked?OPENQSS:CLOSEQSS);
|
||||
ui->labTimeRenameClose->setStyleSheet(checked?CLOSEQSS:OPENQSS);
|
||||
}
|
||||
|
||||
void FrmSetting::schEnableSsl(bool checked)
|
||||
{
|
||||
fileConfig->setAutoCopy(checked);
|
||||
FileConfigDecode::getInstance()->setAutoCopy(checked);
|
||||
ui->labEnableSslOpen->setStyleSheet(checked?OPENQSS:CLOSEQSS);
|
||||
ui->labEnableSslClose->setStyleSheet(checked?CLOSEQSS:OPENQSS);
|
||||
|
||||
@@ -126,5 +136,12 @@ void FrmSetting::schEnableSsl(bool checked)
|
||||
|
||||
}
|
||||
|
||||
void FrmSetting::slot_updateServerConfig(QString address, QString username, QString password)
|
||||
{
|
||||
FileConfigDecode::getInstance()->setAddress(address);
|
||||
FileConfigDecode::getInstance()->setUserName(username);
|
||||
FileConfigDecode::getInstance()->setPassword(password);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class FrmSetting : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FrmSetting(FileConfigDecode* fileConfig, QWidget *parent = nullptr);
|
||||
explicit FrmSetting(QWidget *parent = nullptr);
|
||||
~FrmSetting();
|
||||
|
||||
private:
|
||||
@@ -38,9 +38,11 @@ private slots:
|
||||
void schTimeRename(bool checked);
|
||||
void schEnableSsl(bool checked);
|
||||
|
||||
void slot_updateServerConfig(QString address, QString username, QString password);
|
||||
|
||||
private:
|
||||
Ui::FrmSetting *ui;
|
||||
FileConfigDecode* fileConfig = nullptr;
|
||||
// FileConfigDecode* fileConfig = nullptr;
|
||||
ServerSetting* serversetting;
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -47,7 +47,7 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>35</height>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -66,7 +66,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -82,7 +82,7 @@
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -115,8 +115,8 @@
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>30</height>
|
||||
<width>100</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -139,7 +139,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -155,7 +155,7 @@
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -188,8 +188,8 @@
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>30</height>
|
||||
<width>100</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -212,7 +212,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -228,7 +228,7 @@
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -261,8 +261,8 @@
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>30</height>
|
||||
<width>100</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -285,7 +285,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -293,6 +293,9 @@
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="labEnableSsl">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开启SSL</string>
|
||||
</property>
|
||||
@@ -301,7 +304,7 @@
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -334,8 +337,8 @@
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>30</height>
|
||||
<width>100</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user