From dc0c6d1b4706880cb03e797162d897b4c037c1b7 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 2 Feb 2018 09:37:00 +0100 Subject: [PATCH 1/2] #2443 : Remove obsolete includes of QMessageBox --- .../CompletionCommands/RicExportFishbonesLateralsFeature.cpp | 1 - .../CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp | 1 - .../ExportCommands/RicSaveEclipseInputVisibleCellsFeature.cpp | 1 - .../ExportCommands/RicSnapshotViewToClipboardFeature.cpp | 1 - .../Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp | 1 - .../Commands/OctaveScriptCommands/RicDeleteScriptPathFeature.cpp | 1 - .../Commands/RicConvertAllFractureTemplatesToFieldFeature.cpp | 1 - .../Commands/RicConvertAllFractureTemplatesToMetricFeature.cpp | 1 - .../Commands/RicConvertFractureTemplateUnitFeature.cpp | 1 - .../SummaryPlotCommands/RicAsciiExportSummaryPlotFeature.cpp | 1 - .../WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp | 1 - .../ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp | 1 - 12 files changed, 12 deletions(-) diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesLateralsFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesLateralsFeature.cpp index 74c8a32526..bc36f9192a 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesLateralsFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesLateralsFeature.cpp @@ -32,7 +32,6 @@ #include #include -#include CAF_CMD_SOURCE_INIT(RicExportFishbonesLateralsFeature, "RicExportFishbonesLateralsFeature"); diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp index 1431b059a2..e7b206eb85 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp @@ -43,7 +43,6 @@ #include "cvfMath.h" #include -#include #include diff --git a/ApplicationCode/Commands/ExportCommands/RicSaveEclipseInputVisibleCellsFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicSaveEclipseInputVisibleCellsFeature.cpp index f8dbf19272..5f4f31b112 100644 --- a/ApplicationCode/Commands/ExportCommands/RicSaveEclipseInputVisibleCellsFeature.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicSaveEclipseInputVisibleCellsFeature.cpp @@ -42,7 +42,6 @@ #include #include -#include CAF_CMD_SOURCE_INIT(RicSaveEclipseInputVisibleCellsFeature, "RicSaveEclipseInputVisibleCellsFeature"); CAF_CMD_SOURCE_INIT(RicSaveEclipseInputActiveVisibleCellsFeature, "RicSaveEclipseInputActiveVisibleCellsFeature"); diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.cpp index 7678fc5f71..499efe5ed5 100644 --- a/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToClipboardFeature.cpp @@ -35,7 +35,6 @@ #include #include #include -#include CAF_CMD_SOURCE_INIT(RicSnapshotViewToClipboardFeature, "RicSnapshotViewToClipboardFeature"); diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp index 86cd089a76..dd4f5c114f 100644 --- a/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp @@ -36,7 +36,6 @@ #include #include #include -#include CAF_CMD_SOURCE_INIT(RicSnapshotViewToFileFeature, "RicSnapshotViewToFileFeature"); diff --git a/ApplicationCode/Commands/OctaveScriptCommands/RicDeleteScriptPathFeature.cpp b/ApplicationCode/Commands/OctaveScriptCommands/RicDeleteScriptPathFeature.cpp index 02f046326b..745dc7d3ef 100644 --- a/ApplicationCode/Commands/OctaveScriptCommands/RicDeleteScriptPathFeature.cpp +++ b/ApplicationCode/Commands/OctaveScriptCommands/RicDeleteScriptPathFeature.cpp @@ -31,7 +31,6 @@ #include "cvfAssert.h" #include -#include CAF_CMD_SOURCE_INIT(RicDeleteScriptPathFeature, "RicDeleteScriptPathFeature"); diff --git a/ApplicationCode/Commands/RicConvertAllFractureTemplatesToFieldFeature.cpp b/ApplicationCode/Commands/RicConvertAllFractureTemplatesToFieldFeature.cpp index 6934214627..f554dd318c 100644 --- a/ApplicationCode/Commands/RicConvertAllFractureTemplatesToFieldFeature.cpp +++ b/ApplicationCode/Commands/RicConvertAllFractureTemplatesToFieldFeature.cpp @@ -39,7 +39,6 @@ #include "cvfAssert.h" #include -#include #include #include diff --git a/ApplicationCode/Commands/RicConvertAllFractureTemplatesToMetricFeature.cpp b/ApplicationCode/Commands/RicConvertAllFractureTemplatesToMetricFeature.cpp index 617f91c9f0..62c6593472 100644 --- a/ApplicationCode/Commands/RicConvertAllFractureTemplatesToMetricFeature.cpp +++ b/ApplicationCode/Commands/RicConvertAllFractureTemplatesToMetricFeature.cpp @@ -40,7 +40,6 @@ #include #include -#include #include CAF_CMD_SOURCE_INIT(RicConvertAllFractureTemplatesToMetricFeature, "RicConvertAllFractureTemplatesToMetricFeature"); diff --git a/ApplicationCode/Commands/RicConvertFractureTemplateUnitFeature.cpp b/ApplicationCode/Commands/RicConvertFractureTemplateUnitFeature.cpp index c0e81c537a..8756fb11e6 100644 --- a/ApplicationCode/Commands/RicConvertFractureTemplateUnitFeature.cpp +++ b/ApplicationCode/Commands/RicConvertFractureTemplateUnitFeature.cpp @@ -39,7 +39,6 @@ #include "cvfAssert.h" #include -#include #include #include diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicAsciiExportSummaryPlotFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicAsciiExportSummaryPlotFeature.cpp index f441dfc4d7..42800378a9 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicAsciiExportSummaryPlotFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicAsciiExportSummaryPlotFeature.cpp @@ -36,7 +36,6 @@ #include #include #include -#include diff --git a/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp index f4f8c37791..4e83bcbb78 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp @@ -35,7 +35,6 @@ #include #include #include -#include diff --git a/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp index 259948df34..d371bc762e 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp @@ -44,7 +44,6 @@ #include "cvfVector3.h" #include -#include #include #include From ba09906163e4cbbbdd388189c7aa5ee7637ae7da Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 2 Feb 2018 09:37:34 +0100 Subject: [PATCH 2/2] #2443 Replace QMessageBox with RiaLogging to avoid blocking of batch commands --- .../Commands/ExportCommands/RicExportFaultsFeature.cpp | 4 ++-- .../RicSaveEclipseResultAsInputPropertyExec.cpp | 5 +++-- .../ExportCommands/RicSnapshotAllPlotsToFileFeature.cpp | 3 +-- .../ExportCommands/RicSnapshotAllViewsToFileFeature.cpp | 3 +-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ApplicationCode/Commands/ExportCommands/RicExportFaultsFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicExportFaultsFeature.cpp index 96e8af90ac..2a36d63a46 100644 --- a/ApplicationCode/Commands/ExportCommands/RicExportFaultsFeature.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicExportFaultsFeature.cpp @@ -20,6 +20,7 @@ #include "RicExportFaultsFeature.h" #include "RiaApplication.h" +#include "RiaLogging.h" #include "RigEclipseCaseData.h" #include "RigFault.h" @@ -33,7 +34,6 @@ #include #include -#include 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); diff --git a/ApplicationCode/Commands/ExportCommands/RicSaveEclipseResultAsInputPropertyExec.cpp b/ApplicationCode/Commands/ExportCommands/RicSaveEclipseResultAsInputPropertyExec.cpp index b9ffe7fb15..209c13a23d 100644 --- a/ApplicationCode/Commands/ExportCommands/RicSaveEclipseResultAsInputPropertyExec.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicSaveEclipseResultAsInputPropertyExec.cpp @@ -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 + //-------------------------------------------------------------------------------------------------- /// @@ -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); } } } diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.cpp index b91b150254..b00dab064b 100644 --- a/ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotAllPlotsToFileFeature.cpp @@ -38,7 +38,6 @@ #include #include #include -#include 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); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/ExportCommands/RicSnapshotAllViewsToFileFeature.cpp b/ApplicationCode/Commands/ExportCommands/RicSnapshotAllViewsToFileFeature.cpp index 48ca2cf578..e516785cd0 100644 --- a/ApplicationCode/Commands/ExportCommands/RicSnapshotAllViewsToFileFeature.cpp +++ b/ApplicationCode/Commands/ExportCommands/RicSnapshotAllViewsToFileFeature.cpp @@ -44,7 +44,6 @@ #include #include #include -#include 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); } //--------------------------------------------------------------------------------------------------