Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.
Draft
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
25 changes: 25 additions & 0 deletions mu/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,31 @@ def show_help(self):
"""
Display browser based help about Mu.
"""
from PyQt5.Qsci import QsciScintilla, QsciPrinter
from PyQt5.QtPrintSupport import QPrinter, QPrintDialog
from PyQt5.QtWidgets import QDialog
from PyQt5.QtWidgets import QApplication

# QScintilla printer class docs, mostly a few additions on top of QPrinter:
# https://docs.huihoo.com/pyqt/QScintilla2/classQsciPrinter.html
printer = QsciPrinter(mode=QPrinter.ScreenResolution)
printer.setFullPage(True)
printer.setWrapMode(QsciScintilla.WrapWord)
# More generic QPrinter configuration for the page print can go here, this is also an example of a long line wrapping

printDialog = QPrintDialog(printer, self._view)
if printDialog.exec() == QDialog.Accepted:
# Dialog was blocking, so let's keep the app responsive
QApplication.processEvents()
print("DEBUG: PRINTING...")
printer.setDocName("IS THIS MY FILE NAME??")
code_tab = self._view.current_tab
response_success = printer.printRange(code_tab)
if response_success:
print("DEBUG: PRINTING DONE?????")
else:
print("DEBUG: PRINTING ERROR?????")
return
major_version = ".".join(__version__.split(".")[:2])
url = "https://codewith.mu/{}/help/{}".format(
i18n.language_code[:2], major_version
Expand Down