(#537) Showing error message box if opening a LAS file fails

This commit is contained in:
Pål Hagen
2015-09-24 09:37:26 +02:00
parent 71e74599ff
commit 5d18209e26
4 changed files with 28 additions and 4 deletions

View File

@@ -27,11 +27,14 @@
#include "RimWellLogFile.h"
#include "RivWellPathCollectionPartMgr.h"
#include "RiuMainWindow.h"
#include "cafPdmUiEditorHandle.h"
#include "cafProgressInfo.h"
#include <QFile>
#include <QFileInfo>
#include <QMessageBox>
#include <fstream>
#include <cmath>
@@ -132,9 +135,17 @@ void RimWellPathCollection::readWellPathFiles()
wellPaths[wpIdx]->readWellPathFile();
}
if (wellPaths[wpIdx]->m_wellLogFile)
RimWellLogFile* wellLogFile = wellPaths[wpIdx]->m_wellLogFile;
if (wellLogFile)
{
wellPaths[wpIdx]->m_wellLogFile->readFile();
if (!wellLogFile->readFile())
{
QString errorMessage = "Could not open the well log file: \n" + wellLogFile->fileName();
QMessageBox::warning(RiuMainWindow::instance(),
"File open error",
errorMessage);
}
}
progress.setProgressDescription(QString("Reading file %1").arg(wellPaths[wpIdx]->name));