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())); connect(m_aboutAction, SIGNAL(triggered()), SLOT(slotAbout()));
m_commandLineHelpAction = new QAction("&Command Line Help", this); m_commandLineHelpAction = new QAction("&Command Line Help", this);
connect(m_commandLineHelpAction, SIGNAL(triggered()), SLOT(slotShowCommandLineHelp())); connect(m_commandLineHelpAction, SIGNAL(triggered()), SLOT(slotShowCommandLineHelp()));
m_openUsersGuideInBrowserAction = new QAction("&Users Guide", this);
connect(m_openUsersGuideInBrowserAction, SIGNAL(triggered()), SLOT(slotOpenUsersGuideInBrowserAction()));
// Draw style actions // Draw style actions
m_dsActionGroup = new QActionGroup(this); m_dsActionGroup = new QActionGroup(this);
@ -390,6 +392,7 @@ void RiuMainWindow::createMenus()
// Help menu // Help menu
QMenu* helpMenu = menuBar()->addMenu("&Help"); QMenu* helpMenu = menuBar()->addMenu("&Help");
helpMenu->addAction(m_openUsersGuideInBrowserAction);
helpMenu->addAction(m_aboutAction); helpMenu->addAction(m_aboutAction);
helpMenu->addAction(m_commandLineHelpAction); helpMenu->addAction(m_commandLineHelpAction);
} }
@ -1798,3 +1801,17 @@ void RiuMainWindow::slotAddWellCellsToRangeFilterAction(bool doAdd)
riv->wellCollection()->wellCellsToRangeFilterMode.setValueFromUi(static_cast<unsigned int>(rangeAddType.index())); 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);
}
}

View File

@ -163,6 +163,7 @@ private:
// Help actions // Help actions
QAction* m_aboutAction; QAction* m_aboutAction;
QAction* m_commandLineHelpAction; QAction* m_commandLineHelpAction;
QAction* m_openUsersGuideInBrowserAction;
// Animation // Animation
caf::AnimationToolBar* m_animationToolBar; caf::AnimationToolBar* m_animationToolBar;
@ -245,6 +246,7 @@ private slots:
// Help slots // Help slots
void slotAbout(); void slotAbout();
void slotShowCommandLineHelp(); void slotShowCommandLineHelp();
void slotOpenUsersGuideInBrowserAction();
void slotSubWindowActivated(QMdiSubWindow* subWindow); void slotSubWindowActivated(QMdiSubWindow* subWindow);
void slotCurrentChanged(const QModelIndex & current, const QModelIndex & previous); void slotCurrentChanged(const QModelIndex & current, const QModelIndex & previous);