mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-12-22 10:24:26 +01:00
Some improvements
This commit is contained in:
parent
60ed23486b
commit
b1ea4426a9
@ -39,7 +39,18 @@ std::unique_ptr<MainWindow> mainWindow = nullptr;
|
|||||||
|
|
||||||
static void onDoorlockUpdate(const Clientmessage &msg)
|
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) {
|
if (mainWindow) {
|
||||||
mainWindow->setQRCode(msg.token());
|
mainWindow->setQRCode(msg.token());
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QHBoxLayout>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
#include <QHBoxLayout>
|
|
||||||
|
|
||||||
#include "qrwidget.h"
|
#include "qrwidget.h"
|
||||||
|
|
||||||
@ -14,12 +14,9 @@ public:
|
|||||||
MainWindow() :
|
MainWindow() :
|
||||||
QMainWindow()
|
QMainWindow()
|
||||||
{
|
{
|
||||||
|
layout = new QHBoxLayout;
|
||||||
|
|
||||||
_qrWidget = new QRWidget;
|
_qrWidget = new QRWidget;
|
||||||
|
|
||||||
statusBar()->showMessage(tr("Boofar"));
|
|
||||||
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout;
|
|
||||||
|
|
||||||
layout->addWidget(_qrWidget);
|
layout->addWidget(_qrWidget);
|
||||||
|
|
||||||
QWidget* window = new QWidget;
|
QWidget* window = new QWidget;
|
||||||
@ -38,6 +35,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
QHBoxLayout* layout = { nullptr };
|
||||||
QRWidget* _qrWidget = { nullptr };
|
QRWidget* _qrWidget = { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user