mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Прокинул сигнал ошибки SQL на виджет
This commit is contained in:
@@ -94,7 +94,7 @@ DataBaseSettings DataBaseLMS::getDataBaseSettings()
|
||||
QFile file("config/settings.xml");
|
||||
if(!file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
QMessageBox::critical(ownerWidget, tr("Attention!"), tr("The file could not be opened:") + "config/settings.xml");
|
||||
//QMessageBox::critical(ownerWidget, tr("Attention!"), tr("The file could not be opened:") + "config/settings.xml");
|
||||
return settings;
|
||||
}
|
||||
QXmlStreamReader xmlReader(&file);
|
||||
@@ -234,8 +234,18 @@ void DataBaseLMS::messageWarningErrorQuery(QString queryStr, QSqlQuery* query)
|
||||
|
||||
|
||||
//Сообщение об ошибке
|
||||
QMessageBox::warning(ownerWidget, dbSettings.dbName,
|
||||
/*
|
||||
QWidget* owner = ownerWidget;
|
||||
QMessageBox::critical(ownerWidget, tr("Error PostgreSQL!"),
|
||||
//dbSettings.dbName
|
||||
"Error query:\n" + query->lastError().text() + "\n" +
|
||||
"String of query:\n" + queryStr + "\n" +
|
||||
"Executed query:\n" + query->executedQuery());
|
||||
*/
|
||||
|
||||
QString textError = "";
|
||||
textError = "Error query:\n" + query->lastError().text() + "\n" +
|
||||
"String of query:\n" + queryStr + "\n" +
|
||||
"Executed query:\n" + query->executedQuery();
|
||||
emit signal_ErrorPostgreSQL(textError);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,9 @@ public:
|
||||
public Q_SLOTS:
|
||||
void slot_LanguageChanged(QString language);
|
||||
|
||||
signals:
|
||||
void signal_ErrorPostgreSQL(QString text);
|
||||
|
||||
public:
|
||||
static const QString TypeUserDBInstructor;
|
||||
static const QString TypeUserDBTrainee;
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<context>
|
||||
<name>DataBaseLMS</name>
|
||||
<message>
|
||||
<location filename="../databaselms.cpp" line="95"/>
|
||||
<location filename="../databaselms.cpp" line="97"/>
|
||||
<source>Attention!</source>
|
||||
<translation>Внимание!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../databaselms.cpp" line="95"/>
|
||||
<location filename="../databaselms.cpp" line="97"/>
|
||||
<source>The file could not be opened:</source>
|
||||
<translation>Файл не может быть открыт:</translation>
|
||||
</message>
|
||||
|
||||
Reference in New Issue
Block a user