#6771 Regression Test: Replace QMessageBox with RiaLogging::errorInMessageBox

Fix typo


Includes
This commit is contained in:
Magne Sjaastad
2020-10-13 11:19:51 +02:00
parent ef1b5a3d89
commit 03f659df0c
38 changed files with 133 additions and 232 deletions

View File

@@ -1276,7 +1276,7 @@ void RiaGuiApplication::onProjectBeingOpened()
//--------------------------------------------------------------------------------------------------
void RiaGuiApplication::onProjectOpeningError( const QString& errMsg )
{
QMessageBox::warning( nullptr, "Error when opening project file", errMsg );
RiaLogging::errorInMessageBox( nullptr, "Error when opening project file", errMsg );
m_mainWindow->setPdmRoot( nullptr );
}

View File

@@ -17,6 +17,8 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RiaLogging.h"
#include "RiaGuiApplication.h"
#include "RiaRegressionTestRunner.h"
#include <iostream>
#include <sstream>
@@ -35,8 +37,6 @@
#include <cstring>
#endif
#include "RiaGuiApplication.h"
#include "RiaRegressionTestRunner.h"
#include <QMessageBox>
#include <QString>

View File

@@ -26,7 +26,6 @@
#include "cafPdmFieldScriptingCapability.h"
#include <QAction>
#include <QMessageBox>
RICF_SOURCE_INIT( RicSaveProjectAsFeature, "RicSaveProjectAsFeature", "saveProjectAs" );
@@ -78,11 +77,7 @@ void RicSaveProjectAsFeature::onActionTriggered( bool isChecked )
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
{
QString displayMessage = response.messages().join( "\n" );
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( nullptr, "Error when saving project file", displayMessage );
}
RiaLogging::error( displayMessage );
RiaLogging::errorInMessageBox( nullptr, "Error when saving project file", displayMessage );
}
}
}

View File

@@ -23,7 +23,6 @@
#include "RiaLogging.h"
#include <QAction>
#include <QMessageBox>
RICF_SOURCE_INIT( RicSaveProjectFeature, "RicSaveProjectFeature", "saveProject" );
@@ -91,11 +90,7 @@ void RicSaveProjectFeature::onActionTriggered( bool isChecked )
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
{
QString displayMessage = response.messages().join( "\n" );
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( nullptr, "Error when saving project file", displayMessage );
}
RiaLogging::error( displayMessage );
RiaLogging::errorInMessageBox( nullptr, "Error when saving project file", displayMessage );
}
}

View File

@@ -56,7 +56,6 @@
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QMessageBox>
#include <QStringList>
#include <QTextStream>
@@ -796,10 +795,11 @@ void RicExportLgrFeature::onActionTriggered( bool isChecked )
if ( !wellsIntersectingOtherLgrs.empty() )
{
auto wellsList = wellsIntersectingOtherLgrs.join( ", " );
QMessageBox::warning( nullptr,
"LGR cells intersected",
"No export for some wells due to existing intersecting LGR(s). Affected wells: " +
wellsList );
RiaLogging::errorInMessageBox( nullptr,
"LGR cells intersected",
"No export for some wells due to existing intersecting LGR(s). Affected "
"wells: " +
wellsList );
}
}
}

View File

@@ -37,7 +37,6 @@
#include <QAction>
#include <QFileInfo>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT( RicSaveEclipseInputPropertyFeature, "RicSaveEclipseInputPropertyFeature" );
@@ -69,9 +68,10 @@ void RicSaveEclipseInputPropertyFeature::onActionTriggered( bool isChecked )
if ( !isResolved )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(),
"Export failure",
"Property is not resolved, and then it is not possible to export the property." );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Export failure",
"Property is not resolved, and then it is not possible to export the "
"property." );
return;
}

View File

@@ -41,7 +41,6 @@
#include "cafSelectionManager.h"
#include <QAction>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT( RicCreateSaturationPressurePlotsFeature, "RicCreateSaturationPressurePlotsFeature" );
@@ -188,9 +187,7 @@ void RicCreateSaturationPressurePlotsFeature::onActionTriggered( bool isChecked
text += "and DISGAS are disabled, saturation pressure are not valid.\n\n";
text += "See error log for more details.";
QMessageBox::warning( nullptr, "Saturation Pressure Plots", text );
RiaLogging::warning( text );
RiaLogging::errorInMessageBox( nullptr, "Saturation Pressure Plots", text );
}
else
{

View File

@@ -18,21 +18,21 @@
#include "RicNewIntersectionViewFeature.h"
#include "RiaLogging.h"
#include "Rim2dIntersectionView.h"
#include "RimCase.h"
#include "RimExtrudedCurveIntersection.h"
#include "Riu3DMainWindowTools.h"
#include "Riu3dSelectionManager.h"
#include "RiuViewer.h"
#include "cafSelectionManagerTools.h"
#include <QAction>
#include <QMessageBox>
#include "RiuViewer.h"
#include "cvfCamera.h"
#include <QAction>
CAF_CMD_SOURCE_INIT( RicNewIntersectionViewFeature, "RicNewIntersectionViewFeature" );
//--------------------------------------------------------------------------------------------------
@@ -69,7 +69,7 @@ void RicNewIntersectionViewFeature::onActionTriggered( bool isChecked )
"in the view ." )
.arg( intersection->name() );
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), "New Intersection View", text );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "New Intersection View", text );
}
Rim2dIntersectionView* intersectionView = intersection->correspondingIntersectionView();

View File

@@ -22,6 +22,7 @@
#include "RicScriptFeatureImpl.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RimCalcScript.h"
#include "Riu3DMainWindowTools.h"
@@ -30,7 +31,6 @@
#include "cvfAssert.h"
#include <QAction>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT( RicEditScriptFeature, "RicEditScriptFeature" );
@@ -66,9 +66,9 @@ void RicEditScriptFeature::onActionTriggered( bool isChecked )
if ( !myProcess->waitForStarted( 1000 ) )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to start script editor executable\n" + scriptEditor );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to start script editor executable\n" + scriptEditor );
}
}
}

View File

@@ -20,6 +20,7 @@
#include "RicNewOctaveScriptFeature.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RicRefreshScriptsFeature.h"
#include "RicScriptFeatureImpl.h"
@@ -36,7 +37,6 @@
#include <QFileInfo>
#include <QInputDialog>
#include <QLineEdit>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT( RicNewOctaveScriptFeature, "RicNewOctaveScriptFeature" );
@@ -109,9 +109,9 @@ void RicNewOctaveScriptFeature::onActionTriggered( bool isChecked )
QFile file( fullPathFilenameNewScript );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to create file\n" + fullPathFilenameNewScript );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to create file\n" + fullPathFilenameNewScript );
return;
}
@@ -135,9 +135,9 @@ void RicNewOctaveScriptFeature::onActionTriggered( bool isChecked )
if ( !myProcess->waitForStarted( 1000 ) )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to start script editor executable\n" + scriptEditor );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to start script editor executable\n" + scriptEditor );
}
}
}

View File

@@ -20,6 +20,7 @@
#include "RicNewPythonScriptFeature.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RicRefreshScriptsFeature.h"
#include "RicScriptFeatureImpl.h"
@@ -36,7 +37,6 @@
#include <QFileInfo>
#include <QInputDialog>
#include <QLineEdit>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT( RicNewPythonScriptFeature, "RicNewPythonScriptFeature" );
@@ -110,9 +110,9 @@ void RicNewPythonScriptFeature::onActionTriggered( bool isChecked )
QFile file( fullPathFilenameNewScript );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to create file\n" + fullPathFilenameNewScript );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to create file\n" + fullPathFilenameNewScript );
return;
}
@@ -144,9 +144,9 @@ void RicNewPythonScriptFeature::onActionTriggered( bool isChecked )
if ( !myProcess->waitForStarted( 1000 ) )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to start script editor executable\n" + scriptEditor );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to start script editor executable\n" + scriptEditor );
}
}
}

View File

@@ -57,7 +57,6 @@
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QMessageBox>
#include <QTextStream>
#include <cafPdmUiPropertyViewDialog.h>
@@ -183,10 +182,10 @@ void RicCreateTemporaryLgrFeature::onActionTriggered( bool isChecked )
if ( !wellsIntersectingOtherLgrs.empty() )
{
QMessageBox::warning( nullptr,
"LGR cells intersected",
"At least one completion intersects with an LGR. No LGR(s) for those cells are "
"produced" );
RiaLogging::errorInMessageBox( nullptr,
"LGR cells intersected",
"At least one completion intersects with an LGR. No LGR(s) for those cells "
"are produced" );
}
}
}

View File

@@ -19,6 +19,7 @@
#include "RicImportObservedDataFeature.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RimObservedDataCollection.h"
#include "RimObservedSummaryData.h"
@@ -33,7 +34,6 @@
#include <QAction>
#include <QFileInfo>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT( RicImportObservedDataFeature, "RicImportObservedDataFeature" );
@@ -93,11 +93,7 @@ void RicImportObservedDataFeature::selectObservedDataFileInDialog()
if ( !errorText.isEmpty() )
{
QMessageBox msgBox;
msgBox.setIcon( QMessageBox::Warning );
msgBox.setText( "Errors detected during import " );
msgBox.setDetailedText( errorText );
msgBox.exec();
RiaLogging::errorInMessageBox( nullptr, "Errors detected during import", errorText );
}
} while ( retryImport );
}

View File

@@ -42,7 +42,6 @@
#include <QAction>
#include <QDir>
#include <QFileInfo>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT( RicImportObservedFmuDataFeature, "RicImportObservedFmuDataFeature" );
@@ -65,13 +64,7 @@ void RicImportObservedFmuDataFeature::selectObservedDataPathInDialog()
.arg( RifReaderFmuRft::wellPathFileName() )
.arg( directory );
RiaGuiApplication* guiApp = RiaGuiApplication::instance();
if ( guiApp )
{
QMessageBox::warning( nullptr, "Import of Observed FMU Data", message );
}
RiaLogging::warning( message );
RiaLogging::errorInMessageBox( nullptr, "Import of Observed FMU Data", message );
return;
}

View File

@@ -17,13 +17,15 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RicReloadFormationNamesFeature.h"
#include "RiaLogging.h"
#include "RimFormationNames.h"
#include "RimFormationNamesCollection.h"
#include "cafSelectionManager.h"
#include <QAction>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT( RicReloadFormationNamesFeature, "RicReloadFormationNamesFeature" );
@@ -67,7 +69,7 @@ void RicReloadFormationNamesFeature::onActionTriggered( bool isChecked )
fnames->readFormationNamesFile( &errorMessage );
if ( !errorMessage.isEmpty() )
{
QMessageBox::warning( nullptr, "Reload Formation Names", errorMessage );
RiaLogging::errorInMessageBox( nullptr, "Reload Formation Names", errorMessage );
}
fnames->updateConnectedViews();

View File

@@ -28,7 +28,6 @@
#include "cafSelectionManager.h"
#include <QAction>
#include <QMessageBox>
RICF_SOURCE_INIT( RicStackSelectedCurvesFeature, "RicStackSelectedCurvesFeature", "stackCurves" );
@@ -132,11 +131,7 @@ void RicStackSelectedCurvesFeature::onActionTriggered( bool isChecked )
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
{
QString displayMessage = response.messages().join( "\n" );
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( nullptr, "Error when saving project file", displayMessage );
}
RiaLogging::error( displayMessage );
RiaLogging::errorInMessageBox( nullptr, "Error when saving project file", displayMessage );
}
}

View File

@@ -28,7 +28,6 @@
#include "cafSelectionManager.h"
#include <QAction>
#include <QMessageBox>
RICF_SOURCE_INIT( RicUnstackSelectedCurvesFeature, "RicUnstackSelectedCurvesFeature", "unstackCurves" );
@@ -92,11 +91,7 @@ void RicUnstackSelectedCurvesFeature::onActionTriggered( bool isChecked )
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
{
QString displayMessage = response.messages().join( "\n" );
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( nullptr, "Error when saving project file", displayMessage );
}
RiaLogging::error( displayMessage );
RiaLogging::errorInMessageBox( nullptr, "Error when saving project file", displayMessage );
}
}

View File

@@ -31,7 +31,6 @@
#include <QAction>
#include <QFileInfo>
#include <QMessageBox>
CAF_CMD_SOURCE_INIT( RicWellLogsImportFileFeature, "RicWellLogsImportFileFeature" );
@@ -93,12 +92,7 @@ void RicWellLogsImportFileFeature::onActionTriggered( bool isChecked )
if ( !errorMessages.empty() )
{
QString displayMessage = "Errors opening the LAS files: \n" + errorMessages.join( "\n" );
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), "File open error", displayMessage );
}
RiaLogging::warning( displayMessage );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", displayMessage );
}
}
}

View File

