Open Users Guide url from Help menu

This commit is contained in:
Magne Sjaastad
2013-10-24 10:46:57 +02:00
parent 84bc586f9a
commit a74be74792
2 changed files with 19 additions and 0 deletions

View File

@@ -281,6 +281,8 @@ void RiuMainWindow::createActions()
connect(m_aboutAction, SIGNAL(triggered()), SLOT(slotAbout()));
m_commandLineHelpAction = new QAction("&Command Line Help", this);
connect(m_commandLineHelpAction, SIGNAL(triggered()), SLOT(slotShowCommandLineHelp()));
m_openUsersGuideInBrowserAction = new QAction("&Users Guide", this);
connect(m_openUsersGuideInBrowserAction, SIGNAL(triggered()), SLOT(slotOpenUsersGuideInBrowserAction()));
// Draw style actions
m_dsActionGroup = new QActionGroup(this);
@@ -390,6 +392,7 @@ void RiuMainWindow::createMenus()
// Help menu
QMenu* helpMenu = menuBar()->addMenu("&Help");
helpMenu->addAction(m_openUsersGuideInBrowserAction);
helpMenu->addAction(m_aboutAction);
helpMenu->addAction(m_commandLineHelpAction);
}
@@ -1798,3 +1801,17 @@ void RiuMainWindow::slotAddWellCellsToRangeFilterAction(bool doAdd)
riv->wellCollection()->wellCellsToRangeFilterMode.setValueFromUi(static_cast<unsigned int>(rangeAddType.index()));
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotOpenUsersGuideInBrowserAction()
{
QString usersGuideUrl = "https://github.com/OPM/ResInsight/blob/internal/Documentation/UsersGuide/UsersGuide.md";
if (!QDesktopServices::openUrl(usersGuideUrl))
{
QErrorMessage* errorHandler = QErrorMessage::qtHandler();
errorHandler->showMessage("Failed open browser with the following url\n\n" + usersGuideUrl);
}
}