mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-11-01 06:57:04 +01:00
d1d0d5b160
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>
47 lines
886 B
C++
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
|