mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1889 Curve Creator : Close dialog when close button is pressed
This commit is contained in:
parent
66d08aeb8d
commit
f8ad2f7581
@ -234,6 +234,22 @@ void RicSummaryCurveCreator::setTargetPlot(RimSummaryPlot* targetPlot)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicSummaryCurveCreator::isCloseButtonPressed() const
|
||||
{
|
||||
return m_closeButtonField();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryCurveCreator::clearCloseButton()
|
||||
{
|
||||
m_closeButtonField = false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -245,10 +261,6 @@ void RicSummaryCurveCreator::fieldChangedByUi(const caf::PdmFieldHandle* changed
|
||||
|
||||
updateTargetPlot();
|
||||
}
|
||||
else if (changedField == &m_closeButtonField)
|
||||
{
|
||||
m_closeButtonField = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Lookup item type input field
|
||||
@ -900,6 +912,7 @@ void RicSummaryCurveCreator::defineEditorAttribute(const caf::PdmFieldHandle* fi
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Populate curve creator from the given curve collection
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -77,6 +77,9 @@ public:
|
||||
RimSummaryPlot* previewPlot() { return m_previewPlot;}
|
||||
void setTargetPlot(RimSummaryPlot* targetPlot);
|
||||
|
||||
bool isCloseButtonPressed() const;
|
||||
void clearCloseButton();
|
||||
|
||||
private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
|
@ -39,6 +39,8 @@ RicSummaryCurveCreatorDialog::RicSummaryCurveCreatorDialog(QWidget* parent, RicS
|
||||
|
||||
m_curveCreatorSplitterUi->setPdmObject(summaryCurveCreator);
|
||||
m_curveCreatorSplitterUi->updateUi();
|
||||
|
||||
connect(m_curveCreatorSplitterUi, SIGNAL(signalCloseButtonPressed()), this, SLOT(accept()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -54,6 +54,17 @@ RicSummaryCurveCreatorSplitterUi::~RicSummaryCurveCreatorSplitterUi()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryCurveCreatorSplitterUi::recursivelyConfigureAndUpdateTopLevelUiItems(const std::vector<caf::PdmUiItem *>& topLevelUiItems, const QString& uiConfigName)
|
||||
{
|
||||
RicSummaryCurveCreator* sumCurveCreator = dynamic_cast<RicSummaryCurveCreator*>(this->pdmItem());
|
||||
if (sumCurveCreator)
|
||||
{
|
||||
if (sumCurveCreator->isCloseButtonPressed())
|
||||
{
|
||||
sumCurveCreator->clearCloseButton();
|
||||
|
||||
emit signalCloseButtonPressed();
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_layout) return;
|
||||
|
||||
int splitterPositionIndex = 0;
|
||||
|
@ -42,6 +42,8 @@ namespace caf {
|
||||
//==================================================================================================
|
||||
class RicSummaryCurveCreatorSplitterUi : public caf::PdmUiWidgetBasedObjectEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RicSummaryCurveCreatorSplitterUi(QWidget* parent);
|
||||
~RicSummaryCurveCreatorSplitterUi();
|
||||
@ -64,6 +66,10 @@ private:
|
||||
const std::vector<caf::PdmUiItem *>& topLevelUiItems,
|
||||
const QString& uiConfigName);
|
||||
|
||||
signals:
|
||||
void signalCloseButtonPressed();
|
||||
|
||||
|
||||
private:
|
||||
QPointer<QVBoxLayout> m_layout;
|
||||
QPointer<QSplitter> m_firstColumnSplitter;
|
||||
|
Loading…
Reference in New Issue
Block a user