Прокинул сигнал ошибки SQL на виджет

This commit is contained in:
2025-11-06 20:55:16 +03:00
parent da7363dfb5
commit 2d3d4f82dd
12 changed files with 209 additions and 113 deletions

View File

@@ -107,6 +107,12 @@ void ServerLMSWidget::slot_AddMessageToLog(QString message)
ui->loggerTextField->appendPlainText(message);
}
void ServerLMSWidget::slot_ErrorPostgreSQL(QString text)
{
emit signal_Menu_ShowWindow();
QMessageBox::critical(this, tr("Error PostgreSQL!"),text);
}
void ServerLMSWidget::start()
{
startInitialization();
@@ -170,6 +176,13 @@ void ServerLMSWidget::on_btnStopServer_clicked()
void ServerLMSWidget::on_btnSettings_clicked()
{
ServerDBSettings settingsTemp;
if(!DialogSettingsTray::loadSettings(&settingsTemp))
{
QMessageBox::critical(this, tr("Error!"), tr("Settings file could not be opened:") + "'config/settings.xml'");
return;
}
DialogSettingsTray dlg(providerDBLMS, this);
dlg.setWindowFlags(dlg.windowFlags() & ~Qt::WindowContextHelpButtonHint);
@@ -258,6 +271,7 @@ QString ServerLMSWidget::loadStyleSheet()
void ServerLMSWidget::startInitialization()
{
providerDBLMS = new ProviderDBLMS(this);
connect(providerDBLMS, &ProviderDBLMS::signal_ErrorPostgreSQL, this, &ServerLMSWidget::slot_ErrorPostgreSQL);
connect(providerDBLMS, &ProviderDBLMS::signal_BlockAutorization, this, &ServerLMSWidget::slot_BlockAutorization);
mutex = new QMutex;