83 lines
1.7 KiB
C++
83 lines
1.7 KiB
C++
#ifndef CONNECTIONCONFIGURATIONWIDGET_H
|
|
#define CONNECTIONCONFIGURATIONWIDGET_H
|
|
|
|
#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 ConnectionTreeModel;
|
|
|
|
|
|
class ConnectionConfigurationWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
static void editExistingInWindow(ConnectionController *ctrl, const ConnectionConfig &cfg);
|
|
|
|
explicit ConnectionConfigurationWidget(ConnectionTreeModel *connection_model, QWidget *parent = nullptr);
|
|
|
|
void retranslateUi();
|
|
void setData(const ConnectionConfig &cfg);
|
|
ConnectionConfig data() const;
|
|
QString group() const;
|
|
signals:
|
|
|
|
public slots:
|
|
void testConnection();
|
|
|
|
private:
|
|
ConnectionTreeModel *m_connectionModel;
|
|
|
|
QUuid m_uuid;
|
|
|
|
QLabel *lblGroup;
|
|
QComboBox *cmbbxGroup;
|
|
QLabel *lblName;
|
|
QLineEdit *edtName;
|
|
QLabel *lblHost;
|
|
QLineEdit *edtHost;
|
|
QLabel *lblPort;
|
|
QSpinBox *spinPort;
|
|
QLabel *lblUser;
|
|
QLineEdit *edtUser;
|
|
QLabel *lblPassword;
|
|
QLineEdit *edtPassword;
|
|
QCheckBox *cbSavePassword;
|
|
QLabel *lblDbName;
|
|
QComboBox *cmbDbname;
|
|
QLabel *lblSsl;
|
|
QComboBox *cmbbxSsl;
|
|
QLabel *lblCert;
|
|
QLineEdit *edtCert;
|
|
QLabel *lblKey;
|
|
QLineEdit *edtKey;
|
|
QLabel *lblRootCert;
|
|
QLineEdit *edtRootCert;
|
|
QLabel *lblCrl;
|
|
QLineEdit *edtCrl;
|
|
|
|
QPushButton *btnTest;
|
|
QLabel *lblResult;
|
|
QFormLayout *formLayout;
|
|
|
|
QFutureWatcher<TestConnectionResult> TestWatcher;
|
|
private slots:
|
|
void handleTestResult();
|
|
};
|
|
|
|
|
|
|
|
#endif // CONNECTIONCONFIGURATIONWIDGET_H
|