mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
add messageBox to inform user when dxf2elmt can't convert DXF file
This commit is contained in:
@@ -22,7 +22,6 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <iostream>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,11 +44,20 @@ QByteArray dxfToElmt(const QString &file_path)
|
|||||||
const QStringList arguments{file_path, QStringLiteral("-v")};
|
const QStringList arguments{file_path, QStringLiteral("-v")};
|
||||||
|
|
||||||
process_.start(program, arguments);
|
process_.start(program, arguments);
|
||||||
|
// qInfo()<<"\n Start converting DXF file..........\n"<< file_path;
|
||||||
|
//qInfo()<< process_.readAllStandardError().data(); //Print standard error to log file
|
||||||
|
|
||||||
if (process_.waitForFinished())
|
if (process_.waitForFinished())
|
||||||
{
|
{
|
||||||
qInfo()<<"\n Start converting DXF file..........\n"<< file_path;
|
bool dxf2elmterr = process_.readAllStandardError().isEmpty();
|
||||||
qInfo()<< process_.readAllStandardError().data(); //Print standard error to log file
|
QString message=QObject::tr(
|
||||||
|
"Error: Make sure the file is a valid .dxf file");
|
||||||
|
|
||||||
|
if (!dxf2elmterr){
|
||||||
|
QMessageBox::warning(nullptr,
|
||||||
|
QObject::tr("Error: to convert this dxf file."),
|
||||||
|
message);
|
||||||
|
}
|
||||||
|
|
||||||
const auto byte_array{process_.readAll()};
|
const auto byte_array{process_.readAll()};
|
||||||
process_.close();
|
process_.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user