Panel circle for visual feedback

This commit is contained in:
Jon ESA
2026-04-01 22:08:46 +01:00
parent d75c80ef03
commit 81e8cf74c4
6 changed files with 305 additions and 285 deletions

View File

@@ -1,14 +1,16 @@
#pragma once
#include <QObject>
#include <QString>
#include <QStringList>
#include <QWebSocket>
class GamesPanel;
class LogPanel;
class PanelsPanel;
class PowerPanel;
class QLabel;
class QLineEdit;
class QTextEdit;
class GamesPanel;
class LogPanel;
class PowerPanel;
class SettingsTree;
class VersionsPanel;
@@ -16,43 +18,48 @@ class WebSocketController : public QObject
{
Q_OBJECT
public:
explicit WebSocketController(QLineEdit *urlEdit,
QLabel *statusLabel,
QObject *parent = nullptr);
explicit WebSocketController(QLineEdit *urlEdit, QLabel *statusLabel,
QObject *parent = nullptr);
QWebSocket *socket();
bool isConnected() const;
void addLogView(QTextEdit *log);
void setSettingsTree(SettingsTree *tree);
void setGamesPanel(GamesPanel *panel);
void setVersionsPanel(VersionsPanel *panel);
void setPowerPanel(PowerPanel *panel);
void setLogPanel(LogPanel *panel);
bool isConnected() const;
void setPanelsPanel(PanelsPanel *panel);
public slots:
void startConnection();
void closeConnection();
void sendCommand(const QString &cmd);
void onConnected();
void onDisconnected();
void onTextMessageReceived(const QString &msg);
void onTextMessageReceived(const QString &message);
void onErrorOccurred(QAbstractSocket::SocketError error);
private slots:
void onValueEdited(const QString &key, const QString &newValue);
private:
void handleProtocol(const QString &msg);
void broadcast(const QString &line);
QLineEdit *m_urlEdit = nullptr;
QLabel *m_statusLabel = nullptr;
QWebSocket m_socket;
QList<QTextEdit *> m_logs;
QWebSocket m_socket;
QLineEdit *m_urlEdit = nullptr;
QLabel *m_statusLabel = nullptr;
QList<QTextEdit*> m_logs;
SettingsTree *m_settingsTree = nullptr;
GamesPanel *m_gamesPanel = nullptr;
VersionsPanel *m_versionsPanel = nullptr;
PowerPanel *m_powerPanel = nullptr;
LogPanel *m_logPanel = nullptr;
QStringList m_settingsKeys;
int m_rnpCount = -1;
LogPanel *m_logPanel = nullptr;
PanelsPanel *m_panelsPanel = nullptr;
QStringList m_settingsKeys;
int m_rnpCount = -1;
};