#13126 RiaLogging: Extract errorInMessageBox to RiuMessageDialog

Move the QMessageBox-displaying helper out of the logging utility into a
dedicated UI class. RiaLogging.h no longer pulls QMessageBox/QWidget into
the ~270 files that include it. Behavior is preserved: showError displays
the dialog when running interactively (and not under regression tests),
then forwards the text to RiaLogging::error.
This commit is contained in:
Kristian Bendiksen committed 2026-05-08 10:11:09 +02:00
1 parent 0e27709fe3
commit bb0afbf962
56 files changed
+249 -147

No files matched your search

@@ -45,6 +45,7 @@
#include "RiaVersionInfo.h"
#include "RiaViewRedrawScheduler.h"
#include "RiaWellNameComparer.h"
#include "RiuMessageDialog.h"
#include "RicImportEclipseCaseFeature.h"
#include "RicImportGeneralDataFeature.h"
@@ -1874,7 +1875,7 @@ RiaOsduConnector* RiaApplication::makeOsduConnector()
errMsg +=
"Make sure that the SSL libraries are available (on Windows platform, they are called 'libcrypto*.dll' and 'libssl*.dll').";
#endif
RiaLogging::errorInMessageBox( nullptr, "OSDU Service Connection", errMsg );
RiuMessageDialog::showError( nullptr, "OSDU Service Connection", errMsg );
return nullptr;
}
@@ -39,6 +39,7 @@
#include "RiaSocketServer.h"
#include "RiaVersionInfo.h"
#include "RiaViewRedrawScheduler.h"
#include "RiuMessageDialog.h"
#include "Summary/RiaSummaryTools.h"
#include "EclipseCommands/RicImportEclipseCaseFeature.h"
@@ -1327,7 +1328,7 @@ void RiaGuiApplication::onProjectBeingOpened()
//--------------------------------------------------------------------------------------------------
void RiaGuiApplication::onProjectOpeningError( const QString& errMsg )
{
RiaLogging::errorInMessageBox( nullptr, "Error when opening project file", errMsg );
RiuMessageDialog::showError( nullptr, "Error when opening project file", errMsg );
if ( m_mainWindow ) m_mainWindow->setPdmRoot( nullptr );
}
@@ -17,9 +17,8 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RiaLogging.h"
#include "RiaGuiApplication.h"
#include "RiaApplication.h"
#include "RiaPreferencesSystem.h"
#include "RiaRegressionTestRunner.h"
#include <iostream>
#include <sstream>
@@ -38,7 +37,6 @@
#include <cstring>
#endif
#include <QMessageBox>
#include <QString>
//==================================================================================================
@@ -346,25 +344,6 @@ void RiaLogging::debug( const QString& message, const QString logKeyword )
setLastMessage( message );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaLogging::errorInMessageBox( QWidget* parent, const QString& title, const QString& text )
{
if ( RiaGuiApplication::isRunning() && !RiaRegressionTestRunner::instance()->isRunningRegressionTests() )
{
if ( parent == nullptr )
{
parent = RiaGuiApplication::widgetToUseAsParent();
}
QMessageBox dlg( QMessageBox::Critical, title, text, QMessageBox::Ok, parent );
dlg.setWindowFlags( dlg.windowFlags() | Qt::WindowStaysOnTopHint );
dlg.exec();
}
RiaLogging::error( text );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -25,8 +25,6 @@
#include <QString>
class QWidget;
enum class RILogLevel
{
RI_LL_DISABLED = 0,
@@ -74,8 +72,6 @@ public:
static void info( const QString& message, const QString logKeyword = "" );
static void debug( const QString& message, const QString logKeyword = "" );
static void errorInMessageBox( QWidget* parent, const QString& title, const QString& text );
static std::chrono::time_point<std::chrono::high_resolution_clock> currentTime();
static void logElapsedTime( const QString& message, const std::chrono::time_point<std::chrono::high_resolution_clock>& startTime );
@@ -20,6 +20,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "PlotTemplates/RimPlotTemplateFileItem.h"
#include "RimPressureDepthData.h"
@@ -49,9 +50,9 @@ void RicOpenInTextEditorFeature::openFileInTextEditor( const QString& filePath,
if ( !myProcess->waitForStarted( 1000 ) )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Text editor",
"Failed to start text editor\n" + textEditorExecutablePath );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(),
"Text editor",
"Failed to start text editor\n" + textEditorExecutablePath );
}
}
}
@@ -22,6 +22,7 @@
#include "RiaLogging.h"
#include "RicSaveProjectFeature.h"
#include "Riu3DMainWindowTools.h"
#include "RiuMessageDialog.h"
#include "cafPdmFieldScriptingCapability.h"
@@ -69,7 +70,7 @@ void RicSaveProjectAsFeature::onActionTriggered( bool isChecked )
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
{
QString displayMessage = response.messages().join( "\n" );
RiaLogging::errorInMessageBox( nullptr, "Error when saving project file", displayMessage );
RiuMessageDialog::showError( nullptr, "Error when saving project file", displayMessage );
}
}
}
@@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include <QAction>
@@ -82,7 +83,7 @@ void RicSaveProjectFeature::onActionTriggered( bool isChecked )
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
{
QString displayMessage = response.messages().join( "\n" );
RiaLogging::errorInMessageBox( nullptr, "Error when saving project file", displayMessage );
RiuMessageDialog::showError( nullptr, "Error when saving project file", displayMessage );
}
}
@@ -20,6 +20,7 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "RifTextDataTableFormatter.h"
@@ -98,7 +99,7 @@ void RicExportCompletionsWellSegmentsFeature::onActionTriggered( bool isChecked
if ( !folder.exists() )
{
QString txt = QString( "The path '%1' does not exist. Aborting export." ).arg( exportSettings.folder );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Export", txt );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "Export", txt );
return;
}
@@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "ExportCommands/RicExportLgrFeature.h"
#include "RicExportFeatureImpl.h"
@@ -166,7 +167,7 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl
if ( !folder.exists() )
{
QString txt = QString( "The path '%1' does not exist. Aborting export." ).arg( exportSettings->folder );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Export", txt );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "Export", txt );
return;
}
@@ -22,6 +22,7 @@
#include "RiaPreferencesSystem.h"
#include "RiaWeightedMeanCalculator.h"
#include "RigStatisticsTools.h"
#include "RiuMessageDialog.h"
#include "ExportCommands/RicExportLgrFeature.h"
#include "RicExportCompletionDataSettingsUi.h"
@@ -92,7 +93,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
if ( !folder.exists() )
{
QString txt = QString( "The path '%1' does not exist. Aborting export." ).arg( exportSettings.folder );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Export", txt );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "Export", txt );
return;
}
@@ -20,6 +20,7 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "CompletionExportCommands/RicWellPathExportCompletionDataFeature.h"
#include "RicExportLgrUi.h"
@@ -814,11 +815,11 @@ void RicExportLgrFeature::onActionTriggered( bool isChecked )
if ( !wellsIntersectingOtherLgrs.empty() )
{
auto wellsList = wellsIntersectingOtherLgrs.join( ", " );
RiaLogging::errorInMessageBox( nullptr,
"LGR cells intersected",
"No export for some wells due to existing intersecting LGR(s). Affected "
"wells: " +
wellsList );
RiuMessageDialog::showError( nullptr,
"LGR cells intersected",
"No export for some wells due to existing intersecting LGR(s). Affected "
"wells: " +
wellsList );
}
}
}
@@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "RicEclipseCellResultToFileImpl.h"
#include "RicExportFeatureImpl.h"
@@ -68,10 +69,10 @@ void RicSaveEclipseInputPropertyFeature::onActionTriggered( bool isChecked )
if ( !isResolved )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Export failure",
"Property is not resolved, and then it is not possible to export the "
"property." );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(),
"Export failure",
"Property is not resolved, and then it is not possible to export the "
"property." );
return;
}
@@ -22,6 +22,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaPorosityModel.h"
#include "RiuMessageDialog.h"
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
@@ -170,7 +171,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.";
RiaLogging::errorInMessageBox( nullptr, "Saturation Pressure Plots", text );
RiuMessageDialog::showError( nullptr, "Saturation Pressure Plots", text );
}
else
{
@@ -22,6 +22,7 @@
#include "Rim2dIntersectionView.h"
#include "RimCase.h"
#include "RimExtrudedCurveIntersection.h"
#include "RiuMessageDialog.h"
#include "Riu3DMainWindowTools.h"
#include "Riu3dSelectionManager.h"
@@ -68,7 +69,7 @@ void RicNewIntersectionViewFeature::onActionTriggered( bool isChecked )
"in the view ." )
.arg( intersection->name() );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "New Intersection View", text );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "New Intersection View", text );
}
Rim2dIntersectionView* intersectionView = intersection->correspondingIntersectionView();
@@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "ApplicationCommands/RicOpenInTextEditorFeature.h"
#include "RicRefreshScriptsFeature.h"
@@ -102,9 +103,9 @@ void RicNewOctaveScriptFeature::onActionTriggered( bool isChecked )
QFile file( fullPathFilenameNewScript );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to create file\n" + fullPathFilenameNewScript );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to create file\n" + fullPathFilenameNewScript );
return;
}
@@ -22,6 +22,7 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiuMessageDialog.h"
#include "ApplicationCommands/RicOpenInTextEditorFeature.h"
#include "RicRefreshScriptsFeature.h"
@@ -104,9 +105,9 @@ void RicNewPythonScriptFeature::onActionTriggered( bool isChecked )
QFile file( fullPathFilenameNewScript );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to create file\n" + fullPathFilenameNewScript );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(),
"Script editor",
"Failed to create file\n" + fullPathFilenameNewScript );
return;
}
@@ -25,6 +25,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiuMessageDialog.h"
#include "Summary/RiaSummaryAddressAnalyzer.h"
#include "Summary/RiaSummaryTools.h"
@@ -105,7 +106,7 @@ void RicSaveMultiPlotTemplateFeature::onActionTriggered( bool isChecked )
QFile exportFile( fileName );
if ( !exportFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
RiaLogging::errorInMessageBox( nullptr, "Save Plot Template", QString( "Could not save to the file: %1" ).arg( fileName ) );
RiuMessageDialog::showError( nullptr, "Save Plot Template", QString( "Could not save to the file: %1" ).arg( fileName ) );
return;
}
@@ -21,6 +21,7 @@
#include "RiaCellDividingTools.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "ExportCommands/RicExportLgrFeature.h"
#include "ExportCommands/RicExportLgrUi.h"
@@ -122,10 +123,10 @@ void RicCreateTemporaryLgrFeature::onActionTriggered( bool isChecked )
if ( !wellsIntersectingOtherLgrs.empty() )
{
RiaLogging::errorInMessageBox( nullptr,
"LGR cells intersected",
"At least one completion intersects with an LGR. No LGR(s) for those cells "
"are produced" );
RiuMessageDialog::showError( nullptr,
"LGR cells intersected",
"At least one completion intersects with an LGR. No LGR(s) for those cells "
"are produced" );
}
}
}
@@ -21,6 +21,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiuMessageDialog.h"
#include "RifGridCalculation.h"
#include "RifGridCalculationExporter.h"
@@ -99,9 +100,9 @@ void RicExportGridCalculationExpressionsFeature::onActionTriggered( bool isCheck
auto [isOk, errorMessage] = RifGridCalculationExporter::writeToFile( calculations, fileName.toStdString() );
if ( !isOk )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Grid Calculation Export Error",
QString::fromStdString( errorMessage ) );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(),
"Grid Calculation Export Error",
QString::fromStdString( errorMessage ) );
}
}
@@ -21,6 +21,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiuMessageDialog.h"
#include "RifSummaryCalculation.h"
#include "RifSummaryCalculationExporter.h"
@@ -106,7 +107,7 @@ void RicExportSummaryCalculationExpressionsFeature::onActionTriggered( bool isCh
auto [isOk, errorMessage] = RifSummaryCalculationExporter::writeToFile( calculations, fileName.toStdString() );
if ( !isOk )
{
RiaLogging::errorInMessageBox( RiuPlotMainWindow::instance(), "Summary Calculation Export Error", QString::fromStdString( errorMessage ) );
RiuMessageDialog::showError( RiuPlotMainWindow::instance(), "Summary Calculation Export Error", QString::fromStdString( errorMessage ) );
}
}
@@ -22,6 +22,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiuMessageDialog.h"
#include "RimEclipseCaseTools.h"
#include "RimEclipseResultAddress.h"
@@ -61,9 +62,9 @@ void RicImportGridCalculationExpressionsFeature::onActionTriggered( bool isCheck
auto [calculations, errorMessage] = RifGridCalculationImporter::readFromFile( fileName.toStdString() );
if ( !errorMessage.empty() )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Grid Calculation Import Error",
QString::fromStdString( errorMessage ) );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(),
"Grid Calculation Import Error",
QString::fromStdString( errorMessage ) );
return;
}
@@ -20,6 +20,7 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "RimObservedDataCollection.h"
#include "RimObservedSummaryData.h"
@@ -80,7 +81,7 @@ void RicImportObservedDataFeature::selectObservedDataFileInDialog()
if ( !errorText.isEmpty() )
{
RiaLogging::errorInMessageBox( nullptr, "Errors detected during import", errorText );
RiuMessageDialog::showError( nullptr, "Errors detected during import", errorText );
}
}
@@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "RicImportFormationNamesFeature.h"
@@ -62,7 +63,7 @@ void RicImportObservedFmuDataFeature::selectObservedDataPathInDialog()
.arg( RifReaderFmuRft::wellPathFileName() )
.arg( directory );
RiaLogging::errorInMessageBox( nullptr, "Import of Observed FMU Data", message );
RiuMessageDialog::showError( nullptr, "Import of Observed FMU Data", message );
return;
}
@@ -22,6 +22,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiuMessageDialog.h"
#include "RimOilField.h"
#include "RimProject.h"
@@ -61,7 +62,7 @@ void RicImportSummaryCalculationExpressionsFeature::onActionTriggered( bool isCh
auto [calculations, errorMessage] = RifSummaryCalculationImporter::readFromFile( fileName.toStdString() );
if ( !errorMessage.empty() )
{
RiaLogging::errorInMessageBox( RiuPlotMainWindow::instance(), "Summary Calculation Import Error", QString::fromStdString( errorMessage ) );
RiuMessageDialog::showError( RiuPlotMainWindow::instance(), "Summary Calculation Import Error", QString::fromStdString( errorMessage ) );
return;
}
@@ -20,6 +20,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "RimOilField.h"
#include "RimProject.h"
@@ -76,7 +77,7 @@ void RicImportWellLogCsvFileFeature::onActionTriggered( bool isChecked )
{
wellPath->deleteWellLog( wellLogCsvFile );
QString displayMessage = "Errors opening the CSV file: \n" + errorMessage;
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", displayMessage );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "File open error", displayMessage );
return;
}
else
@@ -19,6 +19,7 @@
#include "RicReloadFormationNamesFeature.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "Formations/RimFormationNames.h"
#include "Formations/RimFormationNamesCollection.h"
@@ -64,7 +65,7 @@ void RicReloadFormationNamesFeature::onActionTriggered( bool isChecked )
fnames->readFormationNamesFile( &errorMessage );
if ( !errorMessage.isEmpty() )
{
RiaLogging::errorInMessageBox( nullptr, "Reload Formation Names", errorMessage );
RiuMessageDialog::showError( nullptr, "Reload Formation Names", errorMessage );
}
fnames->updateConnectedViews();
@@ -20,6 +20,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmObject.h"
@@ -127,7 +128,7 @@ void RicStackSelectedCurvesFeature::onActionTriggered( bool isChecked )
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
{
QString displayMessage = response.messages().join( "\n" );
RiaLogging::errorInMessageBox( nullptr, "Error when saving project file", displayMessage );
RiuMessageDialog::showError( nullptr, "Error when saving project file", displayMessage );
}
}
@@ -20,6 +20,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmObject.h"
@@ -88,7 +89,7 @@ void RicUnstackSelectedCurvesFeature::onActionTriggered( bool isChecked )
if ( response.status() != caf::PdmScriptResponse::COMMAND_OK )
{
QString displayMessage = response.messages().join( "\n" );
RiaLogging::errorInMessageBox( nullptr, "Error when saving project file", displayMessage );
RiuMessageDialog::showError( nullptr, "Error when saving project file", displayMessage );
}
}
@@ -20,6 +20,7 @@
#include "RicNewPltPlotFeature.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "RicNewWellLogPlotFeatureImpl.h"
#include "RicWellLogPlotCurveFeatureImpl.h"
@@ -91,7 +92,7 @@ void RicNewPltPlotFeature::onActionTriggered( bool isChecked )
QString displayMessage =
"To create a PLT plot, either import a LAS file with observed production data or import a well path trajectory.";
RiaLogging::errorInMessageBox( nullptr, "No well data available to create a PLT plot", displayMessage );
RiuMessageDialog::showError( nullptr, "No well data available to create a PLT plot", displayMessage );
return;
}
@@ -22,6 +22,7 @@
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "RimProject.h"
#include "Riu3DMainWindowTools.h"
@@ -81,7 +82,7 @@ void RicWellLogsImportFileFeature::onActionTriggered( bool isChecked )
if ( !errorMessages.empty() )
{
QString displayMessage = "Errors opening the LAS files: \n" + errorMessages.join( "\n" );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", displayMessage );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "File open error", displayMessage );
}
}
}
@@ -22,6 +22,7 @@
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "RimFileWellPath.h"
#include "RimOilField.h"
@@ -218,7 +219,7 @@ void RicImportWellPaths::onActionTriggered( bool isChecked )
if ( !messages.empty() )
{
QString displayMessage = QString( "Problem loading well path files:\n%2" ).arg( messages.join( "\n" ) );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Well Path Loading", displayMessage );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "Well Path Loading", displayMessage );
}
}
}
@@ -19,6 +19,7 @@
#include "RifElementPropertyReader.h"
#include "RiaEclipseUnitTools.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "cvfAssert.h"
@@ -226,5 +227,5 @@ void RifElementPropertyReader::outputWarningAboutWrongFileData()
{
QString warningText = QString( "The chosen result property does not fit the model" );
RiaLogging::errorInMessageBox( nullptr, "Element Property Reader", warningText );
RiuMessageDialog::showError( nullptr, "Element Property Reader", warningText );
}
@@ -24,6 +24,7 @@
#include "RiaEclipseUnitTools.h"
#include "RiaLogging.h"
#include "RiaStringEncodingTools.h"
#include "RiuMessageDialog.h"
#include "RifActiveCellsReader.h"
#include "RifEclipseInputFileTools.h"
@@ -454,7 +455,7 @@ bool RifReaderEclipseOutput::open( const QString& fileName, RigEclipseCaseData*
{
QString msg = QString( "The grid appears to be a radial grid.\nTo import this grid, open Preferences, and set 'Radial "
"Grid Display Mode' to 'Show Cells as Cylinder Segments'." );
RiaLogging::errorInMessageBox( nullptr, "Potential Radial Grid", msg );
RiuMessageDialog::showError( nullptr, "Potential Radial Grid", msg );
}
if ( readerSettings().useCylindricalCoordinates )
@@ -22,6 +22,7 @@
#include "RiaLogging.h"
#include "RiaRegressionTestRunner.h"
#include "Riu3DMainWindowTools.h"
#include "RiuMessageDialog.h"
#include <QFile>
#include <QStringList>
@@ -63,17 +64,17 @@ std::map<QString, cvf::ref<RigWellPathFormations>> RifWellPathFormationReader::r
if ( wellNames.empty() || formationNames.empty() )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Import failure",
QString( "Failed to parse %1 as a well pick file" ).arg( filePath ) );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(),
"Import failure",
QString( "Failed to parse %1 as a well pick file" ).arg( filePath ) );
return result;
}
else if ( !( mdIsPresent || tvdIsPresent ) )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
"Import failure",
QString( "Failed to parse %1 as a well pick file. Neither MD or TVD is present." ).arg( filePath ) );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(),
"Import failure",
QString( "Failed to parse %1 as a well pick file. Neither MD or TVD is present." ).arg( filePath ) );
return result;
}
@@ -21,6 +21,7 @@
#include "RiaLogging.h"
#include "RiaTextStringTools.h"
#include "RigPolyLinesData.h"
#include "RiuMessageDialog.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationLineAppearance.h"
@@ -207,7 +208,7 @@ void RimPolylinesFromFileAnnotation::fieldChangedByUi( const caf::PdmFieldHandle
if ( !errorMessage.isEmpty() )
{
QString totalError = "\nError in: " + fileName() + "\n\t" + errorMessage;
RiaLogging::errorInMessageBox( nullptr, "Import Polylines", totalError );
RiuMessageDialog::showError( nullptr, "Import Polylines", totalError );
}
}
else if ( changedField == &m_showLines )
@@ -24,6 +24,7 @@
#include "RiaCompletionTypeCalculationScheduler.h"
#include "RiaEclipseUnitTools.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "Riu3DMainWindowTools.h"
@@ -212,7 +213,7 @@ void RimFracture::fieldChangedByUi( const caf::PdmFieldHandle* changedField, con
"fracture template of unit '%1'" )
.arg( fractureUnitText );
RiaLogging::errorInMessageBox( nullptr, "Fracture Template Selection", warningText );
RiuMessageDialog::showError( nullptr, "Fracture Template Selection", warningText );
PdmObjectHandle* prevValue = oldValue.value<caf::PdmPointer<PdmObjectHandle>>().rawPtr();
auto prevTemplate = dynamic_cast<RimFractureTemplate*>( prevValue );
@@ -551,7 +552,7 @@ void RimFracture::setFractureTemplateNoUpdate( RimFractureTemplate* fractureTemp
"fracture template of unit '%1'" )
.arg( fractureUnitText );
RiaLogging::errorInMessageBox( nullptr, "Fracture Template Selection", warningText );
RiuMessageDialog::showError( nullptr, "Fracture Template Selection", warningText );
return;
}
@@ -23,6 +23,7 @@
#include "RiaPlotDefines.h"
#include "RiaQDateTimeTools.h"
#include "RiaWellNameComparer.h"
#include "RiuMessageDialog.h"
#include "RifReaderRftInterface.h"
@@ -171,7 +172,7 @@ void RimWellPltPlot::setPlotXAxisTitles( RimWellLogTrack* plotTrack )
}
if ( presentUnitSystems.size() > 1 )
{
RiaLogging::errorInMessageBox( nullptr, "ResInsight PLT Plot", "Inconsistent units in PLT plot" );
RiuMessageDialog::showError( nullptr, "ResInsight PLT Plot", "Inconsistent units in PLT plot" );
}
if ( presentUnitSystems.empty() ) return;
@@ -858,7 +859,7 @@ void RimWellPltPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
"well log path, and the curve will be hidden "
"in this mode.\n\n" );
RiaLogging::errorInMessageBox( nullptr, "Grid/RFT curve without MD", tmp );
RiuMessageDialog::showError( nullptr, "Grid/RFT curve without MD", tmp );
// Do not show multiple dialogs
break;
@@ -21,6 +21,7 @@
#include "RiaLogging.h"
#include "RifFormationNamesReader.h"
#include "RigFormationNames.h"
#include "RiuMessageDialog.h"
#include "Rim3dView.h"
#include "RimCase.h"
@@ -70,7 +71,7 @@ void RimFormationNames::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
readFormationNamesFile( &errorMessage );
if ( !errorMessage.isEmpty() )
{
RiaLogging::errorInMessageBox( nullptr, "Formation Names", errorMessage );
RiuMessageDialog::showError( nullptr, "Formation Names", errorMessage );
}
updateConnectedViews();
}
@@ -23,6 +23,7 @@
#include "RimColorLegendCollection.h"
#include "RimFormationNames.h"
#include "RimProject.h"
#include "RiuMessageDialog.h"
CAF_PDM_SOURCE_INIT( RimFormationNamesCollection, "FormationNamesCollectionObject" );
@@ -100,7 +101,7 @@ std::vector<RimFormationNames*> RimFormationNamesCollection::importFiles( const
if ( !totalErrorMessage.isEmpty() )
{
RiaLogging::errorInMessageBox( nullptr, "Import Formation Names", totalErrorMessage );
RiuMessageDialog::showError( nullptr, "Import Formation Names", totalErrorMessage );
}
return m_formationNamesList.childrenByType();
@@ -23,6 +23,7 @@
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaRegressionTestRunner.h"
#include "RiuMessageDialog.h"
#include "RicfCommandObject.h"
@@ -173,7 +174,7 @@ void RimGeoMechView::onLoadDataAndUpdate()
QString displayMessage = errorMessage.empty() ? "Could not open the Odb file: \n" + m_geomechCase->gridFileName()
: QString::fromStdString( errorMessage );
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", displayMessage );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "File open error", displayMessage );
}
m_geomechCase = nullptr;
@@ -24,6 +24,7 @@
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaQDateTimeTools.h"
#include "RiuMessageDialog.h"
#include "RicGridStatisticsDialog.h"
@@ -1124,14 +1125,14 @@ void Rim3dOverlayInfoConfig::displayPropertyFilteredStatisticsMessage( bool show
if ( !isShowing )
{
isShowing = true;
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 );
RiuMessageDialog::showError( 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 );
isShowing = false;
}
}
@@ -22,6 +22,7 @@
#include "RiaLogging.h"
#include "RiaResultNames.h"
#include "RiuMessageDialog.h"
#include "RicCreateEnsembleWellLogUi.h"
@@ -132,7 +133,7 @@ void RimCellEdgeColors::loadResult()
"data will be loaded.\n\nPlease select equal to or less than 6 properties to show data." )
.arg( resultNames.size() );
RiaLogging::errorInMessageBox( nullptr, title, text );
RiuMessageDialog::showError( nullptr, title, text );
return;
}
@@ -23,6 +23,7 @@
#include "RiaLogging.h"
#include "RiaPorosityModel.h"
#include "RiaRegressionTestRunner.h"
#include "RiuMessageDialog.h"
#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"
@@ -189,7 +190,7 @@ bool RimGridCalculation::calculate()
else
{
QString msg = QString( "No data available for case %1, aborting calculation" ).arg( calculationCase->caseUserDescription() );
RiaLogging::errorInMessageBox( nullptr, "Grid Property Calculator", msg );
RiuMessageDialog::showError( nullptr, "Grid Property Calculator", msg );
return false;
}
}
@@ -198,7 +199,7 @@ bool RimGridCalculation::calculate()
{
QString msg =
QString( "No active cell data available for case %1, aborting calculation" ).arg( calculationCase->caseUserDescription() );
RiaLogging::errorInMessageBox( nullptr, "Grid Property Calculator", msg );
RiuMessageDialog::showError( nullptr, "Grid Property Calculator", msg );
return false;
}
@@ -210,7 +211,7 @@ bool RimGridCalculation::calculate()
{
QString msg = "Detected IJK mismatch between input cases and destination case. All grid "
"cases must have identical IJK sizes.";
RiaLogging::errorInMessageBox( nullptr, "Grid Property Calculator", msg );
RiuMessageDialog::showError( nullptr, "Grid Property Calculator", msg );
return false;
}
}
@@ -235,7 +236,7 @@ bool RimGridCalculation::calculate()
{
QString msg = "No data available for result defined in 'Non-visible Cell Value'";
RiaLogging::errorInMessageBox( nullptr, "Grid Property Calculator", msg );
RiuMessageDialog::showError( nullptr, "Grid Property Calculator", msg );
return false;
}
}
@@ -812,7 +813,7 @@ bool RimGridCalculation::calculateForCases( const std::vector<RimEclipseCase*>&
auto [isOk, errorMessage] = validateVariables();
if ( !isOk )
{
RiaLogging::errorInMessageBox( nullptr, "Grid Property Calculator", errorMessage );
RiuMessageDialog::showError( nullptr, "Grid Property Calculator", errorMessage );
return false;
}
@@ -843,9 +844,9 @@ bool RimGridCalculation::calculateForCases( const std::vector<RimEclipseCase*>&
{
if ( !calculationCase )
{
RiaLogging::errorInMessageBox( nullptr,
"Grid Property Calculator",
QString( "No case found for calculation : %1" ).arg( leftHandSideVariableName ) );
RiuMessageDialog::showError( nullptr,
"Grid Property Calculator",
QString( "No case found for calculation : %1" ).arg( leftHandSideVariableName ) );
anyErrorsDetected = true;
continue;
}
@@ -986,7 +987,7 @@ bool RimGridCalculation::calculateForCases( const std::vector<RimEclipseCase*>&
QString s = "The following error message was received from the parser library : \n\n";
s += evaluateResult.error();
RiaLogging::errorInMessageBox( nullptr, "Grid Property Calculator", s );
RiuMessageDialog::showError( nullptr, "Grid Property Calculator", s );
return false;
}
@@ -23,6 +23,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaResultNames.h"
#include "RiuMessageDialog.h"
#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"
@@ -182,7 +183,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
QString errorMessage = QString( "Could not open the Eclipse Grid file: \n" ) + mainCase->gridFileName() + "\n" +
"Current working directory is: \n" + QDir::currentPath();
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Error when opening project file", errorMessage );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "Error when opening project file", errorMessage );
return;
}
@@ -22,6 +22,7 @@
#include "RiaCurveMerger.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "Summary/RiaSummaryCurveDefinition.h"
#include "Summary/RiaSummaryTools.h"
@@ -125,25 +126,23 @@ bool RimSummaryCalculation::checkVariables() const
if ( !v->summaryCase() )
{
RiaLogging::errorInMessageBox( nullptr,
"Expression Parser",
QString( "No summary case defined for variable : %1" ).arg( v->name() ) );
RiuMessageDialog::showError( nullptr, "Expression Parser", QString( "No summary case defined for variable : %1" ).arg( v->name() ) );
return false;
}
if ( !v->summaryAddress() )
{
RiaLogging::errorInMessageBox( nullptr,
"Expression Parser",
QString( "No summary address defined for variable : %1" ).arg( v->name() ) );
RiuMessageDialog::showError( nullptr,
"Expression Parser",
QString( "No summary address defined for variable : %1" ).arg( v->name() ) );
return false;
}
if ( v->summaryAddress()->address().id() == id() )
{
RiaLogging::errorInMessageBox( nullptr,
"Expression Parser",
QString( "Recursive calculation detected for variable : %1" ).arg( v->name() ) );
RiuMessageDialog::showError( nullptr,
"Expression Parser",
QString( "Recursive calculation detected for variable : %1" ).arg( v->name() ) );
return false;
}
@@ -152,9 +151,9 @@ bool RimSummaryCalculation::checkVariables() const
std::set<int> calcIds;
if ( detectCyclicCalculation( v->summaryAddress()->address().id(), calcIds ) )
{
RiaLogging::errorInMessageBox( nullptr,
"Expression Parser",
QString( "Cyclic calculation detected for variable : %1" ).arg( v->name() ) );
RiuMessageDialog::showError( nullptr,
"Expression Parser",
QString( "Cyclic calculation detected for variable : %1" ).arg( v->name() ) );
return false;
}
}
@@ -392,7 +391,7 @@ std::optional<std::pair<std::vector<double>, std::vector<time_t>>>
QString s = "The following error message was received from the parser library : \n\n";
s += evaluateResult.error();
RiaLogging::errorInMessageBox( nullptr, "Expression Parser", s );
RiuMessageDialog::showError( nullptr, "Expression Parser", s );
}
return {};
@@ -22,6 +22,7 @@
#include "RiaLogging.h"
#include "RiaNetworkTools.h"
#include "RiuMessageDialog.h"
#include "RimProject.h"
#include "RimUserDefinedCalculationVariable.h"
@@ -192,7 +193,7 @@ bool RimUserDefinedCalculation::parseExpression()
QString leftHandSideVariableName = RimUserDefinedCalculation::findLeftHandSide( m_expression );
if ( leftHandSideVariableName.isEmpty() )
{
RiaLogging::errorInMessageBox( nullptr, "Expression Parser", "Failed to detect left hand side of equation" );
RiuMessageDialog::showError( nullptr, "Expression Parser", "Failed to detect left hand side of equation" );
return false;
}
@@ -200,7 +201,7 @@ bool RimUserDefinedCalculation::parseExpression()
std::vector<QString> variableNames = ExpressionParser::detectReferencedVariables( m_expression );
if ( variableNames.empty() )
{
RiaLogging::errorInMessageBox( nullptr, "Expression Parser", "Failed to detect any variable names" );
RiuMessageDialog::showError( nullptr, "Expression Parser", "Failed to detect any variable names" );
return false;
}
@@ -26,6 +26,7 @@
#include "RiaPreferencesSummary.h"
#include "RiaQDateTimeTools.h"
#include "RiaResultNames.h"
#include "RiuMessageDialog.h"
#include "Summary/RiaSummaryCurveDefinition.h"
#include "Summary/RiaSummaryDefines.h"
#include "Summary/RiaSummaryTools.h"
@@ -1299,7 +1300,7 @@ void RimSummaryCurve::checkForMatchingCrossPlotTimeSteps()
QString( "Time step range for Y : '%1' - '%2'" ).arg( first.toString( formatString ) ).arg( last.toString( formatString ) );
}
RiaLogging::errorInMessageBox( nullptr, "Detected no overlapping time steps", description );
RiuMessageDialog::showError( nullptr, "Detected no overlapping time steps", description );
}
}
}
@@ -25,6 +25,7 @@
#include "RiaStdStringTools.h"
#include "RiaTextStringTools.h"
#include "RigStatisticsTools.h"
#include "RiuMessageDialog.h"
#include "Summary/Ensemble/RimSummaryEnsembleParameterCollection.h"
#include "Summary/RiaSummaryAddressAnalyzer.h"
#include "Summary/RiaSummaryTools.h"
@@ -704,7 +705,7 @@ bool RimSummaryEnsemble::validateEnsembleCases( const std::vector<RimSummaryCase
const int maxNumberOfCharactersToDisplaye = 1000;
QString textToDisplay = errors.left( maxNumberOfCharactersToDisplaye );
RiaLogging::errorInMessageBox( nullptr, "", textToDisplay );
RiuMessageDialog::showError( nullptr, "", textToDisplay );
return false;
}
@@ -28,6 +28,7 @@
#include "RiaPreferencesSummary.h"
#include "RiaRegressionTestRunner.h"
#include "RiaStdStringTools.h"
#include "RiuMessageDialog.h"
#include "RifEclipseSummaryAddressDefines.h"
@@ -1095,7 +1096,7 @@ void RimSummaryPlot::overrideTimeAxisSettingsIfTooManyCustomTickmarks( RimSummar
"To prevent slow response the configuration will be reset to default: \n\n"
"Interval = Years and Interval Step = 1." )
.arg( MAX_NUM_TICKS );
RiaLogging::errorInMessageBox( RiuPlotMainWindow::instance(), errorTitle, errorMessage );
RiuMessageDialog::showError( RiuPlotMainWindow::instance(), errorTitle, errorMessage );
}
timeAxisProperties->setTickmarkInterval( RimSummaryTimeAxisProperties::TickmarkInterval::YEARS );
@@ -28,6 +28,7 @@
#include "RiaPreferences.h"
#include "RiaTextStringTools.h"
#include "RiaWellNameComparer.h"
#include "RiuMessageDialog.h"
#include "RifOsduWellLogReader.h"
#include "RifOsduWellPathReader.h"
@@ -537,7 +538,7 @@ void RimWellPathCollection::addWellPathFormations( const QStringList& filePaths
if ( fileReadSuccess )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "Well Picks Import", outputMessage );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "Well Picks Import", outputMessage );
}
sortWellsByName();
@@ -895,7 +896,7 @@ void RimWellPathCollection::readWellPathFormationFiles()
QString errorMessage;
if ( !wellPath->readWellPathFormationsFile( &errorMessage, m_wellPathFormationsImporter.get() ) )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", errorMessage );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "File open error", errorMessage );
}
}
}
@@ -912,7 +913,7 @@ void RimWellPathCollection::reloadAllWellPathFormations()
QString errorMessage;
if ( !wellPath->reloadWellPathFormationsFile( &errorMessage, m_wellPathFormationsImporter.get() ) )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), "File open error", errorMessage );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), "File open error", errorMessage );
}
progress.setProgressDescription( QString( "Reloading formation file for %1" ).arg( wellPath->name() ) );
@@ -20,6 +20,7 @@
#include "RiaLogging.h"
#include "RiaResultNames.h"
#include "RiuMessageDialog.h"
#include "RifEclipseOutputFileTools.h"
#include "RifReaderEclipseOutput.h"
@@ -214,11 +215,11 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
if ( restartFileCount <= timeStepIndex && restartFileCount != maxTimeStepCount )
{
RiaLogging::errorInMessageBox( nullptr,
"ResInsight",
"Flow Diagnostics: Could not find all the restart files. Results will "
"not be "
"loaded." );
RiuMessageDialog::showError( nullptr,
"ResInsight",
"Flow Diagnostics: Could not find all the restart files. Results will "
"not be "
"loaded." );
return result;
}
@@ -234,7 +235,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
}
catch ( const std::exception& e )
{
RiaLogging::errorInMessageBox( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
RiuMessageDialog::showError( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
return result;
}
@@ -265,11 +266,11 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
if ( !currentRestartData->selectReportStep( reportStepNumber ) )
{
RiaLogging::errorInMessageBox( nullptr,
"ResInsight",
"Flow Diagnostics: Could not find the requested timestep in the result file. "
"Results "
"will not be loaded." );
RiuMessageDialog::showError( nullptr,
"ResInsight",
"Flow Diagnostics: Could not find the requested timestep in the result file. "
"Results "
"will not be loaded." );
return result;
}
@@ -308,7 +309,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
}
catch ( const std::exception& e )
{
RiaLogging::errorInMessageBox( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
RiuMessageDialog::showError( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
return result;
}
@@ -424,7 +425,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
}
catch ( const std::exception& e )
{
RiaLogging::errorInMessageBox( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
RiuMessageDialog::showError( nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString( e.what() ) );
return result;
}
@@ -583,7 +584,7 @@ RigFlowDiagDefines::FlowCharacteristicsResultFrame
}
catch ( const std::exception& e )
{
RiaLogging::errorInMessageBox( nullptr, "ResInsight", "Flow Diagnostics: " + QString( e.what() ) );
RiuMessageDialog::showError( nullptr, "ResInsight", "Flow Diagnostics: " + QString( e.what() ) );
}
return result;
@@ -75,6 +75,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RiuFlowCharacteristicsPlot.h
${CMAKE_CURRENT_LIST_DIR}/RiuNightchartsWidget.h
${CMAKE_CURRENT_LIST_DIR}/RiuMessagePanel.h
${CMAKE_CURRENT_LIST_DIR}/RiuMessageDialog.h
${CMAKE_CURRENT_LIST_DIR}/RiuPlotObjectPicker.h
${CMAKE_CURRENT_LIST_DIR}/RiuContextMenuLauncher.h
${CMAKE_CURRENT_LIST_DIR}/RiuSummaryCurveDefinitionKeywords.h
@@ -191,6 +192,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RiuFlowCharacteristicsPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuNightchartsWidget.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuMessagePanel.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuMessageDialog.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuPlotObjectPicker.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuContextMenuLauncher.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionUi.cpp
@@ -20,6 +20,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiuMessageDialog.h"
#include "RiuMainWindow.h"
@@ -62,5 +63,5 @@ void Riu3DMainWindowTools::selectAsCurrentItem( const caf::PdmObject* object, bo
//--------------------------------------------------------------------------------------------------
void Riu3DMainWindowTools::reportAndShowWarning( const QString& warningDialogHeader, const QString& warningtext )
{
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(), warningDialogHeader, warningtext );
RiuMessageDialog::showError( Riu3DMainWindowTools::mainWindowWidget(), warningDialogHeader, warningtext );
}
@@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RiuMessageDialog.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaRegressionTestRunner.h"
#include <QMessageBox>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMessageDialog::showError( QWidget* parent, const QString& title, const QString& text )
{
if ( RiaGuiApplication::isRunning() && !RiaRegressionTestRunner::instance()->isRunningRegressionTests() )
{
if ( parent == nullptr )
{
parent = RiaGuiApplication::widgetToUseAsParent();
}
QMessageBox dlg( QMessageBox::Critical, title, text, QMessageBox::Ok, parent );
dlg.setWindowFlags( dlg.windowFlags() | Qt::WindowStaysOnTopHint );
dlg.exec();
}
RiaLogging::error( text );
}
@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QString>
class QWidget;
//==================================================================================================
//
//==================================================================================================
class RiuMessageDialog
{
public:
static void showError( QWidget* parent, const QString& title, const QString& text );
};
@@ -22,6 +22,7 @@
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaStringListSerializer.h"
#include "RiuMessageDialog.h"
#include <QAction>
#include <QDir>
@@ -152,7 +153,7 @@ void RiuRecentFileActionProvider::slotOpenRecentFile()
}
else
{
RiaLogging::errorInMessageBox( nullptr, "File open", "Failed to import file located at\n" + fileName );
RiuMessageDialog::showError( nullptr, "File open", "Failed to import file located at\n" + fileName );
removeFileName( fileName );
}