Общий перевод. SpecMsgBox

This commit is contained in:
2025-12-16 15:13:37 +03:00
parent a641194b29
commit d1df6a2a05
8 changed files with 29 additions and 22 deletions

View File

@@ -7,6 +7,7 @@
#include <QErrorMessage>
#include "serverlmswidget.h"
#include "dialogsettingstray.h"
#include "specialmessagebox.h"
#include "ui_serverlmswidget.h"
#include "metatypes.h"
@@ -136,7 +137,7 @@ void ServerLMSWidget::slot_AddMessageToLog(QString message)
void ServerLMSWidget::slot_ErrorPostgreSQL(QString text)
{
emit signal_Menu_ShowWindow();
QMessageBox::critical(this, tr("Error PostgreSQL!"),text);
SpecMsgBox::CriticalClose(this, tr("Error PostgreSQL!"));
}
void ServerLMSWidget::slot_UpdateDocs()
@@ -203,7 +204,7 @@ void ServerLMSWidget::slot_BlockAutorization(bool block)
void ServerLMSWidget::slot_LanguageChanged(QString language)
{
qtLanguageTranslator.load(QString("translations/LibServer_") + language, ".");
qtLanguageTranslator.load(QString("translations/RRJServer_") + language, ".");
qApp->installTranslator(&qtLanguageTranslator);
emit signal_LanguageChanged(language);
@@ -243,7 +244,7 @@ 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'");
SpecMsgBox::CriticalClose(this, tr("Settings file could not be opened:") + "'config/settings.xml'");
return;
}
@@ -272,7 +273,7 @@ void ServerLMSWidget::on_btnSettings_clicked()
updateStateServer();
QMessageBox::warning(this, tr("Warning!"), tr("Database settings have been changed.\nThe server will be restarted."));
SpecMsgBox::WarningClose(this, tr("Database settings have been changed.\nThe server will be restarted."));
tryConnectionToDB();
}
@@ -307,12 +308,12 @@ void ServerLMSWidget::setLanguageInterfase()
if(settings.Language == "ENG")
{
qtLanguageTranslator.load(QString("translations/LibServer_") + languageENG, ".");
qtLanguageTranslator.load(QString("translations/RRJServer_") + languageENG, ".");
language = languageENG;
}
else
{
qtLanguageTranslator.load(QString("translations/LibServer_") + languageRUS, ".");
qtLanguageTranslator.load(QString("translations/RRJServer_") + languageRUS, ".");
language = languageRUS;
}
@@ -335,7 +336,7 @@ QString ServerLMSWidget::loadStyleSheet()
QFile styleSheetFile(fileName);
if (!styleSheetFile.open(QFile::ReadOnly | QFile::Text))
{
QMessageBox::warning(this, tr("Warning!"), tr("The file could not be opened ") + fileName);
SpecMsgBox::WarningClose(this, tr("The file could not be opened ") + fileName);
return QStringLiteral("");
}
else
@@ -413,7 +414,7 @@ void ServerLMSWidget::tryConnectionToDB()
emit signal_Menu_ShowWindow();
QMessageBox::critical(this, tr("Error!"), tr("Database connection error!"));
SpecMsgBox::CriticalClose(this, tr("Database connection error!"));
on_btnSettings_clicked();
}

View File

@@ -1,6 +1,7 @@
#include <QMessageBox>
#include <QProcess>
#include <QFile>
#include "specialmessagebox.h"
#include "dialogcheckdb.h"
#include "ui_dialogcheckdb.h"
@@ -80,7 +81,7 @@ void DialogCheckDB::on_btnRepare_clicked()
{
if(!resDriver)
{
QMessageBox::critical(this, tr("Error!"), tr("Install PostgreSQL."));
SpecMsgBox::CriticalClose(this, tr("Install PostgreSQL."));
this->reject();
return;
}
@@ -90,7 +91,7 @@ void DialogCheckDB::on_btnRepare_clicked()
if(!providerDBLMS->createUser())
{
check();
QMessageBox::critical(this, tr("Error!"), tr("Failed to create user!"));
SpecMsgBox::CriticalClose(this, tr("Failed to create user!"));
this->reject();
return;
}
@@ -101,7 +102,7 @@ void DialogCheckDB::on_btnRepare_clicked()
if(!providerDBLMS->createDB())
{
check();
QMessageBox::critical(this, tr("Error!"), tr("Failed to create Database!"));
SpecMsgBox::CriticalClose(this, tr("Failed to create Database!"));
this->reject();
return;
}
@@ -111,7 +112,7 @@ void DialogCheckDB::on_btnRepare_clicked()
if(resDriver && resUser && resDB)
{
QMessageBox::information(this, tr("Completed!"), tr("The database has been successfully restored!"));
SpecMsgBox::InfoOk(this, tr("The database has been successfully restored!"));
this->accept();
}
}

View File

@@ -5,6 +5,7 @@
#include "ui_dialogsettingstray.h"
#include "dialogcheckdb.h"
#include "dialogauthorization.h"
#include "specialmessagebox.h"
DialogSettingsTray::DialogSettingsTray(ProviderDBLMS* providerDBLMS, QWidget *parent) :
QDialog(parent),
@@ -290,7 +291,7 @@ void DialogSettingsTray::on_btnCheckDB_clicked()
//Проверяем, установлен ли PostgreSQL
if(!providerDBLMS->checkDriverQPSQLavailable())
{
QMessageBox::critical(this, tr("Error!"), tr("Driver PostgreSQL is not installed!"));
SpecMsgBox::CriticalClose(this, tr("Driver PostgreSQL is not installed!"));
return;
}
@@ -340,12 +341,12 @@ void DialogSettingsTray::on_btnCheckDB_clicked()
else
{
if(settings->HostName == "localhost")
QMessageBox::critical(this, tr("Error!"), tr("Error connecting to PostgreSQL!") + "\n\n" +
SpecMsgBox::CriticalClose(this, 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" +
SpecMsgBox::CriticalClose(this, 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" +