diff --git a/doorlockd/client/doorlock-client.cpp b/doorlockd/client/doorlock-client.cpp index d8e29f0..33ac2f7 100644 --- a/doorlockd/client/doorlock-client.cpp +++ b/doorlockd/client/doorlock-client.cpp @@ -39,7 +39,18 @@ std::unique_ptr mainWindow = nullptr; static void onDoorlockUpdate(const Clientmessage &msg) { - l("Updated to current token: " + msg.token(), LogLevel::info); + const auto& doormessage = msg.doormessage(); + l("Received message", LogLevel::info); + l((std::string)" token" + msg.token(), + LogLevel::info); + l((std::string)" open: " + std::to_string(doormessage.isOpen), + LogLevel::info); + l((std::string)" button lock: " + std::to_string(doormessage.isLockButton), + LogLevel::info); + l((std::string)" button unlock: " + std::to_string(doormessage.isUnlockButton), + LogLevel::info); + l((std::string)" emergency open: " + std::to_string(doormessage.isEmergencyUnlock), + LogLevel::info); if (mainWindow) { mainWindow->setQRCode(msg.token()); } diff --git a/doorlockd/client/mainwindow.h b/doorlockd/client/mainwindow.h index 0b23cd4..c7388f0 100644 --- a/doorlockd/client/mainwindow.h +++ b/doorlockd/client/mainwindow.h @@ -2,9 +2,9 @@ #define MAINWINDOW_H #include +#include #include #include -#include #include "qrwidget.h" @@ -14,12 +14,9 @@ public: MainWindow() : QMainWindow() { + layout = new QHBoxLayout; + _qrWidget = new QRWidget; - - statusBar()->showMessage(tr("Boofar")); - - QHBoxLayout *layout = new QHBoxLayout; - layout->addWidget(_qrWidget); QWidget* window = new QWidget; @@ -38,6 +35,7 @@ public: private: + QHBoxLayout* layout = { nullptr }; QRWidget* _qrWidget = { nullptr }; };