2025-03-14 16:06:20 +08:00
|
|
|
#ifndef CONNECTIONDIALOG_H
|
|
|
|
|
#define CONNECTIONDIALOG_H
|
|
|
|
|
|
|
|
|
|
#include "global.h"
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
namespace Ui {
|
|
|
|
|
class ConnectionDialog;
|
|
|
|
|
}
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2025-04-18 18:44:26 +08:00
|
|
|
class MainWindow;
|
2025-04-21 14:29:20 +08:00
|
|
|
class MaskLayer;
|
2025-04-15 16:39:36 +08:00
|
|
|
class CustomBorderContainer;
|
2025-04-18 18:44:26 +08:00
|
|
|
|
2025-03-14 16:06:20 +08:00
|
|
|
class ConnectionDialog : public QDialog
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
ConnectionDialog(QWidget *parent = nullptr);
|
|
|
|
|
~ConnectionDialog();
|
|
|
|
|
|
|
|
|
|
void setMainWindow(MainWindow*);
|
|
|
|
|
void setErrorInfo(const QString&);
|
|
|
|
|
void clearErrorInfo();
|
|
|
|
|
|
2025-04-21 14:29:20 +08:00
|
|
|
Q_INVOKABLE void showMask();
|
|
|
|
|
Q_INVOKABLE void hideMask();
|
|
|
|
|
|
2025-03-14 16:06:20 +08:00
|
|
|
protected:
|
|
|
|
|
virtual void showEvent(QShowEvent*);
|
|
|
|
|
virtual void closeEvent(QCloseEvent*);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void initialize();
|
|
|
|
|
void appendConnListItem(const QString&, const QString&, const QString&);
|
|
|
|
|
void addNewConnListItem();
|
|
|
|
|
void removeConnListItem(int);
|
|
|
|
|
void loadConnInfo(const QString&);
|
|
|
|
|
|
|
|
|
|
Ui::ConnectionDialog *ui;
|
2025-04-21 14:29:20 +08:00
|
|
|
MaskLayer* m_pMaskLayer;
|
2025-03-14 16:06:20 +08:00
|
|
|
MainWindow* m_pMainWindow;
|
|
|
|
|
bool m_isNewStatus;//是否是新建链接编辑状态
|
|
|
|
|
int m_curConnListRow;
|
|
|
|
|
|
2025-04-15 16:39:36 +08:00
|
|
|
CustomBorderContainer* m_customBorderContainer;
|
|
|
|
|
|
2025-03-14 16:06:20 +08:00
|
|
|
signals:
|
|
|
|
|
void addConnection(DatabaseConfig&);
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
void onBtnClicked_open();
|
|
|
|
|
void onBtnClicked_cancle();
|
|
|
|
|
void onBtnClicked_save();
|
|
|
|
|
void onBtnClicked_add();
|
|
|
|
|
void onBtnClicked_remove();
|
|
|
|
|
void onComboxChanged_dbType(const QString&);
|
|
|
|
|
void onTableCellClicked_connList(int, int);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // CONNECTIONDIALOG_H
|