#2443 Replace QMessageBox with RiaLogging to avoid blocking of batch commands

This commit is contained in:
Magne Sjaastad 2018-02-02 09:37:34 +01:00
parent dc0c6d1b47
commit ba09906163
4 changed files with 7 additions and 8 deletions

View File

@ -20,6 +20,7 @@
#include "RicExportFaultsFeature.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RigEclipseCaseData.h"
#include "RigFault.h"
@ -33,7 +34,6 @@
#include <QAction>
#include <QFileDialog>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicExportFaultsFeature, "RicExportFaultsFeature");
@ -191,7 +191,7 @@ void RicExportFaultsFeature::saveFault(QString completeFilename, const RigMainGr
if (!exportFile.open(QIODevice::WriteOnly) )
{
QMessageBox::critical(NULL, "ResInsight - Export Faults", "Could not open the file :\n" + completeFilename);
RiaLogging::error("Could not open the file : " + completeFilename);
}
QTextStream stream(&exportFile);

View File

@ -20,6 +20,7 @@
#include "RicSaveEclipseResultAsInputPropertyExec.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RicExportFeatureImpl.h"
@ -38,7 +39,7 @@
#include "cafPdmUiPropertyViewDialog.h"
#include "cafUtils.h"
#include <QMessageBox>
//--------------------------------------------------------------------------------------------------
///
@ -101,7 +102,7 @@ void RicSaveEclipseResultAsInputPropertyExec::redo()
bool isOk = RifEclipseInputFileTools::writeBinaryResultToTextFile(exportSettings.fileName, m_cellColors->reservoirView()->eclipseCase()->eclipseCaseData(), timeStep, m_cellColors, exportSettings.eclipseKeyword, exportSettings.undefinedValue);
if (!isOk)
{
QMessageBox::critical(NULL, "File export", "Failed to exported current result to " + exportSettings.fileName);
RiaLogging::error("Failed to exported current result to " + exportSettings.fileName);
}
}
}

View File

@ -38,7 +38,6 @@
#include <QFileDialog>
#include <QFileInfo>
#include <QMdiSubWindow>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicSnapshotAllPlotsToFileFeature, "RicSnapshotAllPlotsToFileFeature");
@ -63,7 +62,7 @@ void RicSnapshotAllPlotsToFileFeature::saveAllPlots()
exportSnapshotOfAllPlotsIntoFolder(snapshotFolderName);
QString text = QString("Exported snapshots to folder : \n%1").arg(snapshotFolderName);
QMessageBox::information(nullptr, "Export Snapshots To Folder", text);
RiaLogging::info(text);
}
//--------------------------------------------------------------------------------------------------

View File

@ -44,7 +44,6 @@
#include <QFileDialog>
#include <QFileInfo>
#include <QMdiSubWindow>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT(RicSnapshotAllViewsToFileFeature, "RicSnapshotAllViewsToFileFeature");
@ -64,7 +63,7 @@ void RicSnapshotAllViewsToFileFeature::saveAllViews()
exportSnapshotOfAllViewsIntoFolder(snapshotFolderName);
QString text = QString("Exported snapshots to folder : \n%1").arg(snapshotFolderName);
QMessageBox::information(nullptr, "Export Snapshots To Folder", text);
RiaLogging::info(text);
}
//--------------------------------------------------------------------------------------------------