mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1430 When closing top level windows, do not close project if other is visible
This commit is contained in:
@@ -1708,6 +1708,24 @@ RimViewWindow* RiaApplication::activeViewWindow()
|
||||
return viewWindow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaApplication::isMain3dWindowVisible() const
|
||||
{
|
||||
return RiuMainWindow::instance()->isVisible();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaApplication::isMainPlotWindowVisible() const
|
||||
{
|
||||
if (!m_mainPlotWindow) return false;
|
||||
|
||||
return m_mainPlotWindow->isVisible();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -185,6 +185,9 @@ public:
|
||||
|
||||
static RimViewWindow* activeViewWindow();
|
||||
|
||||
bool isMain3dWindowVisible() const;
|
||||
bool isMainPlotWindowVisible() const;
|
||||
|
||||
bool tryCloseMainWindow();
|
||||
bool tryClosePlotWindow();
|
||||
|
||||
|
||||
@@ -138,6 +138,12 @@ void RiuMainPlotWindow::cleanupGuiBeforeProjectClose()
|
||||
void RiuMainPlotWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
if (app->isMain3dWindowVisible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!app->askUserToSaveModifiedProject())
|
||||
{
|
||||
event->ignore();
|
||||
|
||||
@@ -198,6 +198,12 @@ void RiuMainWindow::cleanupGuiBeforeProjectClose()
|
||||
void RiuMainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
if (app->isMainPlotWindowVisible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!app->askUserToSaveModifiedProject())
|
||||
{
|
||||
event->ignore();
|
||||
|
||||
Reference in New Issue
Block a user