1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 18:34:25 +01:00

Improved GUI

This commit is contained in:
Ralf Ramsauer 2015-10-02 19:39:47 +02:00
parent b27196d1cc
commit 7874dafd3a
4 changed files with 65 additions and 10 deletions

View File

@ -55,7 +55,7 @@ static void onDoorlockUpdate(const Clientmessage &msg)
l((std::string)" emergency open: " + std::to_string(doormessage.isEmergencyUnlock), l((std::string)" emergency open: " + std::to_string(doormessage.isEmergencyUnlock),
LogLevel::info); LogLevel::info);
if (mainWindow) { if (mainWindow) {
mainWindow->setQRCode(msg.token()); mainWindow->setClientmessage(msg);
} }
} }

View File

@ -13,7 +13,8 @@ MainWindow::~MainWindow()
delete ui; 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()));
} }

View File

@ -2,6 +2,7 @@
#define MAINWINDOW_H #define MAINWINDOW_H
#include <QWidget> #include <QWidget>
#include "../lib/clientmessage.h"
namespace Ui { namespace Ui {
class MainWindow; class MainWindow;
@ -19,7 +20,7 @@ public:
~MainWindow(); ~MainWindow();
void setQRCode(const std::string &token); void setClientmessage(const Clientmessage &msg);
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>1104</width>
<height>400</height> <height>400</height>
</rect> </rect>
</property> </property>
@ -17,12 +17,65 @@
<item row="0" column="0"> <item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QRWidget" name="qrwidget" native="true"> <widget class="QRWidget" name="qrwidget" native="true"/>
<property name="enabled"> </item>
<bool>true</bool> <item>
<layout class="QVBoxLayout" name="verticalLayout">
<item alignment="Qt::AlignTop">
<widget class="QLabel" name="welcomeLabel">
<property name="font">
<font>
<pointsize>36</pointsize>
</font>
</property>
<property name="text">
<string>Hallo! QR Code scannen, einloggen und eintreten!</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="labelAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<item row="0" column="1">
<widget class="QLabel" name="tokenLabel">
<property name="font">
<font>
<pointsize>22</pointsize>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>22</pointsize>
</font>
</property>
<property name="text">
<string>Aktueller Token:</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>