-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain_window.h
46 lines (31 loc) · 901 Bytes
/
main_window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
#include "i2pcontrol_client.h"
#include <unordered_map>
#include <vector>
#include <QMainWindow>
#include <QTimer>
namespace Ui {
class MainWindow;
}
typedef std::function<void(const QJsonValue&)> RIListener;
constexpr int DEFAULT_REFRESH_INTERVAL = 5000;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
void registerRIListener(const std::string& param, RIListener listener);
void sendAction(const std::string& action, std::function<void(bool)> callback);
void setRefreshSpeed(int miliseconds);
~MainWindow();
private slots:
void updateRI();
private:
Ui::MainWindow *ui;
I2PControlClient itoopie;
std::vector<std::string> infoParameters;
std::unordered_multimap<std::string, RIListener> infoListeners;
QTimer timer;
};
#endif // MAIN_WINDOW_H