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:
@@ -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();
|
updateTargetPlot();
|
||||||
}
|
}
|
||||||
else if (changedField == &m_closeButtonField)
|
|
||||||
{
|
|
||||||
m_closeButtonField = false;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Lookup item type input field
|
// Lookup item type input field
|
||||||
@@ -900,6 +912,7 @@ void RicSummaryCurveCreator::defineEditorAttribute(const caf::PdmFieldHandle* fi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Populate curve creator from the given curve collection
|
/// Populate curve creator from the given curve collection
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ public:
|
|||||||
RimSummaryPlot* previewPlot() { return m_previewPlot;}
|
RimSummaryPlot* previewPlot() { return m_previewPlot;}
|
||||||
void setTargetPlot(RimSummaryPlot* targetPlot);
|
void setTargetPlot(RimSummaryPlot* targetPlot);
|
||||||
|
|
||||||
|
bool isCloseButtonPressed() const;
|
||||||
|
void clearCloseButton();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ RicSummaryCurveCreatorDialog::RicSummaryCurveCreatorDialog(QWidget* parent, RicS
|
|||||||
|
|
||||||
m_curveCreatorSplitterUi->setPdmObject(summaryCurveCreator);
|
m_curveCreatorSplitterUi->setPdmObject(summaryCurveCreator);
|
||||||
m_curveCreatorSplitterUi->updateUi();
|
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)
|
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;
|
if (!m_layout) return;
|
||||||
|
|
||||||
int splitterPositionIndex = 0;
|
int splitterPositionIndex = 0;
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ namespace caf {
|
|||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicSummaryCurveCreatorSplitterUi : public caf::PdmUiWidgetBasedObjectEditor
|
class RicSummaryCurveCreatorSplitterUi : public caf::PdmUiWidgetBasedObjectEditor
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RicSummaryCurveCreatorSplitterUi(QWidget* parent);
|
RicSummaryCurveCreatorSplitterUi(QWidget* parent);
|
||||||
~RicSummaryCurveCreatorSplitterUi();
|
~RicSummaryCurveCreatorSplitterUi();
|
||||||
@@ -64,6 +66,10 @@ private:
|
|||||||
const std::vector<caf::PdmUiItem *>& topLevelUiItems,
|
const std::vector<caf::PdmUiItem *>& topLevelUiItems,
|
||||||
const QString& uiConfigName);
|
const QString& uiConfigName);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void signalCloseButtonPressed();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<QVBoxLayout> m_layout;
|
QPointer<QVBoxLayout> m_layout;
|
||||||
QPointer<QSplitter> m_firstColumnSplitter;
|
QPointer<QSplitter> m_firstColumnSplitter;
|
||||||
|
|||||||
Reference in New Issue
Block a user