#2088 Curve Calculator : Use Close button instead of Ok and Cancel

This commit is contained in:
Magne Sjaastad 2017-11-14 07:30:49 +01:00
parent 2c8658c5c2
commit 2e6c37c266
3 changed files with 18 additions and 3 deletions

View File

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

View File

@ -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<RicSummaryCurveCalculatorEditor>(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);

View File

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