Commit 1049c35f authored by Cory Quammen's avatar Cory Quammen
Browse files

Change URL of ParaView Guide to new ReadTheDocs page

Added logic to open a local PDF file verison of the Guide instead if
it exists in the local documentation directory.
parent f4119b37
Pipeline #186250 waiting for manual action with stages
......@@ -133,8 +133,9 @@ public:
int styleHint(StyleHint hint, const QStyleOption* option = 0, const QWidget* widget = 0,
QStyleHintReturn* returnData = 0) const override
{
return hint == QStyle::SH_Menu_AllowActiveAndDisabled ? 1 : QProxyStyle::styleHint(
hint, option, widget, returnData);
return hint == QStyle::SH_Menu_AllowActiveAndDisabled
? 1
: QProxyStyle::styleHint(hint, option, widget, returnData);
}
};
......@@ -585,17 +586,31 @@ void pqParaViewMenuBuilders::buildHelpMenu(QMenu& menu)
(menu.addAction(QIcon(":/pqWidgets/Icons/pdf.png"), "Getting Started with ParaView")
<< pqSetName("actionGettingStarted")));
// ParaView Guide
QAction* guide = menu.addAction(QIcon(":/pqWidgets/Icons/pdf.png"), "ParaView Guide");
guide->setObjectName("actionGuide");
guide->setShortcut(QKeySequence::HelpContents);
QString guideURL = QString("https://www.paraview.org/paraview-downloads/"
"download.php?submit=Download&version=v%1.%2&type=binary&os="
"Sources&downloadFile=ParaViewGuide-%1.%2.%3.pdf")
QString versionString = QString("%1.%2.%3")
.arg(vtkSMProxyManager::GetVersionMajor())
.arg(vtkSMProxyManager::GetVersionMinor())
.arg(vtkSMProxyManager::GetVersionPatch());
// ParaView Guide. If there is a copy local to the install tree, use it instead of going
// out to the web.
QString paraViewGuideFile =
QString("%1/ParaViewGuide-%2.pdf").arg(documentationPath).arg(versionString);
QFile guideLocalFile(paraViewGuideFile);
QAction* guide = menu.addAction("ParaView Guide");
guide->setObjectName("actionGuide");
guide->setShortcut(QKeySequence::HelpContents);
if (guideLocalFile.exists())
{
guide->setIcon(QIcon(":/pqWidgets/Icons/pdf.png"));
QUrl guideUrl = QUrl::fromLocalFile(paraViewGuideFile);
new pqDesktopServicesReaction(guideUrl, guide);
}
else
{
// Remote ParaView Guide
QString guideURL = QString("https://docs.paraview.org/en/v%1/").arg(versionString);
new pqDesktopServicesReaction(QUrl(guideURL), guide);
}
#ifdef PARAVIEW_USE_QTHELP
// Help
......@@ -613,8 +628,8 @@ void pqParaViewMenuBuilders::buildHelpMenu(QMenu& menu)
.arg(vtkSMProxyManager::GetVersionMajor())
.arg(vtkSMProxyManager::GetVersionMinor())
.arg(vtkSMProxyManager::GetVersionPatch());
new pqDesktopServicesReaction(
QUrl(tutorialURL), (menu.addAction(QIcon(":/pqWidgets/Icons/pdf.png"), "ParaView Tutorial")
new pqDesktopServicesReaction(QUrl(tutorialURL),
(menu.addAction(QIcon(":/pqWidgets/Icons/pdf.png"), "ParaView Tutorial")
<< pqSetName("actionTutorialNotes")));
// Sandia National Labs Tutorials
......@@ -643,12 +658,6 @@ void pqParaViewMenuBuilders::buildHelpMenu(QMenu& menu)
(menu.addAction("ParaView Community Support") << pqSetName("actionCommunitySupport")));
// ParaView Release Notes
QString versionString(PARAVIEW_VERSION_FULL);
int indexOfHyphen = versionString.indexOf('-');
if (indexOfHyphen > -1)
{
versionString = versionString.left(indexOfHyphen);
}
versionString.replace('.', '-');
new pqDesktopServicesReaction(
QUrl("https://blog.kitware.com/paraview-" + versionString + "-release-notes/"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment