-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMySQLConfig.h
More file actions
138 lines (106 loc) · 3.91 KB
/
MySQLConfig.h
File metadata and controls
138 lines (106 loc) · 3.91 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#pragma once
#include <QtWidgets/QDialog>
#include "ui_MySQLConfig.h"
#include <string>
#include <QSettings>
#include <MySQLAgent.h>
#include "WinService.h"
#include "IniFile.h"
enum ServerType
{
Server_Unknown = -1,
Server_Master = 0,
Server_Slave = 1
};
enum LogMode
{
Log_FILE = 0,
Log_TABLE = 1,
Log_FILE_TABLE = 2
};
class MySQLConfig : public QDialog
{
Q_OBJECT
public:
MySQLConfig(QWidget *parent = Q_NULLPTR);
~MySQLConfig();
bool LoadSettings(QString strMySQLPath);
bool SaveSettings(QString strMySQLPath, QString& strMessage);
int nCurSlaveHost = -1;
void SetDefaultMaster();
void SetDefaultSlave();
static bool GetMySQLService(std::string strMySQL_Path, std::string& strMySQLService, ServiceStatus& nServiceStatus);
private slots:
void on_pushButton_Browse_clicked();
void on_pushButton_Connect_clicked();
void on_comboBox_ServerType_currentIndexChanged(int index);
void on_pushButton_ApplySettings_clicked();
void on_checkBox_Logbin_stateChanged(int arg1);
void on_checkBox_Generallog_stateChanged(int arg1);
void on_checkBox_Logerror_stateChanged(int arg1);
void on_checkBox_LongQueryTime_stateChanged(int arg1);
void on_checkBox_SlowQuerylog_stateChanged(int arg1);
void on_checkBox_ExternAccess_stateChanged(int arg1);
void on_checkBox_Expiredlogdays_stateChanged(int arg1);
void on_listWidget_SlaveHosts_customContextMenuRequested(const QPoint &pos);
void OnAddHost();
void OnDelHost();
void OnClearHost();
void on_pushButton_Cancel_clicked();
bool ConfigureMaster();
bool ConfigureSlave();
bool TestMySQLService(QString &strService, ServiceStatus& nStatus);
void OnComboboxSourceDBHidePopup();
void OnStart();
private:
Ui::MySQLConfigClass ui;
QIcon IcoConnect[2];
CIniFile* pMySQLIni = nullptr;
QSettings* pMySQLSettings = nullptr;
QString strMySQLPath;
ServerType nServerType = Server_Unknown;
QString strDBPassword = "";
bool bCheckLogbin = false;
bool bCheckGenerallog = false;
bool bChecklogError = false;
bool bChecklongQueryTime = false;
bool bCheckSlowQuerylog = false;
bool bCheckExpiredlogDays = false;
bool bCheckExternAccess = false;
QString strLogMode;
QString strInstalledPath;
int nServerID;
int nServerPort;
QString strLogbinFile;
QString strGeneralLog;
QString strLogError;
int nLongQueryTime;
QString strSlowQuerylog;
int nExpiredlogDays;
QString strExternAccessPassword;
// Master Server Variables
QString strSourceDB;
QString strIgorenDB;
QString strReplicationAccount;
QString strReplicationPassword;
QStringList strSlaveHostList;
// Slave Server Variables
QString strMasterHost;
int nMasterPort;
QString strMasterLogFile;
int nMasterlogPos;
QString strRelayLog;
QString strRelayLogIndex;
QString strMasterAccount;
QString strMasterPassword;
vector<QWidget*>* pWidgetPtrServer = nullptr;
vector<QWidget*>* pWidgetPtrMaster = nullptr;
vector<QWidget*>* pWidgetPtrSlave = nullptr;
};
//#if defined _M_IX86
//#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
//#elif defined _M_X64
//#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
//#else
//#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
//#endif