@@ -36,7 +36,6 @@
#include <QAction>
#include <QDir>
#include <QMessageBox>
//==================================================================================================
///
@@ -231,19 +230,7 @@ void RicImportWellPaths::onActionTriggered( bool isChecked )
if ( !messages.empty() )
{
QString displayMessage = QString( "Problem loading well path files:\n%2" ).arg( messages.join( "\n" ) );
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), "Well Path Loading", displayMessage );
}
if ( response.status() == caf::PdmScriptResponse::COMMAND_ERROR )
{
RiaLogging::error( displayMessage );
}
else
{
RiaLogging::warning( displayMessage );
}
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Well Path Loading", displayMessage );
}
}
}

View File

@@ -17,12 +17,12 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RifElementPropertyReader.h"
#include "RiaLogging.h"
#include "cvfAssert.h"
#include <cmath>
#include <QMessageBox>
#include <QString>
//--------------------------------------------------------------------------------------------------
@@ -233,11 +233,7 @@ void RifElementPropertyReader::makeElementIdToIdxMap()
//--------------------------------------------------------------------------------------------------
void RifElementPropertyReader::outputWarningAboutWrongFileData()
{
QMessageBox msgBox;
msgBox.setIcon( QMessageBox::Warning );
QString warningText;
warningText = QString( "The chosen result property does not fit the model" );
msgBox.setText( warningText );
msgBox.setStandardButtons( QMessageBox::Ok );
msgBox.exec();
QString warningText = QString( "The chosen result property does not fit the model" );
RiaLogging::errorInMessageBox( nullptr, "Element Property Reader", warningText );
}

View File

@@ -20,10 +20,10 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaRegressionTestRunner.h"
#include "Riu3DMainWindowTools.h"
#include <QFile>
#include <QMessageBox>
#include <QStringList>
#include <algorithm>
@@ -64,27 +64,19 @@ std::map<QString, cvf::ref<RigWellPathFormations>>
if ( wellNames.empty() || formationNames.empty() )
{
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(),
"Import failure",
QString( "Failed to parse %1 as a well pick file" ).arg( filePath ) );
}
RiaLogging::error( QString( "Failed to parse %1 as a well pick file" ).arg( filePath ) );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Import failure",
QString( "Failed to parse %1 as a well pick file" ).arg( filePath ) );
return result;
}
else if ( !( mdIsPresent || tvdIsPresent ) )
{
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(),
"Import failure",
QString( "Failed to parse %1 as a well pick file. Neither MD or TVD is present." )
.arg( filePath ) );
}
RiaLogging::error(
QString( "Failed to parse %1 as a well pick file. Neither MD or TVD is present." ).arg( filePath ) );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Import failure",
QString(
"Failed to parse %1 as a well pick file. Neither MD or TVD is present." )
.arg( filePath ) );
return result;
}

View File

@@ -19,6 +19,7 @@
#include "RimAnnotationCollection.h"
#include "RiaColorTables.h"
#include "RiaLogging.h"
#include "RimAnnotationGroupCollection.h"
#include "RimAnnotationLineAppearance.h"
@@ -31,7 +32,6 @@
#include "RimGridView.h"
#include "RimProject.h"
#include <QMessageBox>
#include <QString>
CAF_PDM_SOURCE_INIT( RimAnnotationCollection, "RimAnnotationCollection" );
@@ -273,7 +273,7 @@ void RimAnnotationCollection::reloadPolylinesFromFile( const std::vector<RimPoly
if ( !totalErrorMessage.isEmpty() )
{
QMessageBox::warning( nullptr, "Import Polylines", totalErrorMessage );
RiaLogging::errorInMessageBox( nullptr, "Import Polylines", totalErrorMessage );
}
}

View File

@@ -18,6 +18,7 @@
#include "RimPolylinesFromFileAnnotation.h"
#include "RiaLogging.h"
#include "RigPolyLinesData.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationLineAppearance.h"
@@ -26,7 +27,6 @@
#include <QFile>
#include <QFileInfo>
#include <QMessageBox>
CAF_PDM_SOURCE_INIT( RimPolylinesFromFileAnnotation, "PolylinesFromFileAnnotation" );
@@ -204,7 +204,7 @@ void RimPolylinesFromFileAnnotation::fieldChangedByUi( const caf::PdmFieldHandle
if ( !errorMessage.isEmpty() )
{
QString totalError = "\nError in: " + this->fileName() + "\n\t" + errorMessage;
QMessageBox::warning( nullptr, "Import Polylines", totalError );
RiaLogging::errorInMessageBox( nullptr, "Import Polylines", totalError );
}
}
else if ( changedField == &m_showLines )

