With PyQt5 we used plupdate5 + *.pro file to update the translations
file with new strings, extracted from the source code and UI forms.
In PyQt6, pylupdate6 doesn't support parsing .pro files, so we need to do it
manually.
Debian's QtDesigner 6.8.2 defines horizontal/vertical spacers as
Qt::Orientation::Horizontal, but the Qt definitions since 6.5 is
Qt::Horizontal: https://doc.qt.io/qt-6.5/qt.html#Orientation-enum
Due to this problem, the GUI fails to load on some Qt versions, like
6.6.x (Mint 22.1). It doesn't fail on Arch with PyQt6 6.9 though.
Discussion: #1222
unicode-slugify is basically abandoned upstream. Its repository [1] has seen
the last actual code change in 2018. It uses the deprecated `nose` testing framework.
In nixpkgs, we patched it to use pytest, but made some mistakes in those patches,
resulting in no tests actually executing. I actually fixed the tests to run,
but most of the tests fail: unicode does not reliably get replaced with a slugified version.
There does exist an actual need for slugification. However, the used slugify
package should actually work and be reasonably maintained. The replacement proposed here is
`python-slugify` [2], which sees active development in its repository while the
used API (both import name and the basic function signature `slugify(str)`) is identical.
The version requirement of >=7.0.0 is from their official support matrix for py >= 3.7,
though i did my testing with python-slugify 8.0.4.
[1] https://github.com/mozilla/unicode-slugify
[2] https://pypi.org/project/python-slugify/
This should simplify the search for the lrelease binary:
lrelease - Debian/Ubuntu (?)
lrelease6 - openSUSE
lrelease-qt6 - Fedora
In addition, you can specify the path to an lrelease binary with LRELEASE, e.g.:
export LRELEASE="/usr/local/bin/my-lrelease-v6"
The GUI has been ported to PyQt6.
New dependencies:
- python3-pyqt6
- python3-pyqt6.qtsvg (otherwise, the svg icons are not loaded)
On Arch and other systems qt6-svg is neeeded.
- pyqt6-dev-tools (for uic calls, .ui loading).
- libqt6sql6
Known issues:
- pylupdate6 not longer update .pro files.
It doesn't affect existing translations.
- There might be a delay closing the GUI. Reason still unknown.
Closes: #1009
Discussion: #1222
When the daemon connects to the GUI, the firewall dialog is configured
based on the system firewall configuration (inbound/outbpund policies).
Due to an error, a fw-change notification was being triggered, causing
unnecessary firewall rules reloads.
Allow to use commas to specify multiple data:
- src/dst ip: 1.2.3.4, 5.6.7.8
- dst host: www.a-b-c.org, www.abcd.org
- proto: tcp, udp
- net ifaces: eth0, eth1
- src/dst port: 123, 456
The data will be translated to ^(..|..|..)$ when saving the rule, and
back to "..,..,.." when loading it.
Closes: #1392.
Previously when cloning a rule, we added "clone-{num}-" to the rule.
Depending on the number of rules, the cloned rule might not appear next
to the original.
Now we append "-duplicated-{num}" to the end of the rule name, on the one
hand to make the new rule appear close to the cloned one, and on the other
hand, to be consistent with the menu item that triggers this action.
Closes: #1363.
- In some distros, qt-material icons have stopped loading at startup:
qt.svg: Cannot open file '.../icon:/primary/slider.svg'
The cause of the error is still unknown, but this fix solves it
for now.
- Themes() class moved to its own file.
Closes: #1373.
The HighContrast theme is part of the gnome-themes-standard [0] package
, which is not always available.
Instead of just setting the theme by code, now we distribute the icons.
This ensures that the icons are always clearly visible when using a
qt-material dark theme.
For qt-material light themes and system themes, we'll use the system
icons.
[0] https://download.gnome.org/sources/gnome-themes-standard/
By default we use the system icons theme in the GUI.
The Desktop Environment usually is responsible of switching between
dark and light styles.
However if the user selected a qt-material dark theme from the
Preferences, the icons were not updated, and sometimes they were
practically invisible.
Now if the user selects a qt-material dark theme, we set the
HighContrast icon theme, which ensures that all icons are visible
against dark backgrounds.
Allow to select English language from the Preferences.
This is a static entry like "System default".
It will not load a QTranslator object, so the GUI will use the strings
defined in the code, which are in English.
Closes: #1342