Skip to content

Commit

Permalink
Merge pull request #2981 from OPM/2018-05-1-patch
Browse files Browse the repository at this point in the history
Merge into master for Release 2018.05.1 of ResInsight
  • Loading branch information
magnesj authored May 25, 2018
2 parents 43fed5c + 67a2974 commit 55341cd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
7 changes: 5 additions & 2 deletions ApplicationCode/UserInterface/RiuDockWidgetTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ QDockWidget* RiuDockWidgetTools::findDockWidget(const QObject* parent, const QSt
QAction* RiuDockWidgetTools::toggleActionForWidget(const QObject* parent, const QString& dockWidgetName)
{
auto w = RiuDockWidgetTools::findDockWidget(parent, dockWidgetName);
CVF_ASSERT(w);
if (w)
{
return w->toggleViewAction();
}

return w->toggleViewAction();
return nullptr;
}

//--------------------------------------------------------------------------------------------------
Expand Down
35 changes: 26 additions & 9 deletions ApplicationCode/UserInterface/RiuMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,23 @@ RiuProcessMonitor* RiuMainWindow::processMonitor()
return m_processMonitor;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void appendToggleActionForDockingWidget(QMenu* menu, QWidget* parent, const QString& dockWidgetName)
{
if (menu)
{
auto dwt = RiuDockWidgetTools::instance();
QAction* action = dwt->toggleActionForWidget(parent, dockWidgetName);
if (action)
{
// Some dock windows are depending on configuration (mohrs circle plot), so do not assert they exist
menu->addAction(action);
}
}
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand All @@ -1307,18 +1324,18 @@ void RiuMainWindow::slotBuildWindowActions()

auto dwt = RiuDockWidgetTools::instance();

m_windowMenu->addAction(dwt->toggleActionForWidget(this, dwt->projectTreeName()));
m_windowMenu->addAction(dwt->toggleActionForWidget(this, dwt->propertyEditorName()));
m_windowMenu->addAction(dwt->toggleActionForWidget(this, dwt->messagesName()));
m_windowMenu->addAction(dwt->toggleActionForWidget(this, dwt->processMonitorName()));
appendToggleActionForDockingWidget(m_windowMenu, this, dwt->projectTreeName());
appendToggleActionForDockingWidget(m_windowMenu, this, dwt->propertyEditorName());
appendToggleActionForDockingWidget(m_windowMenu, this, dwt->messagesName());
appendToggleActionForDockingWidget(m_windowMenu, this, dwt->processMonitorName());

m_windowMenu->addSeparator();

m_windowMenu->addAction(dwt->toggleActionForWidget(this, dwt->resultInfoName()));
m_windowMenu->addAction(dwt->toggleActionForWidget(this, dwt->resultPlotName()));
m_windowMenu->addAction(dwt->toggleActionForWidget(this, dwt->relPermPlotName()));
m_windowMenu->addAction(dwt->toggleActionForWidget(this, dwt->pvtPlotName()));
m_windowMenu->addAction(dwt->toggleActionForWidget(this, dwt->mohrsCirclePlotName()));
appendToggleActionForDockingWidget(m_windowMenu, this, dwt->resultInfoName());
appendToggleActionForDockingWidget(m_windowMenu, this, dwt->resultPlotName());
appendToggleActionForDockingWidget(m_windowMenu, this, dwt->relPermPlotName());
appendToggleActionForDockingWidget(m_windowMenu, this, dwt->pvtPlotName());
appendToggleActionForDockingWidget(m_windowMenu, this, dwt->mohrsCirclePlotName());

m_windowMenu->addSeparator();
QAction* cascadeWindowsAction = new QAction("Cascade Windows", this);
Expand Down
2 changes: 1 addition & 1 deletion ResInsightVersion.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

set(RESINSIGHT_MAJOR_VERSION 2018)
set(RESINSIGHT_MINOR_VERSION 05)
set(RESINSIGHT_PATCH_VERSION 0)
set(RESINSIGHT_PATCH_VERSION 1)

# Opional text with no restrictions
#set(RESINSIGHT_VERSION_TEXT "-dev")
Expand Down

0 comments on commit 55341cd

Please sign in to comment.