变更详情:feat(kiosk-shell): 首版登录页与状态机骨架 按《VDI 云桌面软件开发方案》3.2 节实现: - 状态机 BOOT/CONFIG/CONNECTING/SESSION/RECONNECT/ERROR - 首配页(SN 绑定、服务器地址、账号、密码、显示档位) - 全局热键 Ctrl+Alt+Shift+M 呼出管理菜单 - FreeRDP 3 以 libfreerdp3 API 内嵌,非拉起外部进程
69 lines
1.6 KiB
C++
69 lines
1.6 KiB
C++
// 首配 / 登录页
|
||
//
|
||
// 对应《VDI 云桌面软件开发方案》3.2 节:
|
||
// 首配页(无配置时进入)——SN 绑定、WiFi 扫码、服务器地址
|
||
// 状态条——网络 / 会话状态
|
||
|
||
#ifndef KIOSK_SHELL_LOGIN_PAGE_H
|
||
#define KIOSK_SHELL_LOGIN_PAGE_H
|
||
|
||
#include <QWidget>
|
||
#include <functional>
|
||
|
||
#include "config.h"
|
||
|
||
class QLineEdit;
|
||
class QComboBox;
|
||
class QCheckBox;
|
||
class QLabel;
|
||
class QPushButton;
|
||
class QGridLayout;
|
||
class QVBoxLayout;
|
||
|
||
namespace vdi {
|
||
|
||
class LoginPage : public QWidget {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
using ConnectHandler = std::function<void(const TerminalConfig&)>;
|
||
|
||
explicit LoginPage(const TerminalConfig& initial, QWidget* parent = nullptr);
|
||
|
||
void setConnectHandler(ConnectHandler handler);
|
||
void setStatus(const QString& text, bool error = false);
|
||
void setBusy(bool busy);
|
||
|
||
// 供外部回填
|
||
TerminalConfig currentConfig() const;
|
||
|
||
signals:
|
||
void connectRequested(const vdi::TerminalConfig& cfg);
|
||
void quitRequested();
|
||
|
||
private slots:
|
||
void onConnectClicked();
|
||
void onResolutionChanged(int index);
|
||
|
||
private:
|
||
TerminalConfig cfg_;
|
||
ConnectHandler connectHandler_;
|
||
|
||
QLineEdit* editServer_ = nullptr;
|
||
QLineEdit* editUser_ = nullptr;
|
||
QLineEdit* editPassword_ = nullptr;
|
||
QComboBox* comboResolution_ = nullptr;
|
||
QCheckBox* checkRemember_ = nullptr;
|
||
QLabel* labelStatus_ = nullptr;
|
||
QLabel* labelSn_ = nullptr;
|
||
QLabel* labelNetwork_ = nullptr;
|
||
QPushButton* buttonConnect_ = nullptr;
|
||
QPushButton* buttonQuit_ = nullptr;
|
||
};
|
||
|
||
} // namespace vdi
|
||
|
||
Q_DECLARE_METATYPE(vdi::TerminalConfig)
|
||
|
||
#endif // KIOSK_SHELL_LOGIN_PAGE_H
|