mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Рефакт Администрирование БД
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <QXmlStreamReader>
|
||||
#include <QMessageBox>
|
||||
#include "dialogsettingstray.h"
|
||||
#include "Systems/tools.h"
|
||||
#include "ui_dialogsettingstray.h"
|
||||
@@ -240,16 +241,39 @@ void DialogSettingsTray::on_editPassword_textChanged(const QString &arg1)
|
||||
|
||||
void DialogSettingsTray::on_btnCheckDB_clicked()
|
||||
{
|
||||
DialogCheckDB dlgCheckDB(providerDBLMS, this);
|
||||
dlgCheckDB.setWindowFlags(dlgCheckDB.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
switch( dlgCheckDB.exec() )
|
||||
//Проверяем, установлен ли PostgreSQL
|
||||
if(!providerDBLMS->checkDriverQPSQLavailable())
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
break;
|
||||
case QDialog::Rejected:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
QMessageBox::critical(this, tr("Error!"), tr("Driver PostgreSQL is not installed!"));
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO Запрос Логина и Пароля Суперюзера PostgreSQL (postgres)
|
||||
QString UserNamePostgres;
|
||||
QString PasswordPostgres;
|
||||
|
||||
//Имитация
|
||||
UserNamePostgres = "postgres";
|
||||
PasswordPostgres = "12345678";
|
||||
|
||||
if(providerDBLMS->setUserPasswordPostgres(UserNamePostgres, PasswordPostgres))
|
||||
{
|
||||
DialogCheckDB dlgCheckDB(providerDBLMS, this);
|
||||
dlgCheckDB.setWindowFlags(dlgCheckDB.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
switch( dlgCheckDB.exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
break;
|
||||
case QDialog::Rejected:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error!"), tr("The superuser login or password is incorrect!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user