mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Store tree view state in project file
p4#: 21342
This commit is contained in:
@@ -724,6 +724,8 @@ void RiuMainWindow::slotOpenProject()
|
||||
app->loadProject(fileName);
|
||||
}
|
||||
|
||||
restoreTreeViewState();
|
||||
|
||||
//m_mainViewer->setDefaultView();
|
||||
}
|
||||
|
||||
@@ -734,6 +736,8 @@ void RiuMainWindow::slotOpenLastUsedProject()
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
app->loadLastUsedProject();
|
||||
|
||||
restoreTreeViewState();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -889,6 +893,8 @@ void RiuMainWindow::slotSaveProject()
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
storeTreeViewState();
|
||||
|
||||
app->saveProject();
|
||||
}
|
||||
|
||||
@@ -899,6 +905,8 @@ void RiuMainWindow::slotSaveProjectAs()
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
storeTreeViewState();
|
||||
|
||||
app->saveProjectPromptForFileName();
|
||||
}
|
||||
|
||||
@@ -1406,3 +1414,34 @@ void RiuMainWindow::refreshDrawStyleActions()
|
||||
m_drawStyleToggleFaultsAction->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::storeTreeViewState()
|
||||
{
|
||||
if (m_treeView)
|
||||
{
|
||||
QString treeViewState;
|
||||
|
||||
m_treeView->storeTreeViewState(treeViewState);
|
||||
|
||||
RiaApplication::instance()->project()->treeViewState = treeViewState;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::restoreTreeViewState()
|
||||
{
|
||||
if (m_treeView)
|
||||
{
|
||||
QString stateString = RiaApplication::instance()->project()->treeViewState;
|
||||
if (!stateString.isEmpty())
|
||||
{
|
||||
m_treeView->collapseAll();
|
||||
m_treeView->applyTreeViewState(stateString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user