// 桌面列表页 // // 登录成功后展示当前用户可用的云桌面卡片; // 选择桌面后由 MainWindow 获取连接票据并启动对应协议会话; // 会话退出后返回本页。 #ifndef KIOSK_SHELL_DESKTOP_LIST_PAGE_H #define KIOSK_SHELL_DESKTOP_LIST_PAGE_H #include #include #include "desktop_session.h" class QLabel; class QPushButton; class QVBoxLayout; namespace vdi { class DesktopListPage : public QWidget { Q_OBJECT public: explicit DesktopListPage(QWidget* parent = nullptr); // 用桌面数据刷新卡片 void setDesktops(const std::vector& desktops); void setStatus(const QString& text, bool error = false); void setBusy(bool busy); QString currentUser() const; void setCurrentUser(const QString& user); signals: // 用户点击一张可用桌面卡片 void desktopSelected(const QString& desktopId); // 用户点击某张卡片的“设置”按钮 void editRequested(const QString& desktopId); private: void rebuildCards(); std::vector desktops_; QString currentUser_; QLabel* labelUser_ = nullptr; QLabel* labelStatus_ = nullptr; QVBoxLayout* cardsLayout_ = nullptr; std::vector actionButtons_; bool busy_ = false; }; } // namespace vdi #endif // KIOSK_SHELL_DESKTOP_LIST_PAGE_H