mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Settings DB
This commit is contained in:
@@ -9,11 +9,12 @@
|
|||||||
const QString DataBaseLMS::TypeUserDBInstructor = "instructor";
|
const QString DataBaseLMS::TypeUserDBInstructor = "instructor";
|
||||||
const QString DataBaseLMS::TypeUserDBTrainee = "trainee";
|
const QString DataBaseLMS::TypeUserDBTrainee = "trainee";
|
||||||
|
|
||||||
|
QString DataBaseLMS::UserNamePostgres = "";
|
||||||
|
QString DataBaseLMS::PasswordPostgres = "";
|
||||||
|
|
||||||
DataBaseLMS::DataBaseLMS(QObject *parent):
|
DataBaseLMS::DataBaseLMS(QObject *parent):
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
db(nullptr),
|
db(nullptr)
|
||||||
UserNamePostgres(""),
|
|
||||||
PasswordPostgres("")
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,11 +40,14 @@ signals:
|
|||||||
public:
|
public:
|
||||||
static const QString TypeUserDBInstructor;
|
static const QString TypeUserDBInstructor;
|
||||||
static const QString TypeUserDBTrainee;
|
static const QString TypeUserDBTrainee;
|
||||||
|
protected:
|
||||||
|
static QString UserNamePostgres;
|
||||||
|
static QString PasswordPostgres;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//PostgreSQL
|
//PostgreSQL
|
||||||
bool setUserPasswordPostgres(QString userName, QString password);
|
static bool checkDriverQPSQLavailable();
|
||||||
bool checkDriverQPSQLavailable();
|
static bool setUserPasswordPostgres(QString userName, QString password);
|
||||||
bool checkUserLMSexist();
|
bool checkUserLMSexist();
|
||||||
bool checkDataBaseLMSexist();
|
bool checkDataBaseLMSexist();
|
||||||
bool createUser();
|
bool createUser();
|
||||||
@@ -118,7 +121,7 @@ protected:
|
|||||||
int updateReportFIMforTask(TaskAmmFim task);
|
int updateReportFIMforTask(TaskAmmFim task);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DataBaseSettings getDataBaseSettings();
|
static DataBaseSettings getDataBaseSettings();
|
||||||
private:
|
private:
|
||||||
int queryExecInt(QString queryStr);
|
int queryExecInt(QString queryStr);
|
||||||
QString queryExecString(QString queryStr);
|
QString queryExecString(QString queryStr);
|
||||||
@@ -129,9 +132,6 @@ private:
|
|||||||
protected:
|
protected:
|
||||||
QSqlDatabase* db;
|
QSqlDatabase* db;
|
||||||
DataBaseSettings dbSettings;
|
DataBaseSettings dbSettings;
|
||||||
|
|
||||||
QString UserNamePostgres;
|
|
||||||
QString PasswordPostgres;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATABASELMS_H
|
#endif // DATABASELMS_H
|
||||||
|
|||||||
@@ -11,4 +11,6 @@ void registerMetaType()
|
|||||||
|
|
||||||
qRegisterMetaType<EStateServer>("EStateServer");
|
qRegisterMetaType<EStateServer>("EStateServer");
|
||||||
qRegisterMetaType<EStateBlockAutorization>("EStateBlockAutorization");
|
qRegisterMetaType<EStateBlockAutorization>("EStateBlockAutorization");
|
||||||
|
|
||||||
|
qRegisterMetaType<CheckResult>("CheckResult");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "Data/typesDataServerClient.h"
|
#include "Data/typesDataServerClient.h"
|
||||||
#include "Systems/logger.h"
|
#include "Systems/logger.h"
|
||||||
#include "databaselms.h"
|
#include "databaselms.h"
|
||||||
|
#include "providerdblms.h"
|
||||||
|
|
||||||
void registerMetaType();
|
void registerMetaType();
|
||||||
|
|
||||||
@@ -17,4 +18,6 @@ Q_DECLARE_METATYPE(DataBaseSettings)
|
|||||||
Q_DECLARE_METATYPE(EStateServer)
|
Q_DECLARE_METATYPE(EStateServer)
|
||||||
Q_DECLARE_METATYPE(EStateBlockAutorization)
|
Q_DECLARE_METATYPE(EStateBlockAutorization)
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(CheckResult)
|
||||||
|
|
||||||
#endif // METATYPES_H
|
#endif // METATYPES_H
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include "specialmessagebox.h"
|
||||||
|
|
||||||
ProviderDBLMS::ProviderDBLMS(QObject *parent) :
|
ProviderDBLMS::ProviderDBLMS(QObject *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
@@ -25,6 +26,46 @@ void ProviderDBLMS::slot_TryDisConnectionFromDB()
|
|||||||
DisConnectionFromDB();
|
DisConnectionFromDB();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProviderDBLMS::slot_CheckDB()
|
||||||
|
{
|
||||||
|
CheckResult result;
|
||||||
|
|
||||||
|
result.resDriver = ProviderDBLMS::checkDriverQPSQLavailable();
|
||||||
|
|
||||||
|
result.resUser = this->checkUserLMSexist();
|
||||||
|
|
||||||
|
result.resDB = this->checkDataBaseLMSexist();
|
||||||
|
|
||||||
|
emit signal_CheckDBResult(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProviderDBLMS::slot_RepareDB(CheckResult result)
|
||||||
|
{
|
||||||
|
if(!result.resUser)
|
||||||
|
{
|
||||||
|
if(!this->createUser())
|
||||||
|
{
|
||||||
|
result.resUser = false;
|
||||||
|
emit signal_RepareDBResult(result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
result.resUser = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!result.resDB)
|
||||||
|
{
|
||||||
|
if(!this->createDB())
|
||||||
|
{
|
||||||
|
result.resDB = false;
|
||||||
|
emit signal_RepareDBResult(result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
result.resDB = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
emit signal_RepareDBResult(result);
|
||||||
|
}
|
||||||
|
|
||||||
bool ProviderDBLMS::ConnectionToDB()
|
bool ProviderDBLMS::ConnectionToDB()
|
||||||
{
|
{
|
||||||
mtxAccess.lock();
|
mtxAccess.lock();
|
||||||
@@ -103,12 +144,12 @@ DataBaseSettings ProviderDBLMS::getDBSettings()
|
|||||||
|
|
||||||
bool ProviderDBLMS::setUserPasswordPostgres(QString userName, QString password)
|
bool ProviderDBLMS::setUserPasswordPostgres(QString userName, QString password)
|
||||||
{
|
{
|
||||||
return dbLMS->setUserPasswordPostgres(userName, password);
|
return InterfaceDataBaseLMS::setUserPasswordPostgres(userName, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProviderDBLMS::checkDriverQPSQLavailable()
|
bool ProviderDBLMS::checkDriverQPSQLavailable()
|
||||||
{
|
{
|
||||||
return dbLMS->checkDriverQPSQLavailable();
|
return InterfaceDataBaseLMS::checkDriverQPSQLavailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProviderDBLMS::checkUserLMSexist()
|
bool ProviderDBLMS::checkUserLMSexist()
|
||||||
|
|||||||
@@ -6,6 +6,14 @@
|
|||||||
#include "interfacedatabaselms.h"
|
#include "interfacedatabaselms.h"
|
||||||
#include "tasksAmmFim.h"
|
#include "tasksAmmFim.h"
|
||||||
|
|
||||||
|
class CheckResult
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool resDriver = false;
|
||||||
|
bool resUser = false;
|
||||||
|
bool resDB = false;
|
||||||
|
};
|
||||||
|
|
||||||
class ProviderDBLMS : public QObject
|
class ProviderDBLMS : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -80,10 +88,16 @@ signals:
|
|||||||
void signal_ResultTryConnectDb(bool result);
|
void signal_ResultTryConnectDb(bool result);
|
||||||
void signal_ResultTryDisConnectDb(bool result);
|
void signal_ResultTryDisConnectDb(bool result);
|
||||||
|
|
||||||
|
void signal_CheckDBResult(CheckResult result);
|
||||||
|
void signal_RepareDBResult(CheckResult result);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void slot_TryConnectionToDB();
|
void slot_TryConnectionToDB();
|
||||||
void slot_TryDisConnectionFromDB();
|
void slot_TryDisConnectionFromDB();
|
||||||
|
|
||||||
|
void slot_CheckDB();
|
||||||
|
void slot_RepareDB(CheckResult result);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool ConnectionToDB();
|
bool ConnectionToDB();
|
||||||
void DisConnectionFromDB();
|
void DisConnectionFromDB();
|
||||||
@@ -93,8 +107,8 @@ public:
|
|||||||
DataBaseSettings getDBSettings();
|
DataBaseSettings getDBSettings();
|
||||||
|
|
||||||
//PostgreSQL
|
//PostgreSQL
|
||||||
bool setUserPasswordPostgres(QString userName, QString password);
|
static bool checkDriverQPSQLavailable();
|
||||||
bool checkDriverQPSQLavailable();
|
static bool setUserPasswordPostgres(QString userName, QString password);
|
||||||
bool checkUserLMSexist();
|
bool checkUserLMSexist();
|
||||||
bool checkDataBaseLMSexist();
|
bool checkDataBaseLMSexist();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QResizeEvent>
|
||||||
#include "specialmessagebox.h"
|
#include "specialmessagebox.h"
|
||||||
#include "dialogcheckdb.h"
|
#include "dialogcheckdb.h"
|
||||||
#include "ui_dialogcheckdb.h"
|
#include "ui_dialogcheckdb.h"
|
||||||
@@ -8,33 +9,78 @@
|
|||||||
DialogCheckDB::DialogCheckDB(ProviderDBLMS* providerDBLMS, QWidget *parent) :
|
DialogCheckDB::DialogCheckDB(ProviderDBLMS* providerDBLMS, QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::DialogCheckDB),
|
ui(new Ui::DialogCheckDB),
|
||||||
providerDBLMS(providerDBLMS),
|
waitAnimationWidget(nullptr),
|
||||||
resDriver(false),
|
providerDBLMS(providerDBLMS)
|
||||||
resUser(false),
|
|
||||||
resDB(false)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
connect(this, &DialogCheckDB::signal_CheckDB, providerDBLMS, &ProviderDBLMS::slot_CheckDB);
|
||||||
|
connect(providerDBLMS, &ProviderDBLMS::signal_CheckDBResult, this, &DialogCheckDB::slot_CheckDBResult);
|
||||||
|
|
||||||
|
connect(this, &DialogCheckDB::signal_RepareDB, providerDBLMS, &ProviderDBLMS::slot_RepareDB);
|
||||||
|
connect(providerDBLMS, &ProviderDBLMS::signal_RepareDBResult, this, &DialogCheckDB::slot_RepareDBResult);
|
||||||
|
|
||||||
|
|
||||||
|
waitAnimationWidget = new WaitAnimationWidget;
|
||||||
|
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
||||||
|
waitAnimationWidget->setParent(this);
|
||||||
|
waitAnimationWidget->initialize(movie,this);
|
||||||
|
|
||||||
ui->btnRepare->setObjectName("btnRepare");
|
ui->btnRepare->setObjectName("btnRepare");
|
||||||
|
|
||||||
ui->btnRepare->setEnabled(false);
|
ui->btnRepare->setEnabled(false);
|
||||||
|
|
||||||
check();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogCheckDB::~DialogCheckDB()
|
DialogCheckDB::~DialogCheckDB()
|
||||||
{
|
{
|
||||||
|
if(waitAnimationWidget)
|
||||||
|
{
|
||||||
|
waitAnimationWidget->hideWithStop();
|
||||||
|
delete waitAnimationWidget;
|
||||||
|
}
|
||||||
|
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DialogCheckDB::initialize()
|
||||||
|
{
|
||||||
|
check();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DialogCheckDB::resizeEvent(QResizeEvent *event)
|
||||||
|
{
|
||||||
|
QSize size = event->size();
|
||||||
|
waitAnimationWidget->resize(size);
|
||||||
|
}
|
||||||
|
|
||||||
void DialogCheckDB::check()
|
void DialogCheckDB::check()
|
||||||
{
|
{
|
||||||
resDriver = false;
|
waitAnimationWidget->showWithPlay();
|
||||||
resUser = false;
|
|
||||||
resDB = false;
|
|
||||||
|
|
||||||
resDriver = providerDBLMS->checkDriverQPSQLavailable();
|
emit signal_CheckDB();
|
||||||
if(resDriver)
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DialogCheckDB::on_btnRepare_clicked()
|
||||||
|
{
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
|
|
||||||
|
if(!checkResult.resDriver)
|
||||||
|
{
|
||||||
|
SpecMsgBox::CriticalClose(this, tr("Install PostgreSQL."));
|
||||||
|
this->reject();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
emit signal_RepareDB(checkResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DialogCheckDB::slot_CheckDBResult(CheckResult result)
|
||||||
|
{
|
||||||
|
checkResult = result;
|
||||||
|
|
||||||
|
if(result.resDriver)
|
||||||
{
|
{
|
||||||
ui->lblDriverRes->setText(tr("Installed"));
|
ui->lblDriverRes->setText(tr("Installed"));
|
||||||
ui->lblDriverResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
ui->lblDriverResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||||
@@ -45,8 +91,7 @@ void DialogCheckDB::check()
|
|||||||
ui->lblDriverResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleRed.png")));
|
ui->lblDriverResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleRed.png")));
|
||||||
}
|
}
|
||||||
|
|
||||||
resUser = providerDBLMS->checkUserLMSexist();
|
if(result.resUser)
|
||||||
if(resUser)
|
|
||||||
{
|
{
|
||||||
ui->lblUserRes->setText(tr("Exist"));
|
ui->lblUserRes->setText(tr("Exist"));
|
||||||
ui->lblUserResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
ui->lblUserResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||||
@@ -57,8 +102,7 @@ void DialogCheckDB::check()
|
|||||||
ui->lblUserResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleRed.png")));
|
ui->lblUserResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleRed.png")));
|
||||||
}
|
}
|
||||||
|
|
||||||
resDB = providerDBLMS->checkDataBaseLMSexist();
|
if(result.resDB)
|
||||||
if(resDB)
|
|
||||||
{
|
{
|
||||||
ui->lblDBRes->setText(tr("Exist"));
|
ui->lblDBRes->setText(tr("Exist"));
|
||||||
ui->lblDBResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
ui->lblDBResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||||
@@ -69,48 +113,39 @@ void DialogCheckDB::check()
|
|||||||
ui->lblDBResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleRed.png")));
|
ui->lblDBResIco->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleRed.png")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!resDriver || !resUser || !resDB)
|
if(!result.resDriver || !result.resUser || !result.resDB)
|
||||||
{
|
{
|
||||||
ui->btnRepare->setEnabled(true);
|
ui->btnRepare->setEnabled(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ui->btnRepare->setEnabled(false);
|
ui->btnRepare->setEnabled(false);
|
||||||
|
|
||||||
|
waitAnimationWidget->hideWithStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogCheckDB::on_btnRepare_clicked()
|
void DialogCheckDB::slot_RepareDBResult(CheckResult result)
|
||||||
{
|
{
|
||||||
if(!resDriver)
|
checkResult = result;
|
||||||
|
|
||||||
|
if(!checkResult.resUser)
|
||||||
{
|
{
|
||||||
SpecMsgBox::CriticalClose(this, tr("Install PostgreSQL."));
|
slot_CheckDBResult(checkResult);
|
||||||
|
SpecMsgBox::CriticalClose(this, tr("Failed to create user!"));
|
||||||
this->reject();
|
this->reject();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!resUser)
|
if(!checkResult.resDB)
|
||||||
{
|
{
|
||||||
if(!providerDBLMS->createUser())
|
slot_CheckDBResult(checkResult);
|
||||||
{
|
SpecMsgBox::CriticalClose(this, tr("Failed to create Database!"));
|
||||||
check();
|
this->reject();
|
||||||
SpecMsgBox::CriticalClose(this, tr("Failed to create user!"));
|
return;
|
||||||
this->reject();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!resDB)
|
|
||||||
{
|
|
||||||
if(!providerDBLMS->createDB())
|
|
||||||
{
|
|
||||||
check();
|
|
||||||
SpecMsgBox::CriticalClose(this, tr("Failed to create Database!"));
|
|
||||||
this->reject();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check();
|
check();
|
||||||
|
|
||||||
if(resDriver && resUser && resDB)
|
if(checkResult.resDriver && checkResult.resUser && checkResult.resDB)
|
||||||
{
|
{
|
||||||
SpecMsgBox::InfoOk(this, tr("The database has been successfully restored!"));
|
SpecMsgBox::InfoOk(this, tr("The database has been successfully restored!"));
|
||||||
this->accept();
|
this->accept();
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "providerdblms.h"
|
#include "providerdblms.h"
|
||||||
|
#include "waitanimationwidget.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class DialogCheckDB;
|
class DialogCheckDB;
|
||||||
@@ -16,9 +17,22 @@ public:
|
|||||||
explicit DialogCheckDB(ProviderDBLMS* providerDBLMS, QWidget *parent = nullptr);
|
explicit DialogCheckDB(ProviderDBLMS* providerDBLMS, QWidget *parent = nullptr);
|
||||||
~DialogCheckDB();
|
~DialogCheckDB();
|
||||||
|
|
||||||
|
void initialize();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_btnRepare_clicked();
|
void on_btnRepare_clicked();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void signal_CheckDB();
|
||||||
|
void signal_RepareDB(CheckResult result);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void slot_CheckDBResult(CheckResult result);
|
||||||
|
void slot_RepareDBResult(CheckResult result);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void check();
|
void check();
|
||||||
void prepareRestoreDBscript();
|
void prepareRestoreDBscript();
|
||||||
@@ -26,11 +40,11 @@ private:
|
|||||||
private:
|
private:
|
||||||
Ui::DialogCheckDB *ui;
|
Ui::DialogCheckDB *ui;
|
||||||
|
|
||||||
|
WaitAnimationWidget *waitAnimationWidget;
|
||||||
|
|
||||||
ProviderDBLMS* providerDBLMS;
|
ProviderDBLMS* providerDBLMS;
|
||||||
|
|
||||||
bool resDriver;
|
CheckResult checkResult;
|
||||||
bool resUser;
|
|
||||||
bool resDB;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGCHECKDB_H
|
#endif // DIALOGCHECKDB_H
|
||||||
|
|||||||
@@ -24,7 +24,13 @@ DialogSettingsTray::DialogSettingsTray(ProviderDBLMS* providerDBLMS, QWidget *pa
|
|||||||
#ifndef PROJECT_TYPE_DEBUG
|
#ifndef PROJECT_TYPE_DEBUG
|
||||||
ui->checkLocalhost->setEnabled(false);
|
ui->checkLocalhost->setEnabled(false);
|
||||||
ui->btnUpdateDocs->setVisible(false);
|
ui->btnUpdateDocs->setVisible(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PROJECT_TYPE_DEBUG
|
||||||
|
ui->editNameDB->setEnabled(true);
|
||||||
|
ui->editUserName->setEnabled(true);
|
||||||
|
ui->editPassword->setEnabled(true);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Создаем строку для регулярного выражения */
|
/* Создаем строку для регулярного выражения */
|
||||||
QString ipRange = "(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])";
|
QString ipRange = "(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])";
|
||||||
@@ -298,7 +304,7 @@ void DialogSettingsTray::on_checkLocalhost_stateChanged(int arg1)
|
|||||||
void DialogSettingsTray::on_btnCheckDB_clicked()
|
void DialogSettingsTray::on_btnCheckDB_clicked()
|
||||||
{
|
{
|
||||||
//Проверяем, установлен ли PostgreSQL
|
//Проверяем, установлен ли PostgreSQL
|
||||||
if(!providerDBLMS->checkDriverQPSQLavailable())
|
if(!ProviderDBLMS::checkDriverQPSQLavailable())
|
||||||
{
|
{
|
||||||
SpecMsgBox::CriticalClose(this, tr("Driver PostgreSQL is not installed!"));
|
SpecMsgBox::CriticalClose(this, tr("Driver PostgreSQL is not installed!"));
|
||||||
return;
|
return;
|
||||||
@@ -332,10 +338,11 @@ void DialogSettingsTray::on_btnCheckDB_clicked()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(providerDBLMS->setUserPasswordPostgres(UserNamePostgres, PasswordPostgres))
|
if(ProviderDBLMS::setUserPasswordPostgres(UserNamePostgres, PasswordPostgres))
|
||||||
{
|
{
|
||||||
DialogCheckDB dlgCheckDB(providerDBLMS, this);
|
DialogCheckDB dlgCheckDB(providerDBLMS, this);
|
||||||
dlgCheckDB.setWindowFlags(dlgCheckDB.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
dlgCheckDB.setWindowFlags(dlgCheckDB.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
dlgCheckDB.initialize();
|
||||||
|
|
||||||
switch( dlgCheckDB.exec() )
|
switch( dlgCheckDB.exec() )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user