Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon Manager: Switch to using QWebEngineView for README #5458

Merged
merged 1 commit into from Feb 3, 2022

Conversation

chennes
Copy link
Member

@chennes chennes commented Jan 29, 2022

Take Two -- some different design decisions this time. The basic idea is to use QWebEngineView (which is basically a fork of Chromium) to display the README and Macro Wiki Page content, since that content is really web-based and makes sense in a web browser. However, it is not intended as a general purpose web browser: almost all links you click on will ask the system to open its default web browser, the same way the original version did. The only exception is FreeCAD wiki pages, which this web view will render.

@freecadci
Copy link

pipeline status for feature branch PR_5458. Pipeline 459054347 was triggered at 4c6bae8. All CI branches and pipelines.

@chennes chennes self-assigned this Jan 29, 2022
@freecadci
Copy link

pipeline status for feature branch PR_5458. Pipeline 459369082 was triggered at 92b0df7. All CI branches and pipelines.

@freecadci
Copy link

pipeline status for feature branch PR_5458. Pipeline 459527779 was triggered at 062b23a. All CI branches and pipelines.

@yorikvanhavre
Copy link
Member

Not sure how to fix the conflict... Can you have a look @chennes ? I'd like to test this!

@yorikvanhavre yorikvanhavre self-requested a review February 1, 2022 12:18
@chennes chennes force-pushed the addonManagerShowReadmeInWebView branch from 062b23a to 57f9364 Compare February 1, 2022 13:38
@chennes
Copy link
Member Author

chennes commented Feb 1, 2022

@yorikvanhavre Rebased, conflict should be gone now. Thanks for testing!

@yorikvanhavre
Copy link
Member

"Rock 'n roll"

@freecadci
Copy link

pipeline status for feature branch PR_5458. Pipeline 461151121 was triggered at 57f9364. All CI branches and pipelines.

@chennes
Copy link
Member Author

chennes commented Feb 1, 2022

That predated me, but I felt like I had to leave it in 😄

@yorikvanhavre
Copy link
Member

I gave it a test spin, pretty cool! One little thin I would do is add some padding so there is a little space between the HTML text contents and the widget border:

Screenshot from 2022-02-02 12-43-10
:

@chennes chennes force-pushed the addonManagerShowReadmeInWebView branch from 57f9364 to 8eeb0f9 Compare February 2, 2022 22:53
@chennes
Copy link
Member Author

chennes commented Feb 2, 2022

Good idea -- I've added 1em of padding inside the whole body in the cases where we are extracting the article element and reparenting it. This appears to work well for the four known git hosts.

Rather than manually parsing the output from the repo's host, the Addon Manager
now uses an embedded QWebEngineView to display the README data. This makes the
display more repo-location agnostic (rather than trying to parse the specific
code from GitHub, Gitlab, etc.). Special handling of known hosts is still
provided to improve the display of the page, but it is not required. Clicking a
link on the page still loads in a new system browser window, with the exception
of links to the FreeCAD wiki, which are loaded in the same browser. This is
expected to be used primarily to access traslated pages for Macros, so no
advanced web-browsing features are displayed (e.g. back buttons, history
access, etc.).
@chennes chennes force-pushed the addonManagerShowReadmeInWebView branch from 8eeb0f9 to e15ac44 Compare February 2, 2022 23:02
@chennes chennes merged commit e553a0e into FreeCAD:master Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants