75 lines
1.9 KiB
C++
75 lines
1.9 KiB
C++
#pragma once
|
|||
|
|
|
||
|
|
#include <QDialog>
|
||
|
|
|
||
|
|
class QComboBox;
|
||
|
|
class QCheckBox;
|
||
|
|
class QDoubleSpinBox;
|
||
|
|
class QLabel;
|
||
|
|
class QLineEdit;
|
||
|
|
class QProgressBar;
|
||
|
|
class QPushButton;
|
||
|
|
class QSlider;
|
||
|
|
class QSpinBox;
|
||
|
|
class QTableWidget;
|
||
|
|
|
||
|
|
namespace lc {
|
||
|
|
|
||
|
|
namespace models { class ModelDownloader; }
|
||
|
|
|
||
|
|
// 设置对话框:模型管理(下载/删除/选择)、显示、窗口、下载源与代理、高级。
|
||
|
|
// GUI 用户完全靠它驱动,不再需要命令行参数。
|
||
|
|
class SettingsDialog : public QDialog {
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
public:
|
||
|
|
explicit SettingsDialog(bool firstRun, QWidget * parent = nullptr);
|
||
|
|
~SettingsDialog() override;
|
||
|
|
|
||
|
|
Q_SIGNALS:
|
||
|
|
// 设置已变更且用户点了确定
|
||
|
|
void settingsApplied();
|
||
|
|
|
||
|
|
private:
|
||
|
|
QWidget * buildModelPage();
|
||
|
|
QWidget * buildDisplayPage();
|
||
|
|
QWidget * buildAdvancedPage();
|
||
|
|
|
||
|
|
void refreshModelTable();
|
||
|
|
void refreshActiveCombo();
|
||
|
|
void onDownload();
|
||
|
|
void onDelete();
|
||
|
|
void onOpenDir();
|
||
|
|
void onApply();
|
||
|
|
bool ensureModelSelected();
|
||
|
|
|
||
|
|
QTableWidget * table_ = nullptr;
|
||
|
|
QComboBox * activeCombo_ = nullptr;
|
||
|
|
QComboBox * languageCombo_ = nullptr;
|
||
|
|
QPushButton * downloadBtn_ = nullptr;
|
||
|
|
QPushButton * deleteBtn_ = nullptr;
|
||
|
|
QProgressBar * progress_ = nullptr;
|
||
|
|
QLabel * statusLabel_ = nullptr;
|
||
|
|
|
||
|
|
QLineEdit * mirrorEdit_ = nullptr;
|
||
|
|
QComboBox * proxyCombo_ = nullptr;
|
||
|
|
QLineEdit * proxyHost_ = nullptr;
|
||
|
|
QSpinBox * proxyPort_ = nullptr;
|
||
|
|
QLineEdit * proxyUser_ = nullptr;
|
||
|
|
QLineEdit * proxyPass_ = nullptr;
|
||
|
|
|
||
|
|
QSpinBox * fontSpin_ = nullptr;
|
||
|
|
QCheckBox * showTailCheck_ = nullptr;
|
||
|
|
QSpinBox * collapsedSpin_ = nullptr;
|
||
|
|
QSpinBox * expandedSpin_ = nullptr;
|
||
|
|
QSlider * opacitySlider_ = nullptr;
|
||
|
|
QLabel * opacityLabel_ = nullptr;
|
||
|
|
|
||
|
|
QDoubleSpinBox * chunkSpin_ = nullptr;
|
||
|
|
QSpinBox * threadsSpin_ = nullptr;
|
||
|
|
|
||
|
|
models::ModelDownloader * downloader_ = nullptr;
|
||
|
|
bool firstRun_ = false;
|
||
|
|
};
|
||
|
|
|
||
|
|
} // namespace lc
|