-
Notifications
You must be signed in to change notification settings - Fork 178
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
Add update checks for new Dangerzone versions #466
Conversation
Turns out the recursion issue was caused by parallel tests in Docker. I solved the issue on the other PR by completely removing parallel tests (they have caused issues in the past as well). See this diff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra things to think about:
- on linux the check for updates will appear disabled by default. We should mark it as checked and say that it's updated via the package manager.
- the hamburger menu probably needs to be a bit bigger and equally spaced from each margin
- the "new version available" option in the menu should somehow be highlighted (see how Tor Browser shows it).
Hey, thanks a lot for the detailed review :-).
I think it's still worth having this option in two cases:
Definitely, I agree.
Yeap, I agree as well. |
OK! You mean having different behaviors on RPM vs DEB versus unnoficial ones, right? |
Even for the official RPMs / DEBs, if the user just downloads and installs them manually, they will not learn about updates. Hopefully, this will be a rare situation... |
@deeplow Reminder, I have re-implemented your commit for the cooldown period, because I had made some changes to the code and couldn't rebase them on top of your commit. You'll see that the logic and the tests are a bit different in places, so please take a cursory look. |
Run tests sequentially, because in subsequent commits we will add Qt tests that do not play nice when `pytest` creates new processes [1]. Also, remove the pytest wrapper, whose main task was to decide if tests can run in parallel [2]. [1]: https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2393 [2]: #217
Pass the X11 socket of the Linux CI runners to the container where our CI tests run, with the `-g` flag of `dev_scripts/env.py`. By having a working X11 socket, we can run GUI tests. Prior to this fix, we would encounter this error: tests/gui/test_main_window.py::test_change_document_button qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: xcb, offscreen, wayland-egl, wayland, eglfs, vnc, minimalegl, vkkhrdisplay, linuxfb, minimal. Another alternative we considered was to use the `QT_QPA_PLATFORM=offscreen` environment variable. This alternative works, but it's less close to the end-user's environment, so we decided in favor of the approach above.
Add some settings prefixed with `"updater_"`, which will be used for updates later on.
Add the following two features in the Settings class: 1. Add a way to save the settings, if the contents of a key have changed. 2. Add a way to get all the updater settings, by getting fetching the keys that start with `"updater_"`.
Get the default settings of Dangezone for the current version, without having to instantiate the Settings class. Note that instantiating the Settings class also writes the settings to the underlying `settings.json` file, and there are cases where we don't want this behavior.
Add a new Python module called "updater", which contains the logic for prompting the user to enable updates, and checking our GitHub releases for new updates. This class has some light dependency to Qt functionality, since it needs to: * Show a prompt to the user, * Run update checks asynchronously in a Qt thread, * Provide the main window with the result of the update check Refs #189
Add a Pytest fixture that returns an UpdaterThread instance which has its own unique settings directory. Note that the UpdaterThread instance needs to be slightly nerfed, so that it doesn't rely on Qt functionality or any isolation providers.
Add three status icon for the hamburger menu: * hamburger_menu.svg: The typical hamburger menu. Taken from https://commons.wikimedia.org/wiki/File:Hamburger_icon.svg, which is in the public domain. * hamburger_menu_update_error.svg: A hamburger menu with a red notification bubble on the top right corner. * hamburger_menu_update_success.svg: A hamburger menu with a green notification bubble on the top right corner.
Factor out some parts of the Alert class into a more generic dialog class. This class will be used for a new type of dialog that we will introduce in a subsequent commit. Note that this commit does not alter the functionality of the Alert class.
Add a Qt widget called "CollapsibleBox", in order to build sections that you can hide/show with a single click. There is no native widget for this functionality, so we borrow some code from a StackOverflow user: https://stackoverflow.com/a/52617714
Add a dialog that we will show for update-related tasks. This dialog has a different layout than the Alert class: it has a message, followed by a widget that the user chooses (can be a text box or collapsible element), and then one last message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge. The remaining TODOs were agreed to tb be tackled later as not to further delay is rather large PR.
Add a hamburger button in the main window of Dangerzone, that will be the entry point for update information. Whenever a new update is released, users will see a green notification bubble. If an update error happens, they will see a red notification bubble. In the hamburger menu, users have the option to enable or disable update checks. Depending on the update check status, users will see in a pop-up dialog more info about the new update or the error. Closes #189
Add a very rudimentary test for GUI update logic. Refs #290
This is a PR that brings notification updates for new Dangerzone versions. It follows most of the workflow in issue #189, but uses notification bubbles instead of pop-ups, as the main method of grabbing the user's attention.
This PR is mostly complete, but there are some minor issues that still persist:
Closes #189