mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4173 Fix problems with saving state when closing 3d Window before closing plot window
This commit is contained in:
parent
0dbd3e8ad4
commit
fd01871202
@ -80,6 +80,7 @@
|
||||
#include "Riu3dSelectionManager.h"
|
||||
#include "RiuDockWidgetTools.h"
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuMessagePanel.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuProcessMonitor.h"
|
||||
#include "RiuRecentFileActionProvider.h"
|
||||
@ -224,9 +225,18 @@ RiaApplication::RiaApplication(int& argc, char** argv)
|
||||
|
||||
m_runningWorkerProcess = false;
|
||||
|
||||
m_mainWindow = nullptr;
|
||||
m_mainPlotWindow = nullptr;
|
||||
|
||||
m_recentFileActionProvider = std::unique_ptr<RiuRecentFileActionProvider>(new RiuRecentFileActionProvider);
|
||||
|
||||
// Create main windows
|
||||
// The plot window is created to be able to set expanded state on created objects, but hidden by default
|
||||
getOrCreateAndShowMainWindow();
|
||||
getOrCreateMainPlotWindow();
|
||||
|
||||
RiaLogging::setLoggerInstance(new RiuMessagePanelLogger(m_mainWindow->messagePanel()));
|
||||
RiaLogging::loggerInstance()->setLevel(RI_LL_DEBUG);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -237,8 +247,11 @@ RiaApplication::~RiaApplication()
|
||||
RiuDockWidgetTools::instance()->saveDockWidgetsState();
|
||||
|
||||
deleteMainPlotWindow();
|
||||
deleteMainWindow();
|
||||
|
||||
delete m_preferences;
|
||||
|
||||
RiaLogging::deleteLoggerInstance();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -283,8 +296,7 @@ int RiaApplication::parseArgumentsAndRunUnitTestsIfRequested()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::setWindowCaptionFromAppState()
|
||||
{
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
if (!mainWnd) return;
|
||||
if (!m_mainWindow) return;
|
||||
|
||||
// The stuff being done here should really be handled by Qt automatically as a result of
|
||||
// setting applicationName and windowFilePath
|
||||
@ -302,7 +314,7 @@ void RiaApplication::setWindowCaptionFromAppState()
|
||||
capt = projFileName + QString("[*]") + QString(" - ") + capt;
|
||||
}
|
||||
|
||||
mainWnd->setWindowTitle(capt);
|
||||
m_mainWindow->setWindowTitle(capt);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -382,8 +394,7 @@ bool RiaApplication::loadProject(const QString& projectFileName,
|
||||
QString("Unknown project file version detected in file \n%1\n\nCould not open project.").arg(fullPathProjectFileName);
|
||||
QMessageBox::warning(nullptr, "Error when opening project file", tmp);
|
||||
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
mainWnd->setPdmRoot(nullptr);
|
||||
m_mainWindow->setPdmRoot(nullptr);
|
||||
|
||||
// Delete all object possibly generated by readFile()
|
||||
delete m_project;
|
||||
@ -396,11 +407,11 @@ bool RiaApplication::loadProject(const QString& projectFileName,
|
||||
|
||||
if (m_project->show3DWindow())
|
||||
{
|
||||
RiuMainWindow::instance()->show();
|
||||
m_mainWindow->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
RiuMainWindow::instance()->hide();
|
||||
m_mainWindow->hide();
|
||||
}
|
||||
|
||||
if (m_project->showPlotWindow())
|
||||
@ -785,7 +796,7 @@ void RiaApplication::storeTreeViewState()
|
||||
}
|
||||
|
||||
{
|
||||
caf::PdmUiTreeView* projectTreeView = RiuMainWindow::instance()->projectTreeView();
|
||||
caf::PdmUiTreeView* projectTreeView = m_mainWindow->projectTreeView();
|
||||
if (projectTreeView)
|
||||
{
|
||||
QString treeViewState;
|
||||
@ -871,7 +882,7 @@ void RiaApplication::addWellLogsToModel(const QList<QString>& wellLogFilePaths)
|
||||
|
||||
oilField->wellPathCollection->updateConnectedEditors();
|
||||
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(wellLogFile);
|
||||
m_mainWindow->selectAsCurrentItem(wellLogFile);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1018,15 +1029,13 @@ void RiaApplication::closeProject()
|
||||
RicHoloLensSessionManager::instance()->terminateSession();
|
||||
RicHoloLensSessionManager::refreshToolbarState();
|
||||
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
|
||||
RiaViewRedrawScheduler::instance()->clearViewsScheduledForUpdate();
|
||||
|
||||
terminateProcess();
|
||||
|
||||
RiaApplication::clearAllSelections();
|
||||
|
||||
mainWnd->cleanupGuiBeforeProjectClose();
|
||||
m_mainWindow->cleanupGuiBeforeProjectClose();
|
||||
|
||||
if (m_mainPlotWindow)
|
||||
{
|
||||
@ -1049,10 +1058,9 @@ void RiaApplication::closeProject()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::onProjectOpenedOrClosed()
|
||||
{
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
if (mainWnd)
|
||||
if (m_mainWindow)
|
||||
{
|
||||
mainWnd->initializeGuiNewProjectLoaded();
|
||||
m_mainWindow->initializeGuiNewProjectLoaded();
|
||||
}
|
||||
if (m_mainPlotWindow)
|
||||
{
|
||||
@ -1157,7 +1165,7 @@ bool RiaApplication::openOdbCaseFromFile(const QString& fileName, bool applyTime
|
||||
|
||||
m_project->updateConnectedEditors();
|
||||
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(riv->cellResult());
|
||||
m_mainWindow->selectAsCurrentItem(riv->cellResult());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1366,6 +1374,26 @@ int RiaApplication::launchUnitTestsWithConsole()
|
||||
return launchUnitTests();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMainWindow* RiaApplication::getOrCreateAndShowMainWindow()
|
||||
{
|
||||
if (!m_mainWindow)
|
||||
{
|
||||
createMainWindow();
|
||||
}
|
||||
return m_mainWindow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMainWindow* RiaApplication::mainWindow()
|
||||
{
|
||||
return m_mainWindow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1380,6 +1408,33 @@ RiuPlotMainWindow* RiaApplication::getOrCreateMainPlotWindow()
|
||||
return m_mainPlotWindow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::createMainWindow()
|
||||
{
|
||||
CVF_ASSERT(m_mainWindow == nullptr);
|
||||
m_mainWindow = new RiuMainWindow;
|
||||
QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)";
|
||||
m_mainWindow->setWindowTitle("ResInsight " + platform);
|
||||
m_mainWindow->setDefaultWindowSize();
|
||||
m_mainWindow->setDefaultToolbarVisibility();
|
||||
m_mainWindow->loadWinGeoAndDockToolBarLayout();
|
||||
m_mainWindow->showWindow();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::deleteMainWindow()
|
||||
{
|
||||
if (m_mainWindow)
|
||||
{
|
||||
delete m_mainWindow;
|
||||
m_mainWindow = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1447,7 +1502,7 @@ RiuPlotMainWindow* RiaApplication::mainPlotWindow()
|
||||
RiuMainWindowBase* RiaApplication::mainWindowByID(int mainWindowID)
|
||||
{
|
||||
if (mainWindowID == 0)
|
||||
return RiuMainWindow::instance();
|
||||
return m_mainWindow;
|
||||
else if (mainWindowID == 1)
|
||||
return m_mainPlotWindow;
|
||||
else
|
||||
@ -1486,7 +1541,7 @@ RimViewWindow* RiaApplication::activeViewWindow()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaApplication::isMain3dWindowVisible() const
|
||||
{
|
||||
return RiuMainWindow::instance()->isVisible();
|
||||
return m_mainWindow && m_mainWindow->isVisible();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1494,45 +1549,29 @@ bool RiaApplication::isMain3dWindowVisible() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaApplication::isMainPlotWindowVisible() const
|
||||
{
|
||||
if (!m_mainPlotWindow) return false;
|
||||
|
||||
return m_mainPlotWindow->isVisible();
|
||||
return m_mainPlotWindow && m_mainPlotWindow->isVisible();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaApplication::tryCloseMainWindow()
|
||||
void RiaApplication::closeMainWindowIfOpenButHidden()
|
||||
{
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
if (mainWindow && !mainWindow->isVisible())
|
||||
if (m_mainWindow && !m_mainWindow->isVisible())
|
||||
{
|
||||
mainWindow->close();
|
||||
|
||||
return true;
|
||||
m_mainWindow->close();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaApplication::tryClosePlotWindow()
|
||||
void RiaApplication::closeMainPlotWindowIfOpenButHidden()
|
||||
{
|
||||
if (!m_mainPlotWindow)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_mainPlotWindow && !m_mainPlotWindow->isVisible())
|
||||
{
|
||||
m_mainPlotWindow->close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1540,6 +1579,7 @@ bool RiaApplication::tryClosePlotWindow()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::addToRecentFiles(const QString& fileName)
|
||||
{
|
||||
CVF_ASSERT(m_recentFileActionProvider && "The provider needs to be created before any attempts to use the recent file actions");
|
||||
m_recentFileActionProvider->addFileName(fileName);
|
||||
}
|
||||
|
||||
@ -1548,6 +1588,7 @@ void RiaApplication::addToRecentFiles(const QString& fileName)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QAction*> RiaApplication::recentFileActions() const
|
||||
{
|
||||
CVF_ASSERT(m_recentFileActionProvider && "The provider needs to be created before any attempts to use the recent file actions");
|
||||
return m_recentFileActionProvider->actions();
|
||||
}
|
||||
|
||||
@ -1608,19 +1649,24 @@ void RiaApplication::waitUntilCommandObjectsHasBeenProcessed()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::saveWinGeoAndDockToolBarLayout()
|
||||
void RiaApplication::saveMainWinGeoAndDockToolBarLayout()
|
||||
{
|
||||
if (m_mainPlotWindow)
|
||||
if (isMain3dWindowVisible())
|
||||
{
|
||||
m_mainPlotWindow->saveWinGeoAndDockToolBarLayout();
|
||||
}
|
||||
|
||||
if (RiuMainWindow::instance())
|
||||
{
|
||||
RiuMainWindow::instance()->saveWinGeoAndDockToolBarLayout();
|
||||
m_mainWindow->saveWinGeoAndDockToolBarLayout();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::savePlotWinGeoAndDockToolBarLayout()
|
||||
{
|
||||
if (isMainPlotWindowVisible())
|
||||
{
|
||||
m_mainPlotWindow->saveWinGeoAndDockToolBarLayout();
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1696,7 +1742,7 @@ QStringList RiaApplication::octaveArguments() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::slotWorkerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
||||
{
|
||||
RiuMainWindow::instance()->processMonitor()->stopMonitorWorkProcess();
|
||||
m_mainWindow->processMonitor()->stopMonitorWorkProcess();
|
||||
|
||||
// Execute delete later so that other slots that are hooked up
|
||||
// get a chance to run before we delete the object
|
||||
@ -1794,7 +1840,7 @@ bool RiaApplication::launchProcess(const QString& program, const QStringList& ar
|
||||
SIGNAL(finished(int, QProcess::ExitStatus)),
|
||||
SLOT(slotWorkerProcessFinished(int, QProcess::ExitStatus)));
|
||||
|
||||
RiuMainWindow::instance()->processMonitor()->startMonitorWorkProcess(m_workerProcess);
|
||||
m_mainWindow->processMonitor()->startMonitorWorkProcess(m_workerProcess);
|
||||
|
||||
m_workerProcess->start(program, arguments);
|
||||
if (!m_workerProcess->waitForStarted(1000))
|
||||
@ -1803,10 +1849,10 @@ bool RiaApplication::launchProcess(const QString& program, const QStringList& ar
|
||||
m_workerProcess = nullptr;
|
||||
m_runningWorkerProcess = false;
|
||||
|
||||
RiuMainWindow::instance()->processMonitor()->stopMonitorWorkProcess();
|
||||
m_mainWindow->processMonitor()->stopMonitorWorkProcess();
|
||||
|
||||
QMessageBox::warning(
|
||||
RiuMainWindow::instance(), "Script execution", "Failed to start script executable located at\n" + program);
|
||||
m_mainWindow, "Script execution", "Failed to start script executable located at\n" + program);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -1866,9 +1912,9 @@ void RiaApplication::applyPreferences()
|
||||
caf::EffectGenerator::setRenderingMode(caf::EffectGenerator::FIXED_FUNCTION);
|
||||
}
|
||||
|
||||
if (RiuMainWindow::instance() && RiuMainWindow::instance()->projectTreeView())
|
||||
if (m_mainWindow && m_mainWindow->projectTreeView())
|
||||
{
|
||||
RiuMainWindow::instance()->projectTreeView()->enableAppendOfClassNameToUiItemText(
|
||||
m_mainWindow->projectTreeView()->enableAppendOfClassNameToUiItemText(
|
||||
m_preferences->appendClassNameToUiText());
|
||||
if (mainPlotWindow())
|
||||
mainPlotWindow()->projectTreeView()->enableAppendOfClassNameToUiItemText(m_preferences->appendClassNameToUiText());
|
||||
@ -2030,10 +2076,9 @@ void RiaApplication::runMultiCaseSnapshots(const QString& templateProjectF
|
||||
std::vector<QString> gridFileNames,
|
||||
const QString& snapshotFolderName)
|
||||
{
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
if (!mainWnd) return;
|
||||
if (!m_mainWindow) return;
|
||||
|
||||
mainWnd->hideAllDockWindows();
|
||||
m_mainWindow->hideAllDockWindows();
|
||||
|
||||
const size_t numGridFiles = gridFileNames.size();
|
||||
for (size_t i = 0; i < numGridFiles; i++)
|
||||
@ -2050,7 +2095,7 @@ void RiaApplication::runMultiCaseSnapshots(const QString& templateProjectF
|
||||
}
|
||||
}
|
||||
|
||||
mainWnd->loadWinGeoAndDockToolBarLayout();
|
||||
m_mainWindow->loadWinGeoAndDockToolBarLayout();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -58,6 +58,7 @@ class RimViewWindow;
|
||||
class RimWellLogPlot;
|
||||
class RimWellAllocationPlot;
|
||||
|
||||
class RiuMainWindow;
|
||||
class RiuMainWindowBase;
|
||||
class RiuPlotMainWindow;
|
||||
class RiuRecentFileActionProvider;
|
||||
@ -183,6 +184,9 @@ public:
|
||||
int launchUnitTests();
|
||||
int launchUnitTestsWithConsole();
|
||||
|
||||
RiuMainWindow* getOrCreateAndShowMainWindow();
|
||||
RiuMainWindow* mainWindow();
|
||||
|
||||
RiuPlotMainWindow* getOrCreateMainPlotWindow();
|
||||
RiuPlotMainWindow* getOrCreateAndShowMainPlotWindow();
|
||||
RiuPlotMainWindow* mainPlotWindow();
|
||||
@ -193,8 +197,8 @@ public:
|
||||
bool isMain3dWindowVisible() const;
|
||||
bool isMainPlotWindowVisible() const;
|
||||
|
||||
bool tryCloseMainWindow();
|
||||
bool tryClosePlotWindow();
|
||||
void closeMainWindowIfOpenButHidden();
|
||||
void closeMainPlotWindowIfOpenButHidden();
|
||||
|
||||
void addToRecentFiles(const QString& fileName);
|
||||
std::vector<QAction*> recentFileActions() const;
|
||||
@ -204,7 +208,8 @@ public:
|
||||
static std::vector<QString> readFileListFromTextFile(QString listFileName);
|
||||
|
||||
void waitUntilCommandObjectsHasBeenProcessed();
|
||||
void saveWinGeoAndDockToolBarLayout();
|
||||
void saveMainWinGeoAndDockToolBarLayout();
|
||||
void savePlotWinGeoAndDockToolBarLayout();
|
||||
|
||||
static bool enableDevelopmentFeatures();
|
||||
static void clearAllSelections();
|
||||
@ -213,6 +218,9 @@ private:
|
||||
void onProjectOpenedOrClosed();
|
||||
void setWindowCaptionFromAppState();
|
||||
|
||||
void createMainWindow();
|
||||
void deleteMainWindow();
|
||||
|
||||
void createMainPlotWindow();
|
||||
void deleteMainPlotWindow();
|
||||
|
||||
@ -258,6 +266,7 @@ private:
|
||||
|
||||
bool m_runningWorkerProcess;
|
||||
|
||||
RiuMainWindow* m_mainWindow;
|
||||
RiuPlotMainWindow* m_mainPlotWindow;
|
||||
|
||||
std::unique_ptr<RiuRecentFileActionProvider> m_recentFileActionProvider;
|
||||
|
@ -19,9 +19,6 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuMessagePanel.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
RiaLogging::loggerInstance()->setLevel(RI_LL_DEBUG);
|
||||
@ -36,24 +33,9 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
return unitTestResult;
|
||||
}
|
||||
|
||||
RiuMainWindow window;
|
||||
QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)";
|
||||
window.setWindowTitle("ResInsight " + platform);
|
||||
window.setDefaultWindowSize();
|
||||
window.setDefaultToolbarVisibility();
|
||||
window.loadWinGeoAndDockToolBarLayout();
|
||||
window.showWindow();
|
||||
|
||||
// Create plot main window to be able to set expanded state on created objects
|
||||
// The plot window is hidden by default
|
||||
RiaApplication::instance()->getOrCreateMainPlotWindow();
|
||||
|
||||
|
||||
if (app.parseArguments())
|
||||
{
|
||||
RiaLogging::setLoggerInstance(new RiuMessagePanelLogger(window.messagePanel()));
|
||||
RiaLogging::loggerInstance()->setLevel(RI_LL_DEBUG);
|
||||
|
||||
int exitCode = 0;
|
||||
try
|
||||
{
|
||||
@ -70,13 +52,9 @@ int main(int argc, char *argv[])
|
||||
throw;
|
||||
}
|
||||
|
||||
RiaLogging::deleteLoggerInstance();
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
RiaLogging::deleteLoggerInstance();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -108,9 +108,6 @@
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
|
||||
RiuMainWindow* RiuMainWindow::sm_mainWindowInstance = nullptr;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -123,8 +120,6 @@ RiuMainWindow::RiuMainWindow()
|
||||
m_blockSlotSubWindowActivated(false),
|
||||
m_holoLensToolBar(nullptr)
|
||||
{
|
||||
CVF_ASSERT(sm_mainWindowInstance == nullptr);
|
||||
|
||||
m_mdiArea = new QMdiArea;
|
||||
m_mdiArea->setOption(QMdiArea::DontMaximizeSubWindowOnActivation, true);
|
||||
connect(m_mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow *)), SLOT(slotSubWindowActivated(QMdiSubWindow*)));
|
||||
@ -140,8 +135,6 @@ RiuMainWindow::RiuMainWindow()
|
||||
// Store the layout so we can offer reset option
|
||||
m_initialDockAndToolbarLayout = saveState(0);
|
||||
|
||||
sm_mainWindowInstance = this;
|
||||
|
||||
m_dragDropInterface = std::unique_ptr<caf::PdmUiDragDropInterface>(new RiuDragDrop());
|
||||
|
||||
initializeGuiNewProjectLoaded();
|
||||
@ -175,7 +168,7 @@ RiuMainWindow::RiuMainWindow()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMainWindow* RiuMainWindow::instance()
|
||||
{
|
||||
return sm_mainWindowInstance;
|
||||
return RiaApplication::instance()->mainWindow();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -267,6 +260,8 @@ void RiuMainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
app->saveMainWinGeoAndDockToolBarLayout();
|
||||
|
||||
if (app->isMainPlotWindowVisible())
|
||||
{
|
||||
return;
|
||||
@ -278,9 +273,7 @@ void RiuMainWindow::closeEvent(QCloseEvent* event)
|
||||
return;
|
||||
}
|
||||
|
||||
app->saveWinGeoAndDockToolBarLayout();
|
||||
|
||||
if (!app->tryClosePlotWindow()) return;
|
||||
app->closeMainPlotWindowIfOpenButHidden();
|
||||
|
||||
app->closeProject();
|
||||
}
|
||||
|
@ -165,6 +165,8 @@ void RiuPlotMainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
app->savePlotWinGeoAndDockToolBarLayout();
|
||||
|
||||
if (app->isMain3dWindowVisible())
|
||||
{
|
||||
return;
|
||||
@ -176,9 +178,7 @@ void RiuPlotMainWindow::closeEvent(QCloseEvent* event)
|
||||
return;
|
||||
}
|
||||
|
||||
app->saveWinGeoAndDockToolBarLayout();
|
||||
|
||||
if (!app->tryCloseMainWindow()) return;
|
||||
app->closeMainWindowIfOpenButHidden();
|
||||
|
||||
app->closeProject();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user