mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Рефакт Администрирование БД 3
This commit is contained in:
@@ -34,7 +34,7 @@ DialogSettingsTray::DialogSettingsTray(ProviderDBLMS* providerDBLMS, QWidget *pa
|
||||
/* Устанавливаем Валидатор на QLineEdit */
|
||||
ui->editHostName->setValidator(ipValidator);
|
||||
|
||||
settings = new ServerDBSettings;
|
||||
settings = new ServerDBSettings();
|
||||
|
||||
//Задаём два пункта с текстом локалей в комбобоксе
|
||||
ui->cmbLanguage->addItems(QStringList() << "English" << "Русский");
|
||||
@@ -50,7 +50,17 @@ DialogSettingsTray::DialogSettingsTray(ProviderDBLMS* providerDBLMS, QWidget *pa
|
||||
ui->cmbLanguage->setCurrentText("Русский");
|
||||
|
||||
ui->editNameDB->setText(settings->NameDB);
|
||||
|
||||
if(settings->HostName == "localhost")
|
||||
{
|
||||
ui->checkLocalhost->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->checkLocalhost->setChecked(false);
|
||||
}
|
||||
ui->editHostName->setText(settings->HostName);
|
||||
|
||||
ui->editPort->setText(settings->Port);
|
||||
ui->editUserName->setText(settings->UserName);
|
||||
ui->editPassword->setText(settings->Password);
|
||||
@@ -240,6 +250,20 @@ void DialogSettingsTray::on_editPassword_textChanged(const QString &arg1)
|
||||
flSettingsServerChanged = true;
|
||||
}
|
||||
|
||||
void DialogSettingsTray::on_checkLocalhost_stateChanged(int arg1)
|
||||
{
|
||||
if(arg1)
|
||||
{
|
||||
ui->editHostName->setText("localhost");
|
||||
ui->editHostName->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->editHostName->setText("0.0.0.0");
|
||||
ui->editHostName->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void DialogSettingsTray::on_btnCheckDB_clicked()
|
||||
{
|
||||
//Проверяем, установлен ли PostgreSQL
|
||||
@@ -249,7 +273,7 @@ void DialogSettingsTray::on_btnCheckDB_clicked()
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO Запрос Логина и Пароля Суперюзера PostgreSQL (postgres)
|
||||
//Запрос Логина и Пароля Суперюзера PostgreSQL (postgres)
|
||||
QString UserNamePostgres;
|
||||
QString PasswordPostgres;
|
||||
|
||||
@@ -296,7 +320,17 @@ void DialogSettingsTray::on_btnCheckDB_clicked()
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error!"), tr("The superuser login or password is incorrect!"));
|
||||
if(settings->HostName == "localhost")
|
||||
QMessageBox::critical(this, tr("Error!"), tr("Error connecting to PostgreSQL!") + "\n\n" +
|
||||
tr("Possible reasons:") + "\n" +
|
||||
tr("*superuser PostgreSQL login or password is incorrect;") + "\n" +
|
||||
tr("*Port is incorrect."));
|
||||
else
|
||||
QMessageBox::critical(this, tr("Error!"), tr("Error connecting to PostgreSQL!") + "\n\n" +
|
||||
tr("Possible reasons:") + "\n" +
|
||||
tr("*superuser PostgreSQL login or password is incorrect;") + "\n" +
|
||||
tr("*Port is incorrect;") + "\n" +
|
||||
tr("*file 'pg_hba.conf' does not contain an entry for the IP address:") + settings->HostName + ".");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user