1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 02:14:26 +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),
LogLevel::info);
if (mainWindow) {
mainWindow->setQRCode(msg.token());
mainWindow->setClientmessage(msg);
}
}

View File

@ -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()));
}

View File

@ -2,6 +2,7 @@
#define MAINWINDOW_H
#include <QWidget>
#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;

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>1104</width>
<height>400</height>
</rect>
</property>
@ -17,11 +17,64 @@
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRWidget" name="qrwidget" native="true">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
<widget class="QRWidget" name="qrwidget" native="true"/>
</item>
<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>
</widget>
</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>
</item>