-
Notifications
You must be signed in to change notification settings - Fork 13
/
sessiondialog.h
62 lines (47 loc) · 1.07 KB
/
sessiondialog.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef SESSIONDIALOG_H
#define SESSIONDIALOG_H
#include <QDialog>
#include <string>
#include <vector>
using namespace std;
// Types.
enum LoginType {
LOGIN_TYPE_ANONYMOUS = 0,
LOGIN_TYPE_PASSWORD,
LOGIN_TYPE_CERTIFICATE
};
struct Session {
string mqttHost;
quint16 mqttPort;
LoginType loginType;
string username;
string password;
string caFile;
string certFile;
string keyFile;
//vector<string> topics;
};
namespace Ui {
class SessionDialog;
}
class SessionDialog : public QDialog {
Q_OBJECT
public:
explicit SessionDialog(QWidget *parent = 0);
~SessionDialog();
signals:
void updatedSession(Session s, bool newSession);
private slots:
void okButton();
void cancelButton();
void browseCa();
void browseCert();
void browseKey();
public slots:
void setNewSession(bool newSession = false);
void setSessionData(Session s);
private:
Ui::SessionDialog *ui;
bool newSession;
};
#endif // SESSIONDIALOG_H