[FEM] check if Gmsh, CCX and Mystran solver binaries exist
- adds the check like we have already for Z88 and Elmer - also remove an unnecessary return statement
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <thread>
|
||||
# include <QMessageBox>
|
||||
#endif
|
||||
|
||||
#include <Gui/Application.h>
|
||||
@@ -49,6 +50,9 @@ DlgSettingsFemCcxImp::DlgSettingsFemCcxImp(QWidget* parent)
|
||||
// hardware check might fail and then returns 0
|
||||
if (processor_count > 0)
|
||||
ui->sb_ccx_numcpu->setMaximum(processor_count);
|
||||
|
||||
connect(ui->fc_ccx_binary_path, &Gui::PrefFileChooser::fileNameChanged,
|
||||
this, &DlgSettingsFemCcxImp::onfileNameChanged);
|
||||
}
|
||||
|
||||
DlgSettingsFemCcxImp::~DlgSettingsFemCcxImp()
|
||||
@@ -135,4 +139,13 @@ void DlgSettingsFemCcxImp::changeEvent(QEvent* e)
|
||||
}
|
||||
}
|
||||
|
||||
void DlgSettingsFemCcxImp::onfileNameChanged(QString FileName)
|
||||
{
|
||||
if (!QFileInfo::exists(FileName)) {
|
||||
QMessageBox::critical(this, tr("File does not exist"),
|
||||
tr("The specified executable \n'%1'\n does not exist!\n"
|
||||
"Specify another file please.").arg(FileName));
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_DlgSettingsFemCcxImp.cpp"
|
||||
|
||||
@@ -40,6 +40,9 @@ public:
|
||||
DlgSettingsFemCcxImp( QWidget* parent = nullptr );
|
||||
~DlgSettingsFemCcxImp();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void onfileNameChanged(QString FileName);
|
||||
|
||||
protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
|
||||
@@ -102,7 +102,6 @@ void DlgSettingsFemElmerImp::onfileNameChanged(QString FileName)
|
||||
QMessageBox::critical(this, tr("File does not exist"),
|
||||
tr("The specified executable \n'%1'\n does not exist!\n"
|
||||
"Specify another file please.").arg(FileName));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <QMessageBox>
|
||||
#endif
|
||||
|
||||
#include "DlgSettingsFemGmshImp.h"
|
||||
#include "ui_DlgSettingsFemGmsh.h"
|
||||
@@ -35,6 +38,9 @@ DlgSettingsFemGmshImp::DlgSettingsFemGmshImp(QWidget* parent)
|
||||
, ui(new Ui_DlgSettingsFemGmshImp)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->fc_gmsh_binary_path, &Gui::PrefFileChooser::fileNameChanged,
|
||||
this, &DlgSettingsFemGmshImp::onfileNameChanged);
|
||||
}
|
||||
|
||||
DlgSettingsFemGmshImp::~DlgSettingsFemGmshImp()
|
||||
@@ -67,4 +73,13 @@ void DlgSettingsFemGmshImp::changeEvent(QEvent* e)
|
||||
}
|
||||
}
|
||||
|
||||
void DlgSettingsFemGmshImp::onfileNameChanged(QString FileName)
|
||||
{
|
||||
if (!QFileInfo::exists(FileName)) {
|
||||
QMessageBox::critical(this, tr("File does not exist"),
|
||||
tr("The specified executable \n'%1'\n does not exist!\n"
|
||||
"Specify another file please.").arg(FileName));
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_DlgSettingsFemGmshImp.cpp"
|
||||
|
||||
@@ -39,6 +39,9 @@ public:
|
||||
DlgSettingsFemGmshImp( QWidget* parent = nullptr );
|
||||
~DlgSettingsFemGmshImp();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void onfileNameChanged(QString FileName);
|
||||
|
||||
protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <QMessageBox>
|
||||
#endif
|
||||
|
||||
#include "DlgSettingsFemMystranImp.h"
|
||||
#include "ui_DlgSettingsFemMystran.h"
|
||||
@@ -35,6 +38,9 @@ DlgSettingsFemMystranImp::DlgSettingsFemMystranImp(QWidget* parent)
|
||||
, ui(new Ui_DlgSettingsFemMystranImp)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->fc_mystran_binary_path, &Gui::PrefFileChooser::fileNameChanged,
|
||||
this, &DlgSettingsFemMystranImp::onfileNameChanged);
|
||||
}
|
||||
|
||||
DlgSettingsFemMystranImp::~DlgSettingsFemMystranImp()
|
||||
@@ -69,4 +75,13 @@ void DlgSettingsFemMystranImp::changeEvent(QEvent* e)
|
||||
}
|
||||
}
|
||||
|
||||
void DlgSettingsFemMystranImp::onfileNameChanged(QString FileName)
|
||||
{
|
||||
if (!QFileInfo::exists(FileName)) {
|
||||
QMessageBox::critical(this, tr("File does not exist"),
|
||||
tr("The specified executable \n'%1'\n does not exist!\n"
|
||||
"Specify another file please.").arg(FileName));
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_DlgSettingsFemMystranImp.cpp"
|
||||
|
||||
@@ -40,6 +40,9 @@ public:
|
||||
DlgSettingsFemMystranImp( QWidget* parent = nullptr );
|
||||
~DlgSettingsFemMystranImp();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void onfileNameChanged(QString FileName);
|
||||
|
||||
protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
|
||||
Reference in New Issue
Block a user