diff --git a/doorlockd/client/doorlock-client.cpp b/doorlockd/client/doorlock-client.cpp index 28d3283..b245584 100644 --- a/doorlockd/client/doorlock-client.cpp +++ b/doorlockd/client/doorlock-client.cpp @@ -55,7 +55,7 @@ static void onDoorlockUpdate(const Clientmessage &msg) l((std::string)" emergency open: " + std::to_string(doormessage.isEmergencyUnlock), LogLevel::info); if (mainWindow) { - mainWindow->setQRCode(msg.token()); + mainWindow->setClientmessage(msg); } } diff --git a/doorlockd/client/mainwindow.cpp b/doorlockd/client/mainwindow.cpp index 8b45670..54b6b13 100644 --- a/doorlockd/client/mainwindow.cpp +++ b/doorlockd/client/mainwindow.cpp @@ -13,7 +13,8 @@ MainWindow::~MainWindow() delete ui; } -void MainWindow::setQRCode(const std::string &token) +void MainWindow::setClientmessage(const Clientmessage &msg) { - ui->qrwidget->setQRData(token); + ui->qrwidget->setQRData(msg.token()); + ui->tokenLabel->setText(QString::fromStdString(msg.token())); } diff --git a/doorlockd/client/mainwindow.h b/doorlockd/client/mainwindow.h index 1d36b8f..c9d9ac7 100644 --- a/doorlockd/client/mainwindow.h +++ b/doorlockd/client/mainwindow.h @@ -2,6 +2,7 @@ #define MAINWINDOW_H #include +#include "../lib/clientmessage.h" namespace Ui { class MainWindow; @@ -19,7 +20,7 @@ public: ~MainWindow(); - void setQRCode(const std::string &token); + void setClientmessage(const Clientmessage &msg); private: Ui::MainWindow *ui; diff --git a/doorlockd/client/mainwindow.ui b/doorlockd/client/mainwindow.ui index 34d78cd..1943861 100644 --- a/doorlockd/client/mainwindow.ui +++ b/doorlockd/client/mainwindow.ui @@ -6,7 +6,7 @@ 0 0 - 800 + 1104 400 @@ -17,11 +17,64 @@ - - - true - - + + + + + + + + + 36 + + + + Hallo! QR Code scannen, einloggen und eintreten! + + + + + + + Qt::Horizontal + + + + + + + QLayout::SetDefaultConstraint + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + 22 + + + + + + + + + + + + 22 + + + + Aktueller Token: + + + + + +