1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 18:34:25 +01:00
doorlockd-mirror/doorlockd/client/mainwindow.h
Ralf Ramsauer d1d0d5b160 Fix QT quirk
So far, we used QT interfaces in a wrong way. QT is not thread safe, so
use its signal/slot concept and move network communication stuff to a
separate QThread.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2016-07-31 15:48:19 +02:00

47 lines
886 B
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QWidget>
#include "../lib/clientmessage.h"
#include "../lib/logger.h"
#include "wave.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QWidget
{
Q_OBJECT
public:
explicit MainWindow(const std::string &hostname,
const unsigned short port,
QWidget *parent = 0);
MainWindow(const MainWindow &rhs);
MainWindow &operator =(const MainWindow &rhs);
~MainWindow();
public slots:
void setClientmessage(const Clientmessage &msg);
private:
Ui::MainWindow *ui;
Clientmessage _oldMessage = { };
const Wave _soundLock;
const Wave _soundUnlock;
const Wave _soundEmergencyUnlock;
const Wave _soundZonk;
const Wave _soundLockButton;
const Wave _soundUnlockButton;
void _LED(const bool on);
};
#endif // MAINWINDOW_H