#1938 Curve creator: Close all widgets on closing of curve creator

This commit is contained in:
Rebecca Cox 2017-09-27 14:35:12 +02:00
parent 4019e76ae1
commit 31133f31c0
4 changed files with 33 additions and 3 deletions

View File

@ -18,9 +18,13 @@
#include "RicSummaryCurveCreatorDialog.h"
#include "RiaApplication.h"
#include "RicSummaryCurveCreator.h"
#include "RicSummaryCurveCreatorSplitterUi.h"
#include "RiuMainPlotWindow.h"
#include <QVBoxLayout>
//--------------------------------------------------------------------------------------------------
@ -43,6 +47,8 @@ RicSummaryCurveCreatorDialog::RicSummaryCurveCreatorDialog(QWidget* parent, RicS
setWindowTitle("ResInsight: Plot Editor");
resize(1200, 800);
connect(m_curveCreatorSplitterUi, SIGNAL(signalCloseButtonPressed()), this, SLOT(accept()));
connect(this, SIGNAL(finished(int)), this, SLOT(slotDialogFinished()));
}
//--------------------------------------------------------------------------------------------------
@ -50,5 +56,16 @@ RicSummaryCurveCreatorDialog::RicSummaryCurveCreatorDialog(QWidget* parent, RicS
//--------------------------------------------------------------------------------------------------
RicSummaryCurveCreatorDialog::~RicSummaryCurveCreatorDialog()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSummaryCurveCreatorDialog::slotDialogFinished()
{
RiuMainPlotWindow* plotwindow = RiaApplication::instance()->mainPlotWindow();
if (plotwindow)
{
plotwindow->cleanUpTemporaryWidgets();
}
}

View File

@ -29,10 +29,14 @@ class RicSummaryCurveCreator;
//==================================================================================================
class RicSummaryCurveCreatorDialog : public QDialog
{
Q_OBJECT
public:
RicSummaryCurveCreatorDialog(QWidget* parent, RicSummaryCurveCreator* summaryCurveCreator);
~RicSummaryCurveCreatorDialog();
private slots:
void slotDialogFinished();
private:
RicSummaryCurveCreatorSplitterUi* m_curveCreatorSplitterUi;
};

View File

@ -119,6 +119,16 @@ void RiuMainPlotWindow::cleanupGuiBeforeProjectClose()
m_pdmUiPropertyView->showProperties(NULL);
}
cleanUpTemporaryWidgets();
setWindowTitle("Plots - ResInsight");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainPlotWindow::cleanUpTemporaryWidgets()
{
for (QWidget* w : m_temporaryWidgets)
{
w->close();
@ -126,8 +136,6 @@ void RiuMainPlotWindow::cleanupGuiBeforeProjectClose()
}
m_temporaryWidgets.clear();
setWindowTitle("Plots - ResInsight");
}
//--------------------------------------------------------------------------------------------------

View File

@ -57,6 +57,7 @@ public:
void initializeGuiNewProjectLoaded();
void cleanupGuiBeforeProjectClose();
void cleanUpTemporaryWidgets();
void removeViewer( QWidget* viewer ) override;
void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry) override;