1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 02:14:26 +01:00

Some improvements

This commit is contained in:
Ralf Ramsauer 2015-09-29 14:55:20 +02:00
parent 60ed23486b
commit b1ea4426a9
2 changed files with 16 additions and 7 deletions

View File

@ -39,7 +39,18 @@ std::unique_ptr<MainWindow> 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());
}

View File

@ -2,9 +2,9 @@
#define MAINWINDOW_H
#include <QApplication>
#include <QHBoxLayout>
#include <QMainWindow>
#include <QStatusBar>
#include <QHBoxLayout>
#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 };
};