diff --git a/ApplicationCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake b/ApplicationCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake index 58df19d32e..54ffa552e6 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake +++ b/ApplicationCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake @@ -75,6 +75,7 @@ list(APPEND QT_MOC_HEADERS ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorSplitterUi.h ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorDialog.h ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorEditor.h +${CEE_CURRENT_LIST_DIR}RicSummaryCurveCalculatorDialog.h ) diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp index 9d612a8829..ff73fb8024 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp @@ -53,6 +53,16 @@ void RicSummaryCurveCalculatorDialog::setCalculationAndUpdateUi(RimSummaryCalcul m_summaryCalcEditor->updateUi(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicSummaryCurveCalculatorDialog::slotTryCloseDialog() +{ + // Test for dirty + + accept(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -64,9 +74,8 @@ void RicSummaryCurveCalculatorDialog::setUp() m_summaryCalcEditor = std::unique_ptr(new RicSummaryCurveCalculatorEditor()); mainLayout->addWidget(m_summaryCalcEditor->getOrCreateWidget(this)); - QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); + connect(buttonBox, SIGNAL(rejected()), this, SLOT(slotTryCloseDialog())); mainLayout->addWidget(buttonBox); diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.h b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.h index 05a27cbac3..fa95e5fa0b 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.h +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.h @@ -30,12 +30,17 @@ class RimSummaryCalculation; //================================================================================================== class RicSummaryCurveCalculatorDialog : public QDialog { + Q_OBJECT + public: RicSummaryCurveCalculatorDialog(QWidget* parent); ~RicSummaryCurveCalculatorDialog(); void setCalculationAndUpdateUi(RimSummaryCalculation* calculation); +private slots: + void slotTryCloseDialog(); + private: void setUp();