From ad92b93e06f2507dece657264eb6404c0aab4fb2 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 12 Oct 2017 20:24:26 +0200 Subject: [PATCH] #1977 Curve Calculator : Rename to RicSummaryCurveCalculatorEditor --- .../CMakeLists_files.cmake | 6 +++++- .../RicSummaryCurveCalculatorDialog.cpp | 8 ++++---- .../RicSummaryCurveCalculatorDialog.h | 4 ++++ ...pp => RicSummaryCurveCalculatorEditor.cpp} | 20 +++++++++++++------ ...et.h => RicSummaryCurveCalculatorEditor.h} | 6 +++--- 5 files changed, 30 insertions(+), 14 deletions(-) rename ApplicationCode/Commands/SummaryPlotCommands/{RicSummaryCurveCalculatorWidget.cpp => RicSummaryCurveCalculatorEditor.cpp} (91%) rename ApplicationCode/Commands/SummaryPlotCommands/{RicSummaryCurveCalculatorWidget.h => RicSummaryCurveCalculatorEditor.h} (92%) diff --git a/ApplicationCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake b/ApplicationCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake index 5254a83ac8..5be86bf6b7 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake +++ b/ApplicationCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake @@ -26,6 +26,10 @@ ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreator.h ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorSplitterUi.h ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorDialog.h ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorFactoryImpl.h +${CEE_CURRENT_LIST_DIR}RicShowSummaryCurveCalculatorFeature.h +${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorDialog.h +${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorEditor.h +${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculator.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -51,7 +55,7 @@ ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorDialog.cpp ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorFactoryImpl.cpp ${CEE_CURRENT_LIST_DIR}RicShowSummaryCurveCalculatorFeature.cpp ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorDialog.cpp -${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorWidget.cpp +${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorEditor.cpp ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculator.cpp ) diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp index e13d6aa07b..11865a3293 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp @@ -18,7 +18,7 @@ #include "RicSummaryCurveCalculatorDialog.h" -#include "RicSummaryCurveCalculatorWidget.h" +#include "RicSummaryCurveCalculatorEditor.h" #include #include @@ -50,8 +50,8 @@ void RicSummaryCurveCalculatorDialog::setUp() QVBoxLayout* mainLayout = new QVBoxLayout(this); mainLayout->setContentsMargins(0, 0, 0, 0); - RicSummaryCurveCalculatorWidget* w = new RicSummaryCurveCalculatorWidget(this); - mainLayout->addWidget(w->getOrCreateWidget(this)); + m_summaryCalcWidget = std::unique_ptr(new RicSummaryCurveCalculatorEditor(this)); + mainLayout->addWidget(m_summaryCalcWidget->getOrCreateWidget(this)); QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); @@ -59,6 +59,6 @@ void RicSummaryCurveCalculatorDialog::setUp() mainLayout->addWidget(buttonBox); - w->updateUi(); + m_summaryCalcWidget->updateUi(); } diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.h b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.h index 69d157e7da..ff3e8d8a6e 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.h +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.h @@ -19,7 +19,9 @@ #pragma once #include +#include +class RicSummaryCurveCalculatorEditor; //================================================================================================== /// @@ -34,4 +36,6 @@ public: private: void setUp(); +private: + std::unique_ptr m_summaryCalcWidget; }; diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorWidget.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorEditor.cpp similarity index 91% rename from ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorWidget.cpp rename to ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorEditor.cpp index 552769264b..15c661f93e 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorWidget.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorEditor.cpp @@ -16,7 +16,7 @@ // ///////////////////////////////////////////////////////////////////////////////// -#include "RicSummaryCurveCalculatorWidget.h" +#include "RicSummaryCurveCalculatorEditor.h" #include "RicSummaryCurveCalculator.h" @@ -40,7 +40,7 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicSummaryCurveCalculatorWidget::RicSummaryCurveCalculatorWidget(QWidget* parent) +RicSummaryCurveCalculatorEditor::RicSummaryCurveCalculatorEditor(QWidget* parent) { m_calculator = std::unique_ptr(new RicSummaryCurveCalculator); @@ -61,15 +61,23 @@ RicSummaryCurveCalculatorWidget::RicSummaryCurveCalculatorWidget(QWidget* parent //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicSummaryCurveCalculatorWidget::~RicSummaryCurveCalculatorWidget() +RicSummaryCurveCalculatorEditor::~RicSummaryCurveCalculatorEditor() { + if (m_pdmTableView) + { + m_pdmTableView->setListField(nullptr); + delete m_pdmTableView; + m_pdmTableView = nullptr; + } + + this->setPdmObject(nullptr); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicSummaryCurveCalculatorWidget::recursivelyConfigureAndUpdateTopLevelUiItems(const std::vector& topLevelUiItems, const QString& uiConfigName) +void RicSummaryCurveCalculatorEditor::recursivelyConfigureAndUpdateTopLevelUiItems(const std::vector& topLevelUiItems, const QString& uiConfigName) { if (!m_firstRowLeftLayout || !m_firstRowRightLayout) return; @@ -106,7 +114,7 @@ void RicSummaryCurveCalculatorWidget::recursivelyConfigureAndUpdateTopLevelUiIte //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QWidget* RicSummaryCurveCalculatorWidget::createWidget(QWidget* parent) +QWidget* RicSummaryCurveCalculatorEditor::createWidget(QWidget* parent) { QWidget* widget = new QWidget(parent); @@ -147,7 +155,7 @@ QWidget* RicSummaryCurveCalculatorWidget::createWidget(QWidget* parent) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QMinimizePanel* RicSummaryCurveCalculatorWidget::updateGroupBoxWithContent(caf::PdmUiGroup* group, +QMinimizePanel* RicSummaryCurveCalculatorEditor::updateGroupBoxWithContent(caf::PdmUiGroup* group, const QString& uiConfigName) { QMinimizePanel* groupBox = findOrCreateGroupBox(this->widget(), group, uiConfigName); diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorWidget.h b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorEditor.h similarity index 92% rename from ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorWidget.h rename to ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorEditor.h index 9451d52b94..f1b32886b6 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorWidget.h +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorEditor.h @@ -42,11 +42,11 @@ namespace caf { /// /// //================================================================================================== -class RicSummaryCurveCalculatorWidget : public caf::PdmUiWidgetBasedObjectEditor +class RicSummaryCurveCalculatorEditor : public caf::PdmUiWidgetBasedObjectEditor { public: - RicSummaryCurveCalculatorWidget(QWidget* parent); - ~RicSummaryCurveCalculatorWidget(); + RicSummaryCurveCalculatorEditor(QWidget* parent); + ~RicSummaryCurveCalculatorEditor(); private: virtual void recursivelyConfigureAndUpdateTopLevelUiItems(const std::vector& topLevelUiItems,