diff --git a/doorlockd/client/mainwindow.cpp b/doorlockd/client/mainwindow.cpp
index 6f041e7..0f66aae 100644
--- a/doorlockd/client/mainwindow.cpp
+++ b/doorlockd/client/mainwindow.cpp
@@ -26,6 +26,7 @@ void MainWindow::setClientmessage(const Clientmessage &msg)
{
ui->qrwidget->setQRData(msg.token());
ui->tokenLabel->setText(QString::fromStdString(msg.token()));
+ QString statusMessage("");
const auto &doormsg = msg.doormessage();
@@ -34,9 +35,12 @@ void MainWindow::setClientmessage(const Clientmessage &msg)
if (_oldMessage.isOpen()
&& !msg.isOpen()
&& !doormsg.isLockButton) {
+ // regular close
+ statusMessage = "Bye bye. See you next time!";
_soundLock.playAsync();
} else if (!_oldMessage.isOpen() && msg.isOpen()) {
// regular open
+ statusMessage = "Come in! Happy hacking!";
_soundUnlock.playAsync();
} else {
// no change
@@ -44,9 +48,12 @@ void MainWindow::setClientmessage(const Clientmessage &msg)
if (doormsg.isEmergencyUnlock) {
_soundEmergencyUnlock.playAsync();
+ statusMessage = "!! EMERGENCY UNLOCK !!";
} else if (doormsg.isLockButton) {
_soundLockButton.playAsync();
+ statusMessage = "!! LOCK BUTTON !!";
} else if (doormsg.isUnlockButton) {
+ statusMessage = "!! UNLOCK BUTTON !!";
if (msg.isOpen()) {
_soundZonk.playAsync();
} else {
@@ -54,6 +61,8 @@ void MainWindow::setClientmessage(const Clientmessage &msg)
}
}
+ ui->message->setText(statusMessage);
+
_oldMessage = msg;
}
diff --git a/doorlockd/client/mainwindow.ui b/doorlockd/client/mainwindow.ui
index bf281a8..681148f 100644
--- a/doorlockd/client/mainwindow.ui
+++ b/doorlockd/client/mainwindow.ui
@@ -73,6 +73,31 @@
+ -
+
+
+
+ 28
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
-