View File

@@ -61,7 +61,6 @@
#include "cvfMatrix4.h"
#include "cvfPlane.h"
#include <QMessageBox>
#include <QString>
#include <cmath>
@@ -219,7 +218,7 @@ void RimFracture::fieldChangedByUi( const caf::PdmFieldHandle* changedField, con
"fracture template of unit '%1'" )
.arg( fractureUnitText );
QMessageBox::warning( nullptr, "Fracture Template Selection", warningText );
RiaLogging::errorInMessageBox( nullptr, "Fracture Template Selection", warningText );
PdmObjectHandle* prevValue = oldValue.value<caf::PdmPointer<PdmObjectHandle>>().rawPtr();
auto prevTemplate = dynamic_cast<RimFractureTemplate*>( prevValue );
@@ -522,7 +521,7 @@ void RimFracture::setFractureTemplateNoUpdate( RimFractureTemplate* fractureTemp
"fracture template of unit '%1'" )
.arg( fractureUnitText );
QMessageBox::warning( nullptr, "Fracture Template Selection", warningText );
RiaLogging::errorInMessageBox( nullptr, "Fracture Template Selection", warningText );
return;
}

View File

@@ -19,6 +19,7 @@
#include "RimWellPltPlot.h"
#include "RiaDateStringParser.h"
#include "RiaLogging.h"
#include "RiaQDateTimeTools.h"
#include "RiaWellNameComparer.h"
@@ -59,8 +60,6 @@
#include "cafPdmUiTreeSelectionEditor.h"
#include "cafVecIjk.h"
#include <QMessageBox>
#include <algorithm>
#include <iterator>
#include <tuple>
@@ -182,7 +181,7 @@ void RimWellPltPlot::setPlotXAxisTitles( RimWellLogTrack* plotTrack )
if ( presentUnitSystems.size() > 1 )
{
QMessageBox::warning( nullptr, "ResInsight PLT Plot", "Inconsistent units in PLT plot" );
RiaLogging::errorInMessageBox( nullptr, "ResInsight PLT Plot", "Inconsistent units in PLT plot" );
}
if ( presentUnitSystems.empty() ) return;
@@ -915,7 +914,7 @@ void RimWellPltPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
QString( "Display of Measured Depth (MD) for Grid or RFT curves is not possible without a "
"well log path, and the curve will be hidden in this mode.\n\n" );
QMessageBox::warning( nullptr, "Grid/RFT curve without MD", tmp );
RiaLogging::errorInMessageBox( nullptr, "Grid/RFT curve without MD", tmp );
// Do not show multiple dialogs
break;

View File

@@ -20,6 +20,7 @@
#include "Rim3dOverlayInfoConfig.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaQDateTimeTools.h"
@@ -65,7 +66,6 @@
#include <QApplication>
#include <QLocale>
#include <QMessageBox>
CAF_PDM_SOURCE_INIT( Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig" );
//--------------------------------------------------------------------------------------------------
@@ -1429,14 +1429,15 @@ void Rim3dOverlayInfoConfig::displayPropertyFilteredStatisticsMessage( bool show
if ( !isShowing )
{
isShowing = true;
QMessageBox::information( m_viewDef->viewer()->layoutWidget(),
QString( "ResInsight" ),
QString( "Statistics not available<br>"
RiaLogging::errorInMessageBox( m_viewDef->viewer()->layoutWidget(),
QString( "ResInsight" ),
QString(
"Statistics not available<br>"
"<br>"
"Statistics calculations of <b>Visible Cells</b> for <b>All Time Steps</b> "
"is not supported<br>"
"when you have an active Property filter on a time varying result.<br>" ) +
switchString );
switchString );
isShowing = false;
}
}

View File

@@ -18,6 +18,8 @@
#include "RimFormationNames.h"
#include "RiaLogging.h"
#include "RifColorLegendData.h"
#include "RigFormationNames.h"
#include "Rim3dView.h"
@@ -25,8 +27,6 @@
#include "RimTools.h"
#include "RimWellLogTrack.h"
#include "RifColorLegendData.h"
#include "RiuPlotMainWindowTools.h"
#include "cafAssert.h"
@@ -34,7 +34,6 @@
#include <QFile>
#include <QFileInfo>
#include <QMessageBox>
CAF_PDM_SOURCE_INIT( RimFormationNames, "FormationNames" );
@@ -73,7 +72,7 @@ void RimFormationNames::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
readFormationNamesFile( &errorMessage );
if ( !errorMessage.isEmpty() )
{
QMessageBox::warning( nullptr, "Formation Names", errorMessage );
RiaLogging::errorInMessageBox( nullptr, "Formation Names", errorMessage );
}
updateConnectedViews();
}

View File

@@ -18,11 +18,10 @@
#include "RimFormationNamesCollection.h"
#include "RiaLogging.h"
#include "RimCase.h"
#include "RimFormationNames.h"
#include <QMessageBox>
CAF_PDM_SOURCE_INIT( RimFormationNamesCollection, "FormationNamesCollectionObject" );
//--------------------------------------------------------------------------------------------------
@@ -107,7 +106,7 @@ std::vector<RimFormationNames*> RimFormationNamesCollection::importFiles( const
if ( !totalErrorMessage.isEmpty() )
{
QMessageBox::warning( nullptr, "Import Formation Names", totalErrorMessage );
RiaLogging::errorInMessageBox( nullptr, "Import Formation Names", totalErrorMessage );
}
return m_formationNamesList.childObjects();

View File

@@ -76,8 +76,6 @@
#include "cvfViewport.h"
#include "cvfqtUtils.h"
#include <QMessageBox>
CAF_PDM_SOURCE_INIT( RimGeoMechView, "GeoMechView" );
//--------------------------------------------------------------------------------------------------
///
@@ -152,11 +150,7 @@ void RimGeoMechView::onLoadDataAndUpdate()
? "Could not open the Odb file: \n" + m_geomechCase->gridFileName()
: QString::fromStdString( errorMessage );
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), "File open error", displayMessage );
}
RiaLogging::error( displayMessage );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", displayMessage );
}
m_geomechCase = nullptr;

View File

@@ -46,7 +46,6 @@
#include "cafProgressInfo.h"
#include <QDir>
#include <QMessageBox>
CAF_PDM_SOURCE_INIT( RimIdenticalGridCaseGroup, "RimIdenticalGridCaseGroup" );
@@ -193,11 +192,9 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
QString errorMessage = QString( "Could not open the Eclipse Grid file: \n" ) + mainCase->gridFileName() + "\n" +
"Current working directory is: \n" + QDir::currentPath();
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), "Error when opening project file", errorMessage );
}
RiaLogging::error( errorMessage );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Error when opening project file",
errorMessage );
return;
}

View File

@@ -20,11 +20,11 @@
#include "expressionparser/ExpressionParser.h"
#include "RiaCurveMerger.h"
#include "RiaLogging.h"
#include "RiaSummaryCurveDefinition.h"
#include "RiaSummaryTools.h"
#include "RiaCurveMerger.h"
#include "RimProject.h"
#include "RimSummaryAddress.h"
#include "RimSummaryCalculationCollection.h"
@@ -38,8 +38,6 @@
#include "cafPdmUiLineEditor.h"
#include "cafPdmUiTextEditor.h"
#include <QMessageBox>
#include <algorithm>
CAF_PDM_SOURCE_INIT( RimSummaryCalculation, "RimSummaryCalculation" );
@@ -199,7 +197,7 @@ bool RimSummaryCalculation::parseExpression()
QString leftHandSideVariableName = RimSummaryCalculation::findLeftHandSide( m_expression );
if ( leftHandSideVariableName.isEmpty() )
{
QMessageBox::warning( nullptr, "Expression Parser", "Failed to detect left hand side of equation" );
RiaLogging::errorInMessageBox( nullptr, "Expression Parser", "Failed to detect left hand side of equation" );
return false;
}
@@ -207,7 +205,7 @@ bool RimSummaryCalculation::parseExpression()
std::vector<QString> variableNames = ExpressionParser::detectReferencedVariables( m_expression );
if ( variableNames.size() < 1 )
{
QMessageBox::warning( nullptr, "Expression Parser", "Failed to detect any variable names" );
RiaLogging::errorInMessageBox( nullptr, "Expression Parser", "Failed to detect any variable names" );
return false;
}
@@ -265,18 +263,18 @@ bool RimSummaryCalculation::calculate()
if ( !v->summaryCase() )
{
QMessageBox::warning( nullptr,
"Expression Parser",
QString( "No summary case defined for variable : %1" ).arg( v->name() ) );
RiaLogging::errorInMessageBox( nullptr,
"Expression Parser",
QString( "No summary case defined for variable : %1" ).arg( v->name() ) );
return false;
}
if ( !v->summaryAddress() )
{
QMessageBox::warning( nullptr,
"Expression Parser",
QString( "No summary address defined for variable : %1" ).arg( v->name() ) );
RiaLogging::errorInMessageBox( nullptr,
"Expression Parser",
QString( "No summary address defined for variable : %1" ).arg( v->name() ) );
return false;
}
@@ -339,7 +337,7 @@ bool RimSummaryCalculation::calculate()
QString s = "The following error message was received from the parser library : \n\n";
s += errorText;
QMessageBox::warning( nullptr, "Expression Parser", s );
RiaLogging::errorInMessageBox( nullptr, "Expression Parser", s );
}
return evaluatedOk;

View File

@@ -19,6 +19,10 @@
#include "RimWellLogFileCurve.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RigWellLogCurveData.h"
#include "RigWellPath.h"
@@ -36,14 +40,9 @@
#include "RiuQwtPlotCurve.h"
#include "RiuQwtPlotWidget.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "cafPdmUiTreeOrdering.h"
#include <QFileInfo>
#include <QMessageBox>
CAF_PDM_SOURCE_INIT( RimWellLogFileCurve, "WellLogFileCurve" );
@@ -155,7 +154,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
tmp += "Control display of this warning from \"Preferences->Show LAS curve without TVD "
"warning\"";
QMessageBox::warning( nullptr, "LAS curve without current depth type", tmp );
RiaLogging::errorInMessageBox( nullptr, "LAS curve without current depth type", tmp );
}
}

View File

@@ -53,7 +53,6 @@
#include <QFile>
#include <QFileInfo>
#include <QMessageBox>
#include <QString>
#include "RimFileWellPath.h"
@@ -401,11 +400,7 @@ void RimWellPathCollection::addWellPathFormations( const QStringList& filePaths
if ( fileReadSuccess )
{
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::information( Riu3DMainWindowTools::mainWindowWidget(), "Well Picks Import", outputMessage );
}
RiaLogging::info( outputMessage );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Well Picks Import", outputMessage );
}
this->sortWellsByName();
@@ -562,11 +557,7 @@ void RimWellPathCollection::readWellPathFormationFiles()
QString errorMessage;
if ( !wellPaths[wpIdx]->readWellPathFormationsFile( &errorMessage, m_wellPathFormationsImporter ) )
{
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), "File open error", errorMessage );
}
RiaLogging::warning( errorMessage );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", errorMessage );
}
progress.setProgressDescription( QString( "Reading formation file %1" ).arg( wpIdx ) );
@@ -586,11 +577,7 @@ void RimWellPathCollection::reloadAllWellPathFormations()
QString errorMessage;
if ( !wellPaths[wpIdx]->reloadWellPathFormationsFile( &errorMessage, m_wellPathFormationsImporter ) )
{
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), "File open error", errorMessage );
}
RiaLogging::warning( errorMessage );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", errorMessage );
}
progress.setProgressDescription( QString( "Reloading formation file %1" ).arg( wpIdx ) );

View File

@@ -19,6 +19,7 @@
#include "RimSummaryCaseCollection.h"
#include "RiaFieldHandleTools.h"
#include "RiaLogging.h"
#include "RiaStatisticsTools.h"
#include "RiaWeightedMeanCalculator.h"
@@ -38,7 +39,6 @@
#include "cafPdmFieldScriptingCapability.h"
#include <QFileInfo>
#include <QMessageBox>
#include <algorithm>
#include <cmath>
@@ -911,10 +911,8 @@ bool RimSummaryCaseCollection::validateEnsembleCases( const std::vector<RimSumma
}
catch ( QString errorMessage )
{
QMessageBox mbox;
mbox.setIcon( QMessageBox::Icon::Warning );
mbox.setText( errorMessage );
mbox.exec();
RiaLogging::errorInMessageBox( nullptr, "", errorMessage );
return false;
}
}

View File

@@ -22,6 +22,7 @@
#include "RiaCurveMerger.h"
#include "RiaDefines.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaStatisticsTools.h"
#include "RiaSummaryTools.h"
@@ -58,7 +59,6 @@
#include "qwt_plot.h"
#include "cafPdmUiLineEditor.h"
#include <QMessageBox>
CAF_PDM_SOURCE_INIT( RimSummaryCurve, "SummaryCurve" );
@@ -1166,7 +1166,7 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
.arg( last.toString( formatString ) );
}
QMessageBox::warning( nullptr, "Detected no overlapping time steps", description );
RiaLogging::errorInMessageBox( nullptr, "Detected no overlapping time steps", description );
}
}
}

View File

@@ -40,7 +40,6 @@
#include "RimFlowDiagSolution.h"
#include "cafProgressInfo.h"
#include <QMessageBox>
#include "cvfTrace.h"
@@ -287,10 +286,11 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
if ( restartFileCount <= timeStepIndex && restartFileCount != maxTimeStepCount )
{
QMessageBox::critical( nullptr,
"ResInsight",
"Flow Diagnostics: Could not find all the restart files. Results will not be "
"loaded." );
RiaLogging::errorInMessageBox( nullptr,
"ResInsight",
"Flow Diagnostics: Could not find all the restart files. Results will "
"not be "
"loaded." );
return result;
}
@@ -307,7 +307,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
}
catch ( const std::exception& e )
{
QMessageBox::critical( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
RiaLogging::errorInMessageBox( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
return result;
}
@@ -340,10 +340,11 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
if ( !currentRestartData->selectReportStep( reportStepNumber ) )
{
QMessageBox::critical( nullptr,
"ResInsight",
"Flow Diagnostics: Could not find the requested timestep in the result file. Results "
"will not be loaded." );
RiaLogging::errorInMessageBox( nullptr,
"ResInsight",
"Flow Diagnostics: Could not find the requested timestep in the result file. "
"Results "
"will not be loaded." );
return result;
}
@@ -386,7 +387,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
}
catch ( const std::exception& e )
{
QMessageBox::critical( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
RiaLogging::errorInMessageBox( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
return result;
}
@@ -505,7 +506,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
}
catch ( const std::exception& e )
{
QMessageBox::critical( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
RiaLogging::errorInMessageBox( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
return result;
}
@@ -611,7 +612,7 @@ void RigFlowDiagSolverInterface::reportRelPermCurveError( const QString& message
{
if ( m_relpermCurveErrorCount == 0 )
{
QMessageBox::critical( nullptr, "ResInsight", "RelPerm curve problems: \n" + message );
RiaLogging::errorInMessageBox( nullptr, "ResInsight", "RelPerm curve problems: \n" + message );
}
m_relpermCurveErrorCount++;
}
@@ -623,7 +624,7 @@ void RigFlowDiagSolverInterface::reportPvtCurveError( const QString& message )
{
if ( m_pvtCurveErrorCount == 0 )
{
QMessageBox::critical( nullptr, "ResInsight", "PVT curve problems: \n" + message );
RiaLogging::errorInMessageBox( nullptr, "ResInsight", "PVT curve problems: \n" + message );
}
m_pvtCurveErrorCount++;
}
@@ -662,7 +663,7 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
}
catch ( const std::exception& e )
{
QMessageBox::critical( nullptr, "ResInsight", "Flow Diagnostics: " + QString( e.what() ) );
RiaLogging::errorInMessageBox( nullptr, "ResInsight", "Flow Diagnostics: " + QString( e.what() ) );
}
return result;

View File

@@ -23,7 +23,6 @@
#include "RiuMainWindow.h"
#include <QMessageBox>
#include <QString>
//--------------------------------------------------------------------------------------------------
@@ -72,10 +71,5 @@ void Riu3DMainWindowTools::selectAsCurrentItem( const caf::PdmObject* object, bo
//--------------------------------------------------------------------------------------------------
void Riu3DMainWindowTools::reportAndShowWarning( const QString& warningDialogHeader, const QString& warningtext )
{
if ( RiaGuiApplication::isRunning() )
{
QMessageBox::warning( Riu3DMainWindowTools::mainWindowWidget(), warningDialogHeader, warningtext );
}
RiaLogging::error( warningtext );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), warningDialogHeader, warningtext );
}

View File

@@ -20,11 +20,11 @@
#include "RiaFilePathTools.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaStringListSerializer.h"
#include <QAction>
#include <QFileInfo>
#include <QMessageBox>
//--------------------------------------------------------------------------------------------------
///
@@ -138,7 +138,7 @@ void RiuRecentFileActionProvider::slotOpenRecentFile()
}
else
{
QMessageBox::warning( nullptr, "File open", "Failed to import file located at\n" + fileName );
RiaLogging::errorInMessageBox( nullptr, "File open", "Failed to import file located at\n" + fileName );
removeFileName( fileName );
}