-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnectionsdialog.h
64 lines (41 loc) · 1.12 KB
/
connectionsdialog.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
63
64
#ifndef CONNECTIONSDIALOG_H
#define CONNECTIONSDIALOG_H
#include "sqlconnection.h"
#include <QDialog>
#include <QListWidgetItem>
#include <QSettings>
#include <QStandardItemModel>
#include <QString>
namespace Ui {
class ConnectionsDialog;
}
struct ConnectionValid {
bool status;
QString message;
};
class ConnectionsDialog : public QDialog
{
Q_OBJECT
public:
explicit ConnectionsDialog(QWidget *parent = nullptr);
~ConnectionsDialog();
CurrentConnection currentConnection;
private slots:
void on_Button_Connect_clicked();
void on_Button_Remove_clicked();
void on_Button_Save_clicked();
void on_Button_Add_clicked();
void on_Button_Test_clicked();
void on_List_Connections_doubleClicked(const QModelIndex &index);
void on_List_Connections_clicked(const QModelIndex &index);
private:
QStandardItemModel *connectionsModel;
Ui::ConnectionsDialog *ui;
QSettings settings;
void ConnectDatabase();
ConnectionValid CheckConnection();
bool CheckConnectionInputs();
void ClearForm();
void ResfreshConnectionsList();
};
#endif // CONNECTIONSDIALOG_H