| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- /**
- * @file settings_dialog.h
- * @brief 设置对话框 - 应用程序设置界面
- *
- * 功能:
- * - 守护进程模式设置
- * - 其他应用程序设置
- */
- #ifndef SETTINGS_DIALOG_H
- #define SETTINGS_DIALOG_H
- #include <QDialog>
- class QCheckBox;
- class QLabel;
- class QPushButton;
- class QVBoxLayout;
- class QHBoxLayout;
- class QGroupBox;
- class DaemonClient;
- /**
- * @brief 设置对话框
- */
- class SettingsDialog : public QDialog
- {
- Q_OBJECT
- public:
- explicit SettingsDialog(QWidget *parent = nullptr);
- ~SettingsDialog();
- /**
- * @brief 获取是否使用守护进程模式
- */
- bool useDaemonMode() const;
- /**
- * @brief 设置是否使用守护进程模式
- */
- void setUseDaemonMode(bool use);
- /**
- * @brief 设置守护进程客户端(用于检查守护进程状态)
- */
- void setDaemonClient(DaemonClient* daemonClient);
- /**
- * @brief 加载设置
- */
- void loadSettings();
- /**
- * @brief 保存设置
- */
- void saveSettings();
- private slots:
- void onApply();
- void onOk();
- void onCancel();
- void onDaemonModeChanged(bool enabled);
- private:
- void createUI();
- void updateDaemonStatus();
- // UI 组件
- QGroupBox *m_daemonGroupBox;
- QCheckBox *m_useDaemonCheckBox;
- QLabel *m_daemonStatusLabel;
- QLabel *m_daemonInfoLabel;
-
- QPushButton *m_applyButton;
- QPushButton *m_okButton;
- QPushButton *m_cancelButton;
-
- QVBoxLayout *m_mainLayout;
- QHBoxLayout *m_buttonLayout;
-
- // 设置值
- bool m_useDaemonMode;
-
- // 守护进程客户端(用于检查状态)
- DaemonClient* m_daemonClient;
- };
- #endif // SETTINGS_DIALOG_H
|