Desktop: Use the Packaged HTML User Manual when Opening the Manual in the Browser.#4735
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves offline usability by preferring the locally packaged HTML user manual when opening the manual in an external browser (e.g., when the built-in HTML viewer cannot be built), falling back to the website only if the packaged manual isn’t found.
Changes:
- Added a shared helper to resolve the packaged user manual’s local file URL (with language fallbacks) and a “best available” manual URL selector.
- Refactored the in-app user manual dialog to use the shared packaged-manual resolver.
- Updated the “User Manual” action (when
NO_USERMANUALis defined) to open the packaged manual in the system browser instead of always using the website.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| desktop-widgets/usermanualpath.h | Declares helper functions to locate the packaged manual and choose the best manual URL. |
| desktop-widgets/usermanualpath.cpp | Implements packaged-manual discovery (localized fallback) and website fallback URL selection. |
| desktop-widgets/usermanual.cpp | Uses the new packaged-manual resolver instead of duplicating path/language lookup logic. |
| desktop-widgets/mainwindow.cpp | Opens getUserManualUrl() in the system browser under NO_USERMANUAL. |
| desktop-widgets/CMakeLists.txt | Adds the new helper source/header to the desktop-widgets build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
desktop-widgets/usermanualpath.cpp
Outdated
| QString searchPath = getSubsurfaceDataPath("Documentation"); | ||
| if (searchPath.size()) { | ||
| QString lang = getUiLanguage(); | ||
| QString prefix = searchPath.append("/user-manual"); |
There was a problem hiding this comment.
In getPackagedUserManualUrl(), QString prefix = searchPath.append("/user-manual"); mutates searchPath as a side effect, which is easy to miss and makes the path-building logic harder to follow. Prefer constructing prefix without modifying searchPath (e.g., concatenation or QDir(searchPath).filePath(...)).
| QString prefix = searchPath.append("/user-manual"); | |
| QString prefix = searchPath + "/user-manual"; |
desktop-widgets/usermanual.cpp
Outdated
| #endif | ||
| } | ||
| } else { | ||
| report_info("unable to find packaged user manual"); |
There was a problem hiding this comment.
The failure log message here no longer includes the documentation directory that was searched (the previous implementation logged it). Including the resolved documentation path and/or selected language in this report_info would make missing-packaged-manual issues easier to diagnose.
| report_info("unable to find packaged user manual"); | |
| report_info("unable to find packaged user manual (resolved URL: %s)", manualUrl.toString().toUtf8().constData()); |
|
Artifacts: |
|
Artifacts: |
|
Artifacts: |
|
Artifacts: |
… the Browser. When the built-in html viewer for the user manual can not be built, we are currently opening the user manual on the website in the system default browser. This obviously does not work when there is no internet connection. Default to using the packaged HTML version of the user manual when opening the manual in the browser. Signed-off-by: Michael Keller <github@ike.ch>
42db91b to
36396e7
Compare
|
Artifacts: |
|
Artifacts: |
|
Artifacts: |
|
Artifacts: |
Describe the pull request:
Pull request long description:
When the built-in html viewer for the user manual can not be built, we
are currently opening the user manual on the website in the system
default browser. This obviously does not work when there is no internet
connection. Default to using the packaged HTML version of the user manual
when opening the manual in the browser.
Changes made:
Related issues:
#4717
Additional information:
Documentation change:
Mentions: