#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

@@ -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 );
}
}