Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/sphinx-docs/source/user/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Tutorials

.. note:: In Windows use [Alt]-[Cursor left] to return to the previous page

:download:`Getting Started with Sasview <sasview/getting_started_with_sasview_v5.pdf>`
Getting Started with Sasview <sasview/getting_started_with_sasview_v5.pdf>

:download:`Subtracting a Model Calculation from Experimental Data <sasview/subtracting_a_model_calculation_from_real_data_v5.pdf>`
:ref:`Subtracting a Model Calculation from Experimental Data <sasview/subtracting_a_model_calculation_from_real_data_v5.pdf>`

:download:`Basic 1D Fitting in Sasview <sasview/basic_1d_fitting_in_sasview_v6.pdf>`

Expand Down
2 changes: 2 additions & 0 deletions docs/sphinx-docs/source/user/working.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Working with SasView

Example Data <example_data/testdata_help>

Tutorials <tutorial>

Writing a Plugin Model <qtgui/Perspectives/Fitting/plugin>

Scripting Interface to Sasmodels <qtgui/Perspectives/Fitting/scripting>
Expand Down
3 changes: 2 additions & 1 deletion src/sas/qtgui/MainWindow/GuiManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,8 @@ def actionTutorial(self):
Open the page with tutorial PDF links
"""

webbrowser.open("https://www.sasview.org/docs/user/tutorial.html")
tutorialfile = "/user/tutorial.html"
self.showHelp(tutorialfile)

def actionAcknowledge(self):
"""
Expand Down
17 changes: 16 additions & 1 deletion src/sas/qtgui/Utilities/DocViewWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def initializeSignals(self):
self.communicate.documentationRegeneratedSignal.connect(self.refresh)
self.communicate.closeSignal.connect(self.onClose)
self.webEngineViewer.urlChanged.connect(self.updateTitle)
self.webEngineViewer.page().profile().downloadRequested.connect(self.onDownload)

def onEdit(self):
"""Open editor (TabbedModelEditor) window."""
Expand Down Expand Up @@ -150,7 +151,18 @@ def onShow(self):
Keep as a separate method to allow for additional functionality when opening
"""
self.show()


def onDownload(self, download_item):
download_item.accept()
download_item.isFinishedChanged.connect(lambda: self.onDownloadFinished(download_item))

def onDownloadFinished(self, item):
_filename = item.downloadFileName()
if item.state() == item.DownloadState.DownloadCompleted:
logging.warning(f"your file: {_filename} was downloaded to your default download directory")
else:
logging.error(f"FAILED TO DOWNLOAD: {_filename} is unavailable")

def regenerateIfNeeded(self):
"""
Determines whether a file needs to be regenerated.
Expand Down Expand Up @@ -228,8 +240,11 @@ def loadHtml(self):
url = self.processUrl()
settings = self.webEngineViewer.settings()
# Allows QtWebEngine to access MathJax and code highlighting APIs
# and enables the Pdf Viewer. Note that setting is enabled by default
# but requires PluginsEnabled to be True first
settings.setAttribute(QtWebEngineCore.QWebEngineSettings.LocalContentCanAccessRemoteUrls, True)
settings.setAttribute(QtWebEngineCore.QWebEngineSettings.LocalContentCanAccessFileUrls, True)
settings.setAttribute(QtWebEngineCore.QWebEngineSettings.PluginsEnabled, True)
self.webEngineViewer.load(url)

# Show widget
Expand Down
Loading