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: ...@@ -133,8 +133,9 @@ public:
int styleHint(StyleHint hint, const QStyleOption* option = 0, const QWidget* widget = 0, int styleHint(StyleHint hint, const QStyleOption* option = 0, const QWidget* widget = 0,
QStyleHintReturn* returnData = 0) const override QStyleHintReturn* returnData = 0) const override
{ {
return hint == QStyle::SH_Menu_AllowActiveAndDisabled ? 1 : QProxyStyle::styleHint( return hint == QStyle::SH_Menu_AllowActiveAndDisabled
hint, option, widget, returnData); ? 1
: QProxyStyle::styleHint(hint, option, widget, returnData);
} }
}; };
...@@ -583,19 +584,33 @@ void pqParaViewMenuBuilders::buildHelpMenu(QMenu& menu) ...@@ -583,19 +584,33 @@ void pqParaViewMenuBuilders::buildHelpMenu(QMenu& menu)
// Getting Started with ParaView // Getting Started with ParaView
new pqDesktopServicesReaction(QUrl::fromLocalFile(paraViewGettingStartedFile), new pqDesktopServicesReaction(QUrl::fromLocalFile(paraViewGettingStartedFile),
(menu.addAction(QIcon(":/pqWidgets/Icons/pdf.png"), "Getting Started with ParaView") (menu.addAction(QIcon(":/pqWidgets/Icons/pdf.png"), "Getting Started with ParaView")
<< pqSetName("actionGettingStarted"))); << pqSetName("actionGettingStarted")));
// ParaView Guide QString versionString = QString("%1.%2.%3")
QAction* guide = menu.addAction(QIcon(":/pqWidgets/Icons/pdf.png"), "ParaView Guide"); .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->setObjectName("actionGuide");
guide->setShortcut(QKeySequence::HelpContents); guide->setShortcut(QKeySequence::HelpContents);
QString guideURL = QString("https://www.paraview.org/paraview-downloads/" if (guideLocalFile.exists())
"download.php?submit=Download&version=v%1.%2&type=binary&os=" {
"Sources&downloadFile=ParaViewGuide-%1.%2.%3.pdf") guide->setIcon(QIcon(":/pqWidgets/Icons/pdf.png"));
.arg(vtkSMProxyManager::GetVersionMajor()) QUrl guideUrl = QUrl::fromLocalFile(paraViewGuideFile);
.arg(vtkSMProxyManager::GetVersionMinor()) new pqDesktopServicesReaction(guideUrl, guide);
.arg(vtkSMProxyManager::GetVersionPatch()); }
new pqDesktopServicesReaction(QUrl(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 #ifdef PARAVIEW_USE_QTHELP
// Help // Help
...@@ -613,9 +628,9 @@ void pqParaViewMenuBuilders::buildHelpMenu(QMenu& menu) ...@@ -613,9 +628,9 @@ void pqParaViewMenuBuilders::buildHelpMenu(QMenu& menu)
.arg(vtkSMProxyManager::GetVersionMajor()) .arg(vtkSMProxyManager::GetVersionMajor())
.arg(vtkSMProxyManager::GetVersionMinor()) .arg(vtkSMProxyManager::GetVersionMinor())
.arg(vtkSMProxyManager::GetVersionPatch()); .arg(vtkSMProxyManager::GetVersionPatch());
new pqDesktopServicesReaction( new pqDesktopServicesReaction(QUrl(tutorialURL),
QUrl(tutorialURL), (menu.addAction(QIcon(":/pqWidgets/Icons/pdf.png"), "ParaView Tutorial") (menu.addAction(QIcon(":/pqWidgets/Icons/pdf.png"), "ParaView Tutorial")
<< pqSetName("actionTutorialNotes"))); << pqSetName("actionTutorialNotes")));
// Sandia National Labs Tutorials // Sandia National Labs Tutorials
new pqDesktopServicesReaction(QUrl("http://www.paraview.org/Wiki/SNL_ParaView_4_Tutorials"), new pqDesktopServicesReaction(QUrl("http://www.paraview.org/Wiki/SNL_ParaView_4_Tutorials"),
...@@ -643,12 +658,6 @@ void pqParaViewMenuBuilders::buildHelpMenu(QMenu& menu) ...@@ -643,12 +658,6 @@ void pqParaViewMenuBuilders::buildHelpMenu(QMenu& menu)
(menu.addAction("ParaView Community Support") << pqSetName("actionCommunitySupport"))); (menu.addAction("ParaView Community Support") << pqSetName("actionCommunitySupport")));
// ParaView Release Notes // ParaView Release Notes
QString versionString(PARAVIEW_VERSION_FULL);
int indexOfHyphen = versionString.indexOf('-');
if (indexOfHyphen > -1)
{
versionString = versionString.left(indexOfHyphen);
}
versionString.replace('.', '-'); versionString.replace('.', '-');
new pqDesktopServicesReaction( new pqDesktopServicesReaction(
QUrl("https://blog.kitware.com/paraview-" + versionString + "-release-notes/"), 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