Added ability to test the connection in the dialog where the connection details are entered.

This commit is contained in:
eelke 2021-07-04 16:45:50 +02:00
parent 45795333f2
commit c00a0452d1
7 changed files with 201 additions and 43 deletions

View file

@ -3,19 +3,24 @@
#include <QWidget>
#include <QUuid>
#include <QFutureWatcher>
#include <tuple>
#include "TestConnection.h"
class ConnectionController;
class ConnectionConfig;
class QCheckBox;
class QComboBox;
class QDataWidgetMapper;
class QFormLayout;
class QLabel;
class QLineEdit;
class QPushButton;
class QSpinBox;
class QComboBox;
class QDataWidgetMapper;
class ConnectionTreeModel;
class ConnectionConfigurationWidget : public QWidget
{
Q_OBJECT
@ -26,11 +31,15 @@ public:
void retranslateUi();
void setData(const ConnectionConfig &cfg);
std::tuple<QString, ConnectionConfig> data() const;
ConnectionConfig data() const;
QString group() const;
signals:
public slots:
void testConnection();
private:
ConnectionTreeModel *m_connectionModel;
ConnectionTreeModel *m_connectionModel;
QUuid m_uuid;
@ -44,8 +53,11 @@ private:
QSpinBox *spinPort;
QLabel *lblUser;
QLineEdit *edtUser;
QLabel *lblDbName;
QLineEdit *edtDbname;
QLabel *lblPassword;
QLineEdit *edtPassword;
QCheckBox *cbSavePassword;
QLabel *lblDbName;
QComboBox *cmbDbname;
QLabel *lblSsl;
QComboBox *cmbbxSsl;
QLabel *lblCert;
@ -56,9 +68,14 @@ private:
QLineEdit *edtRootCert;
QLabel *lblCrl;
QLineEdit *edtCrl;
QFormLayout *formLayout;
public slots:
QPushButton *btnTest;
QLabel *lblResult;
QFormLayout *formLayout;
QFutureWatcher<TestConnectionResult> TestWatcher;
private slots:
void handleTestResult();
};