mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-12-22 10:24:26 +01:00
Improved GUI
This commit is contained in:
parent
99ddc88c6b
commit
9ac1e22af3
@ -9,8 +9,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
_greenLED(false);
|
_LED(false);
|
||||||
_redLED(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
@ -23,27 +22,13 @@ void MainWindow::setClientmessage(const Clientmessage &msg)
|
|||||||
ui->qrwidget->setQRData(msg.token());
|
ui->qrwidget->setQRData(msg.token());
|
||||||
ui->tokenLabel->setText(QString::fromStdString(msg.token()));
|
ui->tokenLabel->setText(QString::fromStdString(msg.token()));
|
||||||
|
|
||||||
if (msg.isOpen()) {
|
_LED(msg.isOpen());
|
||||||
_greenLED(true);
|
|
||||||
_redLED(false);
|
|
||||||
} else {
|
|
||||||
_greenLED(false);
|
|
||||||
_redLED(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::_greenLED(const bool on)
|
void MainWindow::_LED(const bool on)
|
||||||
{
|
{
|
||||||
if (on)
|
if (on)
|
||||||
ui->greenLED->setPixmap(QPixmap(IMAGE_LOCATION "led-green-on.png"));
|
ui->LED->setPixmap(QPixmap(IMAGE_LOCATION "led-green.png"));
|
||||||
else
|
else
|
||||||
ui->greenLED->setPixmap(QPixmap(IMAGE_LOCATION "led-green-off.png"));
|
ui->LED->setPixmap(QPixmap(IMAGE_LOCATION "led-red.png"));
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::_redLED(const bool on)
|
|
||||||
{
|
|
||||||
if (on)
|
|
||||||
ui->redLED->setPixmap(QPixmap(IMAGE_LOCATION "led-red-on.png"));
|
|
||||||
else
|
|
||||||
ui->redLED->setPixmap(QPixmap(IMAGE_LOCATION "led-red-off.png"));
|
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
|
|
||||||
void _greenLED(const bool on);
|
void _LED(const bool on);
|
||||||
void _redLED(const bool on);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
@ -52,21 +52,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item alignment="Qt::AlignHCenter">
|
<item alignment="Qt::AlignHCenter">
|
||||||
<widget class="QLabel" name="greenLED">
|
<widget class="QLabel" name="LED">
|
||||||
<property name="text">
|
|
||||||
<string>TextLabel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item alignment="Qt::AlignHCenter">
|
|
||||||
<widget class="QLabel" name="redLED">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>TextLabel</string>
|
<string>TextLabel</string>
|
||||||
</property>
|
</property>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue
Block